From owner-svn-src-head@freebsd.org Sun Sep 22 08:34: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 DDAF5F9B24; Sun, 22 Sep 2019 08:34:23 +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 46bgjW5Vy2z4Vk0; Sun, 22 Sep 2019 08:34:23 +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 9FDCC23D30; Sun, 22 Sep 2019 08:34:23 +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 x8M8YNRl064425; Sun, 22 Sep 2019 08:34:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8M8YNFV064424; Sun, 22 Sep 2019 08:34:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909220834.x8M8YNFV064424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 22 Sep 2019 08:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352590 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 352590 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, 22 Sep 2019 08:34:23 -0000 Author: avg Date: Sun Sep 22 08:34:23 2019 New Revision: 352590 URL: https://svnweb.freebsd.org/changeset/base/352590 Log: print summary line for space estimate of zfs send from bookmark Although there is always a single stream and the total size in the summary is always equal to the size reported for the stream, it's nice to follow the usual output format. MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sun Sep 22 05:16:10 2019 (r352589) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sun Sep 22 08:34:23 2019 (r352590) @@ -2054,6 +2054,15 @@ zfs_send_one(zfs_handle_t *zhp, const char *from, int if (err == 0) { send_print_verbose(fout, zhp->zfs_name, from, size, flags.parsable); + if (flags.parsable) { + (void) fprintf(fout, "size\t%llu\n", + (longlong_t)size); + } else { + char buf[16]; + zfs_nicenum(size, buf, sizeof (buf)); + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + "total estimated size is %s\n"), buf); + } } else { (void) fprintf(stderr, "Cannot estimate send size: " "%s\n", strerror(errno)); From owner-svn-src-head@freebsd.org Sun Sep 22 08:44: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 97600F9F3F; Sun, 22 Sep 2019 08:44:42 +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 46bgxQ3LYwz4WKk; Sun, 22 Sep 2019 08:44:42 +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 51FF723EF0; Sun, 22 Sep 2019 08:44:42 +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 x8M8igqD070733; Sun, 22 Sep 2019 08:44:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8M8if8X070730; Sun, 22 Sep 2019 08:44:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201909220844.x8M8if8X070730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 22 Sep 2019 08:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352591 - in head: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 352591 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, 22 Sep 2019 08:44:42 -0000 Author: avg Date: Sun Sep 22 08:44:41 2019 New Revision: 352591 URL: https://svnweb.freebsd.org/changeset/base/352591 Log: MFZoL: Retire send space estimation via ZFS_IOC_SEND Add a small wrapper around libzfs_core's lzc_send_space() to libzfs so that every legacy ZFS_IOC_SEND consumer, along with their userland counterpart estimate_ioctl(), can leverage ZFS_IOC_SEND_SPACE to request send space estimation. The legacy functionality in zfs_ioc_send() is left untouched for compatibility purposes. Obtained from: ZoL Obtained from: zfsonlinux/zfs@cf7684bc8d57 Author: loli10K MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sun Sep 22 08:34:23 2019 (r352590) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sun Sep 22 08:44:41 2019 (r352591) @@ -948,39 +948,32 @@ typedef struct send_dump_data { } send_dump_data_t; static int -estimate_ioctl(zfs_handle_t *zhp, uint64_t fromsnap_obj, - boolean_t fromorigin, enum lzc_send_flags flags, uint64_t *sizep) +zfs_send_space(zfs_handle_t *zhp, const char *snapname, const char *from, + enum lzc_send_flags flags, uint64_t *spacep) { - zfs_cmd_t zc = { 0 }; libzfs_handle_t *hdl = zhp->zfs_hdl; + int error; - assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); - assert(fromsnap_obj == 0 || !fromorigin); + assert(snapname != NULL); + error = lzc_send_space(snapname, from, flags, spacep); - (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - zc.zc_obj = fromorigin; - zc.zc_sendobj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID); - zc.zc_fromobj = fromsnap_obj; - zc.zc_guid = 1; /* estimate flag */ - zc.zc_flags = flags; - - if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SEND, &zc) != 0) { + if (error != 0) { char errbuf[1024]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, - "warning: cannot estimate space for '%s'"), zhp->zfs_name); + "warning: cannot estimate space for '%s'"), snapname); - switch (errno) { + switch (error) { case EXDEV: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "not an earlier snapshot from the same fs")); return (zfs_error(hdl, EZFS_CROSSTARGET, errbuf)); case ENOENT: - if (zfs_dataset_exists(hdl, zc.zc_name, + if (zfs_dataset_exists(hdl, snapname, ZFS_TYPE_SNAPSHOT)) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "incremental source (@%s) does not exist"), - zc.zc_value); + "incremental source (%s) does not exist"), + snapname); } return (zfs_error(hdl, EZFS_NOENT, errbuf)); @@ -994,16 +987,15 @@ estimate_ioctl(zfs_handle_t *zhp, uint64_t fromsnap_ob case ERANGE: case EFAULT: case EROFS: - zfs_error_aux(hdl, strerror(errno)); + case EINVAL: + zfs_error_aux(hdl, strerror(error)); return (zfs_error(hdl, EZFS_BADBACKUP, errbuf)); default: - return (zfs_standard_error(hdl, errno, errbuf)); + return (zfs_standard_error(hdl, error, errbuf)); } } - *sizep = zc.zc_objset_type; - return (0); } @@ -1290,13 +1282,22 @@ dump_snapshot(zfs_handle_t *zhp, void *arg) (sdd->fromorigin || sdd->replicate); if (sdd->verbose || sdd->progress) { - (void) estimate_ioctl(zhp, sdd->prevsnap_obj, - fromorigin, flags, &size); - sdd->size += size; + char fromds[ZFS_MAX_DATASET_NAME_LEN]; - send_print_verbose(fout, zhp->zfs_name, - sdd->prevsnap[0] ? sdd->prevsnap : NULL, - size, sdd->parsable); + if (sdd->prevsnap[0] != '\0') { + (void) strlcpy(fromds, zhp->zfs_name, sizeof (fromds)); + *(strchr(fromds, '@') + 1) = '\0'; + (void) strlcat(fromds, sdd->prevsnap, sizeof (fromds)); + } + if (zfs_send_space(zhp, zhp->zfs_name, + sdd->prevsnap[0] ? fromds : NULL, flags, &size) != 0) { + size = 0; /* cannot estimate send space */ + } else { + send_print_verbose(fout, zhp->zfs_name, + sdd->prevsnap[0] ? sdd->prevsnap : NULL, + size, sdd->parsable); + } + sdd->size += size; } if (!sdd->dryrun) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Sep 22 08:34:23 2019 (r352590) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sun Sep 22 08:44:41 2019 (r352591) @@ -4799,6 +4799,9 @@ out: * * outputs: * zc_objset_type estimated size, if zc_guid is set + * + * NOTE: This is no longer the preferred interface, any new functionality + * should be added to zfs_ioc_send_new() instead. */ static int zfs_ioc_send(zfs_cmd_t *zc) From owner-svn-src-head@freebsd.org Sun Sep 22 10:40:16 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 7BA1FFCFF1; Sun, 22 Sep 2019 10:40:16 +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 46bkVm2dPxz4crb; Sun, 22 Sep 2019 10:40:16 +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 394362533D; Sun, 22 Sep 2019 10:40: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 x8MAeG6m036984; Sun, 22 Sep 2019 10:40:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MAeFKW036980; Sun, 22 Sep 2019 10:40:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909221040.x8MAeFKW036980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 22 Sep 2019 10:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352592 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352592 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, 22 Sep 2019 10:40:16 -0000 Author: tuexen Date: Sun Sep 22 10:40:15 2019 New Revision: 352592 URL: https://svnweb.freebsd.org/changeset/base/352592 Log: Cleanup the RTO calculation and perform some consistency checks before computing the RTO. This should fix an overflow issue reported by Felix Weinrank in https://github.com/sctplab/usrsctp/issues/375 for the userland stack and found by running a fuzz tester. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Sep 22 08:44:41 2019 (r352591) +++ head/sys/netinet/sctp_indata.c Sun Sep 22 10:40:15 2019 (r352592) @@ -3108,13 +3108,12 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru * update RTO too ? */ if (tp1->do_rtt) { - if (*rto_ok) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - &stcb->asoc, - tp1->whoTo, - &tp1->sent_rcv_time, - SCTP_RTT_FROM_DATA); + if (*rto_ok && + sctp_calculate_rto(stcb, + &stcb->asoc, + tp1->whoTo, + &tp1->sent_rcv_time, + SCTP_RTT_FROM_DATA)) { *rto_ok = 0; } if (tp1->whoTo->rto_needed == 0) { @@ -4086,16 +4085,12 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 /* update RTO too? */ if (tp1->do_rtt) { - if (rto_ok) { - tp1->whoTo->RTO = - /* - * sa_ignore - * NO_NULL_CHK - */ - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - SCTP_RTT_FROM_DATA); + if (rto_ok && + sctp_calculate_rto(stcb, + &stcb->asoc, + tp1->whoTo, + &tp1->sent_rcv_time, + SCTP_RTT_FROM_DATA)) { rto_ok = 0; } if (tp1->whoTo->rto_needed == 0) { @@ -4704,12 +4699,12 @@ hopeless_peer: /* update RTO too? */ if (tp1->do_rtt) { - if (rto_ok) { - tp1->whoTo->RTO = - sctp_calculate_rto(stcb, - asoc, tp1->whoTo, - &tp1->sent_rcv_time, - SCTP_RTT_FROM_DATA); + if (rto_ok && + sctp_calculate_rto(stcb, + &stcb->asoc, + tp1->whoTo, + &tp1->sent_rcv_time, + SCTP_RTT_FROM_DATA)) { rto_ok = 0; } if (tp1->whoTo->rto_needed == 0) { Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Sep 22 08:44:41 2019 (r352591) +++ head/sys/netinet/sctp_input.c Sun Sep 22 10:40:15 2019 (r352592) @@ -548,7 +548,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); /* calculate the RTO */ - net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, + sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); retval = sctp_send_cookie_echo(m, offset, initack_limit, stcb, net); return (retval); @@ -648,7 +648,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk tv.tv_sec = cp->heartbeat.hb_info.time_value_1; tv.tv_usec = cp->heartbeat.hb_info.time_value_2; /* Now lets do a RTO with this */ - r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, + sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, SCTP_RTT_FROM_NON_DATA); if (!(r_net->dest_state & SCTP_ADDR_REACHABLE)) { r_net->dest_state |= SCTP_ADDR_REACHABLE; @@ -1674,8 +1674,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle old.tv_sec = cookie->time_entered.tv_sec; old.tv_usec = cookie->time_entered.tv_usec; net->hb_responded = 1; - net->RTO = sctp_calculate_rto(stcb, asoc, net, - &old, + sctp_calculate_rto(stcb, asoc, net, &old, SCTP_RTT_FROM_NON_DATA); if (stcb->asoc.sctp_autoclose_ticks && @@ -2399,8 +2398,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in /* calculate the RTT and set the encaps port */ old.tv_sec = cookie->time_entered.tv_sec; old.tv_usec = cookie->time_entered.tv_usec; - (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, - &old, SCTP_RTT_FROM_NON_DATA); + sctp_calculate_rto(stcb, asoc, *netp, &old, SCTP_RTT_FROM_NON_DATA); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2976,8 +2974,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c SCTP_STAT_INCR_COUNTER32(sctps_activeestab); SCTP_STAT_INCR_GAUGE32(sctps_currestab); if (asoc->overall_error_count == 0) { - net->RTO = sctp_calculate_rto(stcb, asoc, net, - &asoc->time_entered, + sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Sep 22 08:44:41 2019 (r352591) +++ head/sys/netinet/sctputil.c Sun Sep 22 10:40:15 2019 (r352592) @@ -2469,25 +2469,24 @@ sctp_mtu_size_reset(struct sctp_inpcb *inp, /* - * given an association and starting time of the current RTT period return - * RTO in number of msecs net should point to the current network + * Given an association and starting time of the current RTT period, update + * RTO in number of msecs. net should point to the current network. + * Return 1, if an RTO update was performed, return 0 if no update was + * performed due to invalid starting point. */ -uint32_t +int sctp_calculate_rto(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_nets *net, struct timeval *old, int rtt_from_sack) { - /*- - * given an association and the starting time of the current RTT - * period (in value1/value2) return RTO in number of msecs. - */ + struct timeval now; + uint64_t rtt_us; /* RTT in us */ int32_t rtt; /* RTT in ms */ uint32_t new_rto; int first_measure = 0; - struct timeval now; /************************/ /* 1. calculate new RTT */ @@ -2498,10 +2497,19 @@ sctp_calculate_rto(struct sctp_tcb *stcb, } else { (void)SCTP_GETTIME_TIMEVAL(&now); } + if ((old->tv_sec > now.tv_sec) || + ((old->tv_sec == now.tv_sec) && (old->tv_sec > now.tv_sec))) { + /* The starting point is in the future. */ + return (0); + } timevalsub(&now, old); + rtt_us = (uint64_t)1000000 * (uint64_t)now.tv_sec + (uint64_t)now.tv_usec; + if (rtt_us > SCTP_RTO_UPPER_BOUND * 1000) { + /* The RTT is larger than a sane value. */ + return (0); + } /* store the current RTT in us */ - net->rtt = (uint64_t)1000000 * (uint64_t)now.tv_sec + - (uint64_t)now.tv_usec; + net->rtt = rtt_us; /* compute rtt in ms */ rtt = (int32_t)(net->rtt / 1000); if ((asoc->cc_functions.sctp_rtt_calculated) && (rtt_from_sack == SCTP_RTT_FROM_DATA)) { @@ -2533,7 +2541,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb, * Paper "Congestion Avoidance and Control", Annex A. * * (net->lastsa >> SCTP_RTT_SHIFT) is the srtt - * (net->lastsa >> SCTP_RTT_VAR_SHIFT) is the rttvar + * (net->lastsv >> SCTP_RTT_VAR_SHIFT) is the rttvar */ if (net->RTO_measured) { rtt -= (net->lastsa >> SCTP_RTT_SHIFT); @@ -2574,8 +2582,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb, if (new_rto > stcb->asoc.maxrto) { new_rto = stcb->asoc.maxrto; } - /* we are now returning the RTO */ - return (new_rto); + net->RTO = new_rto; + return (1); } /* Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sun Sep 22 08:44:41 2019 (r352591) +++ head/sys/netinet/sctputil.h Sun Sep 22 10:40:15 2019 (r352592) @@ -133,7 +133,7 @@ uint32_t sctp_get_next_mtu(uint32_t); void sctp_timeout_handler(void *); -uint32_t +int sctp_calculate_rto(struct sctp_tcb *, struct sctp_association *, struct sctp_nets *, struct timeval *, int); From owner-svn-src-head@freebsd.org Sun Sep 22 11:11: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 610B7FDCA4; Sun, 22 Sep 2019 11:11:02 +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 46blBG1z9Nz4fqr; Sun, 22 Sep 2019 11:11:02 +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 0E059258ED; Sun, 22 Sep 2019 11:11:02 +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 x8MBB1xC058747; Sun, 22 Sep 2019 11:11:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MBB1ZB058746; Sun, 22 Sep 2019 11:11:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909221111.x8MBB1ZB058746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 22 Sep 2019 11:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352594 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352594 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, 22 Sep 2019 11:11:02 -0000 Author: tuexen Date: Sun Sep 22 11:11:01 2019 New Revision: 352594 URL: https://svnweb.freebsd.org/changeset/base/352594 Log: Don't hold the info lock when calling sctp_select_a_tag(). This avoids a double lock bug in the NAT colliding state processing of SCTP. Thanks to Felix Weinrank for finding and reporting this issue in https://github.com/sctplab/usrsctp/issues/374 He found this bug using fuzz testing. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Sep 22 10:59:51 2019 (r352593) +++ head/sys/netinet/sctp_input.c Sun Sep 22 11:11:01 2019 (r352594) @@ -703,34 +703,37 @@ static int sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) { /* - * return 0 means we want you to proceed with the abort non-zero - * means no abort processing + * Return 0 means we want you to proceed with the abort non-zero + * means no abort processing. */ + uint32_t new_vtag; struct sctpasochead *head; if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) || (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) { + new_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_INP_INFO_WLOCK(); SCTP_TCB_LOCK(stcb); atomic_subtract_int(&stcb->asoc.refcnt, 1); + } else { + return (0); } if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) { /* generate a new vtag and send init */ LIST_REMOVE(stcb, sctp_asocs); - stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); + stcb->asoc.my_vtag = new_vtag; head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; /* * put it in the bucket in the vtag hash of assoc's for the * system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); - sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); SCTP_INP_INFO_WUNLOCK(); + sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); return (1); - } - if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) { + } else { /* * treat like a case where the cookie expired i.e.: - dump * current cookie. - generate a new vtag. - resend init. @@ -740,15 +743,15 @@ sctp_handle_nat_colliding_state(struct sctp_tcb *stcb) SCTP_SET_STATE(stcb, SCTP_STATE_COOKIE_WAIT); sctp_stop_all_cookie_timers(stcb); sctp_toss_old_cookies(stcb, &stcb->asoc); - stcb->asoc.my_vtag = sctp_select_a_tag(stcb->sctp_ep, stcb->sctp_ep->sctp_lport, stcb->rport, 1); + stcb->asoc.my_vtag = new_vtag; head = &SCTP_BASE_INFO(sctp_asochash)[SCTP_PCBHASH_ASOC(stcb->asoc.my_vtag, SCTP_BASE_INFO(hashasocmark))]; /* * put it in the bucket in the vtag hash of assoc's for the * system */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); - sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); SCTP_INP_INFO_WUNLOCK(); + sctp_send_initiate(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); return (1); } return (0); From owner-svn-src-head@freebsd.org Sun Sep 22 13:56: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 64D381230B8; Sun, 22 Sep 2019 13:56:28 +0000 (UTC) (envelope-from karels@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 46bps80GHdz3Kdm; Sun, 22 Sep 2019 13:56:27 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BFE8A277A8; Sun, 22 Sep 2019 13:56:27 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8MDuRxD055448; Sun, 22 Sep 2019 13:56:27 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MDuR70055447; Sun, 22 Sep 2019 13:56:27 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201909221356.x8MDuR70055447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sun, 22 Sep 2019 13:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352597 - head/lib/libkvm X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: head/lib/libkvm X-SVN-Commit-Revision: 352597 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, 22 Sep 2019 13:56:28 -0000 Author: karels Date: Sun Sep 22 13:56:27 2019 New Revision: 352597 URL: https://svnweb.freebsd.org/changeset/base/352597 Log: Add support for ps -H on corefiles in libkvm Add support for kernel threads in kvm_getprocs() and the underlying kvm_proclist() in libkvm when fetching from a kernel core file. This has been missing/needed for several releases, when kernel threads became normal threads. The loop over the processes now contains a sub-loop for threads, which iterates beyond the first thread only when threads are requested. Also set some fields such as tid that were previously uninitialized. Reviewed by: vangyzen jhb(earlier revision) MFC after: 4 days Sponsored by: Forcepoint LLC Differential Revision: https://reviews.freebsd.org/D21461 Modified: head/lib/libkvm/kvm_proc.c Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Sun Sep 22 12:33:18 2019 (r352596) +++ head/lib/libkvm/kvm_proc.c Sun Sep 22 13:56:27 2019 (r352597) @@ -67,6 +67,7 @@ __SCCSID("@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93"); #include #include #include +#include #include #include #include @@ -130,13 +131,16 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc struct proc pproc; struct sysentvec sysent; char svname[KI_EMULNAMELEN]; + struct thread *td = NULL; + bool first_thread; kp = &kinfo_proc; kp->ki_structsize = sizeof(kinfo_proc); /* - * Loop on the processes. this is completely broken because we need to be - * able to loop on the threads and merge the ones that are the same process some how. + * Loop on the processes, then threads within the process if requested. */ + if (what == KERN_PROC_ALL) + what |= KERN_PROC_INC_THREAD; for (; cnt < maxcnt && p != NULL; p = LIST_NEXT(&proc, p_list)) { memset(kp, 0, sizeof *kp); if (KREAD(kd, (u_long)p, &proc)) { @@ -145,15 +149,6 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc } if (proc.p_state == PRS_NEW) continue; - if (proc.p_state != PRS_ZOMBIE) { - if (KREAD(kd, (u_long)TAILQ_FIRST(&proc.p_threads), - &mtd)) { - _kvm_err(kd, kd->program, - "can't read thread at %p", - TAILQ_FIRST(&proc.p_threads)); - return (-1); - } - } if (KREAD(kd, (u_long)proc.p_ucred, &ucred) == 0) { kp->ki_ruid = ucred.cr_ruid; kp->ki_svuid = ucred.cr_svuid; @@ -222,6 +217,7 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc kp->ki_addr = 0; /* XXX uarea */ /* kp->ki_kstack = proc.p_thread.td_kstack; XXXKSE */ kp->ki_args = proc.p_args; + kp->ki_numthreads = proc.p_numthreads; kp->ki_tracep = proc.p_tracevp; kp->ki_textvp = proc.p_textvp; kp->ki_fd = proc.p_fd; @@ -285,9 +281,6 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc kp->ki_sid = sess.s_sid; (void)memcpy(kp->ki_login, sess.s_login, sizeof(kp->ki_login)); - kp->ki_kiflag = sess.s_ttyvp ? KI_CTTY : 0; - if (sess.s_leader == p) - kp->ki_kiflag |= KI_SLEADER; if ((proc.p_flag & P_CONTROLT) && sess.s_ttyp != NULL) { if (KREAD(kd, (u_long)sess.s_ttyp, &tty)) { _kvm_err(kd, kd->program, @@ -330,9 +323,6 @@ kvm_proclist(kvm_t *kd, int what, int arg, struct proc nopgrp: kp->ki_tdev = NODEV; } - if ((proc.p_state != PRS_ZOMBIE) && mtd.td_wmesg) - (void)kvm_read(kd, (u_long)mtd.td_wmesg, - kp->ki_wmesg, WMESGLEN); (void)kvm_read(kd, (u_long)proc.p_vmspace, (char *)&vmspace, sizeof(vmspace)); @@ -374,85 +364,127 @@ nopgrp: sizeof(svname)); if (svname[0] != 0) strlcpy(kp->ki_emul, svname, KI_EMULNAMELEN); - if ((proc.p_state != PRS_ZOMBIE) && - (mtd.td_blocked != 0)) { - kp->ki_kiflag |= KI_LOCKBLOCK; - if (mtd.td_lockname) - (void)kvm_read(kd, - (u_long)mtd.td_lockname, - kp->ki_lockname, LOCKNAMELEN); - kp->ki_lockname[LOCKNAMELEN] = 0; - } kp->ki_runtime = cputick2usec(proc.p_rux.rux_runtime); kp->ki_pid = proc.p_pid; - kp->ki_siglist = proc.p_siglist; - SIGSETOR(kp->ki_siglist, mtd.td_siglist); - kp->ki_sigmask = mtd.td_sigmask; kp->ki_xstat = KW_EXITCODE(proc.p_xexit, proc.p_xsig); kp->ki_acflag = proc.p_acflag; kp->ki_lock = proc.p_lock; - if (proc.p_state != PRS_ZOMBIE) { - kp->ki_swtime = (ticks - proc.p_swtick) / hz; - kp->ki_flag = proc.p_flag; - kp->ki_sflag = 0; - kp->ki_nice = proc.p_nice; - kp->ki_traceflag = proc.p_traceflag; - if (proc.p_state == PRS_NORMAL) { - if (TD_ON_RUNQ(&mtd) || - TD_CAN_RUN(&mtd) || - TD_IS_RUNNING(&mtd)) { - kp->ki_stat = SRUN; - } else if (mtd.td_state == - TDS_INHIBITED) { - if (P_SHOULDSTOP(&proc)) { - kp->ki_stat = SSTOP; - } else if ( - TD_IS_SLEEPING(&mtd)) { - kp->ki_stat = SSLEEP; - } else if (TD_ON_LOCK(&mtd)) { - kp->ki_stat = SLOCK; - } else { - kp->ki_stat = SWAIT; - } + kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ + + /* Per-thread items; iterate as appropriate. */ + td = TAILQ_FIRST(&proc.p_threads); + for (first_thread = true; cnt < maxcnt && td != NULL && + (first_thread || (what & KERN_PROC_INC_THREAD)); + first_thread = false) { + if (proc.p_state != PRS_ZOMBIE) { + if (KREAD(kd, (u_long)td, &mtd)) { + _kvm_err(kd, kd->program, + "can't read thread at %p", td); + return (-1); } + if (what & KERN_PROC_INC_THREAD) + td = TAILQ_NEXT(&mtd, td_plist); + } else + td = NULL; + if ((proc.p_state != PRS_ZOMBIE) && mtd.td_wmesg) + (void)kvm_read(kd, (u_long)mtd.td_wmesg, + kp->ki_wmesg, WMESGLEN); + else + memset(kp->ki_wmesg, 0, WMESGLEN); + if (proc.p_pgrp == NULL) { + kp->ki_kiflag = 0; } else { - kp->ki_stat = SIDL; + kp->ki_kiflag = sess.s_ttyvp ? KI_CTTY : 0; + if (sess.s_leader == p) + kp->ki_kiflag |= KI_SLEADER; } - /* Stuff from the thread */ - kp->ki_pri.pri_level = mtd.td_priority; - kp->ki_pri.pri_native = mtd.td_base_pri; - kp->ki_lastcpu = mtd.td_lastcpu; - kp->ki_wchan = mtd.td_wchan; - kp->ki_oncpu = mtd.td_oncpu; - if (mtd.td_name[0] != '\0') - strlcpy(kp->ki_tdname, mtd.td_name, sizeof(kp->ki_tdname)); - kp->ki_pctcpu = 0; - kp->ki_rqindex = 0; + if ((proc.p_state != PRS_ZOMBIE) && + (mtd.td_blocked != 0)) { + kp->ki_kiflag |= KI_LOCKBLOCK; + if (mtd.td_lockname) + (void)kvm_read(kd, + (u_long)mtd.td_lockname, + kp->ki_lockname, LOCKNAMELEN); + else + memset(kp->ki_lockname, 0, + LOCKNAMELEN); + kp->ki_lockname[LOCKNAMELEN] = 0; + } else + kp->ki_kiflag &= ~KI_LOCKBLOCK; + kp->ki_siglist = proc.p_siglist; + if (proc.p_state != PRS_ZOMBIE) { + SIGSETOR(kp->ki_siglist, mtd.td_siglist); + kp->ki_sigmask = mtd.td_sigmask; + kp->ki_swtime = (ticks - proc.p_swtick) / hz; + kp->ki_flag = proc.p_flag; + kp->ki_sflag = 0; + kp->ki_nice = proc.p_nice; + kp->ki_traceflag = proc.p_traceflag; + if (proc.p_state == PRS_NORMAL) { + if (TD_ON_RUNQ(&mtd) || + TD_CAN_RUN(&mtd) || + TD_IS_RUNNING(&mtd)) { + kp->ki_stat = SRUN; + } else if (mtd.td_state == + TDS_INHIBITED) { + if (P_SHOULDSTOP(&proc)) { + kp->ki_stat = SSTOP; + } else if ( + TD_IS_SLEEPING(&mtd)) { + kp->ki_stat = SSLEEP; + } else if (TD_ON_LOCK(&mtd)) { + kp->ki_stat = SLOCK; + } else { + kp->ki_stat = SWAIT; + } + } + } else { + kp->ki_stat = SIDL; + } + /* Stuff from the thread */ + kp->ki_pri.pri_level = mtd.td_priority; + kp->ki_pri.pri_native = mtd.td_base_pri; + kp->ki_lastcpu = mtd.td_lastcpu; + kp->ki_wchan = mtd.td_wchan; + kp->ki_oncpu = mtd.td_oncpu; + if (mtd.td_name[0] != '\0') + strlcpy(kp->ki_tdname, mtd.td_name, + sizeof(kp->ki_tdname)); + else + memset(kp->ki_tdname, 0, + sizeof(kp->ki_tdname)); + kp->ki_pctcpu = 0; + kp->ki_rqindex = 0; - /* - * Note: legacy fields; wraps at NO_CPU_OLD or the - * old max CPU value as appropriate - */ - if (mtd.td_lastcpu == NOCPU) - kp->ki_lastcpu_old = NOCPU_OLD; - else if (mtd.td_lastcpu > MAXCPU_OLD) - kp->ki_lastcpu_old = MAXCPU_OLD; - else - kp->ki_lastcpu_old = mtd.td_lastcpu; + /* + * Note: legacy fields; wraps at NO_CPU_OLD + * or the old max CPU value as appropriate + */ + if (mtd.td_lastcpu == NOCPU) + kp->ki_lastcpu_old = NOCPU_OLD; + else if (mtd.td_lastcpu > MAXCPU_OLD) + kp->ki_lastcpu_old = MAXCPU_OLD; + else + kp->ki_lastcpu_old = mtd.td_lastcpu; - if (mtd.td_oncpu == NOCPU) - kp->ki_oncpu_old = NOCPU_OLD; - else if (mtd.td_oncpu > MAXCPU_OLD) - kp->ki_oncpu_old = MAXCPU_OLD; - else - kp->ki_oncpu_old = mtd.td_oncpu; - } else { - kp->ki_stat = SZOMB; + if (mtd.td_oncpu == NOCPU) + kp->ki_oncpu_old = NOCPU_OLD; + else if (mtd.td_oncpu > MAXCPU_OLD) + kp->ki_oncpu_old = MAXCPU_OLD; + else + kp->ki_oncpu_old = mtd.td_oncpu; + kp->ki_tid = mtd.td_tid; + } else { + memset(&kp->ki_sigmask, 0, + sizeof(kp->ki_sigmask)); + kp->ki_stat = SZOMB; + kp->ki_tid = 0; + } + + bcopy(&kinfo_proc, bp, sizeof(kinfo_proc)); + ++bp; + ++cnt; } - kp->ki_tdev_freebsd11 = kp->ki_tdev; /* truncate */ - bcopy(&kinfo_proc, bp, sizeof(kinfo_proc)); - ++bp; - ++cnt; } return (cnt); } @@ -466,7 +498,7 @@ kvm_deadprocs(kvm_t *kd, int what, int arg, u_long a_a u_long a_zombproc, int maxcnt) { struct kinfo_proc *bp = kd->procbase; - int acnt, zcnt; + int acnt, zcnt = 0; struct proc *p; if (KREAD(kd, a_allproc, &p)) { @@ -477,13 +509,15 @@ kvm_deadprocs(kvm_t *kd, int what, int arg, u_long a_a if (acnt < 0) return (acnt); - if (KREAD(kd, a_zombproc, &p)) { - _kvm_err(kd, kd->program, "cannot read zombproc"); - return (-1); + if (a_zombproc != 0) { + if (KREAD(kd, a_zombproc, &p)) { + _kvm_err(kd, kd->program, "cannot read zombproc"); + return (-1); + } + zcnt = kvm_proclist(kd, what, arg, p, bp + acnt, maxcnt - acnt); + if (zcnt < 0) + zcnt = 0; } - zcnt = kvm_proclist(kd, what, arg, p, bp + acnt, maxcnt - acnt); - if (zcnt < 0) - zcnt = 0; return (acnt + zcnt); } @@ -568,16 +602,19 @@ kvm_getprocs(kvm_t *kd, int op, int arg, int *cnt) liveout: nprocs = size == 0 ? 0 : size / kd->procbase->ki_structsize; } else { - struct nlist nl[7], *p; + struct nlist nl[6], *p; + struct nlist nlz[2]; nl[0].n_name = "_nprocs"; nl[1].n_name = "_allproc"; - nl[2].n_name = "_zombproc"; - nl[3].n_name = "_ticks"; - nl[4].n_name = "_hz"; - nl[5].n_name = "_cpu_tick_frequency"; - nl[6].n_name = 0; + nl[2].n_name = "_ticks"; + nl[3].n_name = "_hz"; + nl[4].n_name = "_cpu_tick_frequency"; + nl[5].n_name = 0; + nlz[0].n_name = "_zombproc"; + nlz[1].n_name = 0; + if (!kd->arch->ka_native(kd)) { _kvm_err(kd, kd->program, "cannot read procs from non-native core"); @@ -591,19 +628,27 @@ liveout: "%s: no such symbol", p->n_name); return (0); } + (void) kvm_nlist(kd, nlz); /* attempt to get zombproc */ if (KREAD(kd, nl[0].n_value, &nprocs)) { _kvm_err(kd, kd->program, "can't read nprocs"); return (0); } - if (KREAD(kd, nl[3].n_value, &ticks)) { + /* + * If returning all threads, we don't know how many that + * might be. Presume that there are, on average, no more + * than 10 threads per process. + */ + if (op == KERN_PROC_ALL || (op & KERN_PROC_INC_THREAD)) + nprocs *= 10; /* XXX */ + if (KREAD(kd, nl[2].n_value, &ticks)) { _kvm_err(kd, kd->program, "can't read ticks"); return (0); } - if (KREAD(kd, nl[4].n_value, &hz)) { + if (KREAD(kd, nl[3].n_value, &hz)) { _kvm_err(kd, kd->program, "can't read hz"); return (0); } - if (KREAD(kd, nl[5].n_value, &cpu_tick_frequency)) { + if (KREAD(kd, nl[4].n_value, &cpu_tick_frequency)) { _kvm_err(kd, kd->program, "can't read cpu_tick_frequency"); return (0); @@ -614,7 +659,7 @@ liveout: return (0); nprocs = kvm_deadprocs(kd, op, arg, nl[1].n_value, - nl[2].n_value, nprocs); + nlz[0].n_value, nprocs); if (nprocs <= 0) { _kvm_freeprocs(kd); nprocs = 0; From owner-svn-src-head@freebsd.org Sun Sep 22 16:10: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 24F0A1258E0; Sun, 22 Sep 2019 16:10:26 +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 46bsqk08C4z3QgK; Sun, 22 Sep 2019 16:10:26 +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 C3012F10; Sun, 22 Sep 2019 16:10:25 +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 x8MGAPIu031697; Sun, 22 Sep 2019 16:10:25 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MGAPXs031695; Sun, 22 Sep 2019 16:10:25 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909221610.x8MGAPXs031695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 22 Sep 2019 16:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352599 - head/stand/forth X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/forth X-SVN-Commit-Revision: 352599 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, 22 Sep 2019 16:10:26 -0000 Author: tsoome Date: Sun Sep 22 16:10:25 2019 New Revision: 352599 URL: https://svnweb.freebsd.org/changeset/base/352599 Log: loader_4th: menu items need to reset color attribute, not switch to white Forth menu kernel and BE entries, instead of resetting the color attribute, are switching to white color. Modified: head/stand/forth/menu.4th head/stand/forth/menu.rc Modified: head/stand/forth/menu.4th ============================================================================== --- head/stand/forth/menu.4th Sun Sep 22 15:00:19 2019 (r352598) +++ head/stand/forth/menu.4th Sun Sep 22 16:10:25 2019 (r352599) @@ -397,7 +397,7 @@ also menu-infrastructure definitions setenv \ Assign third to ansi_caption[x][y] - kerncapbuf 0 s" @[1mK@[37mernel: " [char] @ escc! strcat + kerncapbuf 0 s" @[1mK@[mernel: " [char] @ escc! strcat kernmenuidx @ [char] 0 = if s" default/@[32m" else @@ -405,7 +405,7 @@ also menu-infrastructure definitions then [char] @ escc! strcat 2over strcat - s" @[37m" [char] @ escc! strcat + s" @[m" [char] @ escc! strcat kernidx @ kernmenuidx @ ansi_caption[x][y] setenv Modified: head/stand/forth/menu.rc ============================================================================== --- head/stand/forth/menu.rc Sun Sep 22 15:00:19 2019 (r352598) +++ head/stand/forth/menu.rc Sun Sep 22 16:10:25 2019 (r352599) @@ -72,7 +72,7 @@ s" currdev" getenv dup 0> [if] drop 4 s" zfs:" compare set mainmenu_caption[7]="Select Boot [E]nvironment..." set mainmenu_command[7]="3 goto_menu" set mainmenu_keycode[7]=101 - set mainansi_caption[7]="Select Boot ^[1mE^[37mnvironment..." + set mainansi_caption[7]="Select Boot ^[1mE^[mnvironment..." s" chain_disk" getenv? [if] set mainmenu_caption[8]="Chain[L]oad ${chain_disk}" From owner-svn-src-head@freebsd.org Sun Sep 22 16:37: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 651F1126A31; Sun, 22 Sep 2019 16:37:25 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 46btQs1xKBz3y6Y; Sun, 22 Sep 2019 16:37:25 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qt1-x836.google.com with SMTP id d2so14478412qtr.4; Sun, 22 Sep 2019 09:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Td25cipsASzunWIGUVUX5ipS49BNyTJgm3ST/nmEeLg=; b=dWUG/iBMv4/0z5U8NLg73fVTNbtcciSM8rvCEUqpuE5DyP9VhSgvBtEA9fKb+gaO9y 8AMrjALgoeCccK4CxLSVVxvpYlTRkEmaUQzzhsmac8dtvMYKgJSVpDhK3tU32rvXxvzb kh8QIUZPCA8Jsc18T1uP2uz6hVpRl9IU0zvNavRtjCN3RM3xErqm1dfR5l7zK6RyfwTL j7sIfkm46TCDmOsTXkdrgQSwLcHKWTtY/TwT1tM+sDYQb5TFlbbZVnOQSGMxi9iQ0PG6 UGfdIVOPLoqt9mfGNi6h9vy2jv7wOXevn/AoXiBgkzaF1QowI1QYBkWIjaYJhllLUBnn 2kLw== 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=Td25cipsASzunWIGUVUX5ipS49BNyTJgm3ST/nmEeLg=; b=ilQ7Hd7LqpsJTlyIStWAcYrpTXlmnA78YE8gWIg5Kz9mfb7O772hvCVY/kiAU9kRx6 DOaTKTqjCVjh1QjlAwb+Tf5BWD0nXLks68YZWB1dHVTt25gjpvsJ7qZzPPlMIiVfx4BM XUl5U7uscly8ftw66zaJx7YU4ERXojXJew7hfFb4PSU50sRET/04/javi7A3ao8C3IUq QmSdVB7erGNI2wbK6kcIoDTsznl7kk9LiBSk6DhfNlRatyCdtc7Br74LxX5o/3NFjIV+ wKfPDDkcLpswPCB3uU85WNn14rkO8xxFe34v+JJSVA10L4BvvOkBLywfk8ojUl9UT6bf vN8A== X-Gm-Message-State: APjAAAVdLFgILN8fQ8mb/1cZ1Ppd81De7pyG3fx8NHuaigS7vxzGy8M8 eoiB/ogVh+1a+BccYg/ZXJ5eL+sXgzxlGfhlALmJeA== X-Google-Smtp-Source: APXvYqzm+lhu1n8kXFYe8xrmuzZNmg9DkpXqJmBFqSBoM+s3iOZdEG2DDq10hB4lYmbpeSXdmmL0V0uI70jClXjK3EU= X-Received: by 2002:ac8:34d8:: with SMTP id x24mr13559854qtb.353.1569170243595; Sun, 22 Sep 2019 09:37:23 -0700 (PDT) MIME-Version: 1.0 References: <201909212003.x8LK3HFK021501@repo.freebsd.org> In-Reply-To: <201909212003.x8LK3HFK021501@repo.freebsd.org> From: Ryan Stone Date: Sun, 22 Sep 2019 12:37:12 -0400 Message-ID: Subject: Re: svn commit: r352585 - head/sys/kern To: Konstantin Belousov 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: 46btQs1xKBz3y6Y X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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, 22 Sep 2019 16:37:25 -0000 Thanks! On Sat, Sep 21, 2019 at 4:03 PM Konstantin Belousov wrote: > > Author: kib > Date: Sat Sep 21 20:03:17 2019 > New Revision: 352585 > URL: https://svnweb.freebsd.org/changeset/base/352585 > > Log: > kern.elf{32,64}.pie_base sysctl: enforce page alignment. > > Requested by: rstone > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > Modified: > head/sys/kern/imgact_elf.c > > Modified: head/sys/kern/imgact_elf.c > ============================================================================== > --- head/sys/kern/imgact_elf.c Sat Sep 21 19:51:57 2019 (r352584) > +++ head/sys/kern/imgact_elf.c Sat Sep 21 20:03:17 2019 (r352585) > @@ -136,8 +136,24 @@ SYSCTL_INT(_kern_elf32, OID_AUTO, read_exec, CTLFLAG_R > #endif > > static u_long __elfN(pie_base) = ET_DYN_LOAD_ADDR; > -SYSCTL_ULONG(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base, > - CTLFLAG_RWTUN, &__elfN(pie_base), 0, > +static int > +sysctl_pie_base(SYSCTL_HANDLER_ARGS) > +{ > + u_long val; > + int error; > + > + val = __elfN(pie_base); > + error = sysctl_handle_long(oidp, &val, 0, req); > + if (error != 0 || req->newptr == NULL) > + return (error); > + if ((val & PAGE_MASK) != 0) > + return (EINVAL); > + __elfN(pie_base) = val; > + return (0); > +} > +SYSCTL_PROC(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base, > + CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, > + sysctl_pie_base, "LU", > "PIE load base without randomization"); > > SYSCTL_NODE(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, aslr, CTLFLAG_RW, 0, From owner-svn-src-head@freebsd.org Sun Sep 22 17:39: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 1E036127E48; Sun, 22 Sep 2019 17:39:22 +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 46bvpK74bQz421p; Sun, 22 Sep 2019 17:39:21 +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 D754A1F10; Sun, 22 Sep 2019 17:39:21 +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 x8MHdLRC084772; Sun, 22 Sep 2019 17:39:21 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MHdK6k084768; Sun, 22 Sep 2019 17:39:20 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909221739.x8MHdK6k084768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 22 Sep 2019 17:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352601 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 352601 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, 22 Sep 2019 17:39:22 -0000 Author: tsoome Date: Sun Sep 22 17:39:20 2019 New Revision: 352601 URL: https://svnweb.freebsd.org/changeset/base/352601 Log: loader_lua: lua color changes should end with reset The color change should have reset sequence, not switch to white. Modified: head/stand/lua/color.lua head/stand/lua/logo-beastie.lua head/stand/lua/logo-orb.lua head/stand/lua/menu.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Sun Sep 22 17:31:27 2019 (r352600) +++ head/stand/lua/color.lua Sun Sep 22 17:39:20 2019 (r352601) @@ -42,7 +42,7 @@ color.MAGENTA = 5 color.CYAN = 6 color.WHITE = 7 -color.DEFAULT = 0 +color.DEFAULT = 9 color.BRIGHT = 1 color.DIM = 2 @@ -67,7 +67,7 @@ function color.resetfg() if color.disabled then return '' end - return color.escapefg(color.WHITE) + return color.escapefg(color.DEFAULT) end function color.escapebg(color_value) @@ -81,7 +81,7 @@ function color.resetbg() if color.disabled then return '' end - return color.escapebg(color.BLACK) + return color.escapebg(color.DEFAULT) end function color.escape(fg_color, bg_color, attribute) @@ -101,7 +101,7 @@ function color.default() if color.disabled then return "" end - return color.escape(color.WHITE, color.BLACK, color.DEFAULT) + return color.escape(color.DEFAULT, color.DEFAULT) end function color.highlight(str) Modified: head/stand/lua/logo-beastie.lua ============================================================================== --- head/stand/lua/logo-beastie.lua Sun Sep 22 17:31:27 2019 (r352600) +++ head/stand/lua/logo-beastie.lua Sun Sep 22 17:39:20 2019 (r352601) @@ -48,7 +48,7 @@ local beastie_color = { " \\ / /\\", " \027[36m______\027[31m( (_ / \\______/", " \027[36m,' ,-----' |", -" `--{__________)\027[37m" +" `--{__________)\027[m" } drawer.addLogo("beastie", { Modified: head/stand/lua/logo-orb.lua ============================================================================== --- head/stand/lua/logo-orb.lua Sun Sep 22 17:31:27 2019 (r352600) +++ head/stand/lua/logo-orb.lua Sun Sep 22 17:39:20 2019 (r352601) @@ -44,7 +44,7 @@ local orb_color = { " -- \027[31;1m-.\027[31m", " `:` \027[31;1m`:`", " \027[31;1m.-- `--.", -" .---.....----.\027[37m" +" .---.....----.\027[m" } drawer.addLogo("orb", { Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sun Sep 22 17:31:27 2019 (r352600) +++ head/stand/lua/menu.lua Sun Sep 22 17:39:20 2019 (r352601) @@ -47,10 +47,10 @@ local return_menu_entry = { local function OnOff(str, value) if value then return str .. color.escapefg(color.GREEN) .. "On" .. - color.escapefg(color.WHITE) + color.resetfg() else return str .. color.escapefg(color.RED) .. "off" .. - color.escapefg(color.WHITE) + color.resetfg() end end From owner-svn-src-head@freebsd.org Sun Sep 22 18:27: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 0B61A128C6F; Sun, 22 Sep 2019 18:27:58 +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 46bwtP6SP8z445y; Sun, 22 Sep 2019 18:27:57 +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 C0C7827EA; Sun, 22 Sep 2019 18:27:57 +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 x8MIRvCw014002; Sun, 22 Sep 2019 18:27:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MIRvFM014001; Sun, 22 Sep 2019 18:27:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909221827.x8MIRvFM014001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 22 Sep 2019 18:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352603 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 352603 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, 22 Sep 2019 18:27:58 -0000 Author: kevans Date: Sun Sep 22 18:27:57 2019 New Revision: 352603 URL: https://svnweb.freebsd.org/changeset/base/352603 Log: Honor CWARNFLAGS.clang/gcc in the kernel build Some kernel builds or users may want to disable warnings on a per-compiler basis, so do this now. Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Sep 22 18:07:52 2019 (r352602) +++ head/sys/conf/kern.mk Sun Sep 22 18:27:57 2019 (r352603) @@ -253,6 +253,7 @@ CFLAGS+= -gdwarf-2 .endif CFLAGS+= ${CWARNFLAGS:M*} ${CWARNFLAGS.${.IMPSRC:T}} +CFLAGS+= ${CWARNFLAGS.${COMPILER_TYPE}} CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} ${CFLAGS.${.IMPSRC:T}} # Tell bmake not to mistake standard targets for things to be searched for From owner-svn-src-head@freebsd.org Sun Sep 22 18:30:20 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 9FC09128D0C; Sun, 22 Sep 2019 18:30:20 +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 46bwx83hk3z44Dm; Sun, 22 Sep 2019 18:30:20 +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 61DA727EF; Sun, 22 Sep 2019 18:30:20 +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 x8MIUKJo014185; Sun, 22 Sep 2019 18:30:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MIUKAu014184; Sun, 22 Sep 2019 18:30:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909221830.x8MIUKAu014184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 22 Sep 2019 18:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352604 - head/sys/mips/cavium X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/mips/cavium X-SVN-Commit-Revision: 352604 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, 22 Sep 2019 18:30:20 -0000 Author: kevans Date: Sun Sep 22 18:30:19 2019 New Revision: 352604 URL: https://svnweb.freebsd.org/changeset/base/352604 Log: octeon1: suppress a couple of warnings under clang These appear in octeon-sdk -- there are new releases, but they don't seem to address the running issues in octeon-sdk. GCC4.2 is more than happy, but clang is much less-so and most of them are fairly innocuous and perhaps a by-product of their style guide, which may make some of the changes harder to upstream (if this is even possible anymore). Modified: head/sys/mips/cavium/std.octeon1 Modified: head/sys/mips/cavium/std.octeon1 ============================================================================== --- head/sys/mips/cavium/std.octeon1 Sun Sep 22 18:27:57 2019 (r352603) +++ head/sys/mips/cavium/std.octeon1 Sun Sep 22 18:30:19 2019 (r352604) @@ -7,3 +7,4 @@ cpu CPU_CNMIPS makeoptions CFLAGS_PARAM_INLINE_UNIT_GROWTH=10000 makeoptions CFLAGS_PARAM_LARGE_FUNCTION_GROWTH=100000 makeoptions CFLAGS_ARCH_PARAMS="--param max-inline-insns-single=10000" +makeoptions "CWARNFLAGS.clang"+="-Wno-parentheses-equality -Wno-pointer-sign" From owner-svn-src-head@freebsd.org Sun Sep 22 18:32: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 D105A128EAF; Sun, 22 Sep 2019 18:32:05 +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 46bwz95F1vz44Y2; Sun, 22 Sep 2019 18:32:05 +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 980222995; Sun, 22 Sep 2019 18:32:05 +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 x8MIW5k3018168; Sun, 22 Sep 2019 18:32:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MIW5rq018167; Sun, 22 Sep 2019 18:32:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909221832.x8MIW5rq018167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 22 Sep 2019 18:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352605 - head/sys/contrib/octeon-sdk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/contrib/octeon-sdk X-SVN-Commit-Revision: 352605 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, 22 Sep 2019 18:32:05 -0000 Author: kevans Date: Sun Sep 22 18:32:05 2019 New Revision: 352605 URL: https://svnweb.freebsd.org/changeset/base/352605 Log: octeon-sdk: suppress another set of warnings under clang Clang sees this construct and warns that adding an int to a string like this does not concatenate the two. Fortunately, this is not what octeon-sdk actually intended to do, so we take the path towards remediation that clang offers: use array indexing instead. Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Sun Sep 22 18:30:19 2019 (r352604) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Sun Sep 22 18:32:05 2019 (r352605) @@ -355,7 +355,7 @@ enum cvmx_chip_types_enum { #define CVMX_BOARD_TYPE_NAO38 CVMX_BOARD_TYPE_NAC38 /* Functions to return string based on type */ -#define ENUM_BRD_TYPE_CASE(x) case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */ +#define ENUM_BRD_TYPE_CASE(x) case x: return(&#x[16]); /* Skip CVMX_BOARD_TYPE_ */ static inline const char *cvmx_board_type_to_string(enum cvmx_board_types_enum type) { switch (type) @@ -491,7 +491,7 @@ static inline const char *cvmx_board_type_to_string(en return "Unsupported Board"; } -#define ENUM_CHIP_TYPE_CASE(x) case x: return(#x + 15); /* Skip CVMX_CHIP_TYPE */ +#define ENUM_CHIP_TYPE_CASE(x) case x: return(&#x[15]); /* Skip CVMX_CHIP_TYPE */ static inline const char *cvmx_chip_type_to_string(enum cvmx_chip_types_enum type) { switch (type) From owner-svn-src-head@freebsd.org Sun Sep 22 18:37:39 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 868CB12903F for ; Sun, 22 Sep 2019 18:37:39 +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 46bx5b2vVTz44mq for ; Sun, 22 Sep 2019 18:37:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 3B014CE16 for ; Sun, 22 Sep 2019 18:37:39 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f174.google.com with SMTP id u40so14632693qth.11 for ; Sun, 22 Sep 2019 11:37:39 -0700 (PDT) X-Gm-Message-State: APjAAAVMBtJ1w2DqLa7eycwjEUQJOYBi9ybEgRx43GR5mO2BW+IplihH bulskSl7Jn1hxNfC7xEy+Z86YGldoqBfM/mZ7Gw= X-Received: by 2002:ac8:6918:: with SMTP id e24mt11983915qtr.60.1569177458581; Sun, 22 Sep 2019 11:37:38 -0700 (PDT) MIME-Version: 1.0 References: <201909221830.x8MIUKAu014184@repo.freebsd.org> In-Reply-To: <201909221830.x8MIUKAu014184@repo.freebsd.org> From: Kyle Evans Date: Sun, 22 Sep 2019 13:37:26 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352604 - head/sys/mips/cavium Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" 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, 22 Sep 2019 18:37:39 -0000 On Sun, Sep 22, 2019 at 1:30 PM Kyle Evans wrote: > > Author: kevans > Date: Sun Sep 22 18:30:19 2019 > New Revision: 352604 > URL: https://svnweb.freebsd.org/changeset/base/352604 > > Log: > octeon1: suppress a couple of warnings under clang > > These appear in octeon-sdk -- there are new releases, but they don't seem to > address the running issues in octeon-sdk. GCC4.2 is more than happy, but > clang is much less-so and most of them are fairly innocuous and perhaps a > by-product of their style guide, which may make some of the changes harder > to upstream (if this is even possible anymore). > > Modified: > head/sys/mips/cavium/std.octeon1 > > Modified: head/sys/mips/cavium/std.octeon1 > ============================================================================== > --- head/sys/mips/cavium/std.octeon1 Sun Sep 22 18:27:57 2019 (r352603) > +++ head/sys/mips/cavium/std.octeon1 Sun Sep 22 18:30:19 2019 (r352604) > @@ -7,3 +7,4 @@ cpu CPU_CNMIPS > makeoptions CFLAGS_PARAM_INLINE_UNIT_GROWTH=10000 > makeoptions CFLAGS_PARAM_LARGE_FUNCTION_GROWTH=100000 > makeoptions CFLAGS_ARCH_PARAMS="--param max-inline-insns-single=10000" > +makeoptions "CWARNFLAGS.clang"+="-Wno-parentheses-equality -Wno-pointer-sign" I meant to mention this... the extra quoting of "CWARNFLAGS.clang" is because config(8) doesn't see the dot as a valid character in an ID token, so unquoting it leaves us with a config(8) error -- we could resolve this by allowing periods in ID strings, but this doesn't seem to have bothered us thus far so I wonder if it's worth it. From owner-svn-src-head@freebsd.org Sun Sep 22 19:20:38 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 6F235129D39; Sun, 22 Sep 2019 19:20:38 +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 46by3B25ddz47Bx; Sun, 22 Sep 2019 19:20:38 +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 2C1CA30BA; Sun, 22 Sep 2019 19:20:38 +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 x8MJKcni044347; Sun, 22 Sep 2019 19:20:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MJKcpb044346; Sun, 22 Sep 2019 19:20:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909221920.x8MJKcpb044346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 Sep 2019 19:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352606 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 352606 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, 22 Sep 2019 19:20:38 -0000 Author: kib Date: Sun Sep 22 19:20:37 2019 New Revision: 352606 URL: https://svnweb.freebsd.org/changeset/base/352606 Log: amd64: minor tweaks to pat decoding in sysctl vm.pmap.kernel_maps. Decode PAT_UNCACHED. When unknown pat mode is encountered, print the pte bits combination instead of the index, which is always 8. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21738 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Sep 22 18:32:05 2019 (r352605) +++ head/sys/amd64/amd64/pmap.c Sun Sep 22 19:20:37 2019 (r352606) @@ -10023,6 +10023,9 @@ sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_ case PAT_UNCACHEABLE: mode = "UC"; break; + case PAT_UNCACHED: + mode = "U-"; + break; case PAT_WRITE_PROTECTED: mode = "WP"; break; @@ -10031,7 +10034,7 @@ sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_ break; default: printf("%s: unknown PAT mode %#x for range 0x%016lx-0x%016lx\n", - __func__, i, range->sva, eva); + __func__, pat_idx, range->sva, eva); mode = "??"; break; } From owner-svn-src-head@freebsd.org Sun Sep 22 19:23: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 D1195129EF1; Sun, 22 Sep 2019 19:23:01 +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 46by5x52Jrz47cK; Sun, 22 Sep 2019 19:23:01 +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 8FDC33270; Sun, 22 Sep 2019 19:23:01 +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 x8MJN1px049062; Sun, 22 Sep 2019 19:23:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MJN0xP049059; Sun, 22 Sep 2019 19:23:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909221923.x8MJN0xP049059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 Sep 2019 19:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352607 - in head/sys/i386: i386 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/i386: i386 include X-SVN-Commit-Revision: 352607 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, 22 Sep 2019 19:23:01 -0000 Author: kib Date: Sun Sep 22 19:23:00 2019 New Revision: 352607 URL: https://svnweb.freebsd.org/changeset/base/352607 Log: i386: implement sysctl vm.pmap.kernel_maps. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21739 Modified: head/sys/i386/i386/pmap.c head/sys/i386/i386/pmap_base.c head/sys/i386/include/pmap_base.h Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Sep 22 19:20:37 2019 (r352606) +++ head/sys/i386/i386/pmap.c Sun Sep 22 19:23:00 2019 (r352607) @@ -121,6 +121,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1130,6 +1131,38 @@ __CONCAT(PMTYPE, cache_bits)(pmap_t pmap, int mode, bo return (cache_bits); } +static int +pmap_pat_index(pmap_t pmap, pt_entry_t pte, bool is_pde) +{ + int pat_flag, pat_idx; + + if ((cpu_feature & CPUID_PAT) == 0) + return (0); + + pat_idx = 0; + /* The PAT bit is different for PTE's and PDE's. */ + pat_flag = is_pde ? PG_PDE_PAT : 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; + + /* See pmap_init_pat(). */ + if (pat_works) { + if (pat_idx == 4) + pat_idx = 0; + if (pat_idx == 7) + pat_idx = 3; + } else { + /* XXXKIB */ + } + + return (pat_idx); +} + static bool __CONCAT(PMTYPE, ps_enabled)(pmap_t pmap __unused) { @@ -6083,7 +6116,213 @@ __CONCAT(PMTYPE, bios16_leave)(void *arg) free(h->pte, M_TEMP); /* ... and free it */ } -#define PMM(a) \ +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_UNCACHED: + mode = "U-"; + break; + case PAT_WRITE_PROTECTED: + mode = "WP"; + break; + case PAT_WRITE_COMBINING: + mode = "WC"; + break; + default: + printf("%s: unknown PAT mode %#x for range 0x%08x-0x%08x\n", + __func__, pat_idx, range->sva, eva); + mode = "??"; + break; + } + + sbuf_printf(sb, "0x%08x-0x%08x r%c%c%c%c %s %d %d %d\n", + range->sva, eva, + (range->attrs & PG_RW) != 0 ? 'w' : '-', +#ifdef PMAP_PAE_COMP + (range->attrs & pg_nx) != 0 ? '-' : 'x', +#else + '-', +#endif + (range->attrs & PG_U) != 0 ? 'u' : 's', + (range->attrs & PG_G) != 0 ? 'g' : '-', + mode, range->pdpes, range->pdes, range->ptes); + + /* Reset to sentinel value. */ + range->sva = 0xffffffff; +} + +/* + * 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 = PG_G | PG_RW | PG_U | PG_PDE_CACHE; +#ifdef PMAP_PAE_COMP + mask |= pg_nx; +#endif + diff = (range->attrs ^ attrs) & mask; + if (diff == 0) + return (true); + if ((diff & ~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, pd_entry_t pde, pt_entry_t pte) +{ + pt_entry_t attrs, mask; + + attrs = pde & (PG_RW | PG_U); +#ifdef PMAP_PAE_COMP + attrs |= pde & pg_nx; +#endif + + if ((pde & PG_PS) != 0) { + attrs |= pde & (PG_G | PG_PDE_CACHE); + } else if (pte != 0) { + mask = pte & (PG_RW | PG_U); +#ifdef PMAP_PAE_COMP + mask |= pg_nx; +#endif + attrs &= mask; + attrs |= pte & (PG_G | PG_PTE_CACHE); + + /* Canonicalize by always using the PDE PAT bit. */ + if ((attrs & PG_PTE_PAT) != 0) + attrs ^= PG_PDE_PAT | 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 +__CONCAT(PMTYPE, sysctl_kmaps)(SYSCTL_HANDLER_ARGS) +{ + struct pmap_kernel_map_range range; + struct sbuf sbuf, *sb; + pd_entry_t pde; + pt_entry_t *pt, pte; + vm_offset_t sva; + vm_paddr_t pa; + int error; + u_int i, k; + + 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 = 0xffffffff; + + /* + * Iterate over the kernel page tables without holding the + * kernel pmap lock. Kernel page table pages are never freed, + * so at worst we will observe inconsistencies in the output. + */ + for (sva = 0, i = 0; i < NPTEPG * NPGPTD * NPDEPG ;) { + if (i == 0) + sbuf_printf(sb, "\nLow PDE:\n"); + else if (i == LOWPTDI * NPTEPG) + sbuf_printf(sb, "Low PDE dup:\n"); + else if (i == PTDPTDI * NPTEPG) + sbuf_printf(sb, "Recursive map:\n"); + else if (i == KERNPTDI * NPTEPG) + sbuf_printf(sb, "Kernel base:\n"); + else if (i == TRPTDI * NPTEPG) + sbuf_printf(sb, "Trampoline:\n"); + pde = IdlePTD[sva >> PDRSHIFT]; + if ((pde & PG_V) == 0) { + sva = rounddown2(sva, NBPDR); + sysctl_kmaps_dump(sb, &range, sva); + sva += NBPDR; + i += NPTEPG; + continue; + } + pa = pde & PG_FRAME; + if ((pde & PG_PS) != 0) { + sysctl_kmaps_check(sb, &range, sva, pde, 0); + range.pdes++; + sva += NBPDR; + i += NPTEPG; + continue; + } + for (pt = vtopte(sva), k = 0; k < NPTEPG; i++, k++, pt++, + sva += PAGE_SIZE) { + pte = *pt; + if ((pte & PG_V) == 0) { + sysctl_kmaps_dump(sb, &range, sva); + continue; + } + sysctl_kmaps_check(sb, &range, sva, pde, pte); + range.ptes++; + } + } + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +#define PMM(a) \ .pm_##a = __CONCAT(PMTYPE, a), struct pmap_methods __CONCAT(PMTYPE, methods) = { @@ -6162,4 +6401,5 @@ struct pmap_methods __CONCAT(PMTYPE, methods) = { PMM(flush_page) PMM(kenter) PMM(kremove) + PMM(sysctl_kmaps) }; Modified: head/sys/i386/i386/pmap_base.c ============================================================================== --- head/sys/i386/i386/pmap_base.c Sun Sep 22 19:20:37 2019 (r352606) +++ head/sys/i386/i386/pmap_base.c Sun Sep 22 19:23:00 2019 (r352607) @@ -258,6 +258,17 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_spare, CTLFLAG struct pmap kernel_pmap_store; static struct pmap_methods *pmap_methods_ptr; +static int +sysctl_kmaps(SYSCTL_HANDLER_ARGS) +{ + return (pmap_methods_ptr->pm_sysctl_kmaps(oidp, arg1, arg2, req)); +} +SYSCTL_OID(_vm_pmap, OID_AUTO, kernel_maps, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_kmaps, "A", + "Dump kernel address layout"); + + /* * Initialize a vm_page's machine-dependent fields. */ Modified: head/sys/i386/include/pmap_base.h ============================================================================== --- head/sys/i386/include/pmap_base.h Sun Sep 22 19:20:37 2019 (r352606) +++ head/sys/i386/include/pmap_base.h Sun Sep 22 19:23:00 2019 (r352607) @@ -118,6 +118,7 @@ struct pmap_methods { void (*pm_flush_page)(vm_page_t); void (*pm_kenter)(vm_offset_t, vm_paddr_t); void (*pm_kremove)(vm_offset_t); + int (*pm_sysctl_kmaps)(SYSCTL_HANDLER_ARGS); }; void pmap_cold(void); From owner-svn-src-head@freebsd.org Sun Sep 22 19:59: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 E8A4612AD22; Sun, 22 Sep 2019 19:59:10 +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 46byvf5gWWz49V0; Sun, 22 Sep 2019 19:59:10 +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 A1A7039F7; Sun, 22 Sep 2019 19:59:10 +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 x8MJxAQ8066900; Sun, 22 Sep 2019 19:59:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MJxAEn066899; Sun, 22 Sep 2019 19:59:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909221959.x8MJxAEn066899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 22 Sep 2019 19:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352609 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 352609 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, 22 Sep 2019 19:59:11 -0000 Author: kib Date: Sun Sep 22 19:59:10 2019 New Revision: 352609 URL: https://svnweb.freebsd.org/changeset/base/352609 Log: i386: reduce differences in source between PAE and non-PAE pmaps ... by defining pg_nx as zero for non-PAE and correspondingly simplifying some expressions. Suggested and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21757 Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Sep 22 19:53:29 2019 (r352608) +++ head/sys/i386/i386/pmap.c Sun Sep 22 19:59:10 2019 (r352609) @@ -227,6 +227,8 @@ static int nkpt = NKPT; #ifdef PMAP_PAE_COMP pt_entry_t pg_nx; static uma_zone_t pdptzone; +#else +#define pg_nx 0 #endif _Static_assert(VM_MAXUSER_ADDRESS == VADDR(TRPTDI, 0), "VM_MAXUSER_ADDRESS"); @@ -1871,11 +1873,7 @@ __CONCAT(PMTYPE, qenter)(vm_offset_t sva, vm_page_t *m m->md.pat_mode, 0); if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { oldpte |= *pte; -#ifdef PMAP_PAE_COMP pte_store(pte, pa | pg_nx | PG_RW | PG_V); -#else - pte_store(pte, pa | PG_RW | PG_V); -#endif } pte++; } @@ -6168,11 +6166,7 @@ sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_ sbuf_printf(sb, "0x%08x-0x%08x r%c%c%c%c %s %d %d %d\n", range->sva, eva, (range->attrs & PG_RW) != 0 ? 'w' : '-', -#ifdef PMAP_PAE_COMP (range->attrs & pg_nx) != 0 ? '-' : 'x', -#else - '-', -#endif (range->attrs & PG_U) != 0 ? 'u' : 's', (range->attrs & PG_G) != 0 ? 'g' : '-', mode, range->pdpes, range->pdes, range->ptes); @@ -6191,10 +6185,7 @@ sysctl_kmaps_match(struct pmap_kernel_map_range *range { pt_entry_t diff, mask; - mask = PG_G | PG_RW | PG_U | PG_PDE_CACHE; -#ifdef PMAP_PAE_COMP - mask |= pg_nx; -#endif + mask = pg_nx | PG_G | PG_RW | PG_U | PG_PDE_CACHE; diff = (range->attrs ^ attrs) & mask; if (diff == 0) return (true); @@ -6224,21 +6215,15 @@ static void sysctl_kmaps_check(struct sbuf *sb, struct pmap_kernel_map_range *range, vm_offset_t va, pd_entry_t pde, pt_entry_t pte) { - pt_entry_t attrs, mask; + pt_entry_t attrs; - attrs = pde & (PG_RW | PG_U); -#ifdef PMAP_PAE_COMP - attrs |= pde & pg_nx; -#endif + attrs = pde & (PG_RW | PG_U | pg_nx); if ((pde & PG_PS) != 0) { attrs |= pde & (PG_G | PG_PDE_CACHE); } else if (pte != 0) { - mask = pte & (PG_RW | PG_U); -#ifdef PMAP_PAE_COMP - mask |= pg_nx; -#endif - attrs &= mask; + attrs |= pte & pg_nx; + attrs &= pg_nx | (pte & (PG_RW | PG_U)); attrs |= pte & (PG_G | PG_PTE_CACHE); /* Canonicalize by always using the PDE PAT bit. */ From owner-svn-src-head@freebsd.org Sun Sep 22 20:44: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 6A29212BA8F; Sun, 22 Sep 2019 20:44:25 +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 46bzvs27dZz4CZs; Sun, 22 Sep 2019 20:44:25 +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 2903743A6; Sun, 22 Sep 2019 20:44:25 +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 x8MKiP7q096200; Sun, 22 Sep 2019 20:44:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MKiPnK096199; Sun, 22 Sep 2019 20:44:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909222044.x8MKiPnK096199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 22 Sep 2019 20:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352611 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352611 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, 22 Sep 2019 20:44:25 -0000 Author: mjg Date: Sun Sep 22 20:44:24 2019 New Revision: 352611 URL: https://svnweb.freebsd.org/changeset/base/352611 Log: lockprof: move per-cpu data to dpcpu Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21747 Modified: head/sys/kern/subr_lock.c Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Sun Sep 22 20:03:25 2019 (r352610) +++ head/sys/kern/subr_lock.c Sun Sep 22 20:44:24 2019 (r352611) @@ -241,7 +241,9 @@ struct lock_prof_cpu { struct lock_prof_type lpc_types[2]; /* One for spin one for other. */ }; -struct lock_prof_cpu *lp_cpu[MAXCPU]; +DPCPU_DEFINE_STATIC(struct lock_prof_cpu, lp); +#define LP_CPU_SELF (DPCPU_PTR(lp)) +#define LP_CPU(cpu) (DPCPU_ID_PTR((cpu), lp)) volatile int __read_mostly lock_prof_enable; static volatile int lock_prof_resetting; @@ -288,10 +290,8 @@ lock_prof_init(void *arg) int cpu; CPU_FOREACH(cpu) { - lp_cpu[cpu] = malloc(sizeof(*lp_cpu[cpu]), M_DEVBUF, - M_WAITOK | M_ZERO); - lock_prof_init_type(&lp_cpu[cpu]->lpc_types[0]); - lock_prof_init_type(&lp_cpu[cpu]->lpc_types[1]); + lock_prof_init_type(&LP_CPU(cpu)->lpc_types[0]); + lock_prof_init_type(&LP_CPU(cpu)->lpc_types[1]); } } SYSINIT(lockprof, SI_SUB_SMP, SI_ORDER_ANY, lock_prof_init, NULL); @@ -331,14 +331,14 @@ lock_prof_reset(void) * into per-thread lists as well. */ CPU_FOREACH(cpu) { - lpc = lp_cpu[cpu]; + lpc = LP_CPU(cpu); for (i = 0; i < LPROF_CACHE_SIZE; i++) { LIST_REMOVE(&lpc->lpc_types[0].lpt_objs[i], lpo_link); LIST_REMOVE(&lpc->lpc_types[1].lpt_objs[i], lpo_link); } } CPU_FOREACH(cpu) { - lpc = lp_cpu[cpu]; + lpc = LP_CPU(cpu); bzero(lpc, sizeof(*lpc)); lock_prof_init_type(&lpc->lpc_types[0]); lock_prof_init_type(&lpc->lpc_types[1]); @@ -379,7 +379,7 @@ lock_prof_sum(struct lock_prof *match, struct lock_pro dst->name = match->name; CPU_FOREACH(cpu) { - type = &lp_cpu[cpu]->lpc_types[spin]; + type = &LP_CPU(cpu)->lpc_types[spin]; SLIST_FOREACH(l, &type->lpt_hash[hash], link) { if (l->ticks == t) continue; @@ -436,8 +436,8 @@ dump_lock_prof_stats(SYSCTL_HANDLER_ARGS) quiesce_all_cpus("profstat", 0); t = ticks; CPU_FOREACH(cpu) { - lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[0], sb, 0, t); - lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[1], sb, 1, t); + lock_prof_type_stats(&LP_CPU(cpu)->lpc_types[0], sb, 0, t); + lock_prof_type_stats(&LP_CPU(cpu)->lpc_types[1], sb, 1, t); } lock_prof_enable = enabled; @@ -503,7 +503,7 @@ lock_profile_lookup(struct lock_object *lo, int spin, p = unknown; hash = (uintptr_t)lo->lo_name * 31 + (uintptr_t)p * 31 + line; hash &= LPROF_HASH_MASK; - type = &lp_cpu[PCPU_GET(cpuid)]->lpc_types[spin]; + type = &LP_CPU_SELF->lpc_types[spin]; head = &type->lpt_hash[hash]; SLIST_FOREACH(lp, head, link) { if (lp->line == line && lp->file == p && @@ -538,7 +538,7 @@ lock_profile_object_lookup(struct lock_object *lo, int if (l->lpo_obj == lo && l->lpo_file == file && l->lpo_line == line) return (l); - type = &lp_cpu[PCPU_GET(cpuid)]->lpc_types[spin]; + type = &LP_CPU_SELF->lpc_types[spin]; l = LIST_FIRST(&type->lpt_lpoalloc); if (l == NULL) { lock_prof_rejected++; @@ -674,7 +674,7 @@ lock_profile_release_lock(struct lock_object *lo) lp->cnt_cur += l->lpo_cnt; release: LIST_REMOVE(l, lpo_link); - type = &lp_cpu[PCPU_GET(cpuid)]->lpc_types[spin]; + type = &LP_CPU_SELF->lpc_types[spin]; LIST_INSERT_HEAD(&type->lpt_lpoalloc, l, lpo_link); out: critical_exit(); From owner-svn-src-head@freebsd.org Sun Sep 22 20:49: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 31C9012BBD2; Sun, 22 Sep 2019 20:49:18 +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 46c01T53QFz4Ckk; Sun, 22 Sep 2019 20:49:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 791BB43AD; Sun, 22 Sep 2019 20:49:17 +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 x8MKnHib096489; Sun, 22 Sep 2019 20:49:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MKnHnP096488; Sun, 22 Sep 2019 20:49:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909222049.x8MKnHnP096488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 22 Sep 2019 20:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352612 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352612 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, 22 Sep 2019 20:49:18 -0000 Author: mjg Date: Sun Sep 22 20:49:17 2019 New Revision: 352612 URL: https://svnweb.freebsd.org/changeset/base/352612 Log: cache: jump in negative success instead of positive Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Sep 22 20:44:24 2019 (r352611) +++ head/sys/kern/vfs_cache.c Sun Sep 22 20:49:17 2019 (r352612) @@ -1380,7 +1380,7 @@ retry: } /* We failed to find an entry */ - if (ncp == NULL) { + if (__predict_false(ncp == NULL)) { rw_runlock(blp); SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, NULL); @@ -1388,35 +1388,17 @@ retry: return (0); } - /* We found a "positive" match, return the vnode */ - if (!(ncp->nc_flag & NCF_NEGATIVE)) { - counter_u64_add(numposhits, 1); - *vpp = ncp->nc_vp; - CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", - dvp, cnp->cn_nameptr, *vpp, ncp); - SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, - *vpp); - cache_out_ts(ncp, tsp, ticksp); - goto success; - } + if (ncp->nc_flag & NCF_NEGATIVE) + goto negative_success; -negative_success: - /* We found a negative match, and want to create it, so purge */ - if (cnp->cn_nameiop == CREATE) { - counter_u64_add(numnegzaps, 1); - goto zap_and_exit; - } - - counter_u64_add(numneghits, 1); - cache_negative_hit(ncp); - if (ncp->nc_flag & NCF_WHITE) - cnp->cn_flags |= ISWHITEOUT; - SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, - ncp->nc_name); + /* We found a "positive" match, return the vnode */ + counter_u64_add(numposhits, 1); + *vpp = ncp->nc_vp; + CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", + dvp, cnp->cn_nameptr, *vpp, ncp); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ncp->nc_name, + *vpp); cache_out_ts(ncp, tsp, ticksp); - cache_lookup_unlock(blp, dvlp); - return (ENOENT); - success: /* * On success we return a locked and ref'd vnode as per the lookup @@ -1449,6 +1431,23 @@ success: ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); } return (-1); + +negative_success: + /* We found a negative match, and want to create it, so purge */ + if (cnp->cn_nameiop == CREATE) { + counter_u64_add(numnegzaps, 1); + goto zap_and_exit; + } + + counter_u64_add(numneghits, 1); + cache_negative_hit(ncp); + if (ncp->nc_flag & NCF_WHITE) + cnp->cn_flags |= ISWHITEOUT; + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, + ncp->nc_name); + cache_out_ts(ncp, tsp, ticksp); + cache_lookup_unlock(blp, dvlp); + return (ENOENT); zap_and_exit: if (blp != NULL) From owner-svn-src-head@freebsd.org Sun Sep 22 20:50: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 1C6EA12BC65; Sun, 22 Sep 2019 20:50:25 +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 46c02m6zvjz4Ct3; Sun, 22 Sep 2019 20:50:24 +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 D31AA43B1; Sun, 22 Sep 2019 20:50:24 +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 x8MKoOug096635; Sun, 22 Sep 2019 20:50:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8MKoOnM096634; Sun, 22 Sep 2019 20:50:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909222050.x8MKoOnM096634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 22 Sep 2019 20:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352613 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352613 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, 22 Sep 2019 20:50:25 -0000 Author: mjg Date: Sun Sep 22 20:50:24 2019 New Revision: 352613 URL: https://svnweb.freebsd.org/changeset/base/352613 Log: cache: try to avoid vhold if locks held Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Sep 22 20:49:17 2019 (r352612) +++ head/sys/kern/vfs_cache.c Sun Sep 22 20:50:24 2019 (r352613) @@ -1690,7 +1690,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, uint32_t hash; int flag; int len; - bool neg_locked; + bool neg_locked, held_dvp; u_long lnumcache; CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); @@ -1769,6 +1769,13 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, } } + held_dvp = false; + if (LIST_EMPTY(&dvp->v_cache_src) && flag != NCF_ISDOTDOT) { + vhold(dvp); + atomic_add_long(&numcachehv, 1); + held_dvp = true; + } + /* * Calculate the hash key and setup as much of the new * namecache entry as possible before acquiring the lock. @@ -1858,8 +1865,21 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (flag != NCF_ISDOTDOT) { if (LIST_EMPTY(&dvp->v_cache_src)) { - vhold(dvp); - atomic_add_rel_long(&numcachehv, 1); + if (!held_dvp) { + vhold(dvp); + atomic_add_long(&numcachehv, 1); + } + } else { + if (held_dvp) { + /* + * This will not take the interlock as someone + * else already holds the vnode on account of + * the namecache and we hold locks preventing + * this from changing. + */ + vdrop(dvp); + atomic_subtract_long(&numcachehv, 1); + } } LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); } @@ -1894,6 +1914,10 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, out_unlock_free: cache_enter_unlock(&cel); cache_free(ncp); + if (held_dvp) { + vdrop(dvp); + atomic_subtract_long(&numcachehv, 1); + } return; } From owner-svn-src-head@freebsd.org Sun Sep 22 22:24: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 5637D12E524; Sun, 22 Sep 2019 22:24:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 46c26p1YqMz4K40; Sun, 22 Sep 2019 22:24:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-pl1-f169.google.com with SMTP id q15so5613239pll.11; Sun, 22 Sep 2019 15:24:01 -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=kuzWQ55VsMjj0WgJyrVZGLh7tK+vgmthK2UzKL6sGKg=; b=EDvOIMYvwIMiqxRqvL4Iyd7PTrU0RrcSHn1evdTYbRbakpYOuoKXc7Go5UYEyXwPTf tQRZ73ZooMQaFkJlq7rXMRnyNdNogft1GU8CRorzDlYGhQcwN+tniftxd2S1hnVZDPf1 8osS1VihhMftW/jNdf1HNwCfBsAAit6aDuNvdK2S+JlL/B87vWUbiNPvV6XeobQ0iNGH xzS1eqcrFuLfF0k/mmZ02fcjLGYUgd9pFh+fWCjl3kBCu4YeJ2UV+S64muQiImYA+Wie 1AVX3T1LjYvbiWOm4kH2Tc2enpqD39/zQtpYr1l1L0FenEZuYcDZgMiCc04iLVJPF4br hC1w== X-Gm-Message-State: APjAAAVJXyO8oKeyD4nG6lRJ731aQIAmCkythKhZ0F0gJvKsqQ2X5SgD UiZ0lD3RkZnRCi5VSCAid6h/hDQY X-Google-Smtp-Source: APXvYqwtERmyLG+mlLIrYbS4GP+LIx/4qPATjL4csHeZHrWtyVKvan2MTkrK/E8vO45rfPq2R9byVw== X-Received: by 2002:a17:902:b582:: with SMTP id a2mr28606522pls.92.1569191039904; Sun, 22 Sep 2019 15:23:59 -0700 (PDT) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com. [209.85.210.169]) by smtp.gmail.com with ESMTPSA id 16sm9627810pfi.55.2019.09.22.15.23.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Sep 2019 15:23:59 -0700 (PDT) Received: by mail-pf1-f169.google.com with SMTP id q21so7843704pfn.11; Sun, 22 Sep 2019 15:23:59 -0700 (PDT) X-Received: by 2002:a63:fc60:: with SMTP id r32mr27168249pgk.160.1569191039385; Sun, 22 Sep 2019 15:23:59 -0700 (PDT) MIME-Version: 1.0 References: <201909221827.x8MIRvFM014001@repo.freebsd.org> In-Reply-To: <201909221827.x8MIRvFM014001@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sun, 22 Sep 2019 15:23:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352603 - head/sys/conf To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46c26p1YqMz4K40 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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, 22 Sep 2019 22:24:02 -0000 Thanks! The more granular we can be about disabling specific warnings for specific compilers and/or files, the less we lose out on by disabling more broadly. On Sun, Sep 22, 2019 at 11:28 AM Kyle Evans wrote: > > Author: kevans > Date: Sun Sep 22 18:27:57 2019 > New Revision: 352603 > URL: https://svnweb.freebsd.org/changeset/base/352603 > > Log: > Honor CWARNFLAGS.clang/gcc in the kernel build > > Some kernel builds or users may want to disable warnings on a per-compiler > basis, so do this now. > > Modified: > head/sys/conf/kern.mk > > Modified: head/sys/conf/kern.mk > ============================================================================== > --- head/sys/conf/kern.mk Sun Sep 22 18:07:52 2019 (r352602) > +++ head/sys/conf/kern.mk Sun Sep 22 18:27:57 2019 (r352603) > @@ -253,6 +253,7 @@ CFLAGS+= -gdwarf-2 > .endif > > CFLAGS+= ${CWARNFLAGS:M*} ${CWARNFLAGS.${.IMPSRC:T}} > +CFLAGS+= ${CWARNFLAGS.${COMPILER_TYPE}} > CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} ${CFLAGS.${.IMPSRC:T}} > > # Tell bmake not to mistake standard targets for things to be searched for From owner-svn-src-head@freebsd.org Mon Sep 23 04:28: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 2368CD53F7; Mon, 23 Sep 2019 04:28:10 +0000 (UTC) (envelope-from sef@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 46cBBx5S0Zz4WsD; Mon, 23 Sep 2019 04:28:09 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9E65A967F; Mon, 23 Sep 2019 04:28:09 +0000 (UTC) (envelope-from sef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8N4S9Js066148; Mon, 23 Sep 2019 04:28:09 GMT (envelope-from sef@FreeBSD.org) Received: (from sef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8N4S8ud066140; Mon, 23 Sep 2019 04:28:08 GMT (envelope-from sef@FreeBSD.org) Message-Id: <201909230428.x8N4S8ud066140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sef set sender to sef@FreeBSD.org using -f From: Sean Eric Fagan Date: Mon, 23 Sep 2019 04:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352614 - in head: lib/libc/sys sbin/mount sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: sef X-SVN-Commit-Paths: in head: lib/libc/sys sbin/mount sys/kern sys/sys X-SVN-Commit-Revision: 352614 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, 23 Sep 2019 04:28:10 -0000 Author: sef Date: Mon Sep 23 04:28:07 2019 New Revision: 352614 URL: https://svnweb.freebsd.org/changeset/base/352614 Log: Add two options to allow mount to avoid covering up existing mount points. The two options are * nocover/cover: Prevent/allow mounting over an existing root mountpoint. E.g., "mount -t ufs -o nocover /dev/sd1a /usr/local" will fail if /usr/local is already a mountpoint. * emptydir/noemptydir: Prevent/allow mounting on a non-empty directory. E.g., "mount -t ufs -o emptydir /dev/sd1a /usr" will fail. Neither of these options is intended to be a default, for historical and compatibility reasons. Reviewed by: allanjude, kib Differential Revision: https://reviews.freebsd.org/D21458 Modified: head/lib/libc/sys/mount.2 head/sbin/mount/mntopts.h head/sbin/mount/mount.8 head/sbin/mount/mount.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/sys/mount.h head/sys/sys/vnode.h Modified: head/lib/libc/sys/mount.2 ============================================================================== --- head/lib/libc/sys/mount.2 Sun Sep 22 20:50:24 2019 (r352613) +++ head/lib/libc/sys/mount.2 Mon Sep 23 04:28:07 2019 (r352614) @@ -28,7 +28,7 @@ .\" @(#)mount.2 8.3 (Berkeley) 5/24/95 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd August 28, 2019 .Dt MOUNT 2 .Os .Sh NAME @@ -157,6 +157,10 @@ mount even if some files are open for writing. Disable read clustering. .It Dv MNT_NOCLUSTERW Disable write clustering. +.It Dv MNT_NOCOVER +Do not mount over the root of another mount point. +.It Dv MNT_EMPTYDIR +Require an empty directory for the mount point directory. .El .Pp The flag @@ -260,6 +264,11 @@ is not a directory. .It Bq Er EBUSY Another process currently holds a reference to .Fa dir . +.It Bq Er EBUSY +The +.Dv MNT_NOCOVER +option was given, and the requested mount point +is already the root of another mount point. .It Bq Er EFAULT The .Fa dir @@ -280,6 +289,11 @@ The .Fa fspec argument is not a block device. +.It Bq Er ENOTEMPTY +The +.Dv MNT_EMPTYDIR +option was specified, and the requested mount point +is not an empty directory. .It Bq Er ENXIO The major device number of .Fa fspec Modified: head/sbin/mount/mntopts.h ============================================================================== --- head/sbin/mount/mntopts.h Sun Sep 22 20:50:24 2019 (r352613) +++ head/sbin/mount/mntopts.h Mon Sep 23 04:28:07 2019 (r352614) @@ -65,7 +65,8 @@ struct mntopt { #define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } #define MOPT_RO { "ro", 0, MNT_RDONLY, 0 } #define MOPT_RW { "rw", 1, MNT_RDONLY, 0 } - +#define MOPT_NOCOVER { "cover", 1, MNT_NOCOVER, 0 } +#define MOPT_EMPTYDIR { "emptydir", 0, MNT_EMPTYDIR, 0 } /* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */ #define MOPT_AUTO { "auto", 0, 0, 0 } @@ -95,7 +96,9 @@ struct mntopt { MOPT_ACLS, \ MOPT_NFS4ACLS, \ MOPT_AUTOMOUNTED, \ - MOPT_UNTRUSTED + MOPT_UNTRUSTED, \ + MOPT_NOCOVER, \ + MOPT_EMPTYDIR void getmntopts(const char *, const struct mntopt *, int *, int *); void rmslashes(char *, char *); Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Sun Sep 22 20:50:24 2019 (r352613) +++ head/sbin/mount/mount.8 Mon Sep 23 04:28:07 2019 (r352614) @@ -28,7 +28,7 @@ .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" $FreeBSD$ .\" -.Dd March 22, 2017 +.Dd August 28, 2019 .Dt MOUNT 8 .Os .Sh NAME @@ -162,6 +162,8 @@ When used with the .Fl u flag, this is the same as specifying the options currently in effect for the mounted file system. +.It Cm emptydir +Require that the mount point directory be empty. .It Cm force The same as .Fl f ; @@ -237,6 +239,9 @@ flag. Disable read clustering. .It Cm noclusterw Disable write clustering. +.It Cm nocover +Do not mount if the requested mount point is already +the root of a mount point. .It Cm noexec Do not allow execution of any binaries on the mounted file system. This option is useful for a server that has file systems containing Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Sun Sep 22 20:50:24 2019 (r352613) +++ head/sbin/mount/mount.c Mon Sep 23 04:28:07 2019 (r352614) @@ -119,6 +119,8 @@ static struct opt { { MNT_AUTOMOUNTED, "automounted" }, { MNT_VERIFIED, "verified" }, { MNT_UNTRUSTED, "untrusted" }, + { MNT_NOCOVER, "nocover" }, + { MNT_EMPTYDIR, "emptydir" }, { 0, NULL } }; @@ -975,6 +977,8 @@ flags2opts(int flags) if (flags & MNT_ACLS) res = catopt(res, "acls"); if (flags & MNT_NFS4ACLS) res = catopt(res, "nfsv4acls"); if (flags & MNT_UNTRUSTED) res = catopt(res, "untrusted"); + if (flags & MNT_NOCOVER) res = catopt(res, "nocover"); + if (flags & MNT_EMPTYDIR) res = catopt(res, "emptydir"); return (res); } Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Sep 22 20:50:24 2019 (r352613) +++ head/sys/kern/vfs_mount.c Mon Sep 23 04:28:07 2019 (r352614) @@ -668,19 +668,21 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru * when we want to update the root filesystem. */ TAILQ_FOREACH_SAFE(opt, optlist, link, tmp_opt) { + int do_freeopt = 0; + if (strcmp(opt->name, "update") == 0) { fsflags |= MNT_UPDATE; - vfs_freeopt(optlist, opt); + do_freeopt = 1; } else if (strcmp(opt->name, "async") == 0) fsflags |= MNT_ASYNC; else if (strcmp(opt->name, "force") == 0) { fsflags |= MNT_FORCE; - vfs_freeopt(optlist, opt); + do_freeopt = 1; } else if (strcmp(opt->name, "reload") == 0) { fsflags |= MNT_RELOAD; - vfs_freeopt(optlist, opt); + do_freeopt = 1; } else if (strcmp(opt->name, "multilabel") == 0) fsflags |= MNT_MULTILABEL; @@ -741,7 +743,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru autoro = false; } else if (strcmp(opt->name, "autoro") == 0) { - vfs_freeopt(optlist, opt); + do_freeopt = 1; autoro = true; } else if (strcmp(opt->name, "suiddir") == 0) @@ -752,8 +754,22 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru fsflags |= MNT_UNION; else if (strcmp(opt->name, "automounted") == 0) { fsflags |= MNT_AUTOMOUNTED; - vfs_freeopt(optlist, opt); + do_freeopt = 1; + } else if (strcmp(opt->name, "nocover") == 0) { + fsflags |= MNT_NOCOVER; + do_freeopt = 1; + } else if (strcmp(opt->name, "cover") == 0) { + fsflags &= ~MNT_NOCOVER; + do_freeopt = 1; + } else if (strcmp(opt->name, "emptydir") == 0) { + fsflags |= MNT_EMPTYDIR; + do_freeopt = 1; + } else if (strcmp(opt->name, "noemptydir") == 0) { + fsflags &= ~MNT_EMPTYDIR; + do_freeopt = 1; } + if (do_freeopt) + vfs_freeopt(optlist, opt); } /* @@ -889,6 +905,14 @@ vfs_domount_first( ASSERT_VOP_ELOCKED(vp, __func__); KASSERT((fsflags & MNT_UPDATE) == 0, ("MNT_UPDATE shouldn't be here")); + if ((fsflags & MNT_EMPTYDIR) != 0) { + error = vfs_emptydir(vp); + if (error != 0) { + vput(vp); + return (error); + } + } + /* * If the jail of the calling thread lacks permission for this type of * file system, deny immediately. @@ -1229,6 +1253,11 @@ vfs_domount( NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) { + if ((vp->v_vflag & VV_ROOT) != 0 && + (fsflags & MNT_NOCOVER) != 0) { + vput(vp); + return (EBUSY); + } pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); strcpy(pathbuf, fspath); error = vn_path_to_global_path(td, vp, pathbuf, MNAMELEN); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Sep 22 20:50:24 2019 (r352613) +++ head/sys/kern/vfs_subr.c Mon Sep 23 04:28:07 2019 (r352614) @@ -5535,6 +5535,76 @@ filt_vfsvnode(struct knote *kn, long hint) return (res); } +/* + * Returns whether the directory is empty or not. + * If it is empty, the return value is 0; otherwise + * the return value is an error value (which may + * be ENOTEMPTY). + */ +int +vfs_emptydir(struct vnode *vp) +{ + struct uio uio; + struct iovec iov; + struct dirent *dirent, *dp, *endp; + int error, eof; + + error = 0; + eof = 0; + + ASSERT_VOP_LOCKED(vp, "vfs_emptydir"); + + dirent = malloc(sizeof(struct dirent), M_TEMP, M_WAITOK); + iov.iov_base = dirent; + iov.iov_len = sizeof(struct dirent); + + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = 0; + uio.uio_resid = sizeof(struct dirent); + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; + uio.uio_td = curthread; + + while (eof == 0 && error == 0) { + error = VOP_READDIR(vp, &uio, curthread->td_ucred, &eof, + NULL, NULL); + if (error != 0) + break; + endp = (void *)((uint8_t *)dirent + + sizeof(struct dirent) - uio.uio_resid); + for (dp = dirent; dp < endp; + dp = (void *)((uint8_t *)dp + GENERIC_DIRSIZ(dp))) { + if (dp->d_type == DT_WHT) + continue; + if (dp->d_namlen == 0) + continue; + if (dp->d_type != DT_DIR && + dp->d_type != DT_UNKNOWN) { + error = ENOTEMPTY; + break; + } + if (dp->d_namlen > 2) { + error = ENOTEMPTY; + break; + } + if (dp->d_namlen == 1 && + dp->d_name[0] != '.') { + error = ENOTEMPTY; + break; + } + if (dp->d_namlen == 2 && + dp->d_name[1] != '.') { + error = ENOTEMPTY; + break; + } + uio.uio_resid = sizeof(struct dirent); + } + } + free(dirent, M_TEMP); + return (error); +} + int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off) { Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sun Sep 22 20:50:24 2019 (r352613) +++ head/sys/sys/mount.h Mon Sep 23 04:28:07 2019 (r352614) @@ -373,9 +373,11 @@ void __mnt_vnode_markerfree_active(struct vno #define MNT_SNAPSHOT 0x0000000001000000ULL /* snapshot the filesystem */ #define MNT_NONBUSY 0x0000000004000000ULL /* check vnode use counts. */ #define MNT_BYFSID 0x0000000008000000ULL /* specify filesystem by ID. */ +#define MNT_NOCOVER 0x0000001000000000ULL /* Do not cover a mount point */ +#define MNT_EMPTYDIR 0x0000002000000000ULL /* Only mount on empty dir */ #define MNT_CMDFLAGS (MNT_UPDATE | MNT_DELEXPORT | MNT_RELOAD | \ MNT_FORCE | MNT_SNAPSHOT | MNT_NONBUSY | \ - MNT_BYFSID) + MNT_BYFSID | MNT_NOCOVER | MNT_EMPTYDIR) /* * Internal filesystem control flags stored in mnt_kern_flag. * Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Sep 22 20:50:24 2019 (r352613) +++ head/sys/sys/vnode.h Mon Sep 23 04:28:07 2019 (r352614) @@ -930,6 +930,7 @@ int vfs_kqfilter(struct vop_kqfilter_args *); void vfs_mark_atime(struct vnode *vp, struct ucred *cred); struct dirent; int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off); +int vfs_emptydir(struct vnode *vp); int vfs_unixify_accmode(accmode_t *accmode); From owner-svn-src-head@freebsd.org Mon Sep 23 08:53: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 B3B9EECE52; Mon, 23 Sep 2019 08:53:14 +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 46cJ4p4KBFz3Fyr; Mon, 23 Sep 2019 08:53:14 +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 78E26C7C3; Mon, 23 Sep 2019 08:53:14 +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 x8N8rEqh024578; Mon, 23 Sep 2019 08:53:14 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8N8rEnu024577; Mon, 23 Sep 2019 08:53:14 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909230853.x8N8rEnu024577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Sep 2019 08:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352617 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352617 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, 23 Sep 2019 08:53:14 -0000 Author: mjg Date: Mon Sep 23 08:53:14 2019 New Revision: 352617 URL: https://svnweb.freebsd.org/changeset/base/352617 Log: cache: count evictions of negatve entries Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Sep 23 07:23:29 2019 (r352616) +++ head/sys/kern/vfs_cache.c Mon Sep 23 08:53:14 2019 (r352617) @@ -378,6 +378,8 @@ STATNODE_COUNTER(numfullpathfail2, "Number of fullpath search errors (VOP_VPTOCNP failures)"); STATNODE_COUNTER(numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls"); +static long numneg_evicted; STATNODE_ULONG(numneg_evicted, + "Number of negative entries evicted when adding a new entry"); STATNODE_COUNTER(zap_and_exit_bucket_relock_success, "Number of successful removals after relocking"); static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail, @@ -844,6 +846,7 @@ cache_negative_zap_one(void) ncp->nc_name, ncp->nc_neghits); cache_zap_locked(ncp, true); + numneg_evicted++; out_unlock_all: mtx_unlock(&neglist->nl_lock); rw_wunlock(blp); From owner-svn-src-head@freebsd.org Mon Sep 23 11:36: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 8B83FF0F63; Mon, 23 Sep 2019 11:36:17 +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 46cMhw6Y92z3P67; Mon, 23 Sep 2019 11:36:16 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id CMdYiOF0HIhW9CMdZiji2d; Mon, 23 Sep 2019 05:36:14 -0600 X-Authority-Analysis: v=2.3 cv=FcFJO626 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=D_CeWOJqrPHOpRGt5AEA:9 a=yxUT77K8rovF71sl:21 a=P2dH3RFDTczZq4TR:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 6A1935D6; Mon, 23 Sep 2019 04:36:11 -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 x8NBaA48042190; Mon, 23 Sep 2019 04:36:10 -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 x8NBaA29042187; Mon, 23 Sep 2019 04:36:10 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201909231136.x8NBaA29042187@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: Mateusz Guzik cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352617 - head/sys/kern In-reply-to: <201909230853.x8N8rEnu024577@repo.freebsd.org> References: <201909230853.x8N8rEnu024577@repo.freebsd.org> Comments: In-reply-to Mateusz Guzik message dated "Mon, 23 Sep 2019 08:53:14 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 23 Sep 2019 04:36:10 -0700 X-CMAE-Envelope: MS4wfNOQj3sg4W4UXcLJDIn/2U9EP5aAGY0mPTJ6q8jzMI3YnPTZDj6tAzmE5ckj2uX3x6G9x85FpgTxkVvzGDQVIlaLJ9ouvWxbQkUIEsRNCZ9GBa268o5k vMHESsKgtt8FtY2wGr6TZizvRyLxIjZ+hPxgsLwUe1jk6i5Jup6qlAqc4C4slVy9Y+FOGiOhkcgzWNUqG2w9bwBUFU7BPVyUPUxCzJnmpBoKrAxU6rVOsWhQ gMGBhWE3yJnHZhD9i3JQY1TDm0UlyPTgLsp7zlE376HPwj6dshDU6qDYgNYnDVGy X-Rspamd-Queue-Id: 46cMhw6Y92z3P67 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,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: Mon, 23 Sep 2019 11:36:17 -0000 In message <201909230853.x8N8rEnu024577@repo.freebsd.org>, Mateusz Guzik writes : > Author: mjg > Date: Mon Sep 23 08:53:14 2019 > New Revision: 352617 > URL: https://svnweb.freebsd.org/changeset/base/352617 > > Log: > cache: count evictions of negatve entries Why? > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > ============================================================================= > = > --- head/sys/kern/vfs_cache.c Mon Sep 23 07:23:29 2019 (r352616) > +++ head/sys/kern/vfs_cache.c Mon Sep 23 08:53:14 2019 (r352617) > @@ -378,6 +378,8 @@ STATNODE_COUNTER(numfullpathfail2, > "Number of fullpath search errors (VOP_VPTOCNP failures)"); > STATNODE_COUNTER(numfullpathfail4, "Number of fullpath search errors (ENOMEM > )"); > STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls"); > +static long numneg_evicted; STATNODE_ULONG(numneg_evicted, > + "Number of negative entries evicted when adding a new entry"); > STATNODE_COUNTER(zap_and_exit_bucket_relock_success, > "Number of successful removals after relocking"); > static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fai > l, > @@ -844,6 +846,7 @@ cache_negative_zap_one(void) > ncp->nc_name, ncp->nc_neghits); > > cache_zap_locked(ncp, true); > + numneg_evicted++; > out_unlock_all: > mtx_unlock(&neglist->nl_lock); > rw_wunlock(blp); > -- 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 23 12:27: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 C59DCF2CB3; Mon, 23 Sep 2019 12:27:55 +0000 (UTC) (envelope-from tijl@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 46cNrW4tC5z3xHd; Mon, 23 Sep 2019 12:27:55 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8B8FDED4F; Mon, 23 Sep 2019 12:27:55 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8NCRtTS064179; Mon, 23 Sep 2019 12:27:55 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NCRtpW064178; Mon, 23 Sep 2019 12:27:55 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201909231227.x8NCRtpW064178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Mon, 23 Sep 2019 12:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352618 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 352618 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, 23 Sep 2019 12:27:55 -0000 Author: tijl Date: Mon Sep 23 12:27:55 2019 New Revision: 352618 URL: https://svnweb.freebsd.org/changeset/base/352618 Log: Create a "drm" subdirectory for drm devices in linsysfs. Recent versions of linux libdrm check for the existence of this directory: https://cgit.freedesktop.org/mesa/drm/commit/?id=f8392583418aef5e27bfed9989aeb601e20cc96d MFC after: 2 weeks Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Mon Sep 23 08:53:14 2019 (r352617) +++ head/sys/compat/linsysfs/linsysfs.c Mon Sep 23 12:27:55 2019 (r352618) @@ -520,6 +520,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s device_get_unit(dev) >= 0) { dinfo = device_get_ivars(parent); if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { + pfs_create_dir(dir, "drm", NULL, NULL, NULL, 0); sprintf(devname, "226:%d", device_get_unit(dev)); sub_dir = pfs_create_dir(chardev, From owner-svn-src-head@freebsd.org Mon Sep 23 12:43: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 07691F3902; Mon, 23 Sep 2019 12:43:09 +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 46cPB45lMcz3yTl; Mon, 23 Sep 2019 12:43:08 +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 A9E9BF0C6; Mon, 23 Sep 2019 12:43:08 +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 x8NCh8Lx077449; Mon, 23 Sep 2019 12:43:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NCh8RD077448; Mon, 23 Sep 2019 12:43:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909231243.x8NCh8RD077448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 23 Sep 2019 12:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352619 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 352619 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, 23 Sep 2019 12:43:09 -0000 Author: kevans Date: Mon Sep 23 12:43:08 2019 New Revision: 352619 URL: https://svnweb.freebsd.org/changeset/base/352619 Log: mips: fix XLPN32 after r352434 SYSINIT usage was added, but the dependency was not added. This worked by coincidence, as most of the mips configs have DDB enabled and pmap.c gets via ddb.h pollution. Reported by: dim Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon Sep 23 12:27:55 2019 (r352618) +++ head/sys/mips/mips/pmap.c Mon Sep 23 12:43:08 2019 (r352619) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Mon Sep 23 13:24: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 20587F4A74; Mon, 23 Sep 2019 13:24:32 +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 46cQ5q73Spz41X7; Mon, 23 Sep 2019 13:24:31 +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 D5787F80C; Mon, 23 Sep 2019 13:24:31 +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 x8NDOVkj005752; Mon, 23 Sep 2019 13:24:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NDOV7J005751; Mon, 23 Sep 2019 13:24:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909231324.x8NDOV7J005751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 23 Sep 2019 13:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352620 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 352620 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, 23 Sep 2019 13:24:32 -0000 Author: kib Date: Mon Sep 23 13:24:31 2019 New Revision: 352620 URL: https://svnweb.freebsd.org/changeset/base/352620 Log: Fix destruction of the robust mutexes. If robust mutex' owner terminated, causing kernel-assisted state recovery, and then pthread_mutex_destroy() is executed as the next action, assert is triggered about mutex still being on the list. Ignore the mutex linkage in pthread_mutex_destroy() for shared robust mutexes with dead owner, same as for enqueue_mutex(). Reported by: avg Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libthr/thread/thr_mutex.c Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Mon Sep 23 12:43:08 2019 (r352619) +++ head/lib/libthr/thread/thr_mutex.c Mon Sep 23 13:24:31 2019 (r352620) @@ -474,7 +474,11 @@ _thr_mutex_destroy(pthread_mutex_t *mutex) if (m == THR_PSHARED_PTR) { m1 = __thr_pshared_offpage(mutex, 0); if (m1 != NULL) { - mutex_assert_not_owned(_get_curthread(), m1); + if ((uint32_t)m1->m_lock.m_owner != + UMUTEX_RB_OWNERDEAD) { + mutex_assert_not_owned( + _get_curthread(), m1); + } __thr_pshared_destroy(mutex); } *mutex = THR_MUTEX_DESTROYED; From owner-svn-src-head@freebsd.org Mon Sep 23 14:01: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 C5E1FF5A16; Mon, 23 Sep 2019 14:01:42 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (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 46cQwj6p9mz43TJ; Mon, 23 Sep 2019 14:01:41 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-pg1-x536.google.com with SMTP id s1so6954620pgv.8; Mon, 23 Sep 2019 07:01:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=GUfit1dIndutYAtDqht4fKKH0TEqnM2Y+q784tXYgxA=; b=VyszGi/TnOXtifns6zJHcHDdoC4KsC9Rw9ZGhk/xw+97WEDE7kEOxEPODF5CwjeReG v3eZlvicWck3AXOJEqBTBhpIYyNmG5iDGSa9MT0ZV09klxG7gAf+bKXvocpR8naY10T0 HapWDaoEEkSc+Aka8yZnx/IHwCBnWxGF5oPgCM2IW7JQ3CceUAcFWP0mjTmIZixWIbuz wcW68YwGQWq6bcbaWdDlEW1dvopV90Z4U424GsLpC4CkTVE+HNhkdC76bkY9KekV0V/F 5Dwm5Ul3aaiz5p04b3IB8Bnm0aPyQhm2FaQNBJ7jxX2xYM90afxYMKtdMCiMPUjsGsI8 200A== 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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GUfit1dIndutYAtDqht4fKKH0TEqnM2Y+q784tXYgxA=; b=oqzlkPDMA9w7kZ0Z3bR/SyWkNaGR6GXuOISxAIRoh4q9n9pTbLPHtZtNTP3Xlwqxas ujzJQBQIs/SBxGCW8kBAfWYrXlldsZjPhk2ta5FRhNyNkXBPxhGMYOeHsjqvq6yzl30z cWhMGug4wkYBMexnjMHfgBouDpCEntSgkrxWyuhsGpqLW/2mhPKwMQvRRXgmYvd4bOeF eGjBiX2ygJZ5MqWlxnmpYDcuSe/xRPPwiqDFwqUUp2io7We2yubVelKsA411fPuu0jmi YjcDKX2HVRT91BMNo721JUVwemeiOec4ymNHX6I5uaFBt4ilbS0xA5DM6cF9n6ickdtt t7Fg== X-Gm-Message-State: APjAAAWY3yymWZbV9F8g7w/FMwkQLxCeFwtBkRU/YivrEPp+huUSnyDk s4eOld1tCK48+KGV/q3kU4m+aTc= X-Google-Smtp-Source: APXvYqxsCvwXc/6DI3qzp5hbTQd44ibc0aS92xU01Rl3p81tLdHcITv4r92k3WJP7iKxjsiyRixR+A== X-Received: by 2002:a63:7b58:: with SMTP id k24mr151897pgn.138.1569247299590; Mon, 23 Sep 2019 07:01:39 -0700 (PDT) Received: from [192.168.1.3] ([24.4.24.248]) by smtp.googlemail.com with ESMTPSA id v1sm4270783pfg.26.2019.09.23.07.01.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Sep 2019 07:01:38 -0700 (PDT) Subject: Re: svn commit: r352619 - head/sys/mips/mips To: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909231243.x8NCh8RD077448@repo.freebsd.org> From: Jason Harmening Message-ID: Date: Mon, 23 Sep 2019 07:00:34 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201909231243.x8NCh8RD077448@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46cQwj6p9mz43TJ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=VyszGi/T; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of jasonharmening@gmail.com designates 2607:f8b0:4864:20::536 as permitted sender) smtp.mailfrom=jasonharmening@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[248.24.4.24.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; IP_SCORE(0.00)[ip: (-8.43), ipnet: 2607:f8b0::/32(-2.64), asn: 15169(-2.20), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; IP_SCORE_FREEMAIL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[6.3.5.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)[] 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, 23 Sep 2019 14:01:42 -0000 On 2019-09-23 05:43, Kyle Evans wrote: > Author: kevans > Date: Mon Sep 23 12:43:08 2019 > New Revision: 352619 > URL: https://svnweb.freebsd.org/changeset/base/352619 > > Log: > mips: fix XLPN32 after r352434 > > SYSINIT usage was added, but the dependency was not added. > This worked by coincidence, as most of the mips configs have DDB enabled and > pmap.c gets via ddb.h pollution. > > Reported by: dim Thanks for fixing this. Pointyhat to: jah > > Modified: > head/sys/mips/mips/pmap.c > > Modified: head/sys/mips/mips/pmap.c > ============================================================================== > --- head/sys/mips/mips/pmap.c Mon Sep 23 12:27:55 2019 (r352618) > +++ head/sys/mips/mips/pmap.c Mon Sep 23 12:43:08 2019 (r352619) > @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > #include > #include > From owner-svn-src-head@freebsd.org Mon Sep 23 14:12: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 8CA0BF5DA6; Mon, 23 Sep 2019 14:12:00 +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 46cR8c3Gdcz43pP; Mon, 23 Sep 2019 14:12:00 +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 537E8180A9; Mon, 23 Sep 2019 14:12:00 +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 x8NEC0P8039335; Mon, 23 Sep 2019 14:12:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NEC0D4039334; Mon, 23 Sep 2019 14:12:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909231412.x8NEC0D4039334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 23 Sep 2019 14:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352622 - 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: 352622 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, 23 Sep 2019 14:12:00 -0000 Author: markj Date: Mon Sep 23 14:11:59 2019 New Revision: 352622 URL: https://svnweb.freebsd.org/changeset/base/352622 Log: Set NX in mappings created by pmap_kenter() and pmap_kenter_attr(). There does not appear to be any existing need for such mappings to be executable. Reviewed by: alc, kib MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21754 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 23 13:45:50 2019 (r352621) +++ head/sys/amd64/amd64/pmap.c Mon Sep 23 14:11:59 2019 (r352622) @@ -3134,7 +3134,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t pa) pt_entry_t *pte; pte = vtopte(va); - pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g); + pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | pg_nx); } static __inline void @@ -3145,7 +3145,7 @@ pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, int mo pte = vtopte(va); cache_bits = pmap_cache_bits(kernel_pmap, mode, 0); - pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | cache_bits); + pte_store(pte, pa | X86_PG_RW | X86_PG_V | pg_g | pg_nx | cache_bits); } /* From owner-svn-src-head@freebsd.org Mon Sep 23 14:14: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 7C96EF5E60; Mon, 23 Sep 2019 14:14:44 +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 46cRCm2hSXz446h; Mon, 23 Sep 2019 14:14:44 +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 3C612180DB; Mon, 23 Sep 2019 14:14:44 +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 x8NEEiQK040729; Mon, 23 Sep 2019 14:14:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NEEh9e040728; Mon, 23 Sep 2019 14:14:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909231414.x8NEEh9e040728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 23 Sep 2019 14:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352623 - in head/sys: amd64/amd64 kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 kern X-SVN-Commit-Revision: 352623 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, 23 Sep 2019 14:14:44 -0000 Author: markj Date: Mon Sep 23 14:14:43 2019 New Revision: 352623 URL: https://svnweb.freebsd.org/changeset/base/352623 Log: Use elf_relocaddr() when handling R_X86_64_RELATIVE relocations. This is required for DPCPU and VNET data variable definitions to work when KLDs are linked as DSOs. R_X86_64_RELATIVE relocations should not appear in object files, so assert this in elf_relocaddr(). Reviewed by: kib MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21755 Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/kern/link_elf.c Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Mon Sep 23 14:11:59 2019 (r352622) +++ head/sys/amd64/amd64/elf_machdep.c Mon Sep 23 14:14:43 2019 (r352623) @@ -267,7 +267,6 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas */ printf("kldload: unexpected R_COPY relocation\n"); return (-1); - break; case R_X86_64_GLOB_DAT: /* S */ case R_X86_64_JMP_SLOT: /* XXX need addend + offset */ @@ -279,7 +278,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_X86_64_RELATIVE: /* B + A */ - addr = relocbase + addend; + addr = elf_relocaddr(lf, relocbase + addend); val = addr; if (*where != val) *where = val; Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Mon Sep 23 14:11:59 2019 (r352622) +++ head/sys/kern/link_elf.c Mon Sep 23 14:14:43 2019 (r352623) @@ -1162,6 +1162,9 @@ elf_relocaddr(linker_file_t lf, Elf_Addr x) { elf_file_t ef; + KASSERT(lf->ops->cls == (kobj_class_t)&link_elf_class, + ("elf_relocaddr: unexpected linker file %p", lf)); + ef = (elf_file_t)lf; if (x >= ef->pcpu_start && x < ef->pcpu_stop) return ((x - ef->pcpu_start) + ef->pcpu_base); From owner-svn-src-head@freebsd.org Mon Sep 23 14:19: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 54BD6F606E; Mon, 23 Sep 2019 14:19:42 +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 46cRKV1WlXz44PQ; Mon, 23 Sep 2019 14:19:42 +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 175ED180EC; Mon, 23 Sep 2019 14:19:42 +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 x8NEJfN3041701; Mon, 23 Sep 2019 14:19:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NEJf3f041700; Mon, 23 Sep 2019 14:19:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909231419.x8NEJf3f041700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 23 Sep 2019 14:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352624 - 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: 352624 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, 23 Sep 2019 14:19:42 -0000 Author: markj Date: Mon Sep 23 14:19:41 2019 New Revision: 352624 URL: https://svnweb.freebsd.org/changeset/base/352624 Log: Set NX on some non-leaf direct map page table entries. The direct map is never used for execution of code, so we might as well set NX in the direct map's PML4Es. Also clarify the intent of the code in create_pagetables() that restricts access protections on the region of the direct map mapping the kernel text. Reviewed by: alc, kib (previous version) MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21759 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 23 14:14:43 2019 (r352623) +++ head/sys/amd64/amd64/pmap.c Mon Sep 23 14:19:41 2019 (r352624) @@ -1539,13 +1539,13 @@ create_pagetables(vm_paddr_t *firstaddr) } for (j = 0; i < ndmpdp; i++, j++) { pdp_p[i] = DMPDphys + ptoa(j); - pdp_p[i] |= X86_PG_RW | X86_PG_V; + pdp_p[i] |= X86_PG_RW | X86_PG_V | pg_nx; } /* * Instead of using a 1G page for the memory containing the kernel, - * use 2M pages with appropriate permissions. (If using 1G pages, - * this will partially overwrite the PDPEs above.) + * use 2M pages with read-only and no-execute permissions. (If using 1G + * pages, this will partially overwrite the PDPEs above.) */ if (ndm1g) { pd_p = (pd_entry_t *)DMPDkernphys; @@ -1555,7 +1555,7 @@ create_pagetables(vm_paddr_t *firstaddr) bootaddr_rwx(i << PDRSHIFT); for (i = 0; i < nkdmpde; i++) pdp_p[i] = (DMPDkernphys + ptoa(i)) | X86_PG_RW | - X86_PG_V; + X86_PG_V | pg_nx; } /* And recursively map PML4 to itself in order to get PTmap */ @@ -1566,7 +1566,7 @@ create_pagetables(vm_paddr_t *firstaddr) /* Connect the Direct Map slot(s) up to the PML4. */ for (i = 0; i < ndmpdpphys; i++) { p4_p[DMPML4I + i] = DMPDPphys + ptoa(i); - p4_p[DMPML4I + i] |= X86_PG_RW | X86_PG_V; + p4_p[DMPML4I + i] |= X86_PG_RW | X86_PG_V | pg_nx; } /* Connect the KVA slots up to the PML4 */ From owner-svn-src-head@freebsd.org Mon Sep 23 14:29: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 59ED3F642A; Mon, 23 Sep 2019 14:29:06 +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 46cRXL1GDRz44w3; Mon, 23 Sep 2019 14:29:06 +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 E6E8E182BE; Mon, 23 Sep 2019 14:29:05 +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 x8NET5qC048860; Mon, 23 Sep 2019 14:29:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NET5x9048859; Mon, 23 Sep 2019 14:29:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909231429.x8NET5x9048859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 23 Sep 2019 14:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352625 - head/sys/dev/jme X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/jme X-SVN-Commit-Revision: 352625 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, 23 Sep 2019 14:29:06 -0000 Author: markj Date: Mon Sep 23 14:29:05 2019 New Revision: 352625 URL: https://svnweb.freebsd.org/changeset/base/352625 Log: Revert r316820. Despite appearing correct, r316820 breaks packet rx/tx for jme(4) interfaces. With 12.1 approaching, let's just revert the commit for now. PR: 233952 Tested by: Armin Gruner MFC after: 3 days Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Mon Sep 23 14:19:41 2019 (r352624) +++ head/sys/dev/jme/if_jme.c Mon Sep 23 14:29:05 2019 (r352625) @@ -559,7 +559,7 @@ jme_map_intr_vector(struct jme_softc *sc) bzero(map, sizeof(map)); /* Map Tx interrupts source to MSI/MSIX vector 2. */ - map[MSINUM_REG_INDEX(N_INTR_TXQ0_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_TXQ0_COMP)] = MSINUM_INTR_SOURCE(2, N_INTR_TXQ0_COMP); map[MSINUM_REG_INDEX(N_INTR_TXQ1_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ1_COMP); @@ -581,37 +581,37 @@ jme_map_intr_vector(struct jme_softc *sc) MSINUM_INTR_SOURCE(2, N_INTR_TXQ_COAL_TO); /* Map Rx interrupts source to MSI/MSIX vector 1. */ - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COMP)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COMP); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_DESC_EMPTY)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_DESC_EMPTY)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_DESC_EMPTY); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COAL); - map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ0_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ0_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ1_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ1_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ2_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ2_COAL_TO); - map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL_TO)] |= + map[MSINUM_REG_INDEX(N_INTR_RXQ3_COAL_TO)] = MSINUM_INTR_SOURCE(1, N_INTR_RXQ3_COAL_TO); /* Map all other interrupts source to MSI/MSIX vector 0. */ From owner-svn-src-head@freebsd.org Mon Sep 23 14:34:24 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 1254CF6862; Mon, 23 Sep 2019 14:34:24 +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 46cRfR6lyQz45WP; Mon, 23 Sep 2019 14:34:23 +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 CB22518487; Mon, 23 Sep 2019 14:34:23 +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 x8NEYNhW054904; Mon, 23 Sep 2019 14:34:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NEYN2n054903; Mon, 23 Sep 2019 14:34:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909231434.x8NEYN2n054903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 23 Sep 2019 14:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352626 - head/sys/dev/jme X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/jme X-SVN-Commit-Revision: 352626 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, 23 Sep 2019 14:34:24 -0000 Author: markj Date: Mon Sep 23 14:34:23 2019 New Revision: 352626 URL: https://svnweb.freebsd.org/changeset/base/352626 Log: Fix a harmless typo. MFC after: 1 week Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Mon Sep 23 14:29:05 2019 (r352625) +++ head/sys/dev/jme/if_jme.c Mon Sep 23 14:34:23 2019 (r352626) @@ -569,7 +569,7 @@ jme_map_intr_vector(struct jme_softc *sc) MSINUM_INTR_SOURCE(2, N_INTR_TXQ3_COMP); map[MSINUM_REG_INDEX(N_INTR_TXQ4_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ4_COMP); - map[MSINUM_REG_INDEX(N_INTR_TXQ4_COMP)] |= + map[MSINUM_REG_INDEX(N_INTR_TXQ5_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ5_COMP); map[MSINUM_REG_INDEX(N_INTR_TXQ6_COMP)] |= MSINUM_INTR_SOURCE(2, N_INTR_TXQ6_COMP); From owner-svn-src-head@freebsd.org Mon Sep 23 15:08: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 A39EDF76FB; Mon, 23 Sep 2019 15:08:18 +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 46cSPZ3qX4z47g2; Mon, 23 Sep 2019 15:08: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 67C8318A08; Mon, 23 Sep 2019 15:08: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 x8NF8IMD073178; Mon, 23 Sep 2019 15:08:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NF8Hb6073174; Mon, 23 Sep 2019 15:08:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909231508.x8NF8Hb6073174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 23 Sep 2019 15:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352627 - in head/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Commit-Revision: 352627 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, 23 Sep 2019 15:08:18 -0000 Author: markj Date: Mon Sep 23 15:08:17 2019 New Revision: 352627 URL: https://svnweb.freebsd.org/changeset/base/352627 Log: Implement x86 dtrace_invop_(un)init() in C. There is no reason for these routines to be written in assembly. In the ports of DTrace to other platforms, they are already written in C. No functional change intended. MFC after: 1 week Sponsored by: Netflix Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_asm.S head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_asm.S head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Mon Sep 23 14:34:23 2019 (r352626) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Mon Sep 23 15:08:17 2019 (r352627) @@ -150,22 +150,6 @@ bp_ret: END(dtrace_invop_start) /* -void dtrace_invop_init(void) -*/ - ENTRY(dtrace_invop_init) - movq $dtrace_invop_start, dtrace_invop_jump_addr(%rip) - ret - END(dtrace_invop_init) - -/* -void dtrace_invop_uninit(void) -*/ - ENTRY(dtrace_invop_uninit) - movq $0, dtrace_invop_jump_addr(%rip) - ret - END(dtrace_invop_uninit) - -/* greg_t dtrace_getfp(void) */ ENTRY(dtrace_getfp) Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Sep 23 14:34:23 2019 (r352626) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Sep 23 15:08:17 2019 (r352627) @@ -48,8 +48,12 @@ #include extern void dtrace_getnanotime(struct timespec *tsp); +extern int (*dtrace_invop_jump_addr)(struct trapframe *); -int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +int dtrace_invop_start(struct trapframe *frame); +void dtrace_invop_init(void); +void dtrace_invop_uninit(void); typedef struct dtrace_invop_hdlr { int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); @@ -107,6 +111,20 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trap } kmem_free(hdlr, 0); +} + +void +dtrace_invop_init(void) +{ + + dtrace_invop_jump_addr = dtrace_invop_start; +} + +void +dtrace_invop_uninit(void) +{ + + dtrace_invop_jump_addr = NULL; } /*ARGSUSED*/ Modified: head/sys/cddl/dev/dtrace/i386/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_asm.S Mon Sep 23 14:34:23 2019 (r352626) +++ head/sys/cddl/dev/dtrace/i386/dtrace_asm.S Mon Sep 23 15:08:17 2019 (r352627) @@ -135,22 +135,6 @@ invop_nop: END(dtrace_invop_start) /* -void dtrace_invop_init(void) -*/ - ENTRY(dtrace_invop_init) - movl $dtrace_invop_start, dtrace_invop_jump_addr - ret - END(dtrace_invop_init) - -/* -void dtrace_invop_uninit(void) -*/ - ENTRY(dtrace_invop_uninit) - movl $0, dtrace_invop_jump_addr - ret - END(dtrace_invop_uninit) - -/* greg_t dtrace_getfp(void) */ Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Sep 23 14:34:23 2019 (r352626) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Sep 23 15:08:17 2019 (r352627) @@ -51,8 +51,12 @@ extern uintptr_t kernelbase; extern void dtrace_getnanotime(struct timespec *tsp); +extern int (*dtrace_invop_jump_addr)(struct trapframe *); -int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +int dtrace_invop_start(struct trapframe *frame); +void dtrace_invop_init(void); +void dtrace_invop_uninit(void); typedef struct dtrace_invop_hdlr { int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); @@ -110,6 +114,20 @@ dtrace_invop_remove(int (*func)(uintptr_t, struct trap } kmem_free(hdlr, 0); +} + +void +dtrace_invop_init(void) +{ + + dtrace_invop_jump_addr = dtrace_invop_start; +} + +void +dtrace_invop_uninit(void) +{ + + dtrace_invop_jump_addr = NULL; } void From owner-svn-src-head@freebsd.org Mon Sep 23 17:53: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 8B143FB3F5; Mon, 23 Sep 2019 17:53:49 +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 46cX4Y3tY2z4JJC; Mon, 23 Sep 2019 17:53:49 +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 6862B1A88C; Mon, 23 Sep 2019 17:53:49 +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 x8NHrngx073907; Mon, 23 Sep 2019 17:53:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NHrm7t073901; Mon, 23 Sep 2019 17:53:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909231753.x8NHrm7t073901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 23 Sep 2019 17:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352630 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 352630 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, 23 Sep 2019 17:53:49 -0000 Author: mav Date: Mon Sep 23 17:53:47 2019 New Revision: 352630 URL: https://svnweb.freebsd.org/changeset/base/352630 Log: Make nvme(4) driver some more NUMA aware. - For each queue pair precalculate CPU and domain it is bound to. If queue pairs are not per-CPU, then use the domain of the device. - Allocate most of queue pair memory from the domain it is bound to. - Bind callouts to the same CPUs as queue pair to avoid migrations. - Do not assign queue pairs to each SMT thread. It just wasted resources and increased lock congestions. - Remove fixed multiplier of CPUs per queue pair, spread them even. This allows to use more queue pairs in some hardware configurations. - If queue pair serves multiple CPUs, bind different NVMe devices to different CPUs. MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/sys/dev/nvme/nvme_ahci.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_ctrlr_cmd.c head/sys/dev/nvme/nvme_pci.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/dev/nvme/nvme_ahci.c ============================================================================== --- head/sys/dev/nvme/nvme_ahci.c Mon Sep 23 17:05:46 2019 (r352629) +++ head/sys/dev/nvme/nvme_ahci.c Mon Sep 23 17:53:47 2019 (r352630) @@ -96,7 +96,6 @@ nvme_ahci_attach(device_t dev) ctrlr->msix_enabled = 0; ctrlr->num_io_queues = 1; - ctrlr->num_cpus_per_ioq = mp_ncpus; if (bus_setup_intr(dev, ctrlr->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, nvme_ctrlr_intx_handler, ctrlr, &ctrlr->tag) != 0) { Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Mon Sep 23 17:05:46 2019 (r352629) +++ head/sys/dev/nvme/nvme_ctrlr.c Mon Sep 23 17:53:47 2019 (r352630) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "nvme_private.h" @@ -57,6 +58,9 @@ nvme_ctrlr_construct_admin_qpair(struct nvme_controlle int error; qpair = &ctrlr->adminq; + qpair->id = 0; + qpair->cpu = CPU_FFS(&cpuset_domain[ctrlr->domain]) - 1; + qpair->domain = ctrlr->domain; num_entries = NVME_ADMIN_ENTRIES; TUNABLE_INT_FETCH("hw.nvme.admin_entries", &num_entries); @@ -75,22 +79,21 @@ nvme_ctrlr_construct_admin_qpair(struct nvme_controlle * The admin queue's max xfer size is treated differently than the * max I/O xfer size. 16KB is sufficient here - maybe even less? */ - error = nvme_qpair_construct(qpair, - 0, /* qpair ID */ - 0, /* vector */ - num_entries, - NVME_ADMIN_TRACKERS, - ctrlr); + error = nvme_qpair_construct(qpair, num_entries, NVME_ADMIN_TRACKERS, + ctrlr); return (error); } +#define QP(ctrlr, c) ((c) * (ctrlr)->num_io_queues / mp_ncpus) + static int nvme_ctrlr_construct_io_qpairs(struct nvme_controller *ctrlr) { struct nvme_qpair *qpair; uint32_t cap_lo; uint16_t mqes; - int i, error, num_entries, num_trackers, max_entries; + int c, error, i, n; + int num_entries, num_trackers, max_entries; /* * NVMe spec sets a hard limit of 64K max entries, but devices may @@ -130,32 +133,35 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller */ ctrlr->max_hw_pend_io = num_trackers * ctrlr->num_io_queues * 3 / 4; - /* - * This was calculated previously when setting up interrupts, but - * a controller could theoretically support fewer I/O queues than - * MSI-X vectors. So calculate again here just to be safe. - */ - ctrlr->num_cpus_per_ioq = howmany(mp_ncpus, ctrlr->num_io_queues); - ctrlr->ioq = malloc(ctrlr->num_io_queues * sizeof(struct nvme_qpair), M_NVME, M_ZERO | M_WAITOK); - for (i = 0; i < ctrlr->num_io_queues; i++) { + for (i = c = n = 0; i < ctrlr->num_io_queues; i++, c += n) { qpair = &ctrlr->ioq[i]; /* * Admin queue has ID=0. IO queues start at ID=1 - * hence the 'i+1' here. - * + */ + qpair->id = i + 1; + if (ctrlr->num_io_queues > 1) { + /* Find number of CPUs served by this queue. */ + for (n = 1; QP(ctrlr, c + n) == i; n++) + ; + /* Shuffle multiple NVMe devices between CPUs. */ + qpair->cpu = c + (device_get_unit(ctrlr->dev)+n/2) % n; + qpair->domain = pcpu_find(qpair->cpu)->pc_domain; + } else { + qpair->cpu = CPU_FFS(&cpuset_domain[ctrlr->domain]) - 1; + qpair->domain = ctrlr->domain; + } + + /* * For I/O queues, use the controller-wide max_xfer_size * calculated in nvme_attach(). */ - error = nvme_qpair_construct(qpair, - i+1, /* qpair ID */ - ctrlr->msix_enabled ? i+1 : 0, /* vector */ - num_entries, - num_trackers, - ctrlr); + error = nvme_qpair_construct(qpair, num_entries, num_trackers, + ctrlr); if (error) return (error); @@ -164,8 +170,7 @@ nvme_ctrlr_construct_io_qpairs(struct nvme_controller * interrupt thread for this controller. */ if (ctrlr->num_io_queues > 1) - bus_bind_intr(ctrlr->dev, qpair->res, - i * ctrlr->num_cpus_per_ioq); + bus_bind_intr(ctrlr->dev, qpair->res, qpair->cpu); } return (0); @@ -458,6 +463,8 @@ nvme_ctrlr_set_num_qpairs(struct nvme_controller *ctrl */ ctrlr->num_io_queues = min(ctrlr->num_io_queues, sq_allocated); ctrlr->num_io_queues = min(ctrlr->num_io_queues, cq_allocated); + if (ctrlr->num_io_queues > vm_ndomains) + ctrlr->num_io_queues -= ctrlr->num_io_queues % vm_ndomains; return (0); } @@ -473,7 +480,7 @@ nvme_ctrlr_create_qpairs(struct nvme_controller *ctrlr qpair = &ctrlr->ioq[i]; status.done = 0; - nvme_ctrlr_cmd_create_io_cq(ctrlr, qpair, qpair->vector, + nvme_ctrlr_cmd_create_io_cq(ctrlr, qpair, nvme_completion_poll_cb, &status); nvme_completion_poll(&status); if (nvme_completion_is_error(&status.cpl)) { @@ -1132,6 +1139,8 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de ctrlr->dev = dev; mtx_init(&ctrlr->lock, "nvme ctrlr lock", NULL, MTX_DEF); + if (bus_get_domain(dev, &ctrlr->domain) != 0) + ctrlr->domain = 0; cap_hi = nvme_mmio_read_4(ctrlr, cap_hi); ctrlr->dstrd = NVME_CAP_HI_DSTRD(cap_hi) + 2; @@ -1296,7 +1305,7 @@ nvme_ctrlr_submit_io_request(struct nvme_controller *c { struct nvme_qpair *qpair; - qpair = &ctrlr->ioq[curcpu / ctrlr->num_cpus_per_ioq]; + qpair = &ctrlr->ioq[QP(ctrlr, curcpu)]; nvme_qpair_submit_request(qpair, req); } Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr_cmd.c Mon Sep 23 17:05:46 2019 (r352629) +++ head/sys/dev/nvme/nvme_ctrlr_cmd.c Mon Sep 23 17:53:47 2019 (r352630) @@ -76,8 +76,7 @@ nvme_ctrlr_cmd_identify_namespace(struct nvme_controll void nvme_ctrlr_cmd_create_io_cq(struct nvme_controller *ctrlr, - struct nvme_qpair *io_que, uint16_t vector, nvme_cb_fn_t cb_fn, - void *cb_arg) + struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; struct nvme_command *cmd; @@ -93,7 +92,7 @@ nvme_ctrlr_cmd_create_io_cq(struct nvme_controller *ct */ cmd->cdw10 = htole32(((io_que->num_entries-1) << 16) | io_que->id); /* 0x3 = interrupts enabled | physically contiguous */ - cmd->cdw11 = htole32((vector << 16) | 0x3); + cmd->cdw11 = htole32((io_que->vector << 16) | 0x3); cmd->prp1 = htole64(io_que->cpl_bus_addr); nvme_ctrlr_submit_admin_request(ctrlr, req); Modified: head/sys/dev/nvme/nvme_pci.c ============================================================================== --- head/sys/dev/nvme/nvme_pci.c Mon Sep 23 17:05:46 2019 (r352629) +++ head/sys/dev/nvme/nvme_pci.c Mon Sep 23 17:53:47 2019 (r352630) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -233,7 +234,6 @@ nvme_ctrlr_configure_intx(struct nvme_controller *ctrl ctrlr->msix_enabled = 0; ctrlr->num_io_queues = 1; - ctrlr->num_cpus_per_ioq = mp_ncpus; ctrlr->rid = 0; ctrlr->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, &ctrlr->rid, RF_SHAREABLE | RF_ACTIVE); @@ -259,82 +259,61 @@ static void nvme_ctrlr_setup_interrupts(struct nvme_controller *ctrlr) { device_t dev; - int per_cpu_io_queues; + int force_intx, num_io_queues, per_cpu_io_queues; int min_cpus_per_ioq; int num_vectors_requested, num_vectors_allocated; - int num_vectors_available; dev = ctrlr->dev; - min_cpus_per_ioq = 1; - TUNABLE_INT_FETCH("hw.nvme.min_cpus_per_ioq", &min_cpus_per_ioq); - if (min_cpus_per_ioq < 1) { - min_cpus_per_ioq = 1; - } else if (min_cpus_per_ioq > mp_ncpus) { - min_cpus_per_ioq = mp_ncpus; + force_intx = 0; + TUNABLE_INT_FETCH("hw.nvme.force_intx", &force_intx); + if (force_intx || pci_msix_count(dev) < 2) { + nvme_ctrlr_configure_intx(ctrlr); + return; } + num_io_queues = mp_ncpus; + TUNABLE_INT_FETCH("hw.nvme.num_io_queues", &num_io_queues); + if (num_io_queues < 1 || num_io_queues > mp_ncpus) + num_io_queues = mp_ncpus; + per_cpu_io_queues = 1; TUNABLE_INT_FETCH("hw.nvme.per_cpu_io_queues", &per_cpu_io_queues); + if (per_cpu_io_queues == 0) + num_io_queues = 1; - if (per_cpu_io_queues == 0) { - min_cpus_per_ioq = mp_ncpus; + min_cpus_per_ioq = smp_threads_per_core; + TUNABLE_INT_FETCH("hw.nvme.min_cpus_per_ioq", &min_cpus_per_ioq); + if (min_cpus_per_ioq > 1) { + num_io_queues = min(num_io_queues, + max(1, mp_ncpus / min_cpus_per_ioq)); } - ctrlr->force_intx = 0; - TUNABLE_INT_FETCH("hw.nvme.force_intx", &ctrlr->force_intx); + num_io_queues = min(num_io_queues, pci_msix_count(dev) - 1); - /* - * FreeBSD currently cannot allocate more than about 190 vectors at - * boot, meaning that systems with high core count and many devices - * requesting per-CPU interrupt vectors will not get their full - * allotment. So first, try to allocate as many as we may need to - * understand what is available, then immediately release them. - * Then figure out how many of those we will actually use, based on - * assigning an equal number of cores to each I/O queue. - */ - +again: + if (num_io_queues > vm_ndomains) + num_io_queues -= num_io_queues % vm_ndomains; /* One vector for per core I/O queue, plus one vector for admin queue. */ - num_vectors_available = min(pci_msix_count(dev), mp_ncpus + 1); - if (pci_alloc_msix(dev, &num_vectors_available) != 0) { - num_vectors_available = 0; - } - pci_release_msi(dev); - - if (ctrlr->force_intx || num_vectors_available < 2) { - nvme_ctrlr_configure_intx(ctrlr); - return; - } - - /* - * Do not use all vectors for I/O queues - one must be saved for the - * admin queue. - */ - ctrlr->num_cpus_per_ioq = max(min_cpus_per_ioq, - howmany(mp_ncpus, num_vectors_available - 1)); - - ctrlr->num_io_queues = howmany(mp_ncpus, ctrlr->num_cpus_per_ioq); - num_vectors_requested = ctrlr->num_io_queues + 1; + num_vectors_requested = num_io_queues + 1; num_vectors_allocated = num_vectors_requested; - - /* - * Now just allocate the number of vectors we need. This should - * succeed, since we previously called pci_alloc_msix() - * successfully returning at least this many vectors, but just to - * be safe, if something goes wrong just revert to INTx. - */ if (pci_alloc_msix(dev, &num_vectors_allocated) != 0) { nvme_ctrlr_configure_intx(ctrlr); return; } - - if (num_vectors_allocated < num_vectors_requested) { + if (num_vectors_allocated < 2) { pci_release_msi(dev); nvme_ctrlr_configure_intx(ctrlr); return; } + if (num_vectors_allocated != num_vectors_requested) { + pci_release_msi(dev); + num_io_queues = num_vectors_allocated - 1; + goto again; + } ctrlr->msix_enabled = 1; + ctrlr->num_io_queues = num_io_queues; } static int Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Mon Sep 23 17:05:46 2019 (r352629) +++ head/sys/dev/nvme/nvme_private.h Mon Sep 23 17:53:47 2019 (r352630) @@ -175,7 +175,8 @@ struct nvme_qpair { struct nvme_controller *ctrlr; uint32_t id; - uint32_t phase; + int domain; + int cpu; uint16_t vector; int rid; @@ -187,6 +188,7 @@ struct nvme_qpair { uint32_t sq_tdbl_off; uint32_t cq_hdbl_off; + uint32_t phase; uint32_t sq_head; uint32_t sq_tail; uint32_t cq_head; @@ -238,7 +240,7 @@ struct nvme_controller { device_t dev; struct mtx lock; - + int domain; uint32_t ready_timeout_in_ms; uint32_t quirks; #define QUIRK_DELAY_B4_CHK_RDY 1 /* Can't touch MMIO on disable */ @@ -258,11 +260,9 @@ struct nvme_controller { struct resource *bar4_resource; uint32_t msix_enabled; - uint32_t force_intx; uint32_t enable_aborts; uint32_t num_io_queues; - uint32_t num_cpus_per_ioq; uint32_t max_hw_pend_io; /* Fields for tracking progress during controller initialization. */ @@ -377,7 +377,7 @@ void nvme_ctrlr_cmd_get_firmware_page(struct nvme_cont nvme_cb_fn_t cb_fn, void *cb_arg); void nvme_ctrlr_cmd_create_io_cq(struct nvme_controller *ctrlr, - struct nvme_qpair *io_que, uint16_t vector, + struct nvme_qpair *io_que, nvme_cb_fn_t cb_fn, void *cb_arg); void nvme_ctrlr_cmd_create_io_sq(struct nvme_controller *ctrlr, struct nvme_qpair *io_que, @@ -413,9 +413,8 @@ void nvme_ctrlr_submit_io_request(struct nvme_controll void nvme_ctrlr_post_failed_request(struct nvme_controller *ctrlr, struct nvme_request *req); -int nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, - uint16_t vector, uint32_t num_entries, - uint32_t num_trackers, +int nvme_qpair_construct(struct nvme_qpair *qpair, + uint32_t num_entries, uint32_t num_trackers, struct nvme_controller *ctrlr); void nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr); Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Mon Sep 23 17:05:46 2019 (r352629) +++ head/sys/dev/nvme/nvme_qpair.c Mon Sep 23 17:53:47 2019 (r352630) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -637,8 +638,8 @@ nvme_qpair_msix_handler(void *arg) } int -nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, - uint16_t vector, uint32_t num_entries, uint32_t num_trackers, +nvme_qpair_construct(struct nvme_qpair *qpair, + uint32_t num_entries, uint32_t num_trackers, struct nvme_controller *ctrlr) { struct nvme_tracker *tr; @@ -647,8 +648,7 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ uint8_t *queuemem, *prpmem, *prp_list; int i, err; - qpair->id = id; - qpair->vector = vector; + qpair->vector = ctrlr->msix_enabled ? qpair->id : 0; qpair->num_entries = num_entries; qpair->num_trackers = num_trackers; qpair->ctrlr = ctrlr; @@ -659,19 +659,19 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ * MSI-X vector resource IDs start at 1, so we add one to * the queue's vector to get the corresponding rid to use. */ - qpair->rid = vector + 1; + qpair->rid = qpair->vector + 1; qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, &qpair->rid, RF_ACTIVE); bus_setup_intr(ctrlr->dev, qpair->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, nvme_qpair_msix_handler, qpair, &qpair->tag); - if (id == 0) { + if (qpair->id == 0) { bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, "admin"); } else { bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, - "io%d", id - 1); + "io%d", qpair->id - 1); } } @@ -707,6 +707,7 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ nvme_printf(ctrlr, "tag create failed %d\n", err); goto out; } + bus_dma_tag_set_domain(qpair->dma_tag, qpair->domain); if (bus_dmamem_alloc(qpair->dma_tag, (void **)&queuemem, BUS_DMA_NOWAIT, &qpair->queuemem_map)) { @@ -737,9 +738,9 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ * it to various small values. */ qpair->sq_tdbl_off = nvme_mmio_offsetof(doorbell[0]) + - (id << (ctrlr->dstrd + 1)); + (qpair->id << (ctrlr->dstrd + 1)); qpair->cq_hdbl_off = nvme_mmio_offsetof(doorbell[0]) + - (id << (ctrlr->dstrd + 1)) + (1 << ctrlr->dstrd); + (qpair->id << (ctrlr->dstrd + 1)) + (1 << ctrlr->dstrd); TAILQ_INIT(&qpair->free_tr); TAILQ_INIT(&qpair->outstanding_tr); @@ -765,7 +766,8 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ (uint8_t *)roundup2((uintptr_t)prp_list, PAGE_SIZE); } - tr = malloc(sizeof(*tr), M_NVME, M_ZERO | M_WAITOK); + tr = malloc_domainset(sizeof(*tr), M_NVME, + DOMAINSET_PREF(qpair->domain), M_ZERO | M_WAITOK); bus_dmamap_create(qpair->dma_tag_payload, 0, &tr->payload_dma_map); callout_init(&tr->timer, 1); @@ -783,8 +785,9 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ goto out; } - qpair->act_tr = malloc(sizeof(struct nvme_tracker *) * - qpair->num_entries, M_NVME, M_ZERO | M_WAITOK); + qpair->act_tr = malloc_domainset(sizeof(struct nvme_tracker *) * + qpair->num_entries, M_NVME, DOMAINSET_PREF(qpair->domain), + M_ZERO | M_WAITOK); return (0); out: @@ -814,14 +817,14 @@ nvme_qpair_destroy(struct nvme_qpair *qpair) } if (qpair->act_tr) - free(qpair->act_tr, M_NVME); + free_domain(qpair->act_tr, M_NVME); while (!TAILQ_EMPTY(&qpair->free_tr)) { tr = TAILQ_FIRST(&qpair->free_tr); TAILQ_REMOVE(&qpair->free_tr, tr, tailq); bus_dmamap_destroy(qpair->dma_tag_payload, tr->payload_dma_map); - free(tr, M_NVME); + free_domain(tr, M_NVME); } if (qpair->dma_tag) @@ -938,8 +941,8 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st ctrlr = qpair->ctrlr; if (req->timeout) - callout_reset_curcpu(&tr->timer, ctrlr->timeout_period * hz, - nvme_timeout, tr); + callout_reset_on(&tr->timer, ctrlr->timeout_period * hz, + nvme_timeout, tr, qpair->cpu); /* Copy the command from the tracker to the submission queue. */ memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd)); Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Mon Sep 23 17:05:46 2019 (r352629) +++ head/sys/dev/nvme/nvme_sysctl.c Mon Sep 23 17:53:47 2019 (r352630) @@ -306,9 +306,9 @@ nvme_sysctl_initialize_ctrlr(struct nvme_controller *c ctrlr_tree = device_get_sysctl_tree(ctrlr->dev); ctrlr_list = SYSCTL_CHILDREN(ctrlr_tree); - SYSCTL_ADD_UINT(ctrlr_ctx, ctrlr_list, OID_AUTO, "num_cpus_per_ioq", - CTLFLAG_RD, &ctrlr->num_cpus_per_ioq, 0, - "Number of CPUs assigned per I/O queue pair"); + SYSCTL_ADD_UINT(ctrlr_ctx, ctrlr_list, OID_AUTO, "num_io_queues", + CTLFLAG_RD, &ctrlr->num_io_queues, 0, + "Number of I/O queue pairs"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, "int_coal_time", CTLTYPE_UINT | CTLFLAG_RW, ctrlr, 0, From owner-svn-src-head@freebsd.org Mon Sep 23 18:29: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 7C592FC106; Mon, 23 Sep 2019 18:29:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (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 46cXsG2QjZz4Ltl; Mon, 23 Sep 2019 18:29:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f44.google.com with SMTP id b136so35916636iof.3; Mon, 23 Sep 2019 11:29:06 -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=rTV0Q1BpiYiRTMiE7CKr3s4xIOiRzy1D/H4AJAWFgW0=; b=KaoFh+3d1MtQTPd5ahaCPkM+tiIAGzQQqpsAY/82zYS+ypc18yjviPOoHB2n96UWPu uSXAPjgrS/Prk24l0lzC4LX9PdVuiN7o6utbeZ726GPmffOpbg1j/7WUyO1QX/ekiMP8 bh1n1AgGY+zkgP1lTNi16OJt0zHfsc7BVvbyJ/2nX6KUCrcD6t7wHby8umq1mEQDKNX+ 3/S6GF+k71YPclBgaENbPeSESDQ6celZVxokimb60nnU1aH3IbJfYqLxoZEW3KpCq1FZ LdCG2E9+wvsR9BxdpP7hl5UwacztPslx2DRJxMJUB+4UbqLUoJGIGGMzR00ODJ1XElFs pZcw== X-Gm-Message-State: APjAAAUoMm7Ln+PLvsiKGXFuN5oxfdf6lwL7Cbj9nAnF1cjY4JipndIx Z/grkbaYs8sac+OvCzga86wn0ifw X-Google-Smtp-Source: APXvYqw5eYvMhTwRin62/LvW58pgahbd1hjnNFLZblzlitG/LH+apkr/yD2eBdbjRsSG+6f2GvkRdw== X-Received: by 2002:a6b:3804:: with SMTP id f4mr790121ioa.166.1569263344817; Mon, 23 Sep 2019 11:29:04 -0700 (PDT) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com. [209.85.166.50]) by smtp.gmail.com with ESMTPSA id f8sm12449459ioo.27.2019.09.23.11.29.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Sep 2019 11:29:04 -0700 (PDT) Received: by mail-io1-f50.google.com with SMTP id n197so35866855iod.9; Mon, 23 Sep 2019 11:29:04 -0700 (PDT) X-Received: by 2002:a5e:990f:: with SMTP id t15mr741305ioj.270.1569263344078; Mon, 23 Sep 2019 11:29:04 -0700 (PDT) MIME-Version: 1.0 References: <201909231414.x8NEEh9e040728@repo.freebsd.org> In-Reply-To: <201909231414.x8NEEh9e040728@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 23 Sep 2019 11:28:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352623 - in head/sys: amd64/amd64 kern To: Mark Johnston Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46cXsG2QjZz4Ltl X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; 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: Mon, 23 Sep 2019 18:29:06 -0000 Hi Mark, On Mon, Sep 23, 2019 at 7:14 AM Mark Johnston wrote: > > Author: markj > Date: Mon Sep 23 14:14:43 2019 > New Revision: 352623 > URL: https://svnweb.freebsd.org/changeset/base/352623 > > Log: > Use elf_relocaddr() when handling R_X86_64_RELATIVE relocations. > > This is required for DPCPU and VNET data variable definitions to work when > KLDs are linked as DSOs. R_X86_64_RELATIVE relocations should not appear > in object files, so assert this in elf_relocaddr(). Is the goal to eventually link amd64 KLDs as DSOs? I might be confusing the terminology, but I believe amd64 .ko's today are unlinked ordinary object files, rather than shared objects. (I believe they use kern/link_elf_obj.c rather than kern/link_elf.c today.) If so: great! Thanks, Conrad From owner-svn-src-head@freebsd.org Mon Sep 23 19:06: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 39E35FCC40; Mon, 23 Sep 2019 19:06:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (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 46cYhW0lHcz4NfX; Mon, 23 Sep 2019 19:06:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd2f.google.com with SMTP id q1so36246016ion.1; Mon, 23 Sep 2019 12:06:34 -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=bdyHVvLc7crOreWOOY+cpNtNH1bJfGpGh5Auck+zrKk=; b=Ll3rGFaBhQGQ0h6BcAcqHcLhfKyPVqf1z6q+GqsKy1d/NYVX/qf+XGNid+C1M4T5G7 5Ird81imo5DNBDvMmybM4DbgxCIDpxds7T0lO/eo1/cuA6EFpIEc9XPg9VC7272Rduax 4M1SpUw8ZL/RB5jwkZXNRukJgkyfvdgZLqc7ygDuPcVFVuRj4euSNlM7dZvwutfTOdQZ 4pCOXt1R36oqA8D8FR85viPWfyScv49jjNRmLs5pYup3dWnGFlyWOuQ4gbkFT9ybCxyf 24/cJ4XOOLnrb863Ibh4CwfJGj0193vy72RazBS54sReLZTxCgpMxx/qDqfQQBSXvqrK a7vw== 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=bdyHVvLc7crOreWOOY+cpNtNH1bJfGpGh5Auck+zrKk=; b=KxKHJ4kEavVHrsKWQl3Bvsg9Hp/WEQ05+Uvm+f7ktMSkXmUYT40c3nRn21FzegzyF7 VPEhLd0PcJiLLhHtaMzhsE/Jw5NzHNFfAmEVUNu5Yt/V0SEn9GoreGyNdapgIhdaYPcz aiaeLuwVxKi90tG2vxH4hazX++w7Glie3McDr962oeOCP7DjgTAt1R0KGMqXeAHvawpy Y4tpReZcpFPZM6MFs8CODbw8WrZW1nI5WpqFl50x7QFciJDPkdDRda2lV/CdLpfJfqc2 oZe2v595+aUDq5vhg3iwL/AMPN9s2DGxSEBbCQNGElCGKiy4minMbkzlI0nnOXni4fUC oj4g== X-Gm-Message-State: APjAAAVQb00/0mDn81k3i18CQF8slO7azDdeddy/33njSIKspHFqvJ+0 emZFKfNsy6flYeIt4b9OEvgzyNRr X-Google-Smtp-Source: APXvYqy8JtXu5T+TceUHE8L5kbN7oXKlXVt2AZUvhBIq/0TglGJoKhxRTxA5eBnoxU6RW/UlhqmDnA== X-Received: by 2002:a02:a617:: with SMTP id c23mr1099956jam.14.1569265592810; Mon, 23 Sep 2019 12:06:32 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-39-167.dsl.bell.ca. [69.159.39.167]) by smtp.gmail.com with ESMTPSA id g8sm8811110ioc.0.2019.09.23.12.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 12:06:32 -0700 (PDT) Sender: Mark Johnston Date: Mon, 23 Sep 2019 15:06:29 -0400 From: Mark Johnston To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r352623 - in head/sys: amd64/amd64 kern Message-ID: <20190923190629.GD15061@raichu> References: <201909231414.x8NEEh9e040728@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46cYhW0lHcz4NfX X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,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, 23 Sep 2019 19:06:35 -0000 On Mon, Sep 23, 2019 at 11:28:52AM -0700, Conrad Meyer wrote: > Hi Mark, > > On Mon, Sep 23, 2019 at 7:14 AM Mark Johnston wrote: > > > > Author: markj > > Date: Mon Sep 23 14:14:43 2019 > > New Revision: 352623 > > URL: https://svnweb.freebsd.org/changeset/base/352623 > > > > Log: > > Use elf_relocaddr() when handling R_X86_64_RELATIVE relocations. > > > > This is required for DPCPU and VNET data variable definitions to work when > > KLDs are linked as DSOs. R_X86_64_RELATIVE relocations should not appear > > in object files, so assert this in elf_relocaddr(). > > Is the goal to eventually link amd64 KLDs as DSOs? I might be > confusing the terminology, but I believe amd64 .ko's today are > unlinked ordinary object files, rather than shared objects. (I > believe they use kern/link_elf_obj.c rather than kern/link_elf.c > today.) > > If so: great! That's right, and that is indeed my goal. At least, I would like to make the option available; with my patch set, it is possible to specify the format at both the per-module and global levels. There are several in-tree modules (some of the HighPoint RAID drivers, if you're curious) that cannot be linked as DSOs because they contain a non-PIC blob, and for now lld refuses to link them into a DSO. From owner-svn-src-head@freebsd.org Mon Sep 23 20:14: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 4786BFE812 for ; Mon, 23 Sep 2019 20:14:04 +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.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 46cbBM33RHz4SNy for ; Mon, 23 Sep 2019 20:14:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id j31so18768772qta.5 for ; Mon, 23 Sep 2019 13:14:03 -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=ulGasXaI9v/TNxmgKSreGJ2SNeC0XCJM+13FUH6BOXQ=; b=VEXrvE+QPfgn1xWK4TdcGMxNAO/YqDENlosUqDTBydLYBX0Sx/hndhKCx5AZ/ZmdYb g4fmPhsKWKAChv18ovdtzkRsV/n406P0o2WUhy62uVOba3ZI4T89zSDnVKp9LYcAqatr qPjv5A+ar0a6Nx44xlFmKUfs98sjhFpVE4spGTJP0UXuWHYWxqYS5LITBIg2jxkZCOV4 UPVmNCDNhuWtjS6OtpCTaF3HVVmxbEIIy+PVplwSBTbEqJXGhnnaNpQ2iNay6Lgqo/cG SDi9dQ1PMCPc2NBfLDk7wtItT47Ye9wYSgg8zJ63E33gum7IunDSuNhUt7P+zrEtWhlV jGWA== 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=ulGasXaI9v/TNxmgKSreGJ2SNeC0XCJM+13FUH6BOXQ=; b=NybqI4xF9wOkT+P86uF+rI2juiirEH36Q6he8e1wf0sescE/6uvP0cB8RnKfRY6EHK gpZRwpcMG+lftIMMW7GpRplHaFP30s8knNEK7Z7UQ5BwPv72OH/jMP++Bckp8J85ICj/ Xknf8vm5qUZnhtVJvAu2HP0kJ6F6/tACEj8/VSdCoGgqJ11q2khHXRk7m+i1LM6ITQPV UJW5Ee6hOo7g8nvprX+04qE7MkDZ7je7ZoAH1/7dU6ibQN9YGeUg4dJhSLAF0BFXn9Hj 2sG3JDM0+1FPzN1w0g5+INpodfDBEtPXYDxEP/ErOMUJd3EFGabf6Tkzjo8Mh2BveZRX VWVw== X-Gm-Message-State: APjAAAWCUsztLJGMDQZpSd3d6qrfdmKWc2PMXbBbfPIjXv6Efu1WBDF2 uYgQW9f3z+KJX5B5hK+K+S87R7sxnfSv6nMKN+W8lA== X-Google-Smtp-Source: APXvYqyUB78Clt/IcIfODGAS5mJYkA/d6OGiW8qi4Y2IuUiVreZVD/wvwc6HdDuu6/TaBMMc6sP5i3lR1zbzpY50iLI= X-Received: by 2002:ad4:52cc:: with SMTP id p12mr976002qvs.236.1569269642091; Mon, 23 Sep 2019 13:14:02 -0700 (PDT) MIME-Version: 1.0 References: <201909231414.x8NEEh9e040728@repo.freebsd.org> <20190923190629.GD15061@raichu> In-Reply-To: <20190923190629.GD15061@raichu> From: Warner Losh Date: Mon, 23 Sep 2019 22:13:14 +0200 Message-ID: Subject: Re: svn commit: r352623 - in head/sys: amd64/amd64 kern To: Mark Johnston Cc: "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46cbBM33RHz4SNy X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=VEXrvE+Q; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82d) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.85 / 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)[]; 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]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[d.2.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]; 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.85)[ip: (-9.38), ipnet: 2607:f8b0::/32(-2.64), asn: 15169(-2.20), 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: Mon, 23 Sep 2019 20:14:04 -0000 On Mon, Sep 23, 2019, 9:06 PM Mark Johnston wrote: > On Mon, Sep 23, 2019 at 11:28:52AM -0700, Conrad Meyer wrote: > > Hi Mark, > > > > On Mon, Sep 23, 2019 at 7:14 AM Mark Johnston wrote: > > > > > > Author: markj > > > Date: Mon Sep 23 14:14:43 2019 > > > New Revision: 352623 > > > URL: https://svnweb.freebsd.org/changeset/base/352623 > > > > > > Log: > > > Use elf_relocaddr() when handling R_X86_64_RELATIVE relocations. > > > > > > This is required for DPCPU and VNET data variable definitions to > work when > > > KLDs are linked as DSOs. R_X86_64_RELATIVE relocations should not > appear > > > in object files, so assert this in elf_relocaddr(). > > > > Is the goal to eventually link amd64 KLDs as DSOs? I might be > > confusing the terminology, but I believe amd64 .ko's today are > > unlinked ordinary object files, rather than shared objects. (I > > believe they use kern/link_elf_obj.c rather than kern/link_elf.c > > today.) > > > > If so: great! > > That's right, and that is indeed my goal. At least, I would like to > make the option available; with my patch set, it is possible to specify > the format at both the per-module and global levels. There are several > in-tree modules (some of the HighPoint RAID drivers, if you're curious) > that cannot be linked as DSOs because they contain a non-PIC blob, and > for now lld refuses to link them into a DSO. > That problem might be better solved by removing the highpount driver since they are old and abandon ware these days. I'm serious here, old stuff with low value getting in the way might be better off in our rearview mirror... Warner > From owner-svn-src-head@freebsd.org Mon Sep 23 20:28:39 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 8EEDAFED5F; Mon, 23 Sep 2019 20:28:39 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (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 46cbWB6SdMz4TT2; Mon, 23 Sep 2019 20:28:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd41.google.com with SMTP id h144so36747707iof.7; Mon, 23 Sep 2019 13:28:38 -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=yB/aGoFASdsxHtDiO/gHrkLhpDHQO6bT6smeKqU4D9Y=; b=qNE7W820u89ox/BmNYdchXHbImEGoHl3UHKgE2gXqT5Y1rgOerxwW51WVq3S2ZZBKz iDM+Zic1MEYkikS6+n5RtczfRo9ROvQC+GLXvfgddOXnTO2cC8+3+kBVuPeuTI7wWbqC WU6bYmPvWPBTMXFOSEaH8fvhExMepPU90x7VJhLh6HsBaOamiDbAzmk55x7ZGSVFekoz ilpLTLEH+S/5ZBmJhWwF2Yrxe26u0JaQeNyAIq1aNy2xg8ytZ5vN7Zt7Gh56MBiuuyTX 60mmgocdkS2161C/dONTOiWSKFBcJsTBRs04wwea61xV3Pa4eAKQXG7xGY8RPAhvnS+M W6tQ== 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=yB/aGoFASdsxHtDiO/gHrkLhpDHQO6bT6smeKqU4D9Y=; b=Bbf0HBcyWsXn6XbYrFdfH08YdUg4umte/pz1FbbFIFTEGElyCndwehmVVOw+1Jk1GJ 0F81gUOSM6U6DzCbSlByJUw4peWgwbqFkG4ZgMCBAZMHzLy2db66tyzyJynevYttqBea b4XiiHEh9GPPD3kEsmB/Rb1kZZLefNElwC9BkBCwbo0idnY63jtcRqBw6IQQi9Xub01x IHHuR5YHtx33J3dOf+VYpUphlwFKdvsKq665mJh123EKotNbnv0Q4pkz+c8IfA9wEvCJ n8O5kKPgfnYYOo5GT6aTCucQxTzOj49/Ve/fl2PBO76u45CLYE+Nwc5fz8+fPsRuf4sG bc8g== X-Gm-Message-State: APjAAAV+Tsi9DZW2gBvZXX6GrHgu+snFytw8zkrc09YdHatoVVj690pS 3aw2H1Z6uYS1sGmfBIHxdwXUrSEl X-Google-Smtp-Source: APXvYqxk7nmIuHGN+jwNVx4GClz/7idyuop3ZMjqp9VvFqf3PwKzXy/P2tKDwblggsNfJw5+yWOsxA== X-Received: by 2002:a5d:88c9:: with SMTP id i9mr1309830iol.269.1569270517817; Mon, 23 Sep 2019 13:28:37 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-39-167.dsl.bell.ca. [69.159.39.167]) by smtp.gmail.com with ESMTPSA id y17sm12248709ioa.52.2019.09.23.13.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 13:28:37 -0700 (PDT) Sender: Mark Johnston Date: Mon, 23 Sep 2019 16:28:34 -0400 From: Mark Johnston To: Warner Losh Cc: "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r352623 - in head/sys: amd64/amd64 kern Message-ID: <20190923202834.GE15061@raichu> References: <201909231414.x8NEEh9e040728@repo.freebsd.org> <20190923190629.GD15061@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46cbWB6SdMz4TT2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=qNE7W820; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::d41 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.24 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.4.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]; IP_SCORE(-0.55)[ip: (2.16), ipnet: 2607:f8b0::/32(-2.64), asn: 15169(-2.20), country: US(-0.05)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; 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]; 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, 23 Sep 2019 20:28:39 -0000 On Mon, Sep 23, 2019 at 10:13:14PM +0200, Warner Losh wrote: > On Mon, Sep 23, 2019, 9:06 PM Mark Johnston wrote: > > > On Mon, Sep 23, 2019 at 11:28:52AM -0700, Conrad Meyer wrote: > > > Hi Mark, > > > > > > On Mon, Sep 23, 2019 at 7:14 AM Mark Johnston wrote: > > > > > > > > Author: markj > > > > Date: Mon Sep 23 14:14:43 2019 > > > > New Revision: 352623 > > > > URL: https://svnweb.freebsd.org/changeset/base/352623 > > > > > > > > Log: > > > > Use elf_relocaddr() when handling R_X86_64_RELATIVE relocations. > > > > > > > > This is required for DPCPU and VNET data variable definitions to > > work when > > > > KLDs are linked as DSOs. R_X86_64_RELATIVE relocations should not > > appear > > > > in object files, so assert this in elf_relocaddr(). > > > > > > Is the goal to eventually link amd64 KLDs as DSOs? I might be > > > confusing the terminology, but I believe amd64 .ko's today are > > > unlinked ordinary object files, rather than shared objects. (I > > > believe they use kern/link_elf_obj.c rather than kern/link_elf.c > > > today.) > > > > > > If so: great! > > > > That's right, and that is indeed my goal. At least, I would like to > > make the option available; with my patch set, it is possible to specify > > the format at both the per-module and global levels. There are several > > in-tree modules (some of the HighPoint RAID drivers, if you're curious) > > that cannot be linked as DSOs because they contain a non-PIC blob, and > > for now lld refuses to link them into a DSO. > > > > That problem might be better solved by removing the highpount driver since > they are old and abandon ware these days. I'm serious here, old stuff with > low value getting in the way might be better off in our rearview mirror... Well, there are at least four drivers. I'm not sure which, if any, are actively used these days, though some of them have gotten vendor updates in the past several years. In any case, handling the issue involved adding a single line to each driver's makefile, so I don't feel too oppressed. From owner-svn-src-head@freebsd.org Mon Sep 23 20:37: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 AFD2EFF5A0 for ; Mon, 23 Sep 2019 20:37:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (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 46cbht01Q2z4VNk for ; Mon, 23 Sep 2019 20:37:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x833.google.com with SMTP id c3so18800215qtv.10 for ; Mon, 23 Sep 2019 13:37:01 -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=rPQH0VNFSUVHsql7x0KmzN6rRxdAGQXqa7ZeypQzZj4=; b=RzC62QXNJ2uNVj16LsYKY7JDutk9hz1VLKETvcozMPpNvIvRVyuQdBUAu1vPiAYnw8 GuT/5b25VNYSL3mxsPDQY0ptOOPdjcCIZrvbkGQ2A5MPP7QQJjrB3CX4g8sAkz9E+N19 NoFe5QYJu9tJYdHhfztlva5rqRiQU7jhdI6Izwvm1JIxaE+mNg1aOrRW3uoSgFqbmaOB 1tUf9v8Y2pF5lz1nPwTSKBIFbh9OZiUE9w2cRvqTFiQz41PhkTOWfH2kauGepKtlDTe+ nL8fbwBzDTJQS5DSrzFi6WfU7nqPKpki80ylkt95wew8p6x9jLFM8lE5vifMLb+8w/r5 YppA== 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=rPQH0VNFSUVHsql7x0KmzN6rRxdAGQXqa7ZeypQzZj4=; b=hpcIbyBVp7IF2QOxZREzGv8/DkZ01kRs5fRbugQRMedCIIFHaTBwnB8ElLv6g9zkXB WGj2BPD3Pfm6S6VyNRzqm2wzgsx7sT8VujXDGlDKhqk4TFP/eSnjMATn1SatWN9IoWU/ 3SWbvwjkczwOJmWmPufRcuRdnOLrOcmwunkHd9Doc9epNvDva53vanIXk6zBy9yH05O5 LrRvXUdmlvLcsMUhPbs1oFt2zfPUmM7H9BOq5k8F+PL3HPOaE4+NftumSGoPhiF8Dum/ e7NTldoLfinyKcmPF+yNew9VyKqg6XaQ/F7AnNCqqgmDXGQx6ZayMWayG7OeFymzijL8 cAnA== X-Gm-Message-State: APjAAAXjiAPBOBR09uhvVMZjEyFzJeDt1HTL/eQka+o0FDANBVhPbBMa A9KsgeIrie5CXGe41BnpjgPeSOVefMt4qgQIjvyM/Q== X-Google-Smtp-Source: APXvYqzGMujafEu+3DuEDlBTzxmz2hl3nUKUjZXc2K3j2CYvjk4vZ7SbBbfucpZJjYyRbJU2L5FIS1RGhHj5Dl6wIhw= X-Received: by 2002:ac8:44c9:: with SMTP id b9mr2062546qto.175.1569271020959; Mon, 23 Sep 2019 13:37:00 -0700 (PDT) MIME-Version: 1.0 References: <201909231414.x8NEEh9e040728@repo.freebsd.org> <20190923190629.GD15061@raichu> <20190923202834.GE15061@raichu> In-Reply-To: <20190923202834.GE15061@raichu> From: Warner Losh Date: Mon, 23 Sep 2019 22:36:49 +0200 Message-ID: Subject: Re: svn commit: r352623 - in head/sys: amd64/amd64 kern To: Mark Johnston Cc: "Conrad E. Meyer" , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46cbht01Q2z4VNk X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=RzC62QXN; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::833) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.84 / 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)[]; 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]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.3.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]; 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.84)[ip: (-9.31), ipnet: 2607:f8b0::/32(-2.64), asn: 15169(-2.20), 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: Mon, 23 Sep 2019 20:37:02 -0000 On Mon, Sep 23, 2019, 10:28 PM Mark Johnston wrote: > On Mon, Sep 23, 2019 at 10:13:14PM +0200, Warner Losh wrote: > > On Mon, Sep 23, 2019, 9:06 PM Mark Johnston wrote: > > > > > On Mon, Sep 23, 2019 at 11:28:52AM -0700, Conrad Meyer wrote: > > > > Hi Mark, > > > > > > > > On Mon, Sep 23, 2019 at 7:14 AM Mark Johnston > wrote: > > > > > > > > > > Author: markj > > > > > Date: Mon Sep 23 14:14:43 2019 > > > > > New Revision: 352623 > > > > > URL: https://svnweb.freebsd.org/changeset/base/352623 > > > > > > > > > > Log: > > > > > Use elf_relocaddr() when handling R_X86_64_RELATIVE relocations. > > > > > > > > > > This is required for DPCPU and VNET data variable definitions to > > > work when > > > > > KLDs are linked as DSOs. R_X86_64_RELATIVE relocations should > not > > > appear > > > > > in object files, so assert this in elf_relocaddr(). > > > > > > > > Is the goal to eventually link amd64 KLDs as DSOs? I might be > > > > confusing the terminology, but I believe amd64 .ko's today are > > > > unlinked ordinary object files, rather than shared objects. (I > > > > believe they use kern/link_elf_obj.c rather than kern/link_elf.c > > > > today.) > > > > > > > > If so: great! > > > > > > That's right, and that is indeed my goal. At least, I would like to > > > make the option available; with my patch set, it is possible to specify > > > the format at both the per-module and global levels. There are several > > > in-tree modules (some of the HighPoint RAID drivers, if you're curious) > > > that cannot be linked as DSOs because they contain a non-PIC blob, and > > > for now lld refuses to link them into a DSO. > > > > > > > That problem might be better solved by removing the highpount driver > since > > they are old and abandon ware these days. I'm serious here, old stuff > with > > low value getting in the way might be better off in our rearview > mirror... > > Well, there are at least four drivers. I'm not sure which, if any, are > actively used these days, though some of them have gotten vendor updates > in the past several years. In any case, handling the issue involved > adding a single line to each driver's makefile, so I don't feel too > oppressed. > At least 3 of the 4 are so old as to be irrelevant by any standard... and the 4th is teetering on the edge as well. Warner > From owner-svn-src-head@freebsd.org Mon Sep 23 20:50: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 115E2FF9EF; Mon, 23 Sep 2019 20:50:05 +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 46cbzw6V1vz4WBF; Mon, 23 Sep 2019 20:50:04 +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 C37FB1C7B9; Mon, 23 Sep 2019 20:50:04 +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 x8NKo4n7078725; Mon, 23 Sep 2019 20:50:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NKo4O7078724; Mon, 23 Sep 2019 20:50:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909232050.x8NKo4O7078724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Sep 2019 20:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352631 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352631 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, 23 Sep 2019 20:50:05 -0000 Author: mjg Date: Mon Sep 23 20:50:04 2019 New Revision: 352631 URL: https://svnweb.freebsd.org/changeset/base/352631 Log: cache: tidy up handling of negative entries - track the total count of hot entries - pre-read the lock when shrinking since it is typically already taken - place the lock in its own cacheline - shorten the hold time of hot lock list when zapping Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Sep 23 17:53:47 2019 (r352630) +++ head/sys/kern/vfs_cache.c Mon Sep 23 20:50:04 2019 (r352631) @@ -226,7 +226,7 @@ SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsrequeue, CTLFLAG_ struct nchstats nchstats; /* cache effectiveness statistics */ -static struct mtx ncneg_shrink_lock; +static struct mtx __exclusive_cache_line ncneg_shrink_lock; static int shrink_list_turn; struct neglist { @@ -236,6 +236,7 @@ struct neglist { static struct neglist __read_mostly *neglists; static struct neglist ncneg_hot; +static u_long numhotneg; #define numneglists (ncneghash + 1) static u_int __read_mostly ncneghash; @@ -389,6 +390,7 @@ static long zap_and_exit_bucket_fail2; STATNODE_ULONG( static long cache_lock_vnodes_cel_3_failures; STATNODE_ULONG(cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); +STATNODE_ULONG(numhotneg, "Number of hot negative entries"); static void cache_zap_locked(struct namecache *ncp, bool neg_locked); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, @@ -705,6 +707,7 @@ cache_negative_hit(struct namecache *ncp) neglist = NCP2NEGLIST(ncp); mtx_lock(&neglist->nl_lock); if (!(ncp->nc_flag & NCF_HOTNEGATIVE)) { + numhotneg++; TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); ncp->nc_flag |= NCF_HOTNEGATIVE; @@ -758,6 +761,7 @@ cache_negative_remove(struct namecache *ncp, bool neg_ if (ncp->nc_flag & NCF_HOTNEGATIVE) { mtx_assert(&ncneg_hot.nl_lock, MA_OWNED); TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); + numhotneg--; } else { mtx_assert(&neglist->nl_lock, MA_OWNED); TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); @@ -803,7 +807,8 @@ cache_negative_zap_one(void) struct mtx *dvlp; struct rwlock *blp; - if (!mtx_trylock(&ncneg_shrink_lock)) + if (mtx_owner(&ncneg_shrink_lock) != NULL || + !mtx_trylock(&ncneg_shrink_lock)) return; mtx_lock(&ncneg_hot.nl_lock); @@ -814,8 +819,10 @@ cache_negative_zap_one(void) TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); TAILQ_INSERT_TAIL(&neglist->nl_list, ncp, nc_dst); ncp->nc_flag &= ~NCF_HOTNEGATIVE; + numhotneg--; mtx_unlock(&neglist->nl_lock); } + mtx_unlock(&ncneg_hot.nl_lock); cache_negative_shrink_select(shrink_list_turn, &ncp, &neglist); shrink_list_turn++; @@ -823,16 +830,13 @@ cache_negative_zap_one(void) shrink_list_turn = 0; if (ncp == NULL && shrink_list_turn == 0) cache_negative_shrink_select(shrink_list_turn, &ncp, &neglist); - if (ncp == NULL) { - mtx_unlock(&ncneg_hot.nl_lock); + if (ncp == NULL) goto out; - } MPASS(ncp->nc_flag & NCF_NEGATIVE); dvlp = VP2VNODELOCK(ncp->nc_dvp); blp = NCP2BUCKETLOCK(ncp); mtx_unlock(&neglist->nl_lock); - mtx_unlock(&ncneg_hot.nl_lock); mtx_lock(dvlp); rw_wlock(blp); mtx_lock(&neglist->nl_lock); @@ -1750,9 +1754,14 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, if (vp != NULL) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); + if (ncp->nc_flag & NCF_HOTNEGATIVE) + numhotneg--; ncp->nc_flag &= ~(NCF_NEGATIVE|NCF_HOTNEGATIVE); } else { - ncp->nc_flag &= ~(NCF_HOTNEGATIVE); + if (ncp->nc_flag & NCF_HOTNEGATIVE) { + numhotneg--; + ncp->nc_flag &= ~(NCF_HOTNEGATIVE); + } ncp->nc_flag |= NCF_NEGATIVE; cache_negative_insert(ncp, true); } From owner-svn-src-head@freebsd.org Mon Sep 23 22:20: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 D2CBB122548; Mon, 23 Sep 2019 22:20:11 +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 46cdzv524Jz4c5g; Mon, 23 Sep 2019 22:20:11 +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 8B0321D7F9; Mon, 23 Sep 2019 22:20:11 +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 x8NMKBpe032279; Mon, 23 Sep 2019 22:20:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8NMKB7H032278; Mon, 23 Sep 2019 22:20:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909232220.x8NMKB7H032278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 23 Sep 2019 22:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352634 - head/sbin/ping6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/ping6 X-SVN-Commit-Revision: 352634 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, 23 Sep 2019 22:20:11 -0000 Author: markj Date: Mon Sep 23 22:20:11 2019 New Revision: 352634 URL: https://svnweb.freebsd.org/changeset/base/352634 Log: ping6: Use caph_rights_limit(3) for STDIN_FILENO Update some error messages while here. Reported by: olivier MFC after: 3 days Modified: head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Mon Sep 23 20:55:40 2019 (r352633) +++ head/sbin/ping6/ping6.c Mon Sep 23 22:20:11 2019 (r352634) @@ -1028,8 +1028,8 @@ main(int argc, char *argv[]) err(1, "caph_enter_casper"); cap_rights_init(&rights_stdin); - if (cap_rights_limit(STDIN_FILENO, &rights_stdin) < 0) - err(1, "cap_rights_limit stdin"); + if (caph_rights_limit(STDIN_FILENO, &rights_stdin) < 0) + err(1, "caph_rights_limit stdin"); if (caph_limit_stdout() < 0) err(1, "caph_limit_stdout"); if (caph_limit_stderr() < 0) @@ -1037,10 +1037,10 @@ main(int argc, char *argv[]) cap_rights_init(&rights_srecv, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); if (caph_rights_limit(srecv, &rights_srecv) < 0) - err(1, "cap_rights_limit srecv"); + err(1, "caph_rights_limit srecv"); cap_rights_init(&rights_ssend, CAP_SEND, CAP_SETSOCKOPT); if (caph_rights_limit(ssend, &rights_ssend) < 0) - err(1, "cap_rights_limit ssend"); + err(1, "caph_rights_limit ssend"); #if defined(SO_SNDBUF) && defined(SO_RCVBUF) if (sockbufsize) { @@ -1092,10 +1092,10 @@ main(int argc, char *argv[]) cap_rights_clear(&rights_srecv, CAP_SETSOCKOPT); if (caph_rights_limit(srecv, &rights_srecv) < 0) - err(1, "cap_rights_limit srecv setsockopt"); + err(1, "caph_rights_limit srecv setsockopt"); cap_rights_clear(&rights_ssend, CAP_SETSOCKOPT); if (caph_rights_limit(ssend, &rights_ssend) < 0) - err(1, "cap_rights_limit ssend setsockopt"); + err(1, "caph_rights_limit ssend setsockopt"); printf("PING6(%lu=40+8+%lu bytes) ", (unsigned long)(40 + pingerlen()), (unsigned long)(pingerlen() - 8)); From owner-svn-src-head@freebsd.org Tue Sep 24 01:56: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 05095F0196; Tue, 24 Sep 2019 01:56:28 +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 46cknR6KM2z3KJK; Tue, 24 Sep 2019 01:56:27 +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 BC6FB2000A; Tue, 24 Sep 2019 01:56:27 +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 x8O1uRSN061128; Tue, 24 Sep 2019 01:56:27 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8O1uRRu061127; Tue, 24 Sep 2019 01:56:27 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201909240156.x8O1uRRu061127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 24 Sep 2019 01:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352635 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 352635 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, 24 Sep 2019 01:56:28 -0000 Author: lwhsu Date: Tue Sep 24 01:56:27 2019 New Revision: 352635 URL: https://svnweb.freebsd.org/changeset/base/352635 Log: Clean LINT* kernel configurations for arm* MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/makeLINT.mk Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Mon Sep 23 22:20:11 2019 (r352634) +++ head/sys/conf/makeLINT.mk Tue Sep 24 01:56:27 2019 (r352635) @@ -11,6 +11,9 @@ clean: .if ${TARGET} == "amd64" || ${TARGET} == "i386" rm -f LINT-NOINET LINT-NOINET6 LINT-NOIP .endif +.if ${TARGET} == "arm" + rm -f LINT-V5 LINT-V7 +.endif NOTES+= ${.CURDIR}/../../conf/NOTES ${.CURDIR}/NOTES MAKELINT_SED= ${.CURDIR}/../../conf/makeLINT.sed From owner-svn-src-head@freebsd.org Tue Sep 24 01:58: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 1B2BAF049E; Tue, 24 Sep 2019 01:58:56 +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 46ckrJ0VXRz3KWs; Tue, 24 Sep 2019 01:58:56 +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 E962B20026; Tue, 24 Sep 2019 01:58:55 +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 x8O1wtFC061286; Tue, 24 Sep 2019 01:58:55 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8O1ws6b061279; Tue, 24 Sep 2019 01:58:54 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201909240158.x8O1ws6b061279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 24 Sep 2019 01:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352636 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 352636 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, 24 Sep 2019 01:58:56 -0000 Author: rmacklem Date: Tue Sep 24 01:58:54 2019 New Revision: 352636 URL: https://svnweb.freebsd.org/changeset/base/352636 Log: Replace all mtx_lock()/mtx_unlock() on n_mtx with the macros. For a long time, some places in the NFS code have locked/unlocked the NFS node lock with the macros NFSLOCKNODE()/NFSUNLOCKNODE() whereas others have simply used mtx_lock()/mtx_unlock(). Since the NFS node mutex needs to change to an sx lock so it can be held when vnode_pager_setsize() is called, replace all occurrences of mtx_lock/mtx_unlock with the macros to simply making the change to an sx lock in future commit. There is no semantic change as a result of this commit. I am not sure if the change to an sx lock will be MFC'd soon, so I put an MFC of 1 week on this commit so that it could be MFC'd with that commit. Suggested by: kib MFC after: 1 week Modified: head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clsubs.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Tue Sep 24 01:56:27 2019 (r352635) +++ head/sys/fs/nfs/nfsport.h Tue Sep 24 01:58:54 2019 (r352636) @@ -855,11 +855,11 @@ MALLOC_DECLARE(M_NEWNFSDSESSION); #define NFSWRITERPC_SETTIME(w, n, a, v4) \ do { \ if (w) { \ - mtx_lock(&((n)->n_mtx)); \ + NFSLOCKNODE(n); \ (n)->n_mtime = (a)->na_mtime; \ if (v4) \ (n)->n_change = (a)->na_filerev; \ - mtx_unlock(&((n)->n_mtx)); \ + NFSUNLOCKNODE(n); \ } \ } while (0) Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Tue Sep 24 01:56:27 2019 (r352635) +++ head/sys/fs/nfsclient/nfs_clbio.c Tue Sep 24 01:58:54 2019 (r352636) @@ -101,9 +101,9 @@ ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn) int biosize, bcount; np = VTONFS(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); nsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); biosize = vp->v_bufobj.bo_bsize; bcount = biosize; @@ -144,13 +144,13 @@ ncl_getpages(struct vop_getpages_args *ap) } if (newnfs_directio_enable && !newnfs_directio_allow_mmap) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((np->n_flag & NNONCACHE) && (vp->v_type == VREG)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); printf("ncl_getpages: called on non-cacheable vnode\n"); return (VM_PAGER_ERROR); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } mtx_lock(&nmp->nm_mtx); @@ -301,12 +301,12 @@ ncl_putpages(struct vop_putpages_args *ap) } else mtx_unlock(&nmp->nm_mtx); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (newnfs_directio_enable && !newnfs_directio_allow_mmap && (np->n_flag & NNONCACHE) && (vp->v_type == VREG)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); printf("ncl_putpages: called on noncache-able vnode\n"); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); } /* * When putting pages, do not extend file past EOF. @@ -316,7 +316,7 @@ ncl_putpages(struct vop_putpages_args *ap) if (count < 0) count = 0; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); for (i = 0; i < npages; i++) rtvals[i] = VM_PAGER_ERROR; @@ -374,9 +374,9 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread * whether the cache is consistent. */ old_lock = ncl_excl_start(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (vp->v_type != VREG) { if (vp->v_type != VDIR) panic("nfs: bioread, not dir"); @@ -390,28 +390,28 @@ nfs_bioread_check_cons(struct vnode *vp, struct thread error = VOP_GETATTR(vp, &vattr, cred); if (error) goto out; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } else { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = VOP_GETATTR(vp, &vattr, cred); if (error) goto out; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((np->n_flag & NSIZECHANGED) || (NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime))) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (vp->v_type == VDIR) ncl_invaldir(vp); error = ncl_vinvalbuf(vp, V_SAVE | V_ALLOWCLEAN, td, 1); if (error != 0) goto out; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; np->n_flag &= ~NSIZECHANGED; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } out: ncl_excl_finish(vp, old_lock); @@ -474,9 +474,9 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int iof do { u_quad_t nsize; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); nsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); switch (vp->v_type) { case VREG: @@ -883,13 +883,13 @@ ncl_write(struct vop_write_args *ap) ("ncl_write proc")); if (vp->v_type != VREG) return (EIO); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NWRITEERR) { np->n_flag &= ~NWRITEERR; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); return (np->n_error); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); mtx_lock(&nmp->nm_mtx); if ((nmp->nm_flag & NFSMNT_NFSV3) != 0 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) { @@ -906,9 +906,9 @@ ncl_write(struct vop_write_args *ap) * mode or if we are appending. */ if (ioflag & (IO_APPEND | IO_SYNC)) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); #ifdef notyet /* Needs matching nonblock semantics elsewhere, too. */ /* * Require non-blocking, synchronous writes to @@ -925,13 +925,13 @@ ncl_write(struct vop_write_args *ap) if (error != 0) return (error); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } orig_resid = uio->uio_resid; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); orig_size = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * If IO_APPEND then load uio_offset. We restart here if we cannot @@ -943,9 +943,9 @@ ncl_write(struct vop_write_args *ap) error = VOP_GETATTR(vp, &vattr, cred); if (error) return (error); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); uio->uio_offset = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (uio->uio_offset < 0) @@ -979,9 +979,9 @@ ncl_write(struct vop_write_args *ap) if (!(ioflag & IO_SYNC)) { int nflag; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); nflag = np->n_flag; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (nflag & NMODIFIED) { BO_LOCK(&vp->v_bufobj); if (vp->v_bufobj.bo_dirty.bv_cnt != 0) { @@ -1018,7 +1018,7 @@ again: * Handle direct append and file extension cases, calculate * unaligned buffer size. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((np->n_flag & NHASBEENLOCKED) == 0 && (nmp->nm_flag & NFSMNT_NONCONTIGWR) != 0) noncontig_write = 1; @@ -1028,7 +1028,7 @@ again: (noncontig_write != 0 && lbn == (np->n_size / biosize) && uio->uio_offset + n > np->n_size)) && n) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * Get the buffer (in its pre-append state to maintain * B_CACHE if it was previously set). Resize the @@ -1041,11 +1041,11 @@ again: if (bp != NULL) { long save; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; vnode_pager_setsize(vp, np->n_size); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); save = bp->b_flags & B_CACHE; bcount = on + n; @@ -1067,15 +1067,15 @@ again: else bcount = np->n_size - (off_t)lbn * biosize; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); bp = nfs_getcacheblk(vp, lbn, bcount, td); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (uio->uio_offset + n > np->n_size) { np->n_size = uio->uio_offset + n; np->n_flag |= NMODIFIED; vnode_pager_setsize(vp, np->n_size); } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (!bp) { @@ -1124,9 +1124,9 @@ again: } if (bp->b_wcred == NOCRED) bp->b_wcred = crhold(cred); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NMODIFIED; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * If dirtyend exceeds file size, chop it down. This should @@ -1369,13 +1369,13 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thre * Invalidate the attribute cache, since writes to a DS * won't update the size attribute. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; } else - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_directio_asyncwr == 0) np->n_flag &= ~NMODIFIED; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); out: ncl_excl_finish(vp, old_lock); return error; @@ -1517,10 +1517,10 @@ again: TAILQ_INSERT_TAIL(&nmp->nm_bufq, bp, b_freelist); nmp->nm_bufqlen++; if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { - mtx_lock(&(VTONFS(bp->b_vp))->n_mtx); + NFSLOCKNODE(VTONFS(bp->b_vp)); VTONFS(bp->b_vp)->n_flag |= NMODIFIED; VTONFS(bp->b_vp)->n_directio_asyncwr++; - mtx_unlock(&(VTONFS(bp->b_vp))->n_mtx); + NFSUNLOCKNODE(VTONFS(bp->b_vp)); } mtx_unlock(&ncl_iod_mutex); return (0); @@ -1552,7 +1552,7 @@ ncl_doio_directwrite(struct buf *bp) free(uiop, M_NFSDIRECTIO); if ((bp->b_flags & B_DIRECT) && bp->b_iocmd == BIO_WRITE) { struct nfsnode *np = VTONFS(bp->b_vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (NFSHASPNFS(VFSTONFS(vnode_mount(bp->b_vp)))) { /* * Invalidate the attribute cache, since writes to a DS @@ -1568,7 +1568,7 @@ ncl_doio_directwrite(struct buf *bp) wakeup((caddr_t)&np->n_directio_asyncwr); } } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } bp->b_vp = NULL; uma_zfree(ncl_pbuf_zone, bp); @@ -1640,14 +1640,14 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre } /* ASSERT_VOP_LOCKED(vp, "ncl_doio"); */ if (p && vp->v_writecount <= -1) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (NFS_TIMESPEC_COMPARE(&np->n_mtime, &np->n_vattr.na_mtime)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); PROC_LOCK(p); killproc(p, "text file modification"); PROC_UNLOCK(p); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } break; case VLNK: @@ -1706,10 +1706,10 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre /* * Setup for actual write */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((off_t)bp->b_blkno * DEV_BSIZE + bp->b_dirtyend > np->n_size) bp->b_dirtyend = np->n_size - (off_t)bp->b_blkno * DEV_BSIZE; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (bp->b_dirtyend > bp->b_dirtyoff) { io.iov_len = uiop->uio_resid = bp->b_dirtyend @@ -1802,11 +1802,11 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucre bp->b_ioflags |= BIO_ERROR; bp->b_flags |= B_INVAL; bp->b_error = np->n_error = error; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NWRITEERR; np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } bp->b_dirtyoff = bp->b_dirtyend = 0; } @@ -1839,10 +1839,10 @@ ncl_meta_setsize(struct vnode *vp, struct thread *td, int biosize = vp->v_bufobj.bo_bsize; int error = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); tsize = np->n_size; np->n_size = nsize; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (nsize < tsize) { struct buf *bp; Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Tue Sep 24 01:56:27 2019 (r352635) +++ head/sys/fs/nfsclient/nfs_clnode.c Tue Sep 24 01:58:54 2019 (r352636) @@ -219,7 +219,7 @@ ncl_releasesillyrename(struct vnode *vp, struct thread } else sp = NULL; if (sp != NULL) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); (void) ncl_vinvalbuf(vp, 0, td, 1); /* * Remove the silly file that was rename'd earlier @@ -228,7 +228,7 @@ ncl_releasesillyrename(struct vnode *vp, struct thread crfree(sp->s_cred); TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); taskqueue_enqueue(taskqueue_thread, &sp->s_task); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); } } @@ -260,7 +260,7 @@ ncl_inactive(struct vop_inactive_args *ap) } np = VTONFS(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); ncl_releasesillyrename(vp, ap->a_td); /* @@ -271,7 +271,7 @@ ncl_inactive(struct vop_inactive_args *ap) * None of the other flags are meaningful after the vnode is unused. */ np->n_flag &= (NMODIFIED | NDSCOMMIT); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); return (0); } @@ -292,9 +292,9 @@ ncl_reclaim(struct vop_reclaim_args *ap) if (nfs_reclaim_p != NULL) nfs_reclaim_p(ap); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); ncl_releasesillyrename(vp, ap->a_td); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (NFS_ISV4(vp) && vp->v_type == VREG) /* @@ -348,11 +348,11 @@ ncl_invalcaches(struct vnode *vp) struct nfsnode *np = VTONFS(vp); int i; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) np->n_accesscache[i].stamp = 0; KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp); np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue Sep 24 01:56:27 2019 (r352635) +++ head/sys/fs/nfsclient/nfs_clport.c Tue Sep 24 01:58:54 2019 (r352636) @@ -742,12 +742,12 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode if (*tl == newnfs_true) { NFSM_DISSECT(tl, u_int32_t *, 6 * NFSX_UNSIGNED); if (wccflagp != NULL) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); *wccflagp = (np->n_mtime.tv_sec == fxdr_unsigned(u_int32_t, *(tl + 2)) && np->n_mtime.tv_nsec == fxdr_unsigned(u_int32_t, *(tl + 3))); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } error = nfscl_postop_attr(nd, nap, flagp, stuff); @@ -768,12 +768,12 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode nd->nd_flag |= ND_NOMOREDATA; if (wccflagp != NULL && nfsva.na_vattr.va_mtime.tv_sec != 0) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); *wccflagp = (np->n_mtime.tv_sec == nfsva.na_vattr.va_mtime.tv_sec && np->n_mtime.tv_nsec == nfsva.na_vattr.va_mtime.tv_sec); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } nfsmout: Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 24 01:56:27 2019 (r352635) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Tue Sep 24 01:58:54 2019 (r352636) @@ -5952,9 +5952,9 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i error = EIO; } else { commit_thru_mds = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (docommit != 0) { if (error == 0) @@ -5968,9 +5968,9 @@ nfscl_doflayoutio(vnode_t vp, struct uio *uiop, int *i *eofp = 1; uiop->uio_resid = 0; } else { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag &= ~NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } else if (rwflag == NFSV4OPEN_ACCESSREAD) error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, @@ -6036,9 +6036,9 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * transfer = dp->nfsdi_rsize; else transfer = dp->nfsdi_wsize; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (len > transfer && docommit == 0) xfer = transfer; else @@ -6075,9 +6075,9 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * *eofp = 1; uiop->uio_resid = 0; } else { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag &= ~NDSCOMMIT; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } else if (rwflag == NFSV4OPEN_ACCESSREAD) { error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, Modified: head/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clsubs.c Tue Sep 24 01:56:27 2019 (r352635) +++ head/sys/fs/nfsclient/nfs_clsubs.c Tue Sep 24 01:58:54 2019 (r352636) @@ -121,20 +121,20 @@ ncl_uninit(struct vfsconf *vfsp) void ncl_dircookie_lock(struct nfsnode *np) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); while (np->n_flag & NDIRCOOKIELK) (void) msleep(&np->n_flag, &np->n_mtx, PZERO, "nfsdirlk", 0); np->n_flag |= NDIRCOOKIELK; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } void ncl_dircookie_unlock(struct nfsnode *np) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag &= ~NDIRCOOKIELK; wakeup(&np->n_flag); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } bool @@ -190,7 +190,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper vap = &np->n_vattr.na_vattr; nmp = VFSTONFS(vp->v_mount); mustflush = nfscl_mustflush(vp); /* must be before mtx_lock() */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); /* XXX n_mtime doesn't seem to be updated on a miss-and-reload */ timeo = (time_second - np->n_mtime.tv_sec) / 10; @@ -225,7 +225,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper if ((time_second - np->n_attrstamp) >= timeo && (mustflush != 0 || np->n_attrstamp == 0)) { nfsstatsv1.attrcache_misses++; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_GET_MISS(vp); return( ENOENT); } @@ -252,7 +252,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper if (np->n_flag & NUPD) vaper->va_mtime = np->n_mtim; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap); return (0); } Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Sep 24 01:56:27 2019 (r352635) +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Sep 24 01:58:54 2019 (r352636) @@ -310,7 +310,7 @@ nfs34_access_otw(struct vnode *vp, int wmode, struct t (void) nfscl_loadattrcache(&vp, &nfsva, NULL, NULL, 0, 1); if (!error) { lrupos = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) { if (np->n_accesscache[i].uid == cred->cr_uid) { np->n_accesscache[i].mode = rmode; @@ -326,7 +326,7 @@ nfs34_access_otw(struct vnode *vp, int wmode, struct t np->n_accesscache[lrupos].mode = rmode; np->n_accesscache[lrupos].stamp = time_second; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (retmode != NULL) *retmode = rmode; KDTRACE_NFS_ACCESSCACHE_LOAD_DONE(vp, cred->cr_uid, rmode, 0); @@ -421,7 +421,7 @@ nfs_access(struct vop_access_args *ap) * this request? */ gotahit = 0; - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) { if (ap->a_cred->cr_uid == np->n_accesscache[i].uid) { if (time_second < (np->n_accesscache[i].stamp @@ -433,7 +433,7 @@ nfs_access(struct vop_access_args *ap) break; } } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); #ifdef KDTRACE_HOOKS if (gotahit != 0) KDTRACE_NFS_ACCESSCACHE_GET_HIT(vp, @@ -465,14 +465,14 @@ nfs_access(struct vop_access_args *ap) * After calling nfsspec_access, we should have the correct * file size cached. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (ap->a_cred->cr_uid == 0 && (ap->a_accmode & VREAD) && VTONFS(vp)->n_size > 0) { struct iovec aiov; struct uio auio; char buf[1]; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); aiov.iov_base = buf; aiov.iov_len = 1; auio.uio_iov = &aiov; @@ -498,7 +498,7 @@ nfs_access(struct vop_access_args *ap) else error = EACCES; } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); return (error); } } @@ -543,52 +543,52 @@ nfs_open(struct vop_open_args *ap) * Now, if this Open will be doing reading, re-validate/flush the * cache, so that Close/Open coherency is maintained. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); if (vp->v_type == VDIR) np->n_direofoffset = 0; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; if (NFS_ISV4(vp)) np->n_change = vattr.va_filerev; } else { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((NFS_ISV4(vp) && np->n_change != vattr.va_filerev) || NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) { if (vp->v_type == VDIR) np->n_direofoffset = 0; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = vattr.va_mtime; if (NFS_ISV4(vp)) np->n_change = vattr.va_filerev; @@ -601,14 +601,14 @@ nfs_open(struct vop_open_args *ap) if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) { if (np->n_directio_opens == 0) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error) { if (NFS_ISV4(vp)) (void) nfsrpc_close(vp, 0, ap->a_td); return (error); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_flag |= NNONCACHE; } np->n_directio_opens++; @@ -630,7 +630,7 @@ nfs_open(struct vop_open_args *ap) np->n_writecred = crhold(ap->a_cred); } else cred = NULL; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (cred != NULL) crfree(cred); @@ -657,9 +657,9 @@ nfs_open(struct vop_open_args *ap) /* And, finally, make sure that n_mtime is up to date. */ np = VTONFS(vp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_mtime = np->n_vattr.na_mtime; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } return (0); } @@ -734,9 +734,9 @@ nfs_close(struct vop_close_args *ap) vm_object_page_clean(vp->v_object, 0, 0, 0); VM_OBJECT_WUNLOCK(vp->v_object); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if (NFS_ISV3(vp)) { /* * Under NFSv3 we have dirty buffers to dispose of. We @@ -770,7 +770,7 @@ nfs_close(struct vop_close_args *ap) } else { error = ncl_vinvalbuf(vp, V_SAVE, ap->a_td, 1); } - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); } /* * Invalidate the attribute cache in all cases. @@ -795,7 +795,7 @@ nfs_close(struct vop_close_args *ap) np->n_flag &= ~NWRITEERR; error = np->n_error; } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (NFS_ISV4(vp)) { @@ -829,13 +829,13 @@ nfs_close(struct vop_close_args *ap) ("nfs_close: dirty unflushed (%d) directio buffers\n", np->n_directio_asyncwr)); if (newnfs_directio_enable && (fmode & O_DIRECT) && (vp->v_type == VREG)) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); KASSERT((np->n_directio_opens > 0), ("nfs_close: unexpectedly value (0) of n_directio_opens\n")); np->n_directio_opens--; if (np->n_directio_opens == 0) np->n_flag &= ~NNONCACHE; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } if (localcred) NFSFREECRED(cred); @@ -859,10 +859,10 @@ nfs_getattr(struct vop_getattr_args *ap) /* * Update local times for special files. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & (NACC | NUPD)) np->n_flag |= NCHG; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * First look in the cache. */ @@ -976,14 +976,14 @@ nfs_setattr(struct vop_setattr_args *ap) * V_SAVE races that might setsize a lower * value. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); tsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_meta_setsize(vp, td, vap->va_size); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (np->n_flag & NMODIFIED) { tsize = np->n_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, vap->va_size == 0 ? 0 : V_SAVE, td, 1); if (error != 0) { @@ -996,34 +996,34 @@ nfs_setattr(struct vop_setattr_args *ap) */ nfscl_delegmodtime(vp); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); /* * np->n_size has already been set to vap->va_size * in ncl_meta_setsize(). We must set it again since * nfs_loadattrcache() could be called through * ncl_meta_setsize() and could modify np->n_size. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_vattr.na_size = np->n_size = vap->va_size; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } else { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if ((vap->va_mtime.tv_sec != VNOVAL || vap->va_atime.tv_sec != VNOVAL) && (np->n_flag & NMODIFIED) && vp->v_type == VREG) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); error = ncl_vinvalbuf(vp, V_SAVE, td, 1); if (error == EINTR || error == EIO) return (error); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } error = nfs_setattrrpc(vp, vap, ap->a_cred, td); if (error && vap->va_size != VNOVAL) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_size = np->n_vattr.na_size = tsize; vnode_pager_setsize(vp, tsize); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } return (error); } @@ -1040,11 +1040,11 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, st struct nfsvattr nfsva; if (NFS_ISV34(vp)) { - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); for (i = 0; i < NFS_ACCESSCACHESIZE; i++) np->n_accesscache[i].stamp = 0; np->n_flag |= NDELEGMOD; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ACCESSCACHE_FLUSH_DONE(vp); } error = nfsrpc_setattr(vp, vap, NULL, cred, td, &nfsva, &attrflag, @@ -1092,12 +1092,12 @@ nfs_lookup(struct vop_lookup_args *ap) np = VTONFS(dvp); /* For NFSv4, wait until any remove is done. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); while (NFSHASNFSV4(nmp) && (np->n_flag & NREMOVEINPROG)) { np->n_flag |= NREMOVEWANT; (void) msleep((caddr_t)np, &np->n_mtx, PZERO, "nfslkup", 0); } - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) return (error); @@ -1139,10 +1139,10 @@ nfs_lookup(struct vop_lookup_args *ap) if (!(nmp->nm_flag & NFSMNT_NOCTO) && (flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { - mtx_lock(&newnp->n_mtx); + NFSLOCKNODE(newnp); newnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); - mtx_unlock(&newnp->n_mtx); + NFSUNLOCKNODE(newnp); } if (nfscl_nodeleg(newvp, 0) == 0 || ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && @@ -1224,14 +1224,14 @@ nfs_lookup(struct vop_lookup_args *ap) * has changed. Don't bother adding the entry * if the directory has already changed. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); if (timespeccmp(&np->n_vattr.na_mtime, &dnfsva.na_mtime, ==)) { - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); cache_enter_time(dvp, NULL, cnp, &dnfsva.na_mtime, NULL); } else - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } return (ENOENT); } @@ -1319,10 +1319,10 @@ nfs_lookup(struct vop_lookup_args *ap) * are fetched in nfs_open() since we did not * fetch attributes from the LOOKUP reply. */ - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); } } if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) @@ -1516,13 +1516,13 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, st vap->va_gid); } dnp = VTONFS(dvp); - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); dnp->n_flag |= NMODIFIED; if (!dattrflag) { dnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); return (error); } @@ -1593,12 +1593,12 @@ nfs_create(struct vop_create_args *ap) nmp = VFSTONFS(vnode_mount(dvp)); again: /* For NFSv4, wait until any remove is done. */ - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); while (NFSHASNFSV4(nmp) && (dnp->n_flag & NREMOVEINPROG)) { dnp->n_flag |= NREMOVEWANT; (void) msleep((caddr_t)dnp, &dnp->n_mtx, PZERO, "nfscrt", 0); } - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); cverf = nfs_get_cverf(); error = nfsrpc_create(dvp, cnp->cn_nameptr, cnp->cn_namelen, @@ -1664,13 +1664,13 @@ again: error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, vap->va_gid); } - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); dnp->n_flag |= NMODIFIED; if (!dattrflag) { dnp->n_attrstamp = 0; KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); return (error); } @@ -1729,9 +1729,9 @@ nfs_remove(struct vop_remove_args *ap) error = 0; } else if (!np->n_sillyrename) error = nfs_sillyrename(dvp, vp, cnp); - mtx_lock(&np->n_mtx); + NFSLOCKNODE(np); np->n_attrstamp = 0; - mtx_unlock(&np->n_mtx); + NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); return (error); } @@ -1763,29 +1763,29 @@ nfs_removerpc(struct vnode *dvp, struct vnode *vp, cha struct nfsnode *dnp = VTONFS(dvp); int error = 0, dattrflag; - mtx_lock(&dnp->n_mtx); + NFSLOCKNODE(dnp); dnp->n_flag |= NREMOVEINPROG; - mtx_unlock(&dnp->n_mtx); + NFSUNLOCKNODE(dnp); error = nfsrpc_remove(dvp, name, namelen, vp, cred, td, &dnfsva, &dattrflag, NULL); - mtx_lock(&dnp->n_mtx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Sep 24 12:21: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 D960E125086; Tue, 24 Sep 2019 12:21:02 +0000 (UTC) (envelope-from yuripv@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 46d0f65W5Pz4PrF; Tue, 24 Sep 2019 12:21:02 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A1821271DF; Tue, 24 Sep 2019 12:21:02 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8OCL2EO026600; Tue, 24 Sep 2019 12:21:02 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OCL2Wr026598; Tue, 24 Sep 2019 12:21:02 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201909241221.x8OCL2Wr026598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Tue, 24 Sep 2019 12:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352651 - head/lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/lib/libc/regex X-SVN-Commit-Revision: 352651 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, 24 Sep 2019 12:21:02 -0000 Author: yuripv Date: Tue Sep 24 12:21:01 2019 New Revision: 352651 URL: https://svnweb.freebsd.org/changeset/base/352651 Log: lib/libc/regex: fix build with REDEBUG defined Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D21760 Modified: head/lib/libc/regex/engine.c head/lib/libc/regex/regcomp.c Modified: head/lib/libc/regex/engine.c ============================================================================== --- head/lib/libc/regex/engine.c Tue Sep 24 06:37:01 2019 (r352650) +++ head/lib/libc/regex/engine.c Tue Sep 24 12:21:01 2019 (r352651) @@ -1068,7 +1068,7 @@ print(struct match *m, fprintf(d, " %s", pchar(ch)); for (i = 0; i < g->nstates; i++) if (ISSET(st, i)) { - fprintf(d, "%s%d", (first) ? "\t" : ", ", i); + fprintf(d, "%s%lu", (first) ? "\t" : ", ", i); first = 0; } fprintf(d, "\n"); Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Tue Sep 24 06:37:01 2019 (r352650) +++ head/lib/libc/regex/regcomp.c Tue Sep 24 12:21:01 2019 (r352651) @@ -196,12 +196,6 @@ static char nuls[10]; /* place to point scanner in ev #define THERETHERE() (p->slen - 2) #define DROP(n) (p->slen -= (n)) -#ifndef NDEBUG -static int never = 0; /* for use in asserts; shuts lint up */ -#else -#define never 0 /* some s have bugs too */ -#endif - /* Macro used by computejump()/computematchjump() */ #define MIN(a,b) ((a)<(b)?(a):(b)) From owner-svn-src-head@freebsd.org Tue Sep 24 13:15: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 AA28C1266D9; Tue, 24 Sep 2019 13:15:25 +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 46d1rs3k7Bz4SGV; Tue, 24 Sep 2019 13:15:25 +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 62B1F27C7A; Tue, 24 Sep 2019 13:15:25 +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 x8ODFP04060301; Tue, 24 Sep 2019 13:15:25 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ODFPlq060300; Tue, 24 Sep 2019 13:15:25 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909241315.x8ODFPlq060300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 24 Sep 2019 13:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352652 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352652 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, 24 Sep 2019 13:15:25 -0000 Author: tuexen Date: Tue Sep 24 13:15:24 2019 New Revision: 352652 URL: https://svnweb.freebsd.org/changeset/base/352652 Log: Plumb a memory leak. Thnanks to Felix Weinrank for finding this issue using fuzz testing and reporting it for the userland stack: https://github.com/sctplab/usrsctp/issues/378 MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Sep 24 12:21:01 2019 (r352651) +++ head/sys/netinet/sctp_indata.c Tue Sep 24 13:15:24 2019 (r352652) @@ -472,6 +472,11 @@ sctp_clean_up_control(struct sctp_tcb *stcb, struct sc chk->data = NULL; sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } + sctp_free_remote_addr(control->whoFrom); + if (control->data) { + sctp_m_freem(control->data); + control->data = NULL; + } sctp_free_a_readq(stcb, control); } From owner-svn-src-head@freebsd.org Tue Sep 24 16:45: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 64F3C12AC6D; Tue, 24 Sep 2019 16:45:35 +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 46d6WM20phz4fXQ; Tue, 24 Sep 2019 16:45:35 +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 23C8A22A7; Tue, 24 Sep 2019 16:45:35 +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 x8OGjYnj084286; Tue, 24 Sep 2019 16:45:34 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OGjY2p084285; Tue, 24 Sep 2019 16:45:34 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <201909241645.x8OGjY2p084285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard Date: Tue, 24 Sep 2019 16:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352653 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 352653 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, 24 Sep 2019 16:45:35 -0000 Author: olivier (ports committer) Date: Tue Sep 24 16:45:34 2019 New Revision: 352653 URL: https://svnweb.freebsd.org/changeset/base/352653 Log: Fix coredump_phnum_test in case of kern.compress_user_cores=1 PR: 240783 Approved by: ngie, lwhsu MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21776 Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Tue Sep 24 13:15:24 2019 (r352652) +++ head/tests/sys/kern/coredump_phnum_test.sh Tue Sep 24 16:45:34 2019 (r352653) @@ -45,10 +45,12 @@ coredump_phnum_body() ulimit -c '$(ulimit -c)' sysctl kern.coredump=$(sysctl -n kern.coredump) sysctl kern.corefile='$(sysctl -n kern.corefile)' + sysctl kern.compress_user_cores='$(sysctl -n kern.compress_user_cores)' EOF ulimit -c unlimited sysctl kern.coredump=1 + sysctl kern.compress_user_cores=0 sysctl kern.corefile="$(pwd)/coredump_phnum_helper.core" atf_check -s signal:sigabrt "$(atf_get_srcdir)/coredump_phnum_helper" From owner-svn-src-head@freebsd.org Tue Sep 24 16: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 BD68512AD49; Tue, 24 Sep 2019 16:49:42 +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 46d6c64fzJz4fm6; Tue, 24 Sep 2019 16:49:42 +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 7F21D22B1; Tue, 24 Sep 2019 16:49:42 +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 x8OGngWF084520; Tue, 24 Sep 2019 16:49:42 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OGngKo084519; Tue, 24 Sep 2019 16:49:42 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <201909241649.x8OGngKo084519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard Date: Tue, 24 Sep 2019 16:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352654 - head/sys/dev/pccard X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/sys/dev/pccard X-SVN-Commit-Revision: 352654 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, 24 Sep 2019 16:49:42 -0000 Author: olivier (ports committer) Date: Tue Sep 24 16:49:42 2019 New Revision: 352654 URL: https://svnweb.freebsd.org/changeset/base/352654 Log: Fix a minor typo Approved by: lwhsu MFC after: 1 month Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19970 Modified: head/sys/dev/pccard/pccard.c Modified: head/sys/dev/pccard/pccard.c ============================================================================== --- head/sys/dev/pccard/pccard.c Tue Sep 24 16:45:34 2019 (r352653) +++ head/sys/dev/pccard/pccard.c Tue Sep 24 16:49:42 2019 (r352654) @@ -266,7 +266,7 @@ pccard_probe_and_attach_child(device_t dev, device_t c * In NetBSD, the drivers are responsible for activating each * function of a card and selecting the config to use. In * FreeBSD, all that's done automatically in the typical lazy - * way we do device resoruce allocation (except we pick the + * way we do device resource allocation (except we pick the * cfe up front). This is the biggest depature from the * inherited NetBSD model, apart from the FreeBSD resource code. * From owner-svn-src-head@freebsd.org Tue Sep 24 17:03: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 CB9FA12B5E4; Tue, 24 Sep 2019 17:03:31 +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 46d6w34dyvz3CnX; Tue, 24 Sep 2019 17:03:31 +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 838D12659; Tue, 24 Sep 2019 17:03:31 +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 x8OH3VGq096102; Tue, 24 Sep 2019 17:03:31 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OH3VoG096101; Tue, 24 Sep 2019 17:03:31 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201909241703.x8OH3VoG096101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 24 Sep 2019 17:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352655 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 352655 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, 24 Sep 2019 17:03:31 -0000 Author: erj Date: Tue Sep 24 17:03:31 2019 New Revision: 352655 URL: https://svnweb.freebsd.org/changeset/base/352655 Log: iflib: Remove redundant VLAN events deregistration From Piotr: r351152 introduced iflib_deregister() function calling EVENTHANDLER_DEREGISTER() to unregister VLAN events. This patch removes duplicate of EVENTHANDLER_DEREGISTER() calls placed in iflib_device_deregister() as this function is now calling iflib_deregister(). This is to avoid deregistering same event twice. This patch also adds check in iflib_vlan_register() to prevent registering VLAN while being in detach. Patch co-authored by Krzysztof Galazka , erj and Jacob Keller . Signed-off-by: Piotr Pietruszewski Submitted by: Piotr Pietruszewski Reviewed by: gallatin@, erj@ MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21711 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Sep 24 16:49:42 2019 (r352654) +++ head/sys/net/iflib.c Tue Sep 24 17:03:31 2019 (r352655) @@ -4280,6 +4280,9 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag if ((vtag == 0) || (vtag > 4095)) return; + if (iflib_in_detach(ctx)) + return; + CTX_LOCK(ctx); IFDI_VLAN_REGISTER(ctx, vtag); /* Re-init to load the changes */ @@ -5078,12 +5081,6 @@ iflib_device_deregister(if_ctx_t ctx) CTX_LOCK(ctx); iflib_stop(ctx); CTX_UNLOCK(ctx); - - /* Unregister VLAN events */ - if (ctx->ifc_vlan_attach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event); - if (ctx->ifc_vlan_detach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event); iflib_netmap_detach(ifp); ether_ifdetach(ifp); From owner-svn-src-head@freebsd.org Tue Sep 24 17:06: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 F120712B7C4; Tue, 24 Sep 2019 17:06:33 +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 46d6zY5XhSz3D73; Tue, 24 Sep 2019 17:06:33 +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 87C4F266F; Tue, 24 Sep 2019 17:06:33 +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 x8OH6XcR096281; Tue, 24 Sep 2019 17:06:33 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OH6WJq096278; Tue, 24 Sep 2019 17:06:32 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201909241706.x8OH6WJq096278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 24 Sep 2019 17:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352656 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 352656 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, 24 Sep 2019 17:06:34 -0000 Author: erj Date: Tue Sep 24 17:06:32 2019 New Revision: 352656 URL: https://svnweb.freebsd.org/changeset/base/352656 Log: ix, ixv: Read msix_bar from device configuration Instead of predicting the MSI-X bar index based on the device's MAC type, read it from the device's PCI configuration instead. PR: 239704 Submitted by: Piotr Pietruszewski Reviewed by: erj@ MFC after: 3 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21547 Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Tue Sep 24 17:03:31 2019 (r352655) +++ head/sys/dev/ixgbe/if_ix.c Tue Sep 24 17:06:32 2019 (r352656) @@ -1012,12 +1012,13 @@ ixgbe_if_attach_pre(if_ctx_t ctx) CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_TSO; if (adapter->hw.mac.type == ixgbe_mac_82598EB) { scctx->isc_tx_nsegments = IXGBE_82598_SCATTER; - scctx->isc_msix_bar = PCIR_BAR(MSIX_82598_BAR); } else { scctx->isc_tx_csum_flags |= CSUM_SCTP |CSUM_IP6_SCTP; scctx->isc_tx_nsegments = IXGBE_82599_SCATTER; - scctx->isc_msix_bar = PCIR_BAR(MSIX_82599_BAR); } + + scctx->isc_msix_bar = pci_msix_table_bar(dev); + scctx->isc_tx_tso_segments_max = scctx->isc_tx_nsegments; scctx->isc_tx_tso_size_max = IXGBE_TSO_SIZE; scctx->isc_tx_tso_segsize_max = PAGE_SIZE; Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Tue Sep 24 17:03:31 2019 (r352655) +++ head/sys/dev/ixgbe/if_ixv.c Tue Sep 24 17:06:32 2019 (r352656) @@ -494,7 +494,7 @@ ixv_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_TSO | CSUM_IP6_TCP | CSUM_IP6_UDP | CSUM_IP6_TSO; scctx->isc_tx_nsegments = IXGBE_82599_SCATTER; - scctx->isc_msix_bar = PCIR_BAR(MSIX_82598_BAR); + scctx->isc_msix_bar = pci_msix_table_bar(dev); scctx->isc_tx_tso_segments_max = scctx->isc_tx_nsegments; scctx->isc_tx_tso_size_max = IXGBE_TSO_SIZE; scctx->isc_tx_tso_segsize_max = PAGE_SIZE; Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Tue Sep 24 17:03:31 2019 (r352655) +++ head/sys/dev/ixgbe/ixgbe.h Tue Sep 24 17:06:32 2019 (r352656) @@ -189,8 +189,6 @@ #define MAX_NUM_MULTICAST_ADDRESSES 128 #define IXGBE_82598_SCATTER 100 #define IXGBE_82599_SCATTER 32 -#define MSIX_82598_BAR 3 -#define MSIX_82599_BAR 4 #define IXGBE_TSO_SIZE 262140 #define IXGBE_RX_HDR 128 #define IXGBE_VFTA_SIZE 128 From owner-svn-src-head@freebsd.org Tue Sep 24 18:18: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 30BF712D7AD; Tue, 24 Sep 2019 18:18:13 +0000 (UTC) (envelope-from rrs@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 46d8ZF1Gkxz3KdV; Tue, 24 Sep 2019 18:18:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0F91433CE; Tue, 24 Sep 2019 18:18:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8OIIDFW039675; Tue, 24 Sep 2019 18:18:13 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OIIBNr039667; Tue, 24 Sep 2019 18:18:11 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201909241818.x8OIIBNr039667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 24 Sep 2019 18:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352657 - in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys X-SVN-Commit-Revision: 352657 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, 24 Sep 2019 18:18:13 -0000 Author: rrs Date: Tue Sep 24 18:18:11 2019 New Revision: 352657 URL: https://svnweb.freebsd.org/changeset/base/352657 Log: This commit adds BBR (Bottleneck Bandwidth and RTT) congestion control. This is a completely separate TCP stack (tcp_bbr.ko) that will be built only if you add the make options WITH_EXTRA_TCP_STACKS=1 and also include the option TCPHPTS. You can also include the RATELIMIT option if you have a NIC interface that supports hardware pacing, BBR understands how to use such a feature. Note that this commit also adds in a general purpose time-filter which allows you to have a min-filter or max-filter. A filter allows you to have a low (or high) value for some period of time and degrade slowly to another value has time passes. You can find out the details of BBR by looking at the original paper at: https://queue.acm.org/detail.cfm?id=3022184 or consult many other web resources you can find on the web referenced by "BBR congestion control". It should be noted that BBRv1 (which this is) does tend to unfairness in cases of small buffered paths, and it will usually get less bandwidth in the case of large BDP paths(when competing with new-reno or cubic flows). BBR is still an active research area and we do plan on implementing V2 of BBR to see if it is an improvement over V1. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D21582 Added: head/sys/kern/subr_filter.c (contents, props changed) head/sys/modules/tcp/bbr/ head/sys/modules/tcp/bbr/Makefile (contents, props changed) head/sys/netinet/tcp_stacks/bbr.c (contents, props changed) head/sys/netinet/tcp_stacks/tcp_bbr.h (contents, props changed) head/sys/sys/tim_filter.h (contents, props changed) Modified: head/sys/conf/files head/sys/modules/tcp/Makefile head/sys/netinet/ip_output.c head/sys/netinet/ip_var.h head/sys/netinet/tcp.h head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/rack_bbr_common.c head/sys/netinet/tcp_stacks/rack_bbr_common.h head/sys/netinet/tcp_stacks/sack_filter.c head/sys/netinet/tcp_stacks/sack_filter.h head/sys/netinet/tcp_stacks/tcp_rack.h head/sys/sys/mbuf.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 24 17:06:32 2019 (r352656) +++ head/sys/conf/files Tue Sep 24 18:18:11 2019 (r352657) @@ -3808,6 +3808,7 @@ kern/subr_epoch.c standard kern/subr_eventhandler.c standard kern/subr_fattime.c standard kern/subr_firmware.c optional firmware +kern/subr_filter.c standard kern/subr_gtaskqueue.c standard kern/subr_hash.c standard kern/subr_hints.c standard Added: head/sys/kern/subr_filter.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/subr_filter.c Tue Sep 24 18:18:11 2019 (r352657) @@ -0,0 +1,482 @@ +/*- + * Copyright (c) 2016-2019 Netflix, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ + +/* + * Author: Randall Stewart + */ +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include + +void +reset_time(struct time_filter *tf, uint32_t time_len) +{ + tf->cur_time_limit = time_len; +} + +void +reset_time_small(struct time_filter_small *tf, uint32_t time_len) +{ + tf->cur_time_limit = time_len; +} + +/* + * A time filter can be a filter for MIN or MAX. + * You call setup_time_filter() with the pointer to + * the filter structure, the type (FILTER_TYPE_MIN/MAX) and + * the time length. You can optionally reset the time length + * later with reset_time(). + * + * You generally call apply_filter_xxx() to apply the new value + * to the filter. You also provide a time (now). The filter will + * age out entries based on the time now and your time limit + * so that you are always maintaining the min or max in that + * window of time. Time is a relative thing, it might be ticks + * in milliseconds, it might be round trip times, its really + * up to you to decide what it is. + * + * To access the current flitered value you can use the macro + * get_filter_value() which returns the correct entry that + * has the "current" value in the filter. + * + * One thing that used to be here is a single apply_filter(). But + * this meant that we then had to store the type of filter in + * the time_filter structure. In order to keep it at a cache + * line size I split it to two functions. + * + */ +int +setup_time_filter(struct time_filter *tf, int fil_type, uint32_t time_len) +{ + uint64_t set_val; + int i; + + /* + * You must specify either a MIN or MAX filter, + * though its up to the user to use the correct + * apply. + */ + if ((fil_type != FILTER_TYPE_MIN) && + (fil_type != FILTER_TYPE_MAX)) + return(EINVAL); + + if (time_len < NUM_FILTER_ENTRIES) + return(EINVAL); + + if (fil_type == FILTER_TYPE_MIN) + set_val = 0xffffffffffffffff; + else + set_val = 0; + + for(i=0; ientries[i].value = set_val; + tf->entries[i].time_up = 0; + } + tf->cur_time_limit = time_len; + return(0); +} + +int +setup_time_filter_small(struct time_filter_small *tf, int fil_type, uint32_t time_len) +{ + uint32_t set_val; + int i; + + /* + * You must specify either a MIN or MAX filter, + * though its up to the user to use the correct + * apply. + */ + if ((fil_type != FILTER_TYPE_MIN) && + (fil_type != FILTER_TYPE_MAX)) + return(EINVAL); + + if (time_len < NUM_FILTER_ENTRIES) + return(EINVAL); + + if (fil_type == FILTER_TYPE_MIN) + set_val = 0xffffffff; + else + set_val = 0; + + for(i=0; ientries[i].value = set_val; + tf->entries[i].time_up = 0; + } + tf->cur_time_limit = time_len; + return(0); +} + + +static void +check_update_times(struct time_filter *tf, uint64_t value, uint32_t now) +{ + int i, j, fnd; + uint32_t tim; + uint32_t time_limit; + for(i=0; i<(NUM_FILTER_ENTRIES-1); i++) { + tim = now - tf->entries[i].time_up; + time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; + if (tim >= time_limit) { + fnd = 0; + for(j=(i+1); jentries[i].time_up < tf->entries[j].time_up) { + tf->entries[i].value = tf->entries[j].value; + tf->entries[i].time_up = tf->entries[j].time_up; + fnd = 1; + break; + } + } + if (fnd == 0) { + /* Nothing but the same old entry */ + tf->entries[i].value = value; + tf->entries[i].time_up = now; + } + } + } + i = NUM_FILTER_ENTRIES-1; + tim = now - tf->entries[i].time_up; + time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; + if (tim >= time_limit) { + tf->entries[i].value = value; + tf->entries[i].time_up = now; + } +} + +static void +check_update_times_small(struct time_filter_small *tf, uint32_t value, uint32_t now) +{ + int i, j, fnd; + uint32_t tim; + uint32_t time_limit; + for(i=0; i<(NUM_FILTER_ENTRIES-1); i++) { + tim = now - tf->entries[i].time_up; + time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; + if (tim >= time_limit) { + fnd = 0; + for(j=(i+1); jentries[i].time_up < tf->entries[j].time_up) { + tf->entries[i].value = tf->entries[j].value; + tf->entries[i].time_up = tf->entries[j].time_up; + fnd = 1; + break; + } + } + if (fnd == 0) { + /* Nothing but the same old entry */ + tf->entries[i].value = value; + tf->entries[i].time_up = now; + } + } + } + i = NUM_FILTER_ENTRIES-1; + tim = now - tf->entries[i].time_up; + time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; + if (tim >= time_limit) { + tf->entries[i].value = value; + tf->entries[i].time_up = now; + } +} + + + +void +filter_reduce_by(struct time_filter *tf, uint64_t reduce_by, uint32_t now) +{ + int i; + /* + * Reduce our filter main by reduce_by and + * update its time. Then walk other's and + * make them the new value too. + */ + if (reduce_by < tf->entries[0].value) + tf->entries[0].value -= reduce_by; + else + tf->entries[0].value = 0; + tf->entries[0].time_up = now; + for(i=1; ientries[i].value = tf->entries[0].value; + tf->entries[i].time_up = now; + } +} + +void +filter_reduce_by_small(struct time_filter_small *tf, uint32_t reduce_by, uint32_t now) +{ + int i; + /* + * Reduce our filter main by reduce_by and + * update its time. Then walk other's and + * make them the new value too. + */ + if (reduce_by < tf->entries[0].value) + tf->entries[0].value -= reduce_by; + else + tf->entries[0].value = 0; + tf->entries[0].time_up = now; + for(i=1; ientries[i].value = tf->entries[0].value; + tf->entries[i].time_up = now; + } +} + +void +filter_increase_by(struct time_filter *tf, uint64_t incr_by, uint32_t now) +{ + int i; + /* + * Increase our filter main by incr_by and + * update its time. Then walk other's and + * make them the new value too. + */ + tf->entries[0].value += incr_by; + tf->entries[0].time_up = now; + for(i=1; ientries[i].value = tf->entries[0].value; + tf->entries[i].time_up = now; + } +} + +void +filter_increase_by_small(struct time_filter_small *tf, uint32_t incr_by, uint32_t now) +{ + int i; + /* + * Increase our filter main by incr_by and + * update its time. Then walk other's and + * make them the new value too. + */ + tf->entries[0].value += incr_by; + tf->entries[0].time_up = now; + for(i=1; ientries[i].value = tf->entries[0].value; + tf->entries[i].time_up = now; + } +} + +void +forward_filter_clock(struct time_filter *tf, uint32_t ticks_forward) +{ + /* + * Bring forward all time values by N ticks. This + * postpones expiring slots by that amount. + */ + int i; + + for(i=0; ientries[i].time_up += ticks_forward; + } +} + + +void +forward_filter_clock_small(struct time_filter_small *tf, uint32_t ticks_forward) +{ + /* + * Bring forward all time values by N ticks. This + * postpones expiring slots by that amount. + */ + int i; + + for(i=0; ientries[i].time_up += ticks_forward; + } +} + + +void +tick_filter_clock(struct time_filter *tf, uint32_t now) +{ + int i; + uint32_t tim, time_limit; + + /* + * We start at two positions back. This + * is because the oldest worst value is + * preserved always, i.e. it can't expire + * due to clock ticking with no updated value. + * + * The other choice would be to fill it in with + * zero, but I don't like that option since + * some measurement is better than none (even + * if its your oldest measurment). + */ + for(i=(NUM_FILTER_ENTRIES-2); i>=0 ; i--) { + tim = now - tf->entries[i].time_up; + time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; + if (tim >= time_limit) { + /* + * This entry is expired, pull down + * the next one up. + */ + tf->entries[i].value = tf->entries[(i+1)].value; + tf->entries[i].time_up = tf->entries[(i+1)].time_up; + } + + } +} + +void +tick_filter_clock_small(struct time_filter_small *tf, uint32_t now) +{ + int i; + uint32_t tim, time_limit; + + /* + * We start at two positions back. This + * is because the oldest worst value is + * preserved always, i.e. it can't expire + * due to clock ticking with no updated value. + * + * The other choice would be to fill it in with + * zero, but I don't like that option since + * some measurement is better than none (even + * if its your oldest measurment). + */ + for(i=(NUM_FILTER_ENTRIES-2); i>=0 ; i--) { + tim = now - tf->entries[i].time_up; + time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; + if (tim >= time_limit) { + /* + * This entry is expired, pull down + * the next one up. + */ + tf->entries[i].value = tf->entries[(i+1)].value; + tf->entries[i].time_up = tf->entries[(i+1)].time_up; + } + + } +} + +uint32_t +apply_filter_min(struct time_filter *tf, uint64_t value, uint32_t now) +{ + int i, j; + + if (value <= tf->entries[0].value) { + /* Zap them all */ + for(i=0; ientries[i].value = value; + tf->entries[i].time_up = now; + } + return (tf->entries[0].value); + } + for (j=1; jentries[j].value) { + for(i=j; ientries[i].value = value; + tf->entries[i].time_up = now; + } + break; + } + } + check_update_times(tf, value, now); + return (tf->entries[0].value); +} + +uint32_t +apply_filter_min_small(struct time_filter_small *tf, + uint32_t value, uint32_t now) +{ + int i, j; + + if (value <= tf->entries[0].value) { + /* Zap them all */ + for(i=0; ientries[i].value = value; + tf->entries[i].time_up = now; + } + return (tf->entries[0].value); + } + for (j=1; jentries[j].value) { + for(i=j; ientries[i].value = value; + tf->entries[i].time_up = now; + } + break; + } + } + check_update_times_small(tf, value, now); + return (tf->entries[0].value); +} + +uint32_t +apply_filter_max(struct time_filter *tf, uint64_t value, uint32_t now) +{ + int i, j; + + if (value >= tf->entries[0].value) { + /* Zap them all */ + for(i=0; ientries[i].value = value; + tf->entries[i].time_up = now; + } + return (tf->entries[0].value); + } + for (j=1; j= tf->entries[j].value) { + for(i=j; ientries[i].value = value; + tf->entries[i].time_up = now; + } + break; + } + } + check_update_times(tf, value, now); + return (tf->entries[0].value); +} + + +uint32_t +apply_filter_max_small(struct time_filter_small *tf, + uint32_t value, uint32_t now) +{ + int i, j; + + if (value >= tf->entries[0].value) { + /* Zap them all */ + for(i=0; ientries[i].value = value; + tf->entries[i].time_up = now; + } + return (tf->entries[0].value); + } + for (j=1; j= tf->entries[j].value) { + for(i=j; ientries[i].value = value; + tf->entries[i].time_up = now; + } + break; + } + } + check_update_times_small(tf, value, now); + return (tf->entries[0].value); +} Modified: head/sys/modules/tcp/Makefile ============================================================================== --- head/sys/modules/tcp/Makefile Tue Sep 24 17:06:32 2019 (r352656) +++ head/sys/modules/tcp/Makefile Tue Sep 24 18:18:11 2019 (r352657) @@ -6,10 +6,12 @@ SYSDIR?=${SRCTOP}/sys .include "${SYSDIR}/conf/kern.opts.mk" SUBDIR= \ + ${_tcp_bbr} \ ${_tcp_rack} \ ${_tcpmd5} \ .if ${MK_EXTRA_TCP_STACKS} != "no" || defined(ALL_MODULES) +_tcp_bbr= bbr _tcp_rack= rack .endif Added: head/sys/modules/tcp/bbr/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/tcp/bbr/Makefile Tue Sep 24 18:18:11 2019 (r352657) @@ -0,0 +1,23 @@ +# +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/../../../netinet/tcp_stacks + +STACKNAME= bbr +KMOD= tcp_${STACKNAME} +SRCS= bbr.c sack_filter.c rack_bbr_common.c + +SRCS+= opt_inet.h opt_inet6.h opt_ipsec.h +SRCS+= opt_tcpdebug.h +SRCS+= opt_kern_tls.h + +# +# Enable full debugging +# +#CFLAGS += -g + +CFLAGS+= -DMODNAME=${KMOD} +CFLAGS+= -DSTACKNAME=${STACKNAME} + +.include Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Tue Sep 24 17:06:32 2019 (r352656) +++ head/sys/netinet/ip_output.c Tue Sep 24 18:18:11 2019 (r352657) @@ -212,7 +212,7 @@ ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, in static int ip_output_send(struct inpcb *inp, struct ifnet *ifp, struct mbuf *m, - const struct sockaddr_in *gw, struct route *ro) + const struct sockaddr_in *gw, struct route *ro, bool stamp_tag) { #ifdef KERN_TLS struct ktls_session *tls = NULL; @@ -256,7 +256,7 @@ ip_output_send(struct inpcb *inp, struct ifnet *ifp, s mst = inp->inp_snd_tag; } #endif - if (mst != NULL) { + if (stamp_tag && mst != NULL) { KASSERT(m->m_pkthdr.rcvif == NULL, ("trying to add a send tag to a forwarded packet")); if (mst->ifp != ifp) { @@ -791,7 +791,8 @@ sendit: */ m_clrprotoflags(m); IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); - error = ip_output_send(inp, ifp, m, gw, ro); + error = ip_output_send(inp, ifp, m, gw, ro, + (flags & IP_NO_SND_TAG_RL) ? false : true); goto done; } @@ -827,7 +828,7 @@ sendit: IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp, mtod(m, struct ip *), NULL); - error = ip_output_send(inp, ifp, m, gw, ro); + error = ip_output_send(inp, ifp, m, gw, ro, true); } else m_freem(m); } Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Tue Sep 24 17:06:32 2019 (r352656) +++ head/sys/netinet/ip_var.h Tue Sep 24 18:18:11 2019 (r352657) @@ -166,6 +166,7 @@ void kmod_ipstat_dec(int statnum); #define IP_ROUTETOIF SO_DONTROUTE /* 0x10 bypass routing tables */ #define IP_ALLOWBROADCAST SO_BROADCAST /* 0x20 can send broadcast packets */ #define IP_NODEFAULTFLOWID 0x40 /* Don't set the flowid from inp */ +#define IP_NO_SND_TAG_RL 0x80 /* Don't send down the ratelimit tag */ #ifdef __NO_STRICT_ALIGNMENT #define IP_HDR_ALIGNED_P(ip) 1 Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Tue Sep 24 17:06:32 2019 (r352656) +++ head/sys/netinet/tcp.h Tue Sep 24 18:18:11 2019 (r352657) @@ -239,6 +239,7 @@ struct tcphdr { #define TCP_BBR_ACK_COMP_ALG 1096 /* Not used */ #define TCP_BBR_TMR_PACE_OH 1096 /* Recycled in 4.2 */ #define TCP_BBR_EXTRA_GAIN 1097 +#define TCP_RACK_DO_DETECTION 1097 /* Recycle of extra gain for rack, attack detection */ #define TCP_BBR_RACK_RTT_USE 1098 /* what RTT should we use 0, 1, or 2? */ #define TCP_BBR_RETRAN_WTSO 1099 #define TCP_DATA_AFTER_CLOSE 1100 Added: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/tcp_stacks/bbr.c Tue Sep 24 18:18:11 2019 (r352657) @@ -0,0 +1,15189 @@ +/*- + * Copyright (c) 2016-2019 + * Netflix Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + * + */ +/** + * Author: Randall Stewart + * This work is based on the ACM Queue paper + * BBR - Congestion Based Congestion Control + * and also numerous discussions with Neal, Yuchung and Van. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_ipsec.h" +#include "opt_tcpdebug.h" +#include "opt_ratelimit.h" +#include "opt_kern_tls.h" +#include +#include +#include +#ifdef TCP_HHOOK +#include +#endif +#include +#include +#include +#include +#include +#ifdef KERN_TLS +#include +#endif +#include +#include +#include +#include +#ifdef NETFLIX_STATS +#include /* Must come after qmath.h and tree.h */ +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define TCPSTATES /* for logging */ + +#include +#include +#include +#include +#include /* required for icmp_var.h */ +#include /* for ICMP_BANDLIM */ +#include +#include +#include +#include +#define TCPOUTFLAGS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef TCPDEBUG +#include +#endif /* TCPDEBUG */ +#ifdef TCP_OFFLOAD +#include +#endif +#ifdef INET6 +#include +#endif +#include + +#include +#include +#include +#include + +#if defined(IPSEC) || defined(IPSEC_SUPPORT) +#include +#include +#endif /* IPSEC */ + +#include +#include +#include + +#ifdef MAC +#include +#endif + +#include "sack_filter.h" +#include "tcp_bbr.h" +#include "rack_bbr_common.h" +uma_zone_t bbr_zone; +uma_zone_t bbr_pcb_zone; + +struct sysctl_ctx_list bbr_sysctl_ctx; +struct sysctl_oid *bbr_sysctl_root; + +#define TCPT_RANGESET_NOSLOP(tv, value, tvmin, tvmax) do { \ + (tv) = (value); \ + if ((u_long)(tv) < (u_long)(tvmin)) \ + (tv) = (tvmin); \ + if ((u_long)(tv) > (u_long)(tvmax)) \ + (tv) = (tvmax); \ +} while(0) + +/*#define BBR_INVARIANT 1*/ + +/* + * initial window + */ +static uint32_t bbr_def_init_win = 10; +static int32_t bbr_persist_min = 250000; /* 250ms */ +static int32_t bbr_persist_max = 1000000; /* 1 Second */ +static int32_t bbr_cwnd_may_shrink = 0; +static int32_t bbr_cwndtarget_rtt_touse = BBR_RTT_PROP; +static int32_t bbr_num_pktepo_for_del_limit = BBR_NUM_RTTS_FOR_DEL_LIMIT; +static int32_t bbr_hardware_pacing_limit = 8000; +static int32_t bbr_quanta = 3; /* How much extra quanta do we get? */ +static int32_t bbr_no_retran = 0; +static int32_t bbr_tcp_map_entries_limit = 1500; +static int32_t bbr_tcp_map_split_limit = 256; + +static int32_t bbr_error_base_paceout = 10000; /* usec to pace */ +static int32_t bbr_max_net_error_cnt = 10; +/* Should the following be dynamic too -- loss wise */ +static int32_t bbr_rtt_gain_thresh = 0; +/* Measurement controls */ +static int32_t bbr_use_google_algo = 1; +static int32_t bbr_ts_limiting = 1; +static int32_t bbr_ts_can_raise = 0; +static int32_t bbr_do_red = 600; +static int32_t bbr_red_scale = 20000; +static int32_t bbr_red_mul = 1; +static int32_t bbr_red_div = 2; +static int32_t bbr_red_growth_restrict = 1; +static int32_t bbr_target_is_bbunit = 0; +static int32_t bbr_drop_limit = 0; +/* + * How much gain do we need to see to + * stay in startup? + */ +static int32_t bbr_marks_rxt_sack_passed = 0; +static int32_t bbr_start_exit = 25; +static int32_t bbr_low_start_exit = 25; /* When we are in reduced gain */ +static int32_t bbr_startup_loss_thresh = 2000; /* 20.00% loss */ +static int32_t bbr_hptsi_max_mul = 1; /* These two mul/div assure a min pacing */ +static int32_t bbr_hptsi_max_div = 2; /* time, 0 means turned off. We need this + * if we go back ever to where the pacer + * has priority over timers. + */ +static int32_t bbr_policer_call_from_rack_to = 0; +static int32_t bbr_policer_detection_enabled = 1; +static int32_t bbr_min_measurements_req = 1; /* We need at least 2 + * measurments before we are + * "good" note that 2 == 1. + * This is because we use a > + * comparison. This means if + * min_measure was 0, it takes + * num-measures > min(0) and + * you get 1 measurement and + * you are good. Set to 1, you + * have to have two + * measurements (this is done + * to prevent it from being ok + * to have no measurements). */ +static int32_t bbr_no_pacing_until = 4; + +static int32_t bbr_min_usec_delta = 20000; /* 20,000 usecs */ +static int32_t bbr_min_peer_delta = 20; /* 20 units */ +static int32_t bbr_delta_percent = 150; /* 15.0 % */ + +static int32_t bbr_target_cwnd_mult_limit = 8; +/* + * bbr_cwnd_min_val is the number of + * segments we hold to in the RTT probe + * state typically 4. + */ +static int32_t bbr_cwnd_min_val = BBR_PROBERTT_NUM_MSS; + + +static int32_t bbr_cwnd_min_val_hs = BBR_HIGHSPEED_NUM_MSS; + +static int32_t bbr_gain_to_target = 1; +static int32_t bbr_gain_gets_extra_too = 1; +/* + * bbr_high_gain is the 2/ln(2) value we need + * to double the sending rate in startup. This + * is used for both cwnd and hptsi gain's. + */ +static int32_t bbr_high_gain = BBR_UNIT * 2885 / 1000 + 1; +static int32_t bbr_startup_lower = BBR_UNIT * 1500 / 1000 + 1; +static int32_t bbr_use_lower_gain_in_startup = 1; + +/* thresholds for reduction on drain in sub-states/drain */ +static int32_t bbr_drain_rtt = BBR_SRTT; +static int32_t bbr_drain_floor = 88; +static int32_t google_allow_early_out = 1; +static int32_t google_consider_lost = 1; +static int32_t bbr_drain_drop_mul = 4; +static int32_t bbr_drain_drop_div = 5; +static int32_t bbr_rand_ot = 50; +static int32_t bbr_can_force_probertt = 0; +static int32_t bbr_can_adjust_probertt = 1; +static int32_t bbr_probertt_sets_rtt = 0; +static int32_t bbr_can_use_ts_for_rtt = 1; +static int32_t bbr_is_ratio = 0; +static int32_t bbr_sub_drain_app_limit = 1; +static int32_t bbr_prtt_slam_cwnd = 1; +static int32_t bbr_sub_drain_slam_cwnd = 1; +static int32_t bbr_slam_cwnd_in_main_drain = 1; +static int32_t bbr_filter_len_sec = 6; /* How long does the rttProp filter + * hold */ +static uint32_t bbr_rtt_probe_limit = (USECS_IN_SECOND * 4); +/* + * bbr_drain_gain is the reverse of the high_gain + * designed to drain back out the standing queue + * that is formed in startup by causing a larger + * hptsi gain and thus drainging the packets + * in flight. + */ +static int32_t bbr_drain_gain = BBR_UNIT * 1000 / 2885; +static int32_t bbr_rttprobe_gain = 192; + +/* + * The cwnd_gain is the default cwnd gain applied when + * calculating a target cwnd. Note that the cwnd is + * a secondary factor in the way BBR works (see the + * paper and think about it, it will take some time). + * Basically the hptsi_gain spreads the packets out + * so you never get more than BDP to the peer even + * if the cwnd is high. In our implemenation that + * means in non-recovery/retransmission scenarios + * cwnd will never be reached by the flight-size. + */ +static int32_t bbr_cwnd_gain = BBR_UNIT * 2; +static int32_t bbr_tlp_type_to_use = BBR_SRTT; +static int32_t bbr_delack_time = 100000; /* 100ms in useconds */ +static int32_t bbr_sack_not_required = 0; /* set to one to allow non-sack to use bbr */ +static int32_t bbr_initial_bw_bps = 62500; /* 500kbps in bytes ps */ +static int32_t bbr_ignore_data_after_close = 1; +static int16_t bbr_hptsi_gain[] = { + (BBR_UNIT *5 / 4), + (BBR_UNIT * 3 / 4), + BBR_UNIT, + BBR_UNIT, + BBR_UNIT, + BBR_UNIT, + BBR_UNIT, + BBR_UNIT +}; +int32_t bbr_use_rack_resend_cheat = 1; +int32_t bbr_sends_full_iwnd = 1; + +#define BBR_HPTSI_GAIN_MAX 8 +/* + * The BBR module incorporates a number of + * TCP ideas that have been put out into the IETF + * over the last few years: + * - Yuchung Cheng's RACK TCP (for which its named) that + * will stop us using the number of dup acks and instead + * use time as the gage of when we retransmit. + * - Reorder Detection of RFC4737 and the Tail-Loss probe draft + * of Dukkipati et.al. + * - Van Jacobson's et.al BBR. + * + * RACK depends on SACK, so if an endpoint arrives that + * cannot do SACK the state machine below will shuttle the + * connection back to using the "default" TCP stack that is + * in FreeBSD. + * + * To implement BBR and RACK the original TCP stack was first decomposed + * into a functional state machine with individual states + * for each of the possible TCP connection states. The do_segement + * functions role in life is to mandate the connection supports SACK + * initially and then assure that the RACK state matches the conenction + * state before calling the states do_segment function. Data processing + * of inbound segments also now happens in the hpts_do_segment in general + * with only one exception. This is so we can keep the connection on + * a single CPU. + * + * Each state is simplified due to the fact that the original do_segment + * has been decomposed and we *know* what state we are in (no + * switches on the state) and all tests for SACK are gone. This + * greatly simplifies what each state does. + * + * TCP output is also over-written with a new version since it + * must maintain the new rack scoreboard and has had hptsi + * integrated as a requirment. Still todo is to eliminate the + * use of the callout_() system and use the hpts for all + * timers as well. + */ +static uint32_t bbr_rtt_probe_time = 200000; /* 200ms in micro seconds */ +static uint32_t bbr_rtt_probe_cwndtarg = 4; /* How many mss's outstanding */ +static const int32_t bbr_min_req_free = 2; /* The min we must have on the + * free list */ +static int32_t bbr_tlp_thresh = 1; +static int32_t bbr_reorder_thresh = 2; +static int32_t bbr_reorder_fade = 60000000; /* 0 - never fade, def + * 60,000,000 - 60 seconds */ +static int32_t bbr_pkt_delay = 1000; +static int32_t bbr_min_to = 1000; /* Number of usec's minimum timeout */ +static int32_t bbr_incr_timers = 1; + +static int32_t bbr_tlp_min = 10000; /* 10ms in usecs */ +static int32_t bbr_delayed_ack_time = 200000; /* 200ms in usecs */ +static int32_t bbr_exit_startup_at_loss = 1; + +/* + * bbr_lt_bw_ratio is 1/8th + * bbr_lt_bw_diff is < 4 Kbit/sec + */ +static uint64_t bbr_lt_bw_diff = 4000 / 8; /* In bytes per second */ +static uint64_t bbr_lt_bw_ratio = 8; /* For 1/8th */ +static uint32_t bbr_lt_bw_max_rtts = 48; /* How many rtt's do we use + * the lt_bw for */ +static uint32_t bbr_lt_intvl_min_rtts = 4; /* Min num of RTT's to measure + * lt_bw */ +static int32_t bbr_lt_intvl_fp = 0; /* False positive epoch diff */ +static int32_t bbr_lt_loss_thresh = 196; /* Lost vs delivered % */ +static int32_t bbr_lt_fd_thresh = 100; /* false detection % */ + +static int32_t bbr_verbose_logging = 0; +/* + * Currently regular tcp has a rto_min of 30ms + * the backoff goes 12 times so that ends up + * being a total of 122.850 seconds before a + * connection is killed. + */ +static int32_t bbr_rto_min_ms = 30; /* 30ms same as main freebsd */ +static int32_t bbr_rto_max_sec = 4; /* 4 seconds */ + +/****************************************************/ +/* DEFAULT TSO SIZING (cpu performance impacting) */ +/****************************************************/ +/* What amount is our formula using to get TSO size */ +static int32_t bbr_hptsi_per_second = 1000; + +/* + * For hptsi under bbr_cross_over connections what is delay + * target 7ms (in usec) combined with a seg_max of 2 + * gets us close to identical google behavior in + * TSO size selection (possibly more 1MSS sends). + */ +static int32_t bbr_hptsi_segments_delay_tar = 7000; + +/* Does pacing delay include overhead's in its time calculations? */ +static int32_t bbr_include_enet_oh = 0; +static int32_t bbr_include_ip_oh = 1; +static int32_t bbr_include_tcp_oh = 1; +static int32_t bbr_google_discount = 10; + +/* Do we use (nf mode) pkt-epoch to drive us or rttProp? */ +static int32_t bbr_state_is_pkt_epoch = 0; +static int32_t bbr_state_drain_2_tar = 1; +/* What is the max the 0 - bbr_cross_over MBPS TSO target + * can reach using our delay target. Note that this + * value becomes the floor for the cross over + * algorithm. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Sep 24 19:29:41 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 B02B312EEE9; Tue, 24 Sep 2019 19:29:41 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46dB8h47GBz3P7j; Tue, 24 Sep 2019 19:29:40 +0000 (UTC) (envelope-from ohartmann@walstatt.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1569353368; bh=igmhJ3+eSaZLKNLrRCAdRlqU0AxF8MnP4MoxHcvu++4=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=MH7fqeUWkEjojEDOrMiZR8hrYhGEJ2L2b6XKNO6rVLsOaDjbNiyfQW8w9btPeEsV7 Lu9HwOum3t//tl1/OXDcTTr9Nkjdn4u42D9Fdv+Uyo7qb5S/VBHQ+zPDmjGISbIu7p mytikCQTyg23mhPKqdczKlkseuFo6r1M4UXQd4d8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from thor.intern.walstatt.dynvpn.de ([78.55.203.44]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MbzuB-1hcOcZ2AUp-00dUTf; Tue, 24 Sep 2019 21:29:28 +0200 Date: Tue, 24 Sep 2019 21:28:51 +0200 From: "O. Hartmann" To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352657 - in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys Message-ID: <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201909241818.x8OIIBNr039667@repo.freebsd.org> References: <201909241818.x8OIIBNr039667@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:VtDhqBshUKi86Z48deJJOETipNbQhgZWQjIs271SvakXejvSCH4 IRdlEajR+DuizKtegWrcdhFqVcD+vwAel1jkEj/qzpBuHMn10HGIbO3ujqMmrLkpaMikfPI H8Z5A5w5l9caupWzB/WzUHYI1TDUgRm4p9jViiBMxVjkH8CDSELghHn2jugNoZSo1dvVlsJ +PgJ7HquJJOR8FhiaFqTQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:q1xws33WMeE=:H8ZvX1/9QEiCcvFT7qstpK HjbDkugYAz2uERG/UQNLnyTB/a+E/23wUEKKYlQXsU06tN9JaVM/nBA19JcfMDj57NB2SOIXG PmlTF4B+hpu2TAvA7IYsRjb2iobq/UccVxje94k2CXMA95QCIIvzZgy7lqheejEI0XzrOppmx y+EVrAbDhew2vfdQ5aRoTq4SxaQPBfOknHdCwEsz5edSy7DVXNEzzaXLmTAaDaS4dMeTNsqT2 SsWOSZxOH7lNoOe+gcnHwVFFI5w6Lpl8SdidI+c1F4ax/dq8bhMm/QLYNhwfZ5/QMPXRW3s/i 3m0b3QFc9IWQ7dFleyXNN4CO5JXI1E0Dz0vX9hR6wOB5jd/CMo/V44pRbDb+pArX9qoDRi/mw wqP1HPSS+qNmVVp9cv/YIHXrgKEsVezCtb99jHvAracZSIefVDTdOmmlrW5qF1BoqnZTp+Tax pSbnPRuU2Anw65v5f0zf+vZIzxg3suanSojTqvBXrAudJDMQ1UUMdmHn1lL8Q5uITqsFjZhB4 FZ0O3NvOBYrWmKrvVcpx0B/vjLNxv2d+s8Fd305+2nuAUQlQl8LjcxHhWwJSDi4RAjeiPc+FP oyY405XCO5CDy4Mce4IemDaA4pJUaq6izqqfNqZ0bZPQnSsLV5EKas/nmRcv88MIY5nT6Qrs9 qZVDfHYfYErFC0ry+GgD76ju7fx2+b4qusDa6/fq9Bh8j4DJY/akkN4NRQmyOFQSQOH6Qv+Pf b2potZKcuB/fbo4Umupfp1i/nzfgwp9qLLcLH/8+ymuax5W497zRv3s+PJOWbWv42NTz/4xM9 ZfyHy3hlV17ulAL/FyiYg8QMYwlvUUU81wIKtXjFtRUDW8AX3yyAa7+QvwezesEM5XIPaVAi9 Tv9sE0kPJ9LEzVo8gvSmHYSLYyZtmo05GDmkB5VqJYJGYbI3FumK30jMm2A+yeKKrJ67CALQ1 AqJRHbkF1+v61v5JbETMmW0zdnos6A5LyRKjT72Y82r60VN0S+fc9MtT+7PKhvuCtwwSSsYXy 4mgOX9M2yGZiRZbreiw/+lmVcrwfBcOtvINJqxzHJBFGIgTtNb8jMUyQ5Xq8nPBC0+PVrReeC ywjdDNfhMU3Vf+/qg7DdS+DiXXqeFb3uclg+8MybCPgKfj3kHkttiYrv42xsef7q/POUCcWjO EB0AhpbG5OaPppI/riINxA1fir12skyBK3IhDSjN9LeqmtOmhC1SWgXBbDKzwoLmsymyjun98 YLzMZtEx4bMf936/55yi/UoQPZyHV30wvWiGkSgMacMXHXSFx40wqRKpLkEM= X-Rspamd-Queue-Id: 46dB8h47GBz3P7j X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=MH7fqeUW; dmarc=none; spf=none (mx1.freebsd.org: domain of ohartmann@walstatt.org has no SPF policy when checking 212.227.17.20) smtp.mailfrom=ohartmann@walstatt.org X-Spamd-Result: default: False [-3.46 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; IP_SCORE(-1.16)[ip: (-6.56), ipnet: 212.227.0.0/16(-1.37), asn: 8560(2.12), country: DE(-0.01)]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[walstatt.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; HAS_ORG_HEADER(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmx.net:+]; MIME_BASE64_TEXT(0.10)[]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[20.17.227.212.list.dnswl.org : 127.0.3.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; 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: Tue, 24 Sep 2019 19:29:41 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBMjU2DQoNCkFtIFR1 ZSwgMjQgU2VwIDIwMTkgMTg6MTg6MTEgKzAwMDAgKFVUQykNClJhbmRhbGwgU3Rld2FydCA8cnJz QEZyZWVCU0Qub3JnPiBzY2hyaWViOg0KDQo+IEF1dGhvcjogcnJzDQo+IERhdGU6IFR1ZSBTZXAg MjQgMTg6MTg6MTEgMjAxOQ0KPiBOZXcgUmV2aXNpb246IDM1MjY1Nw0KPiBVUkw6IGh0dHBzOi8v c3Zud2ViLmZyZWVic2Qub3JnL2NoYW5nZXNldC9iYXNlLzM1MjY1Nw0KPiANCj4gTG9nOg0KPiAg IFRoaXMgY29tbWl0IGFkZHMgQkJSIChCb3R0bGVuZWNrIEJhbmR3aWR0aCBhbmQgUlRUKSBjb25n ZXN0aW9uIGNvbnRyb2wuIFRoaXMNCj4gICBpcyBhIGNvbXBsZXRlbHkgc2VwYXJhdGUgVENQIHN0 YWNrICh0Y3BfYmJyLmtvKSB0aGF0IHdpbGwgYmUgYnVpbHQgb25seSBpZg0KPiAgIHlvdSBhZGQg dGhlIG1ha2Ugb3B0aW9ucyBXSVRIX0VYVFJBX1RDUF9TVEFDS1M9MSBhbmQgYWxzbyBpbmNsdWRl IHRoZSBvcHRpb24NCj4gICBUQ1BIUFRTLiBZb3UgY2FuIGFsc28gaW5jbHVkZSB0aGUgUkFURUxJ TUlUIG9wdGlvbiBpZiB5b3UgaGF2ZSBhIE5JQyBpbnRlcmZhY2UgdGhhdA0KPiAgIHN1cHBvcnRz IGhhcmR3YXJlIHBhY2luZywgQkJSIHVuZGVyc3RhbmRzIGhvdyB0byB1c2Ugc3VjaCBhIGZlYXR1 cmUuDQo+ICAgDQo+ICAgTm90ZSB0aGF0IHRoaXMgY29tbWl0IGFsc28gYWRkcyBpbiBhIGdlbmVy YWwgcHVycG9zZSB0aW1lLWZpbHRlciB3aGljaA0KPiAgIGFsbG93cyB5b3UgdG8gaGF2ZSBhIG1p bi1maWx0ZXIgb3IgbWF4LWZpbHRlci4gQSBmaWx0ZXIgYWxsb3dzIHlvdSB0bw0KPiAgIGhhdmUg YSBsb3cgKG9yIGhpZ2gpIHZhbHVlIGZvciBzb21lIHBlcmlvZCBvZiB0aW1lIGFuZCBkZWdyYWRl IHNsb3dseQ0KPiAgIHRvIGFub3RoZXIgdmFsdWUgaGFzIHRpbWUgcGFzc2VzLiBZb3UgY2FuIGZp bmQgb3V0IHRoZSBkZXRhaWxzIG9mDQo+ICAgQkJSIGJ5IGxvb2tpbmcgYXQgdGhlIG9yaWdpbmFs IHBhcGVyIGF0Og0KPiAgIA0KPiAgIGh0dHBzOi8vcXVldWUuYWNtLm9yZy9kZXRhaWwuY2ZtP2lk PTMwMjIxODQNCj4gICANCj4gICBvciBjb25zdWx0IG1hbnkgb3RoZXIgd2ViIHJlc291cmNlcyB5 b3UgY2FuIGZpbmQgb24gdGhlIHdlYg0KPiAgIHJlZmVyZW5jZWQgYnkgIkJCUiBjb25nZXN0aW9u IGNvbnRyb2wiLiBJdCBzaG91bGQgYmUgbm90ZWQgdGhhdA0KPiAgIEJCUnYxICh3aGljaCB0aGlz IGlzKSBkb2VzIHRlbmQgdG8gdW5mYWlybmVzcyBpbiBjYXNlcyBvZiBzbWFsbA0KPiAgIGJ1ZmZl cmVkIHBhdGhzLCBhbmQgaXQgd2lsbCB1c3VhbGx5IGdldCBsZXNzIGJhbmR3aWR0aCBpbiB0aGUg Y2FzZQ0KPiAgIG9mIGxhcmdlIEJEUCBwYXRocyh3aGVuIGNvbXBldGluZyB3aXRoIG5ldy1yZW5v IG9yIGN1YmljIGZsb3dzKS4gQkJSDQo+ICAgaXMgc3RpbGwgYW4gYWN0aXZlIHJlc2VhcmNoIGFy ZWEgYW5kIHdlIGRvIHBsYW4gb24gIGltcGxlbWVudGluZyBWMg0KPiAgIG9mIEJCUiB0byBzZWUg aWYgaXQgaXMgYW4gaW1wcm92ZW1lbnQgb3ZlciBWMS4NCj4gICANCj4gICBTcG9uc29yZWQgYnk6 CU5ldGZsaXggSW5jLg0KPiAgIERpZmZlcmVudGlhbCBSZXZpc2lvbjoJaHR0cHM6Ly9yZXZpZXdz LmZyZWVic2Qub3JnL0QyMTU4Mg0KPiANCj4gQWRkZWQ6DQo+ICAgaGVhZC9zeXMva2Vybi9zdWJy X2ZpbHRlci5jICAgKGNvbnRlbnRzLCBwcm9wcyBjaGFuZ2VkKQ0KPiAgIGhlYWQvc3lzL21vZHVs ZXMvdGNwL2Jici8NCj4gICBoZWFkL3N5cy9tb2R1bGVzL3RjcC9iYnIvTWFrZWZpbGUgICAoY29u dGVudHMsIHByb3BzIGNoYW5nZWQpDQo+ICAgaGVhZC9zeXMvbmV0aW5ldC90Y3Bfc3RhY2tzL2Ji ci5jICAgKGNvbnRlbnRzLCBwcm9wcyBjaGFuZ2VkKQ0KPiAgIGhlYWQvc3lzL25ldGluZXQvdGNw X3N0YWNrcy90Y3BfYmJyLmggICAoY29udGVudHMsIHByb3BzIGNoYW5nZWQpDQo+ICAgaGVhZC9z eXMvc3lzL3RpbV9maWx0ZXIuaCAgIChjb250ZW50cywgcHJvcHMgY2hhbmdlZCkNCj4gTW9kaWZp ZWQ6DQo+ICAgaGVhZC9zeXMvY29uZi9maWxlcw0KPiAgIGhlYWQvc3lzL21vZHVsZXMvdGNwL01h a2VmaWxlDQo+ICAgaGVhZC9zeXMvbmV0aW5ldC9pcF9vdXRwdXQuYw0KPiAgIGhlYWQvc3lzL25l dGluZXQvaXBfdmFyLmgNCj4gICBoZWFkL3N5cy9uZXRpbmV0L3RjcC5oDQo+ICAgaGVhZC9zeXMv bmV0aW5ldC90Y3Bfc3RhY2tzL3JhY2suYw0KPiAgIGhlYWQvc3lzL25ldGluZXQvdGNwX3N0YWNr cy9yYWNrX2Jicl9jb21tb24uYw0KPiAgIGhlYWQvc3lzL25ldGluZXQvdGNwX3N0YWNrcy9yYWNr X2Jicl9jb21tb24uaA0KPiAgIGhlYWQvc3lzL25ldGluZXQvdGNwX3N0YWNrcy9zYWNrX2ZpbHRl ci5jDQo+ICAgaGVhZC9zeXMvbmV0aW5ldC90Y3Bfc3RhY2tzL3NhY2tfZmlsdGVyLmgNCj4gICBo ZWFkL3N5cy9uZXRpbmV0L3RjcF9zdGFja3MvdGNwX3JhY2suaA0KPiAgIGhlYWQvc3lzL3N5cy9t YnVmLmgNCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N5cy9jb25mL2ZpbGVzDQo+ID09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvY29uZi9maWxlcwlUdWUgU2VwIDI0IDE3OjA2OjMy IDIwMTkJKHIzNTI2NTYpDQo+ICsrKyBoZWFkL3N5cy9jb25mL2ZpbGVzCVR1ZSBTZXAgMjQgMTg6 MTg6MTEgMjAxOQkocjM1MjY1NykNCj4gQEAgLTM4MDgsNiArMzgwOCw3IEBAIGtlcm4vc3Vicl9l cG9jaC5jCQlzdGFuZGFyZA0KPiAga2Vybi9zdWJyX2V2ZW50aGFuZGxlci5jCXN0YW5kYXJkDQo+ ICBrZXJuL3N1YnJfZmF0dGltZS5jCQlzdGFuZGFyZA0KPiAga2Vybi9zdWJyX2Zpcm13YXJlLmMJ CW9wdGlvbmFsIGZpcm13YXJlDQo+ICtrZXJuL3N1YnJfZmlsdGVyLmMgICAgICAgICAgICAgIHN0 YW5kYXJkDQo+ICBrZXJuL3N1YnJfZ3Rhc2txdWV1ZS5jCQlzdGFuZGFyZA0KPiAga2Vybi9zdWJy X2hhc2guYwkJc3RhbmRhcmQNCj4gIGtlcm4vc3Vicl9oaW50cy5jCQlzdGFuZGFyZA0KPiANCj4g QWRkZWQ6IGhlYWQvc3lzL2tlcm4vc3Vicl9maWx0ZXIuYw0KPiA9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT0NCj4gLS0tIC9kZXYvbnVsbAkwMDowMDowMCAxOTcwCShlbXB0eSwgYmVjYXVzZSBmaWxlIGlz IG5ld2x5IGFkZGVkKQ0KPiArKysgaGVhZC9zeXMva2Vybi9zdWJyX2ZpbHRlci5jCVR1ZSBTZXAg MjQgMTg6MTg6MTEgMjAxOQkocjM1MjY1NykNCj4gQEAgLTAsMCArMSw0ODIgQEANCj4gKy8qLQ0K PiArICogQ29weXJpZ2h0IChjKSAyMDE2LTIwMTkgTmV0ZmxpeCwgSW5jLg0KPiArICogQWxsIHJp Z2h0cyByZXNlcnZlZC4NCj4gKyAqDQo+ICsgKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNv dXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXQNCj4gKyAqIG1vZGlmaWNhdGlv biwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucw0K PiArICogYXJlIG1ldDoNCj4gKyAqIDEuIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBt dXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0DQo+ICsgKiAgICBub3RpY2UsIHRoaXMgbGlz dCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuDQo+ICsgKiAyLiBS ZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNv cHlyaWdodA0KPiArICogICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhl IGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZQ0KPiArICogICAgZG9jdW1lbnRhdGlvbiBhbmQv b3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi4NCj4gKyAq DQo+ICsgKiBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBBVVRIT1IgQU5EIENPTlRS SUJVVE9SUyBgYEFTIElTJycgQU5EDQo+ICsgKiBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJB TlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEUNCj4gKyAqIElNUExJRUQg V0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxB UiBQVVJQT1NFDQo+ICsgKiBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFV VEhPUiBPUiBDT05UUklCVVRPUlMgQkUgTElBQkxFDQo+ICsgKiBGT1IgQU5ZIERJUkVDVCwgSU5E SVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTA0K PiArICogREFNQUdFUyAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5U IE9GIFNVQlNUSVRVVEUgR09PRFMNCj4gKyAqIE9SIFNFUlZJQ0VTOyBMT1NTIE9GIFVTRSwgREFU QSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKQ0KPiArICogSE9XRVZFUiBD QVVTRUQgQU5EIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNU LCBTVFJJQ1QNCj4gKyAqIExJQUJJTElUWSwgT1IgVE9SVCAoSU5DTFVESU5HIE5FR0xJR0VOQ0Ug T1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkNCj4gKyAqIE9VVCBPRiBUSEUgVVNFIE9G IFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YNCj4g KyAqIFNVQ0ggREFNQUdFLg0KPiArICovDQo+ICsNCj4gKy8qDQo+ICsgKiBBdXRob3I6IFJhbmRh bGwgU3Rld2FydCA8cnJzQG5ldGZsaXguY29tPg0KPiArICovDQo+ICsjaW5jbHVkZSA8c3lzL2Nk ZWZzLmg+DQo+ICtfX0ZCU0RJRCgiJEZyZWVCU0QkIik7DQo+ICsjaW5jbHVkZSA8c3lzL3R5cGVz Lmg+DQo+ICsjaW5jbHVkZSA8c3lzL3RpbWUuaD4NCj4gKyNpbmNsdWRlIDxzeXMvZXJybm8uaD4N Cj4gKyNpbmNsdWRlIDxzeXMvdGltX2ZpbHRlci5oPg0KPiArDQo+ICt2b2lkDQo+ICtyZXNldF90 aW1lKHN0cnVjdCB0aW1lX2ZpbHRlciAqdGYsIHVpbnQzMl90IHRpbWVfbGVuKQ0KPiArew0KPiAr CXRmLT5jdXJfdGltZV9saW1pdCA9IHRpbWVfbGVuOw0KPiArfQ0KPiArDQo+ICt2b2lkDQo+ICty ZXNldF90aW1lX3NtYWxsKHN0cnVjdCB0aW1lX2ZpbHRlcl9zbWFsbCAqdGYsIHVpbnQzMl90IHRp bWVfbGVuKQ0KPiArew0KPiArCXRmLT5jdXJfdGltZV9saW1pdCA9IHRpbWVfbGVuOw0KPiArfQ0K PiArDQo+ICsvKg0KPiArICogQSB0aW1lIGZpbHRlciBjYW4gYmUgYSBmaWx0ZXIgZm9yIE1JTiBv ciBNQVguIA0KPiArICogWW91IGNhbGwgc2V0dXBfdGltZV9maWx0ZXIoKSB3aXRoIHRoZSBwb2lu dGVyIHRvDQo+ICsgKiB0aGUgZmlsdGVyIHN0cnVjdHVyZSwgdGhlIHR5cGUgKEZJTFRFUl9UWVBF X01JTi9NQVgpIGFuZA0KPiArICogdGhlIHRpbWUgbGVuZ3RoLiBZb3UgY2FuIG9wdGlvbmFsbHkg cmVzZXQgdGhlIHRpbWUgbGVuZ3RoDQo+ICsgKiBsYXRlciB3aXRoIHJlc2V0X3RpbWUoKS4NCj4g KyAqDQo+ICsgKiBZb3UgZ2VuZXJhbGx5IGNhbGwgYXBwbHlfZmlsdGVyX3h4eCgpIHRvIGFwcGx5 IHRoZSBuZXcgdmFsdWUNCj4gKyAqIHRvIHRoZSBmaWx0ZXIuIFlvdSBhbHNvIHByb3ZpZGUgYSB0 aW1lIChub3cpLiBUaGUgZmlsdGVyIHdpbGwNCj4gKyAqIGFnZSBvdXQgZW50cmllcyBiYXNlZCBv biB0aGUgdGltZSBub3cgYW5kIHlvdXIgdGltZSBsaW1pdA0KPiArICogc28gdGhhdCB5b3UgYXJl IGFsd2F5cyBtYWludGFpbmluZyB0aGUgbWluIG9yIG1heCBpbiB0aGF0DQo+ICsgKiB3aW5kb3cg b2YgdGltZS4gVGltZSBpcyBhIHJlbGF0aXZlIHRoaW5nLCBpdCBtaWdodCBiZSB0aWNrcw0KPiAr ICogaW4gbWlsbGlzZWNvbmRzLCBpdCBtaWdodCBiZSByb3VuZCB0cmlwIHRpbWVzLCBpdHMgcmVh bGx5DQo+ICsgKiB1cCB0byB5b3UgdG8gZGVjaWRlIHdoYXQgaXQgaXMuDQo+ICsgKg0KPiArICog VG8gYWNjZXNzIHRoZSBjdXJyZW50IGZsaXRlcmVkIHZhbHVlIHlvdSBjYW4gdXNlIHRoZSBtYWNy bw0KPiArICogZ2V0X2ZpbHRlcl92YWx1ZSgpIHdoaWNoIHJldHVybnMgdGhlIGNvcnJlY3QgZW50 cnkgdGhhdA0KPiArICogaGFzIHRoZSAiY3VycmVudCIgdmFsdWUgaW4gdGhlIGZpbHRlci4NCj4g KyAqDQo+ICsgKiBPbmUgdGhpbmcgdGhhdCB1c2VkIHRvIGJlIGhlcmUgaXMgYSBzaW5nbGUgYXBw bHlfZmlsdGVyKCkuIEJ1dA0KPiArICogdGhpcyBtZWFudCB0aGF0IHdlIHRoZW4gaGFkIHRvIHN0 b3JlIHRoZSB0eXBlIG9mIGZpbHRlciBpbg0KPiArICogdGhlIHRpbWVfZmlsdGVyIHN0cnVjdHVy ZS4gSW4gb3JkZXIgdG8ga2VlcCBpdCBhdCBhIGNhY2hlDQo+ICsgKiBsaW5lIHNpemUgSSBzcGxp dCBpdCB0byB0d28gZnVuY3Rpb25zLiANCj4gKyAqDQo+ICsgKi8NCj4gK2ludA0KPiArc2V0dXBf dGltZV9maWx0ZXIoc3RydWN0IHRpbWVfZmlsdGVyICp0ZiwgaW50IGZpbF90eXBlLCB1aW50MzJf dCB0aW1lX2xlbikNCj4gK3sNCj4gKwl1aW50NjRfdCBzZXRfdmFsOw0KPiArCWludCBpOw0KPiAr CQ0KPiArCS8qIA0KPiArCSAqIFlvdSBtdXN0IHNwZWNpZnkgZWl0aGVyIGEgTUlOIG9yIE1BWCBm aWx0ZXIsDQo+ICsJICogdGhvdWdoIGl0cyB1cCB0byB0aGUgdXNlciB0byB1c2UgdGhlIGNvcnJl Y3QNCj4gKwkgKiBhcHBseS4NCj4gKwkgKi8NCj4gKwlpZiAoKGZpbF90eXBlICE9IEZJTFRFUl9U WVBFX01JTikgJiYNCj4gKwkgICAgKGZpbF90eXBlICE9IEZJTFRFUl9UWVBFX01BWCkpDQo+ICsJ CXJldHVybihFSU5WQUwpOw0KPiArDQo+ICsJaWYgKHRpbWVfbGVuIDwgTlVNX0ZJTFRFUl9FTlRS SUVTKQ0KPiArCQlyZXR1cm4oRUlOVkFMKTsNCj4gKwkJICAgICAgIA0KPiArCWlmIChmaWxfdHlw ZSA9PSBGSUxURVJfVFlQRV9NSU4pDQo+ICsJCXNldF92YWwgPSAweGZmZmZmZmZmZmZmZmZmZmY7 DQo+ICsJZWxzZQ0KPiArCQlzZXRfdmFsID0gMDsNCj4gKw0KPiArCWZvcihpPTA7IGk8TlVNX0ZJ TFRFUl9FTlRSSUVTOyBpKyspIHsNCj4gKwkJdGYtPmVudHJpZXNbaV0udmFsdWUgPSBzZXRfdmFs Ow0KPiArCQl0Zi0+ZW50cmllc1tpXS50aW1lX3VwID0gMDsNCj4gKwl9DQo+ICsJdGYtPmN1cl90 aW1lX2xpbWl0ID0gdGltZV9sZW47DQo+ICsJcmV0dXJuKDApOw0KPiArfQ0KPiArDQo+ICtpbnQN Cj4gK3NldHVwX3RpbWVfZmlsdGVyX3NtYWxsKHN0cnVjdCB0aW1lX2ZpbHRlcl9zbWFsbCAqdGYs IGludCBmaWxfdHlwZSwgdWludDMyX3QgdGltZV9sZW4pDQo+ICt7DQo+ICsJdWludDMyX3Qgc2V0 X3ZhbDsNCj4gKwlpbnQgaTsNCj4gKwkNCj4gKwkvKiANCj4gKwkgKiBZb3UgbXVzdCBzcGVjaWZ5 IGVpdGhlciBhIE1JTiBvciBNQVggZmlsdGVyLA0KPiArCSAqIHRob3VnaCBpdHMgdXAgdG8gdGhl IHVzZXIgdG8gdXNlIHRoZSBjb3JyZWN0DQo+ICsJICogYXBwbHkuDQo+ICsJICovDQo+ICsJaWYg KChmaWxfdHlwZSAhPSBGSUxURVJfVFlQRV9NSU4pICYmDQo+ICsJICAgIChmaWxfdHlwZSAhPSBG SUxURVJfVFlQRV9NQVgpKQ0KPiArCQlyZXR1cm4oRUlOVkFMKTsNCj4gKw0KPiArCWlmICh0aW1l X2xlbiA8IE5VTV9GSUxURVJfRU5UUklFUykNCj4gKwkJcmV0dXJuKEVJTlZBTCk7DQo+ICsJCSAg ICAgICANCj4gKwlpZiAoZmlsX3R5cGUgPT0gRklMVEVSX1RZUEVfTUlOKQ0KPiArCQlzZXRfdmFs ID0gMHhmZmZmZmZmZjsNCj4gKwllbHNlDQo+ICsJCXNldF92YWwgPSAwOw0KPiArDQo+ICsJZm9y KGk9MDsgaTxOVU1fRklMVEVSX0VOVFJJRVM7IGkrKykgew0KPiArCQl0Zi0+ZW50cmllc1tpXS52 YWx1ZSA9IHNldF92YWw7DQo+ICsJCXRmLT5lbnRyaWVzW2ldLnRpbWVfdXAgPSAwOw0KPiArCX0N Cj4gKwl0Zi0+Y3VyX3RpbWVfbGltaXQgPSB0aW1lX2xlbjsNCj4gKwlyZXR1cm4oMCk7DQo+ICt9 DQo+ICsNCj4gKw0KPiArc3RhdGljIHZvaWQNCj4gK2NoZWNrX3VwZGF0ZV90aW1lcyhzdHJ1Y3Qg dGltZV9maWx0ZXIgKnRmLCB1aW50NjRfdCB2YWx1ZSwgdWludDMyX3Qgbm93KQ0KPiArew0KPiAr CWludCBpLCBqLCBmbmQ7DQo+ICsJdWludDMyX3QgdGltOw0KPiArCXVpbnQzMl90IHRpbWVfbGlt aXQ7DQo+ICsJZm9yKGk9MDsgaTwoTlVNX0ZJTFRFUl9FTlRSSUVTLTEpOyBpKyspIHsNCj4gKwkJ dGltID0gbm93IC0gdGYtPmVudHJpZXNbaV0udGltZV91cDsNCj4gKwkJdGltZV9saW1pdCA9ICh0 Zi0+Y3VyX3RpbWVfbGltaXQgKg0KPiAoTlVNX0ZJTFRFUl9FTlRSSUVTLWkpKS9OVU1fRklMVEVS X0VOVFJJRVM7DQo+ICsJCWlmICh0aW0gPj0gdGltZV9saW1pdCkgew0KPiArCQkJZm5kID0gMDsN Cj4gKwkJCWZvcihqPShpKzEpOyBqPE5VTV9GSUxURVJfRU5UUklFUzsgaisrKSB7DQo+ICsJCQkJ aWYgKHRmLT5lbnRyaWVzW2ldLnRpbWVfdXAgPCB0Zi0+ZW50cmllc1tqXS50aW1lX3VwKSB7DQo+ ICsJCQkJCXRmLT5lbnRyaWVzW2ldLnZhbHVlID0gdGYtPmVudHJpZXNbal0udmFsdWU7DQo+ICsJ CQkJCXRmLT5lbnRyaWVzW2ldLnRpbWVfdXAgPSB0Zi0+ZW50cmllc1tqXS50aW1lX3VwOw0KPiAr CQkJCQlmbmQgPSAxOw0KPiArCQkJCQlicmVhazsNCj4gKwkJCQl9DQo+ICsJCQl9DQo+ICsJCQlp ZiAoZm5kID09IDApIHsNCj4gKwkJCQkvKiBOb3RoaW5nIGJ1dCB0aGUgc2FtZSBvbGQgZW50cnkg Ki8NCj4gKwkJCQl0Zi0+ZW50cmllc1tpXS52YWx1ZSA9IHZhbHVlOw0KPiArCQkJCXRmLT5lbnRy aWVzW2ldLnRpbWVfdXAgPSBub3c7DQo+ICsJCQl9DQo+ICsJCX0NCj4gKwl9DQo+ICsJaSA9IE5V TV9GSUxURVJfRU5UUklFUy0xOw0KPiArCXRpbSA9IG5vdyAtIHRmLT5lbnRyaWVzW2ldLnRpbWVf dXA7DQo+ICsJdGltZV9saW1pdCA9ICh0Zi0+Y3VyX3RpbWVfbGltaXQgKiAoTlVNX0ZJTFRFUl9F TlRSSUVTLWkpKS9OVU1fRklMVEVSX0VOVFJJRVM7DQo+ICsJaWYgKHRpbSA+PSB0aW1lX2xpbWl0 KSB7DQo+ICsJCXRmLT5lbnRyaWVzW2ldLnZhbHVlID0gdmFsdWU7DQo+ICsJCXRmLT5lbnRyaWVz W2ldLnRpbWVfdXAgPSBub3c7DQo+ICsJfQ0KPiArfQ0KPiArDQo+ICtzdGF0aWMgdm9pZA0KPiAr Y2hlY2tfdXBkYXRlX3RpbWVzX3NtYWxsKHN0cnVjdCB0aW1lX2ZpbHRlcl9zbWFsbCAqdGYsIHVp bnQzMl90IHZhbHVlLCB1aW50MzJfdCBub3cpDQo+ICt7DQo+ICsJaW50IGksIGosIGZuZDsNCj4g Kwl1aW50MzJfdCB0aW07DQo+ICsJdWludDMyX3QgdGltZV9saW1pdDsNCj4gKwlmb3IoaT0wOyBp PChOVU1fRklMVEVSX0VOVFJJRVMtMSk7IGkrKykgew0KPiArCQl0aW0gPSBub3cgLSB0Zi0+ZW50 cmllc1tpXS50aW1lX3VwOw0KPiArCQl0aW1lX2xpbWl0ID0gKHRmLT5jdXJfdGltZV9saW1pdCAq DQo+IChOVU1fRklMVEVSX0VOVFJJRVMtaSkpL05VTV9GSUxURVJfRU5UUklFUzsNCj4gKwkJaWYg KHRpbSA+PSB0aW1lX2xpbWl0KSB7DQo+ICsJCQlmbmQgPSAwOw0KPiArCQkJZm9yKGo9KGkrMSk7 IGo8TlVNX0ZJTFRFUl9FTlRSSUVTOyBqKyspIHsNCj4gKwkJCQlpZiAodGYtPmVudHJpZXNbaV0u dGltZV91cCA8IHRmLT5lbnRyaWVzW2pdLnRpbWVfdXApIHsNCj4gKwkJCQkJdGYtPmVudHJpZXNb aV0udmFsdWUgPSB0Zi0+ZW50cmllc1tqXS52YWx1ZTsNCj4gKwkJCQkJdGYtPmVudHJpZXNbaV0u dGltZV91cCA9IHRmLT5lbnRyaWVzW2pdLnRpbWVfdXA7DQo+ICsJCQkJCWZuZCA9IDE7DQo+ICsJ CQkJCWJyZWFrOw0KPiArCQkJCX0NCj4gKwkJCX0NCj4gKwkJCWlmIChmbmQgPT0gMCkgew0KPiAr CQkJCS8qIE5vdGhpbmcgYnV0IHRoZSBzYW1lIG9sZCBlbnRyeSAqLw0KPiArCQkJCXRmLT5lbnRy aWVzW2ldLnZhbHVlID0gdmFsdWU7DQo+ICsJCQkJdGYtPmVudHJpZXNbaV0udGltZV91cCA9IG5v dzsNCj4gKwkJCX0NCj4gKwkJfQ0KPiArCX0NCj4gKwlpID0gTlVNX0ZJTFRFUl9FTlRSSUVTLTE7 DQo+ICsJdGltID0gbm93IC0gdGYtPmVudHJpZXNbaV0udGltZV91cDsNCj4gKwl0aW1lX2xpbWl0 ID0gKHRmLT5jdXJfdGltZV9saW1pdCAqIChOVU1fRklMVEVSX0VOVFJJRVMtaSkpL05VTV9GSUxU RVJfRU5UUklFUzsNCj4gKwlpZiAodGltID49IHRpbWVfbGltaXQpIHsNCj4gKwkJdGYtPmVudHJp ZXNbaV0udmFsdWUgPSB2YWx1ZTsNCj4gKwkJdGYtPmVudHJpZXNbaV0udGltZV91cCA9IG5vdzsN Cj4gKwl9DQo+ICt9DQo+ICsNCj4gKw0KPiArDQo+ICt2b2lkDQo+ICtmaWx0ZXJfcmVkdWNlX2J5 KHN0cnVjdCB0aW1lX2ZpbHRlciAqdGYsIHVpbnQ2NF90IHJlZHVjZV9ieSwgdWludDMyX3Qgbm93 KQ0KPiArew0KPiArCWludCBpOw0KPiArCS8qIA0KPiArCSAqIFJlZHVjZSBvdXIgZmlsdGVyIG1h aW4gYnkgcmVkdWNlX2J5IGFuZA0KPiArCSAqIHVwZGF0ZSBpdHMgdGltZS4gVGhlbiB3YWxrIG90 aGVyJ3MgYW5kDQo+ICsJICogbWFrZSB0aGVtIHRoZSBuZXcgdmFsdWUgdG9vLg0KPiArCSAqLw0K PiArCWlmIChyZWR1Y2VfYnkgPCB0Zi0+ZW50cmllc1swXS52YWx1ZSkNCj4gKwkJdGYtPmVudHJp ZXNbMF0udmFsdWUgLT0gcmVkdWNlX2J5Ow0KPiArCWVsc2UNCj4gKwkJdGYtPmVudHJpZXNbMF0u dmFsdWUgPSAwOw0KPiArCXRmLT5lbnRyaWVzWzBdLnRpbWVfdXAgPSBub3c7DQo+ICsJZm9yKGk9 MTsgaTxOVU1fRklMVEVSX0VOVFJJRVM7IGkrKykgew0KPiArCQl0Zi0+ZW50cmllc1tpXS52YWx1 ZSA9IHRmLT5lbnRyaWVzWzBdLnZhbHVlOw0KPiArCQl0Zi0+ZW50cmllc1tpXS50aW1lX3VwID0g bm93Ow0KPiArCX0NCj4gK30NCj4gKw0KPiArdm9pZA0KPiArZmlsdGVyX3JlZHVjZV9ieV9zbWFs bChzdHJ1Y3QgdGltZV9maWx0ZXJfc21hbGwgKnRmLCB1aW50MzJfdCByZWR1Y2VfYnksIHVpbnQz Ml90IG5vdykNCj4gK3sNCj4gKwlpbnQgaTsNCj4gKwkvKiANCj4gKwkgKiBSZWR1Y2Ugb3VyIGZp bHRlciBtYWluIGJ5IHJlZHVjZV9ieSBhbmQNCj4gKwkgKiB1cGRhdGUgaXRzIHRpbWUuIFRoZW4g d2FsayBvdGhlcidzIGFuZA0KPiArCSAqIG1ha2UgdGhlbSB0aGUgbmV3IHZhbHVlIHRvby4NCj4g KwkgKi8NCj4gKwlpZiAocmVkdWNlX2J5IDwgdGYtPmVudHJpZXNbMF0udmFsdWUpDQo+ICsJCXRm LT5lbnRyaWVzWzBdLnZhbHVlIC09IHJlZHVjZV9ieTsNCj4gKwllbHNlDQo+ICsJCXRmLT5lbnRy aWVzWzBdLnZhbHVlID0gMDsNCj4gKwl0Zi0+ZW50cmllc1swXS50aW1lX3VwID0gbm93Ow0KPiAr CWZvcihpPTE7IGk8TlVNX0ZJTFRFUl9FTlRSSUVTOyBpKyspIHsNCj4gKwkJdGYtPmVudHJpZXNb aV0udmFsdWUgPSB0Zi0+ZW50cmllc1swXS52YWx1ZTsNCj4gKwkJdGYtPmVudHJpZXNbaV0udGlt ZV91cCA9IG5vdzsNCj4gKwl9DQo+ICt9DQo+ICsNCj4gK3ZvaWQNCj4gK2ZpbHRlcl9pbmNyZWFz ZV9ieShzdHJ1Y3QgdGltZV9maWx0ZXIgKnRmLCB1aW50NjRfdCBpbmNyX2J5LCB1aW50MzJfdCBu b3cpDQo+ICt7DQo+ICsJaW50IGk7DQo+ICsJLyogDQo+ICsJICogSW5jcmVhc2Ugb3VyIGZpbHRl ciBtYWluIGJ5IGluY3JfYnkgYW5kDQo+ICsJICogdXBkYXRlIGl0cyB0aW1lLiBUaGVuIHdhbGsg b3RoZXIncyBhbmQNCj4gKwkgKiBtYWtlIHRoZW0gdGhlIG5ldyB2YWx1ZSB0b28uDQo+ICsJICov DQo+ICsJdGYtPmVudHJpZXNbMF0udmFsdWUgKz0gaW5jcl9ieTsNCj4gKwl0Zi0+ZW50cmllc1sw XS50aW1lX3VwID0gbm93Ow0KPiArCWZvcihpPTE7IGk8TlVNX0ZJTFRFUl9FTlRSSUVTOyBpKysp IHsNCj4gKwkJdGYtPmVudHJpZXNbaV0udmFsdWUgPSB0Zi0+ZW50cmllc1swXS52YWx1ZTsNCj4g KwkJdGYtPmVudHJpZXNbaV0udGltZV91cCA9IG5vdzsNCj4gKwl9DQo+ICt9DQo+ICsNCj4gK3Zv aWQNCj4gK2ZpbHRlcl9pbmNyZWFzZV9ieV9zbWFsbChzdHJ1Y3QgdGltZV9maWx0ZXJfc21hbGwg KnRmLCB1aW50MzJfdCBpbmNyX2J5LCB1aW50MzJfdCBub3cpDQo+ICt7DQo+ICsJaW50IGk7DQo+ ICsJLyogDQo+ICsJICogSW5jcmVhc2Ugb3VyIGZpbHRlciBtYWluIGJ5IGluY3JfYnkgYW5kDQo+ ICsJICogdXBkYXRlIGl0cyB0aW1lLiBUaGVuIHdhbGsgb3RoZXIncyBhbmQNCj4gKwkgKiBtYWtl IHRoZW0gdGhlIG5ldyB2YWx1ZSB0b28uDQo+ICsJICovDQo+ICsJdGYtPmVudHJpZXNbMF0udmFs dWUgKz0gaW5jcl9ieTsNCj4gKwl0Zi0+ZW50cmllc1swXS50aW1lX3VwID0gbm93Ow0KPiArCWZv cihpPTE7IGk8TlVNX0ZJTFRFUl9FTlRSSUVTOyBpKyspIHsNCj4gKwkJdGYtPmVudHJpZXNbaV0u dmFsdWUgPSB0Zi0+ZW50cmllc1swXS52YWx1ZTsNCj4gKwkJdGYtPmVudHJpZXNbaV0udGltZV91 cCA9IG5vdzsNCj4gKwl9DQo+ICt9DQo+ICsNCj4gK3ZvaWQNCj4gK2ZvcndhcmRfZmlsdGVyX2Ns b2NrKHN0cnVjdCB0aW1lX2ZpbHRlciAqdGYsIHVpbnQzMl90IHRpY2tzX2ZvcndhcmQpDQo+ICt7 DQo+ICsJLyoNCj4gKwkgKiBCcmluZyBmb3J3YXJkIGFsbCB0aW1lIHZhbHVlcyBieSBOIHRpY2tz LiBUaGlzDQo+ICsJICogcG9zdHBvbmVzIGV4cGlyaW5nIHNsb3RzIGJ5IHRoYXQgYW1vdW50Lg0K PiArCSAqLw0KPiArCWludCBpOw0KPiArDQo+ICsJZm9yKGk9MDsgaTxOVU1fRklMVEVSX0VOVFJJ RVM7IGkrKykgew0KPiArCQl0Zi0+ZW50cmllc1tpXS50aW1lX3VwICs9IHRpY2tzX2ZvcndhcmQ7 DQo+ICsJfQ0KPiArfQ0KPiArDQo+ICsNCj4gK3ZvaWQNCj4gK2ZvcndhcmRfZmlsdGVyX2Nsb2Nr X3NtYWxsKHN0cnVjdCB0aW1lX2ZpbHRlcl9zbWFsbCAqdGYsIHVpbnQzMl90IHRpY2tzX2Zvcndh cmQpDQo+ICt7DQo+ICsJLyoNCj4gKwkgKiBCcmluZyBmb3J3YXJkIGFsbCB0aW1lIHZhbHVlcyBi eSBOIHRpY2tzLiBUaGlzDQo+ICsJICogcG9zdHBvbmVzIGV4cGlyaW5nIHNsb3RzIGJ5IHRoYXQg YW1vdW50Lg0KPiArCSAqLw0KPiArCWludCBpOw0KPiArDQo+ICsJZm9yKGk9MDsgaTxOVU1fRklM VEVSX0VOVFJJRVM7IGkrKykgew0KPiArCQl0Zi0+ZW50cmllc1tpXS50aW1lX3VwICs9IHRpY2tz X2ZvcndhcmQ7DQo+ICsJfQ0KPiArfQ0KPiArDQo+ICsNCj4gK3ZvaWQNCj4gK3RpY2tfZmlsdGVy X2Nsb2NrKHN0cnVjdCB0aW1lX2ZpbHRlciAqdGYsIHVpbnQzMl90IG5vdykNCj4gK3sNCj4gKwlp bnQgaTsNCj4gKwl1aW50MzJfdCB0aW0sIHRpbWVfbGltaXQ7DQo+ICsNCj4gKwkvKg0KPiArCSAq IFdlIHN0YXJ0IGF0IHR3byBwb3NpdGlvbnMgYmFjay4gVGhpcw0KPiArCSAqIGlzIGJlY2F1c2Ug dGhlIG9sZGVzdCB3b3JzdCB2YWx1ZSBpcw0KPiArCSAqIHByZXNlcnZlZCBhbHdheXMsIGkuZS4g aXQgY2FuJ3QgZXhwaXJlDQo+ICsJICogZHVlIHRvIGNsb2NrIHRpY2tpbmcgd2l0aCBubyB1cGRh dGVkIHZhbHVlLg0KPiArCSAqDQo+ICsJICogVGhlIG90aGVyIGNob2ljZSB3b3VsZCBiZSB0byBm aWxsIGl0IGluIHdpdGgNCj4gKwkgKiB6ZXJvLCBidXQgSSBkb24ndCBsaWtlIHRoYXQgb3B0aW9u IHNpbmNlDQo+ICsJICogc29tZSBtZWFzdXJlbWVudCBpcyBiZXR0ZXIgdGhhbiBub25lIChldmVu DQo+ICsJICogaWYgaXRzIHlvdXIgb2xkZXN0IG1lYXN1cm1lbnQpLg0KPiArCSAqLw0KPiArCWZv cihpPShOVU1fRklMVEVSX0VOVFJJRVMtMik7IGk+PTAgOyBpLS0pIHsNCj4gKwkJdGltID0gbm93 IC0gdGYtPmVudHJpZXNbaV0udGltZV91cDsNCj4gKwkJdGltZV9saW1pdCA9ICh0Zi0+Y3VyX3Rp bWVfbGltaXQgKg0KPiAoTlVNX0ZJTFRFUl9FTlRSSUVTLWkpKS9OVU1fRklMVEVSX0VOVFJJRVM7 DQo+ICsJCWlmICh0aW0gPj0gdGltZV9saW1pdCkgew0KPiArCQkJLyogDQo+ICsJCQkgKiBUaGlz IGVudHJ5IGlzIGV4cGlyZWQsIHB1bGwgZG93bg0KPiArCQkJICogdGhlIG5leHQgb25lIHVwLg0K PiArCQkJICovDQo+ICsJCQl0Zi0+ZW50cmllc1tpXS52YWx1ZSA9IHRmLT5lbnRyaWVzWyhpKzEp XS52YWx1ZTsNCj4gKwkJCXRmLT5lbnRyaWVzW2ldLnRpbWVfdXAgPSB0Zi0+ZW50cmllc1soaSsx KV0udGltZV91cDsNCj4gKwkJfQ0KPiArDQo+ICsJfQ0KPiArfQ0KPiArDQo+ICt2b2lkDQo+ICt0 aWNrX2ZpbHRlcl9jbG9ja19zbWFsbChzdHJ1Y3QgdGltZV9maWx0ZXJfc21hbGwgKnRmLCB1aW50 MzJfdCBub3cpDQo+ICt7DQo+ICsJaW50IGk7DQo+ICsJdWludDMyX3QgdGltLCB0aW1lX2xpbWl0 Ow0KPiArDQo+ICsJLyoNCj4gKwkgKiBXZSBzdGFydCBhdCB0d28gcG9zaXRpb25zIGJhY2suIFRo aXMNCj4gKwkgKiBpcyBiZWNhdXNlIHRoZSBvbGRlc3Qgd29yc3QgdmFsdWUgaXMNCj4gKwkgKiBw cmVzZXJ2ZWQgYWx3YXlzLCBpLmUuIGl0IGNhbid0IGV4cGlyZQ0KPiArCSAqIGR1ZSB0byBjbG9j ayB0aWNraW5nIHdpdGggbm8gdXBkYXRlZCB2YWx1ZS4NCj4gKwkgKg0KPiArCSAqIFRoZSBvdGhl ciBjaG9pY2Ugd291bGQgYmUgdG8gZmlsbCBpdCBpbiB3aXRoDQo+ICsJICogemVybywgYnV0IEkg ZG9uJ3QgbGlrZSB0aGF0IG9wdGlvbiBzaW5jZQ0KPiArCSAqIHNvbWUgbWVhc3VyZW1lbnQgaXMg YmV0dGVyIHRoYW4gbm9uZSAoZXZlbg0KPiArCSAqIGlmIGl0cyB5b3VyIG9sZGVzdCBtZWFzdXJt ZW50KS4NCj4gKwkgKi8NCj4gKwlmb3IoaT0oTlVNX0ZJTFRFUl9FTlRSSUVTLTIpOyBpPj0wIDsg aS0tKSB7DQo+ICsJCXRpbSA9IG5vdyAtIHRmLT5lbnRyaWVzW2ldLnRpbWVfdXA7DQo+ICsJCXRp bWVfbGltaXQgPSAodGYtPmN1cl90aW1lX2xpbWl0ICoNCj4gKE5VTV9GSUxURVJfRU5UUklFUy1p KSkvTlVNX0ZJTFRFUl9FTlRSSUVTOw0KPiArCQlpZiAodGltID49IHRpbWVfbGltaXQpIHsNCj4g KwkJCS8qIA0KPiArCQkJICogVGhpcyBlbnRyeSBpcyBleHBpcmVkLCBwdWxsIGRvd24NCj4gKwkJ CSAqIHRoZSBuZXh0IG9uZSB1cC4NCj4gKwkJCSAqLw0KPiArCQkJdGYtPmVudHJpZXNbaV0udmFs dWUgPSB0Zi0+ZW50cmllc1soaSsxKV0udmFsdWU7DQo+ICsJCQl0Zi0+ZW50cmllc1tpXS50aW1l X3VwID0gdGYtPmVudHJpZXNbKGkrMSldLnRpbWVfdXA7DQo+ICsJCX0NCj4gKw0KPiArCX0NCj4g K30NCj4gKw0KPiArdWludDMyX3QNCj4gK2FwcGx5X2ZpbHRlcl9taW4oc3RydWN0IHRpbWVfZmls dGVyICp0ZiwgdWludDY0X3QgdmFsdWUsIHVpbnQzMl90IG5vdykNCj4gK3sNCj4gKwlpbnQgaSwg ajsNCj4gKwkNCj4gKwlpZiAodmFsdWUgPD0gdGYtPmVudHJpZXNbMF0udmFsdWUpIHsNCj4gKwkJ LyogWmFwIHRoZW0gYWxsICovDQo+ICsJCWZvcihpPTA7IGk8TlVNX0ZJTFRFUl9FTlRSSUVTOyBp KyspIHsNCj4gKwkJCXRmLT5lbnRyaWVzW2ldLnZhbHVlID0gdmFsdWU7DQo+ICsJCQl0Zi0+ZW50 cmllc1tpXS50aW1lX3VwID0gbm93Ow0KPiArCQl9DQo+ICsJCXJldHVybiAodGYtPmVudHJpZXNb MF0udmFsdWUpOw0KPiArCX0NCj4gKwlmb3IgKGo9MTsgajxOVU1fRklMVEVSX0VOVFJJRVM7IGor Kykgew0KPiArCQlpZiAodmFsdWUgPD0gdGYtPmVudHJpZXNbal0udmFsdWUpIHsNCj4gKwkJCWZv cihpPWo7IGk8TlVNX0ZJTFRFUl9FTlRSSUVTOyBpKyspIHsNCj4gKwkJCQl0Zi0+ZW50cmllc1tp XS52YWx1ZSA9IHZhbHVlOw0KPiArCQkJCXRmLT5lbnRyaWVzW2ldLnRpbWVfdXAgPSBub3c7DQo+ ICsJCQl9DQo+ICsJCQlicmVhazsNCj4gKwkJfQ0KPiArCX0NCj4gKwljaGVja191cGRhdGVfdGlt ZXModGYsIHZhbHVlLCBub3cpOw0KPiArCXJldHVybiAodGYtPmVudHJpZXNbMF0udmFsdWUpOw0K PiArfQ0KPiArDQo+ICt1aW50MzJfdA0KPiArYXBwbHlfZmlsdGVyX21pbl9zbWFsbChzdHJ1Y3Qg dGltZV9maWx0ZXJfc21hbGwgKnRmLA0KPiArCQkgICAgICAgdWludDMyX3QgdmFsdWUsIHVpbnQz Ml90IG5vdykNCj4gK3sNCj4gKwlpbnQgaSwgajsNCj4gKwkNCj4gKwlpZiAodmFsdWUgPD0gdGYt PmVudHJpZXNbMF0udmFsdWUpIHsNCj4gKwkJLyogWmFwIHRoZW0gYWxsICovDQo+ICsJCWZvcihp PTA7IGk8TlVNX0ZJTFRFUl9FTlRSSUVTOyBpKyspIHsNCj4gKwkJCXRmLT5lbnRyaWVzW2ldLnZh bHVlID0gdmFsdWU7DQo+ICsJCQl0Zi0+ZW50cmllc1tpXS50aW1lX3VwID0gbm93Ow0KPiArCQl9 DQo+ICsJCXJldHVybiAodGYtPmVudHJpZXNbMF0udmFsdWUpOw0KPiArCX0NCj4gKwlmb3IgKGo9 MTsgajxOVU1fRklMVEVSX0VOVFJJRVM7IGorKykgew0KPiArCQlpZiAodmFsdWUgPD0gdGYtPmVu dHJpZXNbal0udmFsdWUpIHsNCj4gKwkJCWZvcihpPWo7IGk8TlVNX0ZJTFRFUl9FTlRSSUVTOyBp KyspIHsNCj4gKwkJCQl0Zi0+ZW50cmllc1tpXS52YWx1ZSA9IHZhbHVlOw0KPiArCQkJCXRmLT5l bnRyaWVzW2ldLnRpbWVfdXAgPSBub3c7DQo+ICsJCQl9DQo+ICsJCQlicmVhazsNCj4gKwkJfQ0K PiArCX0NCj4gKwljaGVja191cGRhdGVfdGltZXNfc21hbGwodGYsIHZhbHVlLCBub3cpOw0KPiAr CXJldHVybiAodGYtPmVudHJpZXNbMF0udmFsdWUpOw0KPiArfQ0KPiArDQo+ICt1aW50MzJfdA0K PiArYXBwbHlfZmlsdGVyX21heChzdHJ1Y3QgdGltZV9maWx0ZXIgKnRmLCB1aW50NjRfdCB2YWx1 ZSwgdWludDMyX3Qgbm93KQ0KPiArew0KPiArCWludCBpLCBqOw0KPiArCQ0KPiArCWlmICh2YWx1 ZSA+PSB0Zi0+ZW50cmllc1swXS52YWx1ZSkgew0KPiArCQkvKiBaYXAgdGhlbSBhbGwgKi8NCj4g KwkJZm9yKGk9MDsgaTxOVU1fRklMVEVSX0VOVFJJRVM7IGkrKykgew0KPiArCQkJdGYtPmVudHJp ZXNbaV0udmFsdWUgPSB2YWx1ZTsNCj4gKwkJCXRmLT5lbnRyaWVzW2ldLnRpbWVfdXAgPSBub3c7 DQo+ICsJCX0NCj4gKwkJcmV0dXJuICh0Zi0+ZW50cmllc1swXS52YWx1ZSk7DQo+ICsJfQ0KPiAr CWZvciAoaj0xOyBqPE5VTV9GSUxURVJfRU5UUklFUzsgaisrKSB7DQo+ICsJCWlmICh2YWx1ZSA+ PSB0Zi0+ZW50cmllc1tqXS52YWx1ZSkgew0KPiArCQkJZm9yKGk9ajsgaTxOVU1fRklMVEVSX0VO VFJJRVM7IGkrKykgew0KPiArCQkJCXRmLT5lbnRyaWVzW2ldLnZhbHVlID0gdmFsdWU7DQo+ICsJ CQkJdGYtPmVudHJpZXNbaV0udGltZV91cCA9IG5vdzsNCj4gKwkJCX0NCj4gKwkJCWJyZWFrOw0K PiArCQl9DQo+ICsJfQ0KPiArCWNoZWNrX3VwZGF0ZV90aW1lcyh0ZiwgdmFsdWUsIG5vdyk7DQo+ ICsJcmV0dXJuICh0Zi0+ZW50cmllc1swXS52YWx1ZSk7DQo+ICt9DQo+ICsNCj4gKw0KPiArdWlu dDMyX3QNCj4gK2FwcGx5X2ZpbHRlcl9tYXhfc21hbGwoc3RydWN0IHRpbWVfZmlsdGVyX3NtYWxs ICp0ZiwNCj4gKwkJICAgICAgIHVpbnQzMl90IHZhbHVlLCB1aW50MzJfdCBub3cpDQo+ICt7DQo+ ICsJaW50IGksIGo7DQo+ICsJDQo+ICsJaWYgKHZhbHVlID49IHRmLT5lbnRyaWVzWzBdLnZhbHVl KSB7DQo+ICsJCS8qIFphcCB0aGVtIGFsbCAqLw0KPiArCQlmb3IoaT0wOyBpPE5VTV9GSUxURVJf RU5UUklFUzsgaSsrKSB7DQo+ICsJCQl0Zi0+ZW50cmllc1tpXS52YWx1ZSA9IHZhbHVlOw0KPiAr CQkJdGYtPmVudHJpZXNbaV0udGltZV91cCA9IG5vdzsNCj4gKwkJfQ0KPiArCQlyZXR1cm4gKHRm LT5lbnRyaWVzWzBdLnZhbHVlKTsNCj4gKwl9DQo+ICsJZm9yIChqPTE7IGo8TlVNX0ZJTFRFUl9F TlRSSUVTOyBqKyspIHsNCj4gKwkJaWYgKHZhbHVlID49IHRmLT5lbnRyaWVzW2pdLnZhbHVlKSB7 DQo+ICsJCQlmb3IoaT1qOyBpPE5VTV9GSUxURVJfRU5UUklFUzsgaSsrKSB7DQo+ICsJCQkJdGYt PmVudHJpZXNbaV0udmFsdWUgPSB2YWx1ZTsNCj4gKwkJCQl0Zi0+ZW50cmllc1tpXS50aW1lX3Vw ID0gbm93Ow0KPiArCQkJfQ0KPiArCQkJYnJlYWs7DQo+ICsJCX0NCj4gKwl9DQo+ICsJY2hlY2tf dXBkYXRlX3RpbWVzX3NtYWxsKHRmLCB2YWx1ZSwgbm93KTsNCj4gKwlyZXR1cm4gKHRmLT5lbnRy aWVzWzBdLnZhbHVlKTsNCj4gK30NCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N5cy9tb2R1bGVzL3Rj cC9NYWtlZmlsZQ0KPiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCj4gLS0tIGhlYWQvc3lzL21vZHVs ZXMvdGNwL01ha2VmaWxlCVR1ZSBTZXAgMjQgMTc6MDY6MzIgMjAxOQkocjM1MjY1NikNCj4gKysr IGhlYWQvc3lzL21vZHVsZXMvdGNwL01ha2VmaWxlCVR1ZSBTZXAgMjQgMTg6MTg6MTEgMjAxOQko cjM1MjY1NykNCj4gQEAgLTYsMTAgKzYsMTIgQEAgU1lTRElSPz0ke1NSQ1RPUH0vc3lzDQo+ICAu aW5jbHVkZSAiJHtTWVNESVJ9L2NvbmYva2Vybi5vcHRzLm1rIg0KPiAgDQo+ICBTVUJESVI9CVwN Cj4gKyAgICAgICAgJHtfdGNwX2Jicn0gXA0KPiAgICAgICAgICAke190Y3BfcmFja30gXA0KPiAg CSR7X3RjcG1kNX0gXA0KPiAgDQo+ICAuaWYgJHtNS19FWFRSQV9UQ1BfU1RBQ0tTfSAhPSAibm8i IHx8IGRlZmluZWQoQUxMX01PRFVMRVMpDQo+ICtfdGNwX2Jicj0gCWJicg0KPiAgX3RjcF9yYWNr PSAJcmFjaw0KPiAgLmVuZGlmDQo+ICANCj4gDQo+IEFkZGVkOiBoZWFkL3N5cy9tb2R1bGVzL3Rj cC9iYnIvTWFrZWZpbGUNCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSAvZGV2L251bGwJ MDA6MDA6MDAgMTk3MAkoZW1wdHksIGJlY2F1c2UgZmlsZSBpcyBuZXdseSBhZGRlZCkNCj4gKysr IGhlYWQvc3lzL21vZHVsZXMvdGNwL2Jici9NYWtlZmlsZQlUdWUgU2VwIDI0IDE4OjE4OjExIDIw MTkJKHIzNTI2NTcpDQo+IEBAIC0wLDAgKzEsMjMgQEANCj4gKyMNCj4gKyMgJEZyZWVCU0QkDQo+ ICsjDQo+ICsNCj4gKy5QQVRIOiAkey5DVVJESVJ9Ly4uLy4uLy4uL25ldGluZXQvdGNwX3N0YWNr cw0KPiArDQo+ICtTVEFDS05BTUU9CWJicg0KPiArS01PRD0JdGNwXyR7U1RBQ0tOQU1FfQ0KPiAr U1JDUz0JYmJyLmMgc2Fja19maWx0ZXIuYyByYWNrX2Jicl9jb21tb24uYw0KPiArDQo+ICtTUkNT Kz0Jb3B0X2luZXQuaCBvcHRfaW5ldDYuaCBvcHRfaXBzZWMuaA0KPiArU1JDUys9CW9wdF90Y3Bk ZWJ1Zy5oDQo+ICtTUkNTKz0Jb3B0X2tlcm5fdGxzLmgNCj4gKw0KPiArIw0KPiArIyBFbmFibGUg ZnVsbCBkZWJ1Z2dpbmcNCj4gKyMNCj4gKyNDRkxBR1MgKz0gLWcNCj4gKw0KPiArQ0ZMQUdTKz0J LURNT0ROQU1FPSR7S01PRH0NCj4gK0NGTEFHUys9CS1EU1RBQ0tOQU1FPSR7U1RBQ0tOQU1FfQ0K PiArDQo+ICsuaW5jbHVkZSA8YnNkLmttb2QubWs+DQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMv bmV0aW5ldC9pcF9vdXRwdXQuYw0KPiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCj4gLS0tIGhlYWQv c3lzL25ldGluZXQvaXBfb3V0cHV0LmMJVHVlIFNlcCAyNCAxNzowNjozMiAyMDE5CShyMzUyNjU2 KQ0KPiArKysgaGVhZC9zeXMvbmV0aW5ldC9pcF9vdXRwdXQuYwlUdWUgU2VwIDI0IDE4OjE4OjEx IDIwMTkJKHIzNTI2NTcpDQo+IEBAIC0yMTIsNyArMjEyLDcgQEAgaXBfb3V0cHV0X3BmaWwoc3Ry dWN0IG1idWYgKiptcCwgc3RydWN0IGlmbmV0ICppZnAsIGluDQo+ICANCj4gIHN0YXRpYyBpbnQN Cj4gIGlwX291dHB1dF9zZW5kKHN0cnVjdCBpbnBjYiAqaW5wLCBzdHJ1Y3QgaWZuZXQgKmlmcCwg c3RydWN0IG1idWYgKm0sDQo+IC0gICAgY29uc3Qgc3RydWN0IHNvY2thZGRyX2luICpndywgc3Ry dWN0IHJvdXRlICpybykNCj4gKyAgICBjb25zdCBzdHJ1Y3Qgc29ja2FkZHJfaW4gKmd3LCBzdHJ1 Y3Qgcm91dGUgKnJvLCBib29sIHN0YW1wX3RhZykNCj4gIHsNCj4gICNpZmRlZiBLRVJOX1RMUw0K PiAgCXN0cnVjdCBrdGxzX3Nlc3Npb24gKnRscyA9IE5VTEw7DQo+IEBAIC0yNTYsNyArMjU2LDcg QEAgaXBfb3V0cHV0X3NlbmQoc3RydWN0IGlucGNiICppbnAsIHN0cnVjdCBpZm5ldCAqaWZwLCBz DQo+ICAJCQltc3QgPSBpbnAtPmlucF9zbmRfdGFnOw0KPiAgCX0NCj4gICNlbmRpZg0KPiAtCWlm IChtc3QgIT0gTlVMTCkgew0KPiArCWlmIChzdGFtcF90YWcgJiYgbXN0ICE9IE5VTEwpIHsNCj4g IAkJS0FTU0VSVChtLT5tX3BrdGhkci5yY3ZpZiA9PSBOVUxMLA0KPiAgCQkgICAgKCJ0cnlpbmcg dG8gYWRkIGEgc2VuZCB0YWcgdG8gYSBmb3J3YXJkZWQgcGFja2V0IikpOw0KPiAgCQlpZiAobXN0 LT5pZnAgIT0gaWZwKSB7DQo+IEBAIC03OTEsNyArNzkxLDggQEAgc2VuZGl0Og0KPiAgCQkgKi8N Cj4gIAkJbV9jbHJwcm90b2ZsYWdzKG0pOw0KPiAgCQlJUF9QUk9CRShzZW5kLCBOVUxMLCBOVUxM LCBpcCwgaWZwLCBpcCwgTlVMTCk7DQo+IC0JCWVycm9yID0gaXBfb3V0cHV0X3NlbmQoaW5wLCBp ZnAsIG0sIGd3LCBybyk7DQo+ICsJCWVycm9yID0gaXBfb3V0cHV0X3NlbmQoaW5wLCBpZnAsIG0s IGd3LCBybywNCj4gKwkJICAgIChmbGFncyAmIElQX05PX1NORF9UQUdfUkwpID8gZmFsc2UgOiB0 cnVlKTsNCj4gIAkJZ290byBkb25lOw0KPiAgCX0NCj4gIA0KPiBAQCAtODI3LDcgKzgyOCw3IEBA IHNlbmRpdDoNCj4gIA0KPiAgCQkJSVBfUFJPQkUoc2VuZCwgTlVMTCwgTlVMTCwgbXRvZChtLCBz dHJ1Y3QgaXAgKiksIGlmcCwNCj4gIAkJCSAgICBtdG9kKG0sIHN0cnVjdCBpcCAqKSwgTlVMTCk7 DQo+IC0JCQllcnJvciA9IGlwX291dHB1dF9zZW5kKGlucCwgaWZwLCBtLCBndywgcm8pOw0KPiAr CQkJZXJyb3IgPSBpcF9vdXRwdXRfc2VuZChpbnAsIGlmcCwgbSwgZ3csIHJvLCB0cnVlKTsNCj4g IAkJfSBlbHNlDQo+ICAJCQltX2ZyZWVtKG0pOw0KPiAgCX0NCj4gDQo+IE1vZGlmaWVkOiBoZWFk L3N5cy9uZXRpbmV0L2lwX3Zhci5oDQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVh ZC9zeXMvbmV0aW5ldC9pcF92YXIuaAlUdWUgU2VwIDI0IDE3OjA2OjMyIDIwMTkJKHIzNTI2NTYp DQo+ICsrKyBoZWFkL3N5cy9uZXRpbmV0L2lwX3Zhci5oCVR1ZSBTZXAgMjQgMTg6MTg6MTEgMjAx OQkocjM1MjY1NykNCj4gQEAgLTE2Niw2ICsxNjYsNyBAQCB2b2lkCWttb2RfaXBzdGF0X2RlYyhp bnQgc3RhdG51bSk7DQo+ICAjZGVmaW5lIElQX1JPVVRFVE9JRgkJU09fRE9OVFJPVVRFCS8qIDB4 MTAgYnlwYXNzIHJvdXRpbmcgdGFibGVzICovDQo+ICAjZGVmaW5lIElQX0FMTE9XQlJPQURDQVNU CVNPX0JST0FEQ0FTVAkvKiAweDIwIGNhbiBzZW5kIGJyb2FkY2FzdCBwYWNrZXRzICovDQo+ICAj ZGVmaW5lCUlQX05PREVGQVVMVEZMT1dJRAkweDQwCQkvKiBEb24ndCBzZXQgdGhlIGZsb3dpZCBm cm9tDQo+IGlucCAqLyArI2RlZmluZSBJUF9OT19TTkRfVEFHX1JMCTB4ODAJCS8qIERvbid0IHNl bmQgZG93biB0aGUgcmF0ZWxpbWl0DQo+IHRhZyAqLyANCj4gICNpZmRlZiBfX05PX1NUUklDVF9B TElHTk1FTlQNCj4gICNkZWZpbmUgSVBfSERSX0FMSUdORURfUChpcCkJMQ0KPiANCj4gTW9kaWZp ZWQ6IGhlYWQvc3lzL25ldGluZXQvdGNwLmgNCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0t LSBoZWFkL3N5cy9uZXRpbmV0L3RjcC5oCVR1ZSBTZXAgMjQgMTc6MDY6MzIgMjAxOQkocjM1MjY1 NikNCj4gKysrIGhlYWQvc3lzL25ldGluZXQvdGNwLmgJVHVlIFNlcCAyNCAxODoxODoxMSAyMDE5 CShyMzUyNjU3KQ0KPiBAQCAtMjM5LDYgKzIzOSw3IEBAIHN0cnVjdCB0Y3BoZHIgew0KPiAgI2Rl ZmluZSBUQ1BfQkJSX0FDS19DT01QX0FMRyAgIDEwOTYgCS8qIE5vdCB1c2VkICovDQo+ICAjZGVm aW5lIFRDUF9CQlJfVE1SX1BBQ0VfT0ggICAgMTA5NgkvKiBSZWN5Y2xlZCBpbiA0LjIgKi8NCj4g ICNkZWZpbmUgVENQX0JCUl9FWFRSQV9HQUlOICAgICAxMDk3DQo+ICsjZGVmaW5lIFRDUF9SQUNL X0RPX0RFVEVDVElPTiAgMTA5NwkvKiBSZWN5Y2xlIG9mIGV4dHJhIGdhaW4gZm9yIHJhY2ssIGF0 dGFjaw0KPiBkZXRlY3Rpb24gKi8gI2RlZmluZSBUQ1BfQkJSX1JBQ0tfUlRUX1VTRSAgIDEwOTgJ Lyogd2hhdCBSVFQgc2hvdWxkIHdlIHVzZSAwLCAxLCBvcg0KPiAyPyAqLyAjZGVmaW5lIFRDUF9C QlJfUkVUUkFOX1dUU08gICAgMTA5OQ0KPiAgI2RlZmluZSBUQ1BfREFUQV9BRlRFUl9DTE9TRSAg IDExMDANCj4gDQo+IEFkZGVkOiBoZWFkL3N5cy9uZXRpbmV0L3RjcF9zdGFja3MvYmJyLmMNCj4g PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSAvZGV2L251bGwJMDA6MDA6MDAgMTk3MAkoZW1w dHksIGJlY2F1c2UgZmlsZSBpcyBuZXdseSBhZGRlZCkNCj4gKysrIGhlYWQvc3lzL25ldGluZXQv dGNwX3N0YWNrcy9iYnIuYwlUdWUgU2VwIDI0IDE4OjE4OjExIDIwMTkJKHIzNTI2NTcpDQo+IEBA IC0wLDAgKzEsMTUxODkgQEANCj4gKy8qLQ0KPiArICogQ29weXJpZ2h0IChjKSAyMDE2LTIwMTkN Cj4gKyAqCU5ldGZsaXggSW5jLg0KPiArICogICAgICBBbGwgcmlnaHRzIHJlc2VydmVkLg0KPiAr ICoNCj4gKyAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9y bXMsIHdpdGggb3Igd2l0aG91dA0KPiArICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHBy b3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zDQo+ICsgKiBhcmUgbWV0Og0KPiAr ICogMS4gUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92 ZSBjb3B5cmlnaHQNCj4gKyAqICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5k IHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci4NCj4gKyAqIDIuIFJlZGlzdHJpYnV0aW9ucyBpbiBi aW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0DQo+ICsgKiAgICBu b3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWlt ZXIgaW4gdGhlDQo+ICsgKiAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMg cHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLg0KPiArICoNCj4gKyAqIFRISVMgU09GVFdB UkUgSVMgUFJPVklERUQgQlkgVEhFIFJFR0VOVFMgQU5EIENPTlRSSUJVVE9SUyBgYEFTIElTJycg QU5EDQo+ICsgKiBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywg QlVUIE5PVCBMSU1JVEVEIFRPLCBUSEUNCj4gKyAqIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJD SEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFDQo+ICsgKiBB UkUgRElTQ0xBSU1FRC4gIElOIE5PIEVWRU5UIFNIQUxMIFRIRSBSRUdFTlRTIE9SIENPTlRSSUJV VE9SUyBCRSBMSUFCTEUNCj4gKyAqIEZPUiBBTlkgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRB TCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMDQo+ICsgKiBEQU1BR0VTIChJ TkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBH T09EUw0KPiArICogT1IgU0VSVklDRVM7IExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBP UiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pDQo+ICsgKiBIT1dFVkVSIENBVVNFRCBBTkQgT04gQU5Z IFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVA0KPiArICog TElBQklMSVRZLCBPUiBUT1JUIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFS SVNJTkcgSU4gQU5ZIFdBWQ0KPiArICogT1VUIE9GIFRIRSBVU0UgT0YgVEhJUyBTT0ZUV0FSRSwg RVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRg0KPiArICogU1VDSCBEQU1BR0Uu DQo+ICsgKg0KPiArICovDQo+ICsvKioNCj4gKyAqIEF1dGhvcjogUmFuZGFsbCBTdGV3YXJ0IDxy cnNAbmV0ZmxpeC5jb20+DQo+ICsgKiBUaGlzIHdvcmsgaXMgYmFzZWQgb24gdGhlIEFDTSBRdWV1 ZSBwYXBlcg0KPiArICogQkJSIC0gQ29uZ2VzdGlvbiBCYXNlZCBDb25nZXN0aW9uIENvbnRyb2wN Cj4gKyAqIGFuZCBhbHNvIG51bWVyb3VzIGRpc2N1c3Npb25zIHdpdGggTmVhbCwgWXVjaHVuZyBh bmQgVmFuLg0KPiArICovDQo+ICsNCj4gKyNpbmNsdWRlIDxzeXMvY2RlZnMuaD4NCj4gK19fRkJT RElEKCIkRnJlZUJTRCQiKTsNCj4gKw0KPiArI2luY2x1ZGUgIm9wdF9pbmV0LmgiDQo+ICsjaW5j bHVkZSAib3B0X2luZXQ2LmgiDQo+ICsjaW5jbHVkZSAib3B0X2lwc2VjLmgiDQo+ICsjaW5jbHVk ZSAib3B0X3RjcGRlYnVnLmgiDQo+ICsjaW5jbHVkZSAib3B0X3JhdGVsaW1pdC5oIg0KPiArI2lu Y2x1ZGUgIm9wdF9rZXJuX3Rscy5oIg0KPiArI2luY2x1ZGUgPHN5cy9wYXJhbS5oPg0KPiArI2lu Y2x1ZGUgPHN5cy9tb2R1bGUuaD4NCj4gKyNpbmNsdWRlIDxzeXMva2VybmVsLmg+DQo+ICsjaWZk ZWYgVENQX0hIT09LDQo+ICsjaW5jbHVkZSA8c3lzL2hob29rLmg+DQo+ICsjZW5kaWYNCj4gKyNp bmNsdWRlIDxzeXMvbWFsbG9jLmg+DQo+ICsjaW5jbHVkZSA8c3lzL21idWYuaD4NCj4gKyNpbmNs dWRlIDxzeXMvcHJvYy5oPg0KPiArI2luY2x1ZGUgPHN5cy9zb2NrZXQuaD4NCj4gKyNpbmNsdWRl IDxzeXMvc29ja2V0dmFyLmg+DQo+ICsjaWZkZWYgS0VSTl9UTFMNCj4gKyNpbmNsdWRlIDxzeXMv a3Rscy5oPg0KPiArI2VuZGlmDQo+ICsjaW5jbHVkZSA8c3lzL3N5c2N0bC5oPg0KPiArI2luY2x1 ZGUgPHN5cy9zeXN0bS5oPg0KPiArI2luY2x1ZGUgPHN5cy9xbWF0aC5oPg0KPiArI2luY2x1ZGUg PHN5cy90cmVlLmg+DQo+ICsjaWZkZWYgTkVURkxJWF9TVEFUUw0KPiArI2luY2x1ZGUgPHN5cy9z dGF0cy5oPiAvKiBNdXN0IGNvbWUgYWZ0ZXIgcW1hdGguaCBhbmQgdHJlZS5oICovDQo+ICsjZW5k aWYNCj4gKyNpbmNsdWRlIDxzeXMvcmVmY291bnQuaD4NCj4gKyNpbmNsdWRlIDxzeXMvcXVldWUu aD4NCj4gKyNpbmNsdWRlIDxzeXMvZXZlbnRoYW5kbGVyLmg+DQo+ICsjaW5jbHVkZSA8c3lzL3Nt cC5oPg0KPiArI2luY2x1ZGUgPHN5cy9rdGhyZWFkLmg+DQo+ICsjaW5jbHVkZSA8c3lzL2xvY2su aD4NCj4gKyNpbmNsdWRlIDxzeXMvbXV0ZXguaD4NCj4gKyNpbmNsdWRlIDxzeXMvdGltX2ZpbHRl ci5oPg0KPiArI2luY2x1ZGUgPHN5cy90aW1lLmg+DQo+ICsjaW5jbHVkZSA8dm0vdW1hLmg+DQo+ ICsjaW5jbHVkZSA8c3lzL2tlcm5fcHJlZmV0Y2guaD4NCj4gKw0KPiArI2luY2x1ZGUgPG5ldC9y b3V0ZS5oPg0KPiArI2luY2x1ZGUgPG5ldC92bmV0Lmg+DQo+ICsNCj4gKyNkZWZpbmUgVENQU1RB VEVTCQkvKiBmb3IgbG9nZ2luZyAqLw0KPiArDQo+ICsjaW5jbHVkZSA8bmV0aW5ldC9pbi5oPg0K PiArI2luY2x1ZGUgPG5ldGluZXQvaW5fa2R0cmFjZS5oPg0KPiArI2luY2x1ZGUgPG5ldGluZXQv aW5fcGNiLmg+DQo+ICsjaW5jbHVkZSA8bmV0aW5ldC9pcC5oPg0KPiArI2luY2x1ZGUgPG5ldGlu ZXQvaXBfaWNtcC5oPgkvKiByZXF1aXJlZCBmb3IgaWNtcF92YXIuaCAqLw0KPiArI2luY2x1ZGUg PG5ldGluZXQvaWNtcF92YXIuaD4JLyogZm9yIElDTVBfQkFORExJTSAqLw0KPiArI2luY2x1ZGUg PG5ldGluZXQvaXBfdmFyLmg+DQo+ICsjaW5jbHVkZSA8bmV0aW5ldC9pcDYuaD4NCj4gKyNpbmNs dWRlIDxuZXRpbmV0Ni9pbjZfcGNiLmg+DQo+ICsjaW5jbHVkZSA8bmV0aW5ldDYvaXA2X3Zhci5o Pg0KPiArI2RlZmluZQlUQ1BPVVRGTEFHUw0KPiArI2luY2x1ZGUgPG5ldGluZXQvdGNwLmg+DQo+ ICsjaW5jbHVkZSA8bmV0aW5ldC90Y3BfZnNtLmg+DQo+ICsjaW5jbHVkZSA8bmV0aW5ldC90Y3Bf c2VxLmg+DQo+ICsjaW5jbHVkZSA8bmV0aW5ldC90Y3BfdGltZXIuaD4NCj4gKyNpbmNsdWRlIDxu ZXRpbmV0L3RjcF92YXIuaD4NCj4gKyNpbmNsdWRlIDxuZXRpbmV0L3RjcGlwLmg+DQo+ICsjaW5j bHVkZSA8bmV0aW5ldC90Y3BfaHB0cy5oPg0KPiArI2luY2x1ZGUgPG5ldGluZXQvY2MvY2MuaD4N Cj4gKyNpbmNsdWRlIDxuZXRpbmV0L3RjcF9sb2dfYnVmLmg+DQo+ICsjaW5jbHVkZSA8bmV0aW5l dC90Y3BfcmF0ZWxpbWl0Lmg+DQo+ICsjaW5jbHVkZSA8bmV0aW5ldC90Y3BfbHJvLmg+DQo+ICsj aWZkZWYgVENQREVCVUcNCj4gKyNpbmNsdWRlIDxuZXRpbmV0L3RjcF9kZWJ1Zy5oPg0KPiArI2Vu ZGlmCQkJCS8qIFRDUERFQlVHICovDQo+ICsjaWZkZWYgVENQX09GRkxPQUQNCj4gKyNpbmNsdWRl IDxuZXRpbmV0L3RjcF9vZmZsb2FkLmg+DQo+ICsjZW5kaWYNCj4gKyNpZmRlZiBJTkVUNg0KPiAr I2luY2x1ZGUgPG5ldGluZXQ2L3RjcDZfdmFyLmg+DQo+ICsjZW5kaWYNCj4gKyNpbmNsdWRlIDxu ZXRpbmV0L3RjcF9mYXN0b3Blbi5oPg0KPiArDQo+ICsjaW5jbHVkZSA8bmV0aXBzZWMvaXBzZWNf c3VwcG9ydC5oPg0KPiArI2luY2x1ZGUgPG5ldC9pZi5oPg0KPiArI2luY2x1ZGUgPG5ldC9pZl92 YXIuaD4NCj4gKyNpbmNsdWRlIDxuZXQvZXRoZXJuZXQuaD4NCj4gKw0KPiArI2lmIGRlZmluZWQo SVBTRUMpIHx8IGRlZmluZWQoSVBTRUNfU1VQUE9SVCkNCj4gKyNpbmNsdWRlIDxuZXRpcHNlYy9p cHNlYy5oPg0KPiArI2luY2x1ZGUgPG5ldGlwc2VjL2lwc2VjNi5oPg0KPiArI2VuZGlmCQkJCS8q IElQU0VDICovDQo+ICsNCj4gKyNpbmNsdWRlIDxuZXRpbmV0L3VkcC5oPg0KPiArI2luY2x1ZGUg PG5ldGluZXQvdWRwX3Zhci5oPg0KPiArI2luY2x1ZGUgPG1hY2hpbmUvaW5fY2tzdW0uaD4NCj4g Kw0KPiArI2lmZGVmIE1BQw0KPiArI2luY2x1ZGUgPHNlY3VyaXR5L21hYy9tYWNfZnJhbWV3b3Jr Lmg+DQo+ICsjZW5kaWYNCj4gKw0KPiArI2luY2x1ZGUgInNhY2tfZmlsdGVyLmgiDQo+ICsjaW5j bHVkZSAidGNwX2Jici5oIg0KPiArI2luY2x1ZGUgInJhY2tfYmJyX2NvbW1vbi5oIg0KPiArdW1h X3pvbmVfdCBiYnJfem9uZTsNCj4gK3VtYV96b25lX3QgYmJyX3BjYl96b25lOw0KPiArDQo+ICtz dHJ1Y3Qgc3lzY3RsX2N0eF9saXN0IGJicl9zeXNjdGxfY3R4Ow0KPiArc3RydWN0IHN5c2N0bF9v aWQgKmJicl9zeXNjdGxfcm9vdDsNCj4gKw0KPiArI2RlZmluZQlUQ1BUX1JBTkdFU0VUX05PU0xP UCh0diwgdmFsdWUsIHR2bWluLCB0dm1heCkgZG8geyBcDQo+ICsJKHR2KSA9ICh2YWx1ZSk7IFwN Cj4gKwlpZiAoKHVfbG9uZykodHYpIDwgKHVfbG9uZykodHZtaW4pKSBcDQo+ICsJCSh0dikgPSAo dHZtaW4pOyBcDQo+ICsJaWYgKCh1X2xvbmcpKHR2KSA+ICh1X2xvbmcpKHR2bWF4KSkgXA0KPiAr CQkodHYpID0gKHR2bWF4KTsgXA0KPiArfSB3aGlsZSgwKQ0KPiArDQo+ICsvKiNkZWZpbmUgQkJS X0lOVkFSSUFOVCAxKi8NCj4gKw0KPiArLyoNCj4gKyAqIGluaXRpYWwgd2luZG93DQo+ICsgKi8N Cj4gK3N0YXRpYyB1aW50MzJfdCBiYnJfZGVmX2luaXRfd2luID0gMTA7DQo+ICtzdGF0aWMgaW50 MzJfdCBiYnJfcGVyc2lzdF9taW4gPSAyNTAwMDA7CS8qIDI1MG1zICovDQo+ICtzdGF0aWMgaW50 MzJfdCBiYnJfcGVyc2lzdF9tYXggPSAxMDAwMDAwOwkvKiAxIFNlY29uZCAqLw0KPiArc3RhdGlj IGludDMyX3QgYmJyX2N3bmRfbWF5X3NocmluayA9IDA7DQo+ICtzdGF0aWMgaW50MzJfdCBiYnJf Y3duZHRhcmdldF9ydHRfdG91c2UgPSBCQlJfUlRUX1BST1A7DQo+ICtzdGF0aWMgaW50MzJfdCBi YnJfbnVtX3BrdGVwb19mb3JfZGVsX2xpbWl0ID0gQkJSX05VTV9SVFRTX0ZPUl9ERUxfTElNSVQ7 DQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfaGFyZHdhcmVfcGFjaW5nX2xpbWl0ID0gODAwMDsNCj4g K3N0YXRpYyBpbnQzMl90IGJicl9xdWFudGEgPSAzOwkvKiBIb3cgbXVjaCBleHRyYSBxdWFudGEg ZG8gd2UgZ2V0PyAqLw0KPiArc3RhdGljIGludDMyX3QgYmJyX25vX3JldHJhbiA9IDA7DQo+ICtz dGF0aWMgaW50MzJfdCBiYnJfdGNwX21hcF9lbnRyaWVzX2xpbWl0ID0gMTUwMDsNCj4gK3N0YXRp YyBpbnQzMl90IGJicl90Y3BfbWFwX3NwbGl0X2xpbWl0ID0gMjU2Ow0KPiArDQo+ICtzdGF0aWMg aW50MzJfdCBiYnJfZXJyb3JfYmFzZV9wYWNlb3V0ID0gMTAwMDA7IC8qIHVzZWMgdG8gcGFjZSAq Lw0KPiArc3RhdGljIGludDMyX3QgYmJyX21heF9uZXRfZXJyb3JfY250ID0gMTA7DQo+ICsvKiBT aG91bGQgdGhlIGZvbGxvd2luZyBiZSBkeW5hbWljIHRvbyAtLSBsb3NzIHdpc2UgKi8NCj4gK3N0 YXRpYyBpbnQzMl90IGJicl9ydHRfZ2Fpbl90aHJlc2ggPSAwOw0KPiArLyogTWVhc3VyZW1lbnQg Y29udHJvbHMgKi8NCj4gK3N0YXRpYyBpbnQzMl90IGJicl91c2VfZ29vZ2xlX2FsZ28gPSAxOw0K PiArc3RhdGljIGludDMyX3QgYmJyX3RzX2xpbWl0aW5nID0gMTsNCj4gK3N0YXRpYyBpbnQzMl90 IGJicl90c19jYW5fcmFpc2UgPSAwOw0KPiArc3RhdGljIGludDMyX3QgYmJyX2RvX3JlZCA9IDYw MDsNCj4gK3N0YXRpYyBpbnQzMl90IGJicl9yZWRfc2NhbGUgPSAyMDAwMDsNCj4gK3N0YXRpYyBp bnQzMl90IGJicl9yZWRfbXVsID0gMTsNCj4gK3N0YXRpYyBpbnQzMl90IGJicl9yZWRfZGl2ID0g MjsNCj4gK3N0YXRpYyBpbnQzMl90IGJicl9yZWRfZ3Jvd3RoX3Jlc3RyaWN0ID0gMTsNCj4gK3N0 YXRpYyBpbnQzMl90ICBiYnJfdGFyZ2V0X2lzX2JidW5pdCA9IDA7DQo+ICtzdGF0aWMgaW50MzJf dCBiYnJfZHJvcF9saW1pdCA9IDA7DQo+ICsvKg0KPiArICogSG93IG11Y2ggZ2FpbiBkbyB3ZSBu ZWVkIHRvIHNlZSB0bw0KPiArICogc3RheSBpbiBzdGFydHVwPw0KPiArICovDQo+ICtzdGF0aWMg aW50MzJfdCBiYnJfbWFya3Nfcnh0X3NhY2tfcGFzc2VkID0gMDsNCj4gK3N0YXRpYyBpbnQzMl90 IGJicl9zdGFydF9leGl0ID0gMjU7DQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfbG93X3N0YXJ0X2V4 aXQgPSAyNTsJLyogV2hlbiB3ZSBhcmUgaW4gcmVkdWNlZCBnYWluICovDQo+ICtzdGF0aWMgaW50 MzJfdCBiYnJfc3RhcnR1cF9sb3NzX3RocmVzaCA9IDIwMDA7CS8qIDIwLjAwJSBsb3NzICovDQo+ ICtzdGF0aWMgaW50MzJfdCBiYnJfaHB0c2lfbWF4X211bCA9IDE7CS8qIFRoZXNlIHR3byBtdWwv ZGl2IGFzc3VyZSBhIG1pbiBwYWNpbmcgKi8NCj4gK3N0YXRpYyBpbnQzMl90IGJicl9ocHRzaV9t YXhfZGl2ID0gMjsJLyogdGltZSwgMCBtZWFucyB0dXJuZWQgb2ZmLiBXZSBuZWVkIHRoaXMNCj4g KwkJCQkJICogaWYgd2UgZ28gYmFjayBldmVyIHRvIHdoZXJlIHRoZSBwYWNlcg0KPiArCQkJCQkg KiBoYXMgcHJpb3JpdHkgb3ZlciB0aW1lcnMuDQo+ICsJCQkJCSAqLw0KPiArc3RhdGljIGludDMy X3QgYmJyX3BvbGljZXJfY2FsbF9mcm9tX3JhY2tfdG8gPSAwOw0KPiArc3RhdGljIGludDMyX3Qg YmJyX3BvbGljZXJfZGV0ZWN0aW9uX2VuYWJsZWQgPSAxOw0KPiArc3RhdGljIGludDMyX3QgYmJy X21pbl9tZWFzdXJlbWVudHNfcmVxID0gMTsJLyogV2UgbmVlZCBhdCBsZWFzdCAyDQo+ICsJCQkJ CQkgKiBtZWFzdXJtZW50cyBiZWZvcmUgd2UgYXJlDQo+ICsJCQkJCQkgKiAiZ29vZCIgbm90ZSB0 aGF0IDIgPT0gMS4NCj4gKwkJCQkJCSAqIFRoaXMgaXMgYmVjYXVzZSB3ZSB1c2UgYSA+DQo+ICsJ CQkJCQkgKiBjb21wYXJpc29uLiBUaGlzIG1lYW5zIGlmDQo+ICsJCQkJCQkgKiBtaW5fbWVhc3Vy ZSB3YXMgMCwgaXQgdGFrZXMNCj4gKwkJCQkJCSAqIG51bS1tZWFzdXJlcyA+IG1pbigwKSBhbmQN Cj4gKwkJCQkJCSAqIHlvdSBnZXQgMSBtZWFzdXJlbWVudCBhbmQNCj4gKwkJCQkJCSAqIHlvdSBh cmUgZ29vZC4gU2V0IHRvIDEsIHlvdQ0KPiArCQkJCQkJICogaGF2ZSB0byBoYXZlIHR3bw0KPiAr CQkJCQkJICogbWVhc3VyZW1lbnRzICh0aGlzIGlzIGRvbmUNCj4gKwkJCQkJCSAqIHRvIHByZXZl bnQgaXQgZnJvbSBiZWluZyBvaw0KPiArCQkJCQkJICogdG8gaGF2ZSBubyBtZWFzdXJlbWVudHMp LiAqLw0KPiArc3RhdGljIGludDMyX3QgYmJyX25vX3BhY2luZ191bnRpbCA9IDQ7DQo+ICsJCQkJ CQkgDQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfbWluX3VzZWNfZGVsdGEgPSAyMDAwMDsJLyogMjAs MDAwIHVzZWNzICovDQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfbWluX3BlZXJfZGVsdGEgPSAyMDsJ CS8qIDIwIHVuaXRzICovDQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfZGVsdGFfcGVyY2VudCA9IDE1 MDsJCS8qIDE1LjAgJSAqLw0KPiArDQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfdGFyZ2V0X2N3bmRf bXVsdF9saW1pdCA9IDg7DQo+ICsvKg0KPiArICogYmJyX2N3bmRfbWluX3ZhbCBpcyB0aGUgbnVt YmVyIG9mDQo+ICsgKiBzZWdtZW50cyB3ZSBob2xkIHRvIGluIHRoZSBSVFQgcHJvYmUNCj4gKyAq IHN0YXRlIHR5cGljYWxseSA0Lg0KPiArICovDQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfY3duZF9t aW5fdmFsID0gQkJSX1BST0JFUlRUX05VTV9NU1M7DQo+ICsNCj4gKw0KPiArc3RhdGljIGludDMy X3QgYmJyX2N3bmRfbWluX3ZhbF9ocyA9IEJCUl9ISUdIU1BFRURfTlVNX01TUzsNCj4gKw0KPiAr c3RhdGljIGludDMyX3QgYmJyX2dhaW5fdG9fdGFyZ2V0ID0gMTsNCj4gK3N0YXRpYyBpbnQzMl90 IGJicl9nYWluX2dldHNfZXh0cmFfdG9vID0gMTsNCj4gKy8qDQo+ICsgKiBiYnJfaGlnaF9nYWlu IGlzIHRoZSAyL2xuKDIpIHZhbHVlIHdlIG5lZWQNCj4gKyAqIHRvIGRvdWJsZSB0aGUgc2VuZGlu ZyByYXRlIGluIHN0YXJ0dXAuIFRoaXMNCj4gKyAqIGlzIHVzZWQgZm9yIGJvdGggY3duZCBhbmQg aHB0c2kgZ2FpbidzLg0KPiArICovDQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfaGlnaF9nYWluID0g QkJSX1VOSVQgKiAyODg1IC8gMTAwMCArIDE7DQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfc3RhcnR1 cF9sb3dlciA9IEJCUl9VTklUICogMTUwMCAvIDEwMDAgKyAxOw0KPiArc3RhdGljIGludDMyX3Qg YmJyX3VzZV9sb3dlcl9nYWluX2luX3N0YXJ0dXAgPSAxOw0KPiArDQo+ICsvKiB0aHJlc2hvbGRz IGZvciByZWR1Y3Rpb24gb24gZHJhaW4gaW4gc3ViLXN0YXRlcy9kcmFpbiAqLw0KPiArc3RhdGlj IGludDMyX3QgYmJyX2RyYWluX3J0dCA9IEJCUl9TUlRUOw0KPiArc3RhdGljIGludDMyX3QgYmJy X2RyYWluX2Zsb29yID0gODg7DQo+ICtzdGF0aWMgaW50MzJfdCBnb29nbGVfYWxsb3dfZWFybHlf b3V0ID0gMTsNCj4gK3N0YXRpYyBpbnQzMl90IGdvb2dsZV9jb25zaWRlcl9sb3N0ID0gMTsNCj4g K3N0YXRpYyBpbnQzMl90IGJicl9kcmFpbl9kcm9wX211bCA9IDQ7DQo+ICtzdGF0aWMgaW50MzJf dCBiYnJfZHJhaW5fZHJvcF9kaXYgPSA1Ow0KPiArc3RhdGljIGludDMyX3QgYmJyX3JhbmRfb3Qg PSA1MDsNCj4gK3N0YXRpYyBpbnQzMl90IGJicl9jYW5fZm9yY2VfcHJvYmVydHQgPSAwOw0KPiAr c3RhdGljIGludDMyX3QgYmJyX2Nhbl9hZGp1c3RfcHJvYmVydHQgPSAxOw0KPiArc3RhdGljIGlu dDMyX3QgYmJyX3Byb2JlcnR0X3NldHNfcnR0ID0gMDsNCj4gK3N0YXRpYyBpbnQzMl90IGJicl9j YW5fdXNlX3RzX2Zvcl9ydHQgPSAxOw0KPiArc3RhdGljIGludDMyX3QgYmJyX2lzX3JhdGlvID0g MDsNCj4gK3N0YXRpYyBpbnQzMl90IGJicl9zdWJfZHJhaW5fYXBwX2xpbWl0ID0gMTsNCj4gK3N0 YXRpYyBpbnQzMl90IGJicl9wcnR0X3NsYW1fY3duZCA9IDE7DQo+ICtzdGF0aWMgaW50MzJfdCBi YnJfc3ViX2RyYWluX3NsYW1fY3duZCA9IDE7DQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfc2xhbV9j d25kX2luX21haW5fZHJhaW4gPSAxOw0KPiArc3RhdGljIGludDMyX3QgYmJyX2ZpbHRlcl9sZW5f c2VjID0gNjsJLyogSG93IGxvbmcgZG9lcyB0aGUgcnR0UHJvcCBmaWx0ZXINCj4gKwkJCQkJICog aG9sZCAqLw0KPiArc3RhdGljIHVpbnQzMl90IGJicl9ydHRfcHJvYmVfbGltaXQgPSAoVVNFQ1Nf SU5fU0VDT05EICogNCk7DQo+ICsvKg0KPiArICogYmJyX2RyYWluX2dhaW4gaXMgdGhlIHJldmVy c2Ugb2YgdGhlIGhpZ2hfZ2Fpbg0KPiArICogZGVzaWduZWQgdG8gZHJhaW4gYmFjayBvdXQgdGhl IHN0YW5kaW5nIHF1ZXVlDQo+ICsgKiB0aGF0IGlzIGZvcm1lZCBpbiBzdGFydHVwIGJ5IGNhdXNp bmcgYSBsYXJnZXINCj4gKyAqIGhwdHNpIGdhaW4gYW5kIHRodXMgZHJhaW5naW5nIHRoZSBwYWNr ZXRzDQo+ICsgKiBpbiBmbGlnaHQuDQo+ICsgKi8NCj4gK3N0YXRpYyBpbnQzMl90IGJicl9kcmFp bl9nYWluID0gQkJSX1VOSVQgKiAxMDAwIC8gMjg4NTsNCj4gK3N0YXRpYyBpbnQzMl90IGJicl9y dHRwcm9iZV9nYWluID0gMTkyOw0KPiArDQo+ICsvKg0KPiArICogVGhlIGN3bmRfZ2FpbiBpcyB0 aGUgZGVmYXVsdCBjd25kIGdhaW4gYXBwbGllZCB3aGVuDQo+ICsgKiBjYWxjdWxhdGluZyBhIHRh cmdldCBjd25kLiBOb3RlIHRoYXQgdGhlIGN3bmQgaXMNCj4gKyAqIGEgc2Vjb25kYXJ5IGZhY3Rv ciBpbiB0aGUgd2F5IEJCUiB3b3JrcyAoc2VlIHRoZQ0KPiArICogcGFwZXIgYW5kIHRoaW5rIGFi b3V0IGl0LCBpdCB3aWxsIHRha2Ugc29tZSB0aW1lKS4NCj4gKyAqIEJhc2ljYWxseSB0aGUgaHB0 c2lfZ2FpbiBzcHJlYWRzIHRoZSBwYWNrZXRzIG91dA0KPiArICogc28geW91IG5ldmVyIGdldCBt b3JlIHRoYW4gQkRQIHRvIHRoZSBwZWVyIGV2ZW4NCj4gKyAqIGlmIHRoZSBjd25kIGlzIGhpZ2gu IEluIG91ciBpbXBsZW1lbmF0aW9uIHRoYXQNCj4gKyAqIG1lYW5zIGluIG5vbi1yZWNvdmVyeS9y ZXRyYW5zbWlzc2lvbiBzY2VuYXJpb3MNCj4gKyAqIGN3bmQgd2lsbCBuZXZlciBiZSByZWFjaGVk IGJ5IHRoZSBmbGlnaHQtc2l6ZS4NCj4gKyAqLw0KPiArc3RhdGljIGludDMyX3QgYmJyX2N3bmRf Z2FpbiA9IEJCUl9VTklUICogMjsNCj4gK3N0YXRpYyBpbnQzMl90IGJicl90bHBfdHlwZV90b191 c2UgPSBCQlJfU1JUVDsNCj4gK3N0YXRpYyBpbnQzMl90IGJicl9kZWxhY2tfdGltZSA9IDEwMDAw MDsJLyogMTAwbXMgaW4gdXNlY29uZHMgKi8NCj4gK3N0YXRpYyBpbnQzMl90IGJicl9zYWNrX25v dF9yZXF1aXJlZCA9IDA7CS8qIHNldCB0byBvbmUgdG8gYWxsb3cgbm9uLXNhY2sgdG8gdXNlIGJi cg0KPiAqLyArc3RhdGljIGludDMyX3QgYmJyX2luaXRpYWxfYndfYnBzID0gNjI1MDA7CS8qIDUw MGticHMgaW4gYnl0ZXMgcHMgKi8NCj4gK3N0YXRpYyBpbnQzMl90IGJicl9pZ25vcmVfZGF0YV9h ZnRlcl9jbG9zZSA9IDE7DQo+ICtzdGF0aWMgaW50MTZfdCBiYnJfaHB0c2lfZ2FpbltdID0gew0K PiArCShCQlJfVU5JVCAqNSAvIDQpLA0KPiArCShCQlJfVU5JVCAqIDMgLyA0KSwNCj4gKwlCQlJf VU5JVCwNCj4gKwlCQlJfVU5JVCwNCj4gKwlCQlJfVU5JVCwNCj4gKwlCQlJfVU5JVCwNCj4gKwlC QlJfVU5JVCwNCj4gKwlCQlJfVU5JVA0KPiArfTsNCj4gK2ludDMyX3QgYmJyX3VzZV9yYWNrX3Jl c2VuZF9jaGVhdCA9IDE7DQo+ICtpbnQzMl90IGJicl9zZW5kc19mdWxsX2l3bmQgPSAxOw0KPiAr DQo+ICsjZGVmaW5lIEJCUl9IUFRTSV9HQUlOX01BWCA4DQo+ICsvKg0KPiArICogVGhlIEJCUiBt b2R1bGUgaW5jb3Jwb3JhdGVzIGEgbnVtYmVyIG9mDQo+ICsgKiBUQ1AgaWRlYXMgdGhhdCBoYXZl IGJlZW4gcHV0IG91dCBpbnRvIHRoZSBJRVRGDQo+ICsgKiBvdmVyIHRoZSBsYXN0IGZldyB5ZWFy czoNCj4gKyAqIC0gWXVjaHVuZyBDaGVuZydzIFJBQ0sgVENQIChmb3Igd2hpY2ggaXRzIG5hbWVk KSB0aGF0DQo+ICsgKiAgICB3aWxsIHN0b3AgdXMgdXNpbmcgdGhlIG51bWJlciBvZiBkdXAgYWNr cyBhbmQgaW5zdGVhZA0KPiArICogICAgdXNlIHRpbWUgYXMgdGhlIGdhZ2Ugb2Ygd2hlbiB3ZSBy ZXRyYW5zbWl0Lg0KPiArICogLSBSZW9yZGVyIERldGVjdGlvbiBvZiBSRkM0NzM3IGFuZCB0aGUg VGFpbC1Mb3NzIHByb2JlIGRyYWZ0DQo+ICsgKiAgICBvZiBEdWtraXBhdGkgZXQuYWwuDQo+ICsg KiAtIFZhbiBKYWNvYnNvbidzIGV0LmFsIEJCUi4NCj4gKyAqDQo+ICsgKiBSQUNLIGRlcGVuZHMg b24gU0FDSywgc28gaWYgYW4gZW5kcG9pbnQgYXJyaXZlcyB0aGF0DQo+ICsgKiBjYW5ub3QgZG8g U0FDSyB0aGUgc3RhdGUgbWFjaGluZSBiZWxvdyB3aWxsIHNodXR0bGUgdGhlDQo+ICsgKiBjb25u ZWN0aW9uIGJhY2sgdG8gdXNpbmcgdGhlICJkZWZhdWx0IiBUQ1Agc3RhY2sgdGhhdCBpcw0KPiAr ICogaW4gRnJlZUJTRC4NCj4gKyAqDQo+ICsgKiBUbyBpbXBsZW1lbnQgQkJSIGFuZCBSQUNLIHRo ZSBvcmlnaW5hbCBUQ1Agc3RhY2sgd2FzIGZpcnN0IGRlY29tcG9zZWQNCj4gKyAqIGludG8gYSBm dW5jdGlvbmFsIHN0YXRlIG1hY2hpbmUgd2l0aCBpbmRpdmlkdWFsIHN0YXRlcw0KPiArICogZm9y IGVhY2ggb2YgdGhlIHBvc3NpYmxlIFRDUCBjb25uZWN0aW9uIHN0YXRlcy4gVGhlIGRvX3NlZ2Vt ZW50DQo+ICsgKiBmdW5jdGlvbnMgcm9sZSBpbiBsaWZlIGlzIHRvIG1hbmRhdGUgdGhlIGNvbm5l Y3Rpb24gc3VwcG9ydHMgU0FDSw0KPiArICogaW5pdGlhbGx5IGFuZCB0aGVuIGFzc3VyZSB0aGF0 IHRoZSBSQUNLIHN0YXRlIG1hdGNoZXMgdGhlIGNvbmVuY3Rpb24NCj4gKyAqIHN0YXRlIGJlZm9y ZSBjYWxsaW5nIHRoZSBzdGF0ZXMgZG9fc2VnbWVudCBmdW5jdGlvbi4gRGF0YSBwcm9jZXNzaW5n DQo+ICsgKiBvZiBpbmJvdW5kIHNlZ21lbnRzIGFsc28gbm93IGhhcHBlbnMgaW4gdGhlIGhwdHNf ZG9fc2VnbWVudCBpbiBnZW5lcmFsDQo+ICsgKiB3aXRoIG9ubHkgb25lIGV4Y2VwdGlvbi4gVGhp cyBpcyBzbyB3ZSBjYW4ga2VlcCB0aGUgY29ubmVjdGlvbiBvbg0KPiArICogYSBzaW5nbGUgQ1BV Lg0KPiArICoNCj4gKyAqIEVhY2ggc3RhdGUgaXMgc2ltcGxpZmllZCBkdWUgdG8gdGhlIGZhY3Qg dGhhdCB0aGUgb3JpZ2luYWwgZG9fc2VnbWVudA0KPiArICogaGFzIGJlZW4gZGVjb21wb3NlZCBh bmQgd2UgKmtub3cqIHdoYXQgc3RhdGUgd2UgYXJlIGluIChubw0KPiArICogc3dpdGNoZXMgb24g dGhlIHN0YXRlKSBhbmQgYWxsIHRlc3RzIGZvciBTQUNLIGFyZSBnb25lLiBUaGlzDQo+ICsgKiBn cmVhdGx5IHNpbXBsaWZpZXMgd2hhdCBlYWNoIHN0YXRlIGRvZXMuDQo+ICsgKg0KPiArICogVENQ IG91dHB1dCBpcyBhbHNvIG92ZXItd3JpdHRlbiB3aXRoIGEgbmV3IHZlcnNpb24gc2luY2UgaXQN Cj4gKyAqIG11c3QgbWFpbnRhaW4gdGhlIG5ldyByYWNrIHNjb3JlYm9hcmQgYW5kIGhhcyBoYWQg aHB0c2kNCj4gKyAqIGludGVncmF0ZWQgYXMgYSByZXF1aXJtZW50LiBTdGlsbCB0b2RvIGlzIHRv IGVsaW1pbmF0ZSB0aGUNCj4gKyAqIHVzZSBvZiB0aGUgY2FsbG91dF8oKSBzeXN0ZW0gYW5kIHVz ZSB0aGUgaHB0cyBmb3IgYWxsDQo+ICsgKiB0aW1lcnMgYXMgd2VsbC4NCj4gKyAqLw0KPiArc3Rh dGljIHVpbnQzMl90IGJicl9ydHRfcHJvYmVfdGltZSA9IDIwMDAwMDsJLyogMjAwbXMgaW4gbWlj cm8gc2Vjb25kcyAqLw0KPiArc3RhdGljIHVpbnQzMl90IGJicl9ydHRfcHJvYmVfY3duZHRhcmcg PSA0OwkvKiBIb3cgbWFueSBtc3MncyBvdXRzdGFuZGluZyAqLw0KPiArc3RhdGljIGNvbnN0IGlu dDMyX3QgYmJyX21pbl9yZXFfZnJlZSA9IDI7CS8qIFRoZSBtaW4gd2UgbXVzdCBoYXZlIG9uIHRo ZQ0KPiArCQkJCQkJICogZnJlZSBsaXN0ICovDQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfdGxwX3Ro cmVzaCA9IDE7DQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfcmVvcmRlcl90aHJlc2ggPSAyOw0KPiAr c3RhdGljIGludDMyX3QgYmJyX3Jlb3JkZXJfZmFkZSA9IDYwMDAwMDAwOwkvKiAwIC0gbmV2ZXIg ZmFkZSwgZGVmDQo+ICsJCQkJCQkgKiA2MCwwMDAsMDAwIC0gNjAgc2Vjb25kcyAqLw0KPiArc3Rh dGljIGludDMyX3QgYmJyX3BrdF9kZWxheSA9IDEwMDA7DQo+ICtzdGF0aWMgaW50MzJfdCBiYnJf bWluX3RvID0gMTAwMDsJLyogTnVtYmVyIG9mIHVzZWMncyBtaW5pbXVtIHRpbWVvdXQgKi8NCj4g K3N0YXRpYyBpbnQzMl90IGJicl9pbmNyX3RpbWVycyA9IDE7DQo+ICsNCj4gK3N0YXRpYyBpbnQz Ml90IGJicl90bHBfbWluID0gMTAwMDA7CS8qIDEwbXMgaW4gdXNlY3MgKi8NCj4gK3N0YXRpYyBp bnQzMl90IGJicl9kZWxheWVkX2Fja190aW1lID0gMjAwMDAwOwkvKiAyMDBtcyBpbiB1c2VjcyAq Lw0KPiArc3RhdGljIGludDMyX3QgYmJyX2V4aXRfc3RhcnR1cF9hdF9sb3NzID0gMTsNCj4gKw0K PiArLyoNCj4gKyAqIGJicl9sdF9id19yYXRpbyBpcyAxLzh0aA0KPiArICogYmJyX2x0X2J3X2Rp ZmYgaXMgIDwgNCBLYml0L3NlYw0KPiArICovDQo+ICtzdGF0aWMgdWludDY0X3QgYmJyX2x0X2J3 X2RpZmYgPSA0MDAwIC8gODsJLyogSW4gYnl0ZXMgcGVyIHNlY29uZCAqLw0KPiArc3RhdGljIHVp bnQ2NF90IGJicl9sdF9id19yYXRpbyA9IDg7CS8qIEZvciAxLzh0aCAqLw0KPiArc3RhdGljIHVp bnQzMl90IGJicl9sdF9id19tYXhfcnR0cyA9IDQ4OwkvKiBIb3cgbWFueSBydHQncyBkbyB3ZSB1 c2UNCj4gKwkJCQkJCSAqIHRoZSBsdF9idyBmb3IgKi8NCj4gK3N0YXRpYyB1aW50MzJfdCBiYnJf bHRfaW50dmxfbWluX3J0dHMgPSA0OwkvKiBNaW4gbnVtIG9mIFJUVCdzIHRvIG1lYXN1cmUNCj4g KwkJCQkJCSAqIGx0X2J3ICovDQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfbHRfaW50dmxfZnAgPSAw OwkJLyogRmFsc2UgcG9zaXRpdmUgZXBvY2ggZGlmZiAqLw0KPiArc3RhdGljIGludDMyX3QgYmJy X2x0X2xvc3NfdGhyZXNoID0gMTk2OwkvKiBMb3N0IHZzIGRlbGl2ZXJlZCAlICovDQo+ICtzdGF0 aWMgaW50MzJfdCBiYnJfbHRfZmRfdGhyZXNoID0gMTAwOwkJLyogZmFsc2UgZGV0ZWN0aW9uICUg Ki8NCj4gKw0KPiArc3RhdGljIGludDMyX3QgYmJyX3ZlcmJvc2VfbG9nZ2luZyA9IDA7DQo+ICsv Kg0KPiArICogQ3VycmVudGx5IHJlZ3VsYXIgdGNwIGhhcyBhIHJ0b19taW4gb2YgMzBtcw0KPiAr ICogdGhlIGJhY2tvZmYgZ29lcyAxMiB0aW1lcyBzbyB0aGF0IGVuZHMgdXANCj4gKyAqIGJlaW5n IGEgdG90YWwgb2YgMTIyLjg1MCBzZWNvbmRzIGJlZm9yZSBhDQo+ICsgKiBjb25uZWN0aW9uIGlz IGtpbGxlZC4NCj4gKyAqLw0KPiArc3RhdGljIGludDMyX3QgYmJyX3J0b19taW5fbXMgPSAzMDsJ LyogMzBtcyBzYW1lIGFzIG1haW4gZnJlZWJzZCAqLw0KPiArc3RhdGljIGludDMyX3QgYmJyX3J0 b19tYXhfc2VjID0gNDsJLyogNCBzZWNvbmRzICovDQo+ICsNCj4gKy8qKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KPiArLyogREVGQVVMVCBUU08g U0laSU5HICAoY3B1IHBlcmZvcm1hbmNlIGltcGFjdGluZykgICovDQo+ICsvKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCj4gKy8qIFdoYXQgYW1v dW50IGlzIG91ciBmb3JtdWxhIHVzaW5nIHRvIGdldCBUU08gc2l6ZSAqLw0KPiArc3RhdGljIGlu dDMyX3QgYmJyX2hwdHNpX3Blcl9zZWNvbmQgPSAxMDAwOw0KPiArDQo+ICsvKg0KPiArICogRm9y IGhwdHNpIHVuZGVyIGJicl9jcm9zc19vdmVyIGNvbm5lY3Rpb25zIHdoYXQgaXMgZGVsYXkgDQo+ ICsgKiB0YXJnZXQgN21zIChpbiB1c2VjKSBjb21iaW5lZCB3aXRoIGEgc2VnX21heCBvZiAyDQo+ ICsgKiBnZXRzIHVzIGNsb3NlIHRvIGlkZW50aWNhbCBnb29nbGUgYmVoYXZpb3IgaW4gDQo+ICsg KiBUU08gc2l6ZSBzZWxlY3Rpb24gKHBvc3NpYmx5IG1vcmUgMU1TUyBzZW5kcykuDQo+ICsgKi8N Cj4gK3N0YXRpYyBpbnQzMl90IGJicl9ocHRzaV9zZWdtZW50c19kZWxheV90YXIgPSA3MDAwOw0K PiArDQo+ICsvKiBEb2VzIHBhY2luZyBkZWxheSBpbmNsdWRlIG92ZXJoZWFkJ3MgaW4gaXRzIHRp bWUgY2FsY3VsYXRpb25zPyAqLw0KPiArc3RhdGljIGludDMyX3QgYmJyX2luY2x1ZGVfZW5ldF9v aCA9IDA7DQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfaW5jbHVkZV9pcF9vaCA9IDE7DQo+ICtzdGF0 aWMgaW50MzJfdCBiYnJfaW5jbHVkZV90Y3Bfb2ggPSAxOw0KPiArc3RhdGljIGludDMyX3QgYmJy X2dvb2dsZV9kaXNjb3VudCA9IDEwOw0KPiArDQo+ICsvKiBEbyB3ZSB1c2UgKG5mIG1vZGUpIHBr dC1lcG9jaCB0byBkcml2ZSB1cyBvciBydHRQcm9wPyAqLw0KPiArc3RhdGljIGludDMyX3QgYmJy X3N0YXRlX2lzX3BrdF9lcG9jaCA9IDA7DQo+ICtzdGF0aWMgaW50MzJfdCBiYnJfc3RhdGVfZHJh aW5fMl90YXIgPSAxOw0KPiArLyogV2hhdCBpcyB0aGUgbWF4IHRoZSAwIC0gYmJyX2Nyb3NzX292 ZXIgTUJQUyBUU08gdGFyZ2V0DQo+ICsgKiBjYW4gcmVhY2ggdXNpbmcgb3VyIGRlbGF5IHRhcmdl dC4gTm90ZSB0aGF0IHRoaXMNCj4gKyAqIHZhbHVlIGJlY29tZXMgdGhlIGZsb29yIGZvciB0aGUg Y3Jvc3Mgb3Zlcg0KPiArICogYWxnb3JpdGhtLg0KPiANCj4gKioqIERJRkYgT1VUUFVUIFRSVU5D QVRFRCBBVCAxMDAwIExJTkVTICoqKg0KPiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fXw0KPiBzdm4tc3JjLWhlYWRAZnJlZWJzZC5vcmcgbWFpbGluZyBsaXN0 DQo+IGh0dHBzOi8vbGlzdHMuZnJlZWJzZC5vcmcvbWFpbG1hbi9saXN0aW5mby9zdm4tc3JjLWhl YWQNCg0KPiBUbyB1bnN1YnNjcmliZSwgc2VuZCBhbnkgbWFpbCB0byAic3ZuLXNyYy1oZWFkLXVu c3Vic2NyaWJlQGZyZWVic2Qub3JnIg0KDQpUaGlzIGJyZWFrIGtlcm5lbCBidWlsZHM6DQoNClsu Li5dDQovdXNyL3NyYy9zeXMvbW9kdWxlcy90Y3AvYmJyLy4uLy4uLy4uL25ldGluZXQvdGNwX3N0 YWNrcy9iYnIuYzo1NjEzOjk6IGVycm9yOiBpbXBsaWNpdA0KZGVjbGFyYXRpb24gb2YgZnVuY3Rp b24gJ3RjcF9jaGdfcGFjaW5nX3JhdGUnIGlzIGludmFsaWQgaW4gQzk5DQpbLVdlcnJvciwtV2lt cGxpY2l0LWZ1bmN0aW9uLWRlY2xhcmF0aW9uXSBucnRlID0gdGNwX2NoZ19wYWNpbmdfcmF0ZShi YnItPnJfY3RsLmNydGUsIF4NCi91c3Ivc3JjL3N5cy9tb2R1bGVzL3RjcC9iYnIvLi4vLi4vLi4v bmV0aW5ldC90Y3Bfc3RhY2tzL2Jici5jOjU2MTM6OTogZXJyb3I6IHRoaXMgZnVuY3Rpb24NCmRl Y2xhcmF0aW9uIGlzIG5vdCBhIHByb3RvdHlwZSBbLVdlcnJvciwtV3N0cmljdC1wcm90b3R5cGVz XQ0KL3Vzci9zcmMvc3lzL21vZHVsZXMvdGNwL2Jici8uLi8uLi8uLi9uZXRpbmV0L3RjcF9zdGFj a3MvYmJyLmM6NTYxMzo3OiBlcnJvcjogaW5jb21wYXRpYmxlDQppbnRlZ2VyIHRvIHBvaW50ZXIg Y29udmVyc2lvbiBhc3NpZ25pbmcgdG8gJ2NvbnN0IHN0cnVjdCB0Y3BfaHdyYXRlX2xpbWl0X3Rh YmxlIConIGZyb20gJ2ludCcNClstV2Vycm9yLC1XaW50LWNvbnZlcnNpb25dIG5ydGUgPSB0Y3Bf Y2hnX3BhY2luZ19yYXRlKGJici0+cl9jdGwuY3J0ZSwgXg0Kfn5+fn5+fn5+fn5+fn5+fn5+fn5+ fn5+fn5+fn5+fn5+fn5+IC0tLSBhbGxfc3ViZGlyX3RvZWNvcmUgLS0tIEJ1aWxkaW5nDQovdXNy L29iai91c3Ivc3JjL2FtZDY0LmFtZDY0L3N5cy9USE9SL21vZHVsZXMvdXNyL3NyYy9zeXMvbW9k dWxlcy90b2Vjb3JlL3RvZWNvcmUua28gLS0tDQphbGxfc3ViZGlyX3RjcCAtLS0gL3Vzci9zcmMv c3lzL21vZHVsZXMvdGNwL2Jici8uLi8uLi8uLi9uZXRpbmV0L3RjcF9zdGFja3MvYmJyLmM6MTA0 NDM6NDoNCmVycm9yOiBpbXBsaWNpdCBkZWNsYXJhdGlvbiBvZiBmdW5jdGlvbiAndGNwX3JlbF9w YWNpbmdfcmF0ZScgaXMgaW52YWxpZCBpbiBDOTkNClstV2Vycm9yLC1XaW1wbGljaXQtZnVuY3Rp b24tZGVjbGFyYXRpb25dIHRjcF9yZWxfcGFjaW5nX3JhdGUoYmJyLT5yX2N0bC5jcnRlLCBiYnIt PnJjX3RwKTsgXg0KLSAtLS0gYWxsX3N1YmRpcl90cG0gLS0tDQo9PT0+IHRwbSAoYWxsKQ0KLSAt LS0gYWxsX3N1YmRpcl90Y3AgLS0tDQovdXNyL3NyYy9zeXMvbW9kdWxlcy90Y3AvYmJyLy4uLy4u Ly4uL25ldGluZXQvdGNwX3N0YWNrcy9iYnIuYzoxMDQ0Mzo0OiBlcnJvcjogdGhpcyBmdW5jdGlv bg0KZGVjbGFyYXRpb24gaXMgbm90IGEgcHJvdG90eXBlIFstV2Vycm9yLC1Xc3RyaWN0LXByb3Rv dHlwZXNdIC0tLSBhbGxfc3ViZGlyX3RybSAtLS0NCj09PT4gdHJtIChhbGwpDQotIC0tLSBhbGxf c3ViZGlyX3RjcCAtLS0NCi91c3Ivc3JjL3N5cy9tb2R1bGVzL3RjcC9iYnIvLi4vLi4vLi4vbmV0 aW5ldC90Y3Bfc3RhY2tzL2Jici5jOjE0MzA3OjIxOiBlcnJvcjogaW1wbGljaXQNCmRlY2xhcmF0 aW9uIG9mIGZ1bmN0aW9uICd0Y3Bfc2V0X3BhY2luZ19yYXRlJyBpcyBpbnZhbGlkIGluIEM5OQ0K Wy1XZXJyb3IsLVdpbXBsaWNpdC1mdW5jdGlvbi1kZWNsYXJhdGlvbl0gYmJyLT5yX2N0bC5jcnRl ID0gdGNwX3NldF9wYWNpbmdfcmF0ZShiYnItPnJjX3RwLCANCg0KLSAtLSANCk8uIEhhcnRtYW5u DQoNCkljaCB3aWRlcnNwcmVjaGUgZGVyIE51dHp1bmcgb2RlciDDnGJlcm1pdHRsdW5nIG1laW5l ciBEYXRlbiBmw7xyDQpXZXJiZXp3ZWNrZSBvZGVyIGbDvHIgZGllIE1hcmt0LSBvZGVyIE1laW51 bmdzZm9yc2NodW5nICjCpyAyOCBBYnMuIDQgQkRTRykuDQotLS0tLUJFR0lOIFBHUCBTSUdOQVRV UkUtLS0tLQ0KDQppSFVFQVJZSUFCMFdJUVN5OElCeEFQRGtxVkJhVEo0NE4xWlpQYmE1UndVQ1hZ cHVqZ0FLQ1JBNE4xWlpQYmE1DQpSN2J3QVFEOWNnSmdKeWI1UHFYOEE4eDlSK0g5VHVuOWIrWVNn NFROSzN2UC9WZmZId0VBOE1OMkIvUVR2aEpjDQpXSVN5c2lMSGVPclFLR2hDSmJ0alcyUlVicHJM ZkFZPQ0KPTBoSXUNCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQ0K From owner-svn-src-head@freebsd.org Tue Sep 24 19:49: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 EE20012F520; Tue, 24 Sep 2019 19:49:29 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yw1-f66.google.com (mail-yw1-f66.google.com [209.85.161.66]) (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 46dBbX75fxz3Q6B; Tue, 24 Sep 2019 19:49:28 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yw1-f66.google.com with SMTP id n11so1085783ywn.6; Tue, 24 Sep 2019 12:49:28 -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=gg7hQjTDHOc3OpoKLf0QPysfe7XkSu4T4fs8+m7dPVI=; b=B2R5NwPKKggYKWglD/Bg06WdfK9ILUFuvZafk3gP1zVO3DPtgjw0qs0KY59jigeS/V XP0VDnCaSnEUoBLRm+DPllwwMyhQ3IoeJ9oKTS5+QmFVHAm905VTjoK+7zcoBVt8abQ7 so4ewJ/wKIF+FIfBbDfumH61NZ+na0hnsII04gCF+EOXf83fnTtQuf2oI0B5FZUcAY7m 3AQCBoWLjvzbIe4l2W3JXhhx1KWvklBvDnAr5XsqnyZ71y9tGb2Pbl7A2gEWKOQ1RXxF l01k94kFAiKhhn2AvYjcXWtz0Upra0zsCjEjN9Mxoqc8R59eCBzHYlwAmSKN42x4/nnQ HiUw== X-Gm-Message-State: APjAAAVf38noUFGeilsD+iJcw25oHEOdR4yv1YA/6kauFKJL8Db65FfK 0PRElFp3DasvRoT0Tcb3Y1Lnh+h2dLh7Ab3ilZsu+0hXhZI= X-Google-Smtp-Source: APXvYqx5pCJoLGfQINYhSKsEYKANXg3214ytWrab8MtpIr4OF4IigMyipavQ4UWj8vQRjCg2ZtqT3j0NsQr6qIrjatk= X-Received: by 2002:a81:5cd4:: with SMTP id q203mr3204782ywb.17.1569354567564; Tue, 24 Sep 2019 12:49:27 -0700 (PDT) MIME-Version: 1.0 References: <201909241818.x8OIIBNr039667@repo.freebsd.org> <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> From: Li-Wen Hsu Date: Tue, 24 Sep 2019 21:49:15 +0200 Message-ID: Subject: Re: svn commit: r352657 - in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys To: "O. Hartmann" Cc: Randall Stewart , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46dBbX75fxz3Q6B X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.161.66 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-3.22 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[66.161.85.209.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.161.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.22)[ip: (-0.54), ipnet: 209.85.128.0/17(-3.30), asn: 15169(-2.19), country: US(-0.05)]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@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]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; 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: Tue, 24 Sep 2019 19:49:30 -0000 On Tue, Sep 24, 2019 at 9:29 PM O. Hartmann wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Am Tue, 24 Sep 2019 18:18:11 +0000 (UTC) > Randall Stewart schrieb: > > > Author: rrs > > Date: Tue Sep 24 18:18:11 2019 > > New Revision: 352657 > > URL: https://svnweb.freebsd.org/changeset/base/352657 ... > This break kernel builds: > > [...] > /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: error: implicit > declaration of function 'tcp_chg_pacing_rate' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] nrte = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ > /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: error: this function > declaration is not a prototype [-Werror,-Wstrict-prototypes] > /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:7: error: incompatible > integer to pointer conversion assigning to 'const struct tcp_hwrate_limit_table *' from 'int' > [-Werror,-Wint-conversion] nrte = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- all_subdir_toecore --- Building > /usr/obj/usr/src/amd64.amd64/sys/THOR/modules/usr/src/sys/modules/toecore/toecore.ko --- > all_subdir_tcp --- /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: > error: implicit declaration of function 'tcp_rel_pacing_rate' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] tcp_rel_pacing_rate(bbr->r_ctl.crte, bbr->rc_tp); ^ > - --- all_subdir_tpm --- > ===> tpm (all) > - --- all_subdir_tcp --- > /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: error: this function > declaration is not a prototype [-Werror,-Wstrict-prototypes] --- all_subdir_trm --- > ===> trm (all) > - --- all_subdir_tcp --- > /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:14307:21: error: implicit > declaration of function 'tcp_set_pacing_rate' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] bbr->r_ctl.crte = tcp_set_pacing_rate(bbr->rc_tp, CI completed a clean build on 12.0-R: https://ci.freebsd.org/job/FreeBSD-head-amd64-build/14672/ What's your build environment and platform? Best, Li-Wen From owner-svn-src-head@freebsd.org Tue Sep 24 19:52: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 AA1DB12F75C for ; Tue, 24 Sep 2019 19:52:17 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) (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 46dBfm66vHz3QVZ for ; Tue, 24 Sep 2019 19:52:16 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pl1-x643.google.com with SMTP id e5so1410945pls.9 for ; Tue, 24 Sep 2019 12:52:16 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AkcKZmscqd7adt276du2P7XnxrS/yPS5OuGQVlnqses=; b=j85qTUgM7T5k00p+uLbrQzrOrgQm95bv/O103M/SH5P4p3fAJY70zCBAik5LV/ZafZ UqVVSXhiSdhvTLbSWwK8ma+UcZZDvZBJ7XVWUNRQZZNUXoXaes4C1O3JF9BddacyFJyW FgyA0sJ5IiSmnuPWwHw6pXbhIAzl9pZOErYjii8yjswK4JC9oE/eek1G+y4uLaYilLUT gpLXm4/tEreUX07bv9dZMM9RM2ePErSxShH18WthiLbYmZpHUif8QdFjquAInwuh2SD8 S0js6wQH8hkmtJyq10QjlYQHZzENKsJnQoje7XOL+t0FEDYl4vaSYlNWoWay29WQmEsT c6Zg== X-Gm-Message-State: APjAAAXtwqxILzJBsH/LZRs5OP3PFA8AAynM94HYinVCOU13dZlA5sVg B4Y4MDIS5zLtli4QyHDg9jKLEVOGYsM= X-Google-Smtp-Source: APXvYqzflieC3hlki6KpWwEEwlIKHygEAN5WZTh0CgvRHSebpkXx7um07vQc9CsyVbqQBjYGdh+SPA== X-Received: by 2002:a17:902:b60d:: with SMTP id b13mr4845864pls.197.1569354734944; Tue, 24 Sep 2019 12:52:14 -0700 (PDT) Received: from ?IPv6:2607:fb10:7021:1::eb2d? ([2607:fb10:7021:1::eb2d]) by smtp.gmail.com with ESMTPSA id z2sm4425811pfq.58.2019.09.24.12.52.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2019 12:52:13 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r352657 - in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys From: Randall Stewart In-Reply-To: <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> Date: Tue, 24 Sep 2019 12:52:08 -0700 Cc: Randall Ray Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2837AF7D-8040-491C-B9AE-9749412F9AE6@netflix.com> References: <201909241818.x8OIIBNr039667@repo.freebsd.org> <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> To: "O. Hartmann" X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 46dBfm66vHz3QVZ X-Spamd-Bar: ------------- X-Spamd-Result: default: False [-13.59 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[netflix.com: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]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[netflix.com:+]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[3.4.6.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]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.09)[ip: (-0.60), ipnet: 2607:f8b0::/32(-2.63), asn: 15169(-2.19), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+] 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, 24 Sep 2019 19:52:17 -0000 This is strange I built this and have it running on my machine with the standard make buildkern KERNCONF=3Dmyconf and make installkern KERNCONF=3Dmyconf Why can I build and it blow up.. last time I saw this I was building in = amd64/compile and was getting a warning that somehow is an error.. but this time it = *should* have built fine :( R > On Sep 24, 2019, at 12:28 PM, O. Hartmann = wrote: >=20 > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 >=20 > Am Tue, 24 Sep 2019 18:18:11 +0000 (UTC) > Randall Stewart schrieb: >=20 >> Author: rrs >> Date: Tue Sep 24 18:18:11 2019 >> New Revision: 352657 >> URL: https://svnweb.freebsd.org/changeset/base/352657 >>=20 >> Log: >> This commit adds BBR (Bottleneck Bandwidth and RTT) congestion = control. This >> is a completely separate TCP stack (tcp_bbr.ko) that will be built = only if >> you add the make options WITH_EXTRA_TCP_STACKS=3D1 and also include = the option >> TCPHPTS. You can also include the RATELIMIT option if you have a NIC = interface that >> supports hardware pacing, BBR understands how to use such a feature. >>=20 >> Note that this commit also adds in a general purpose time-filter = which >> allows you to have a min-filter or max-filter. A filter allows you = to >> have a low (or high) value for some period of time and degrade = slowly >> to another value has time passes. You can find out the details of >> BBR by looking at the original paper at: >>=20 >> https://queue.acm.org/detail.cfm?id=3D3022184 >>=20 >> or consult many other web resources you can find on the web >> referenced by "BBR congestion control". It should be noted that >> BBRv1 (which this is) does tend to unfairness in cases of small >> buffered paths, and it will usually get less bandwidth in the case >> of large BDP paths(when competing with new-reno or cubic flows). BBR >> is still an active research area and we do plan on implementing V2 >> of BBR to see if it is an improvement over V1. >>=20 >> Sponsored by: Netflix Inc. >> Differential Revision: https://reviews.freebsd.org/D21582 >>=20 >> Added: >> head/sys/kern/subr_filter.c (contents, props changed) >> head/sys/modules/tcp/bbr/ >> head/sys/modules/tcp/bbr/Makefile (contents, props changed) >> head/sys/netinet/tcp_stacks/bbr.c (contents, props changed) >> head/sys/netinet/tcp_stacks/tcp_bbr.h (contents, props changed) >> head/sys/sys/tim_filter.h (contents, props changed) >> Modified: >> head/sys/conf/files >> head/sys/modules/tcp/Makefile >> head/sys/netinet/ip_output.c >> head/sys/netinet/ip_var.h >> head/sys/netinet/tcp.h >> head/sys/netinet/tcp_stacks/rack.c >> head/sys/netinet/tcp_stacks/rack_bbr_common.c >> head/sys/netinet/tcp_stacks/rack_bbr_common.h >> head/sys/netinet/tcp_stacks/sack_filter.c >> head/sys/netinet/tcp_stacks/sack_filter.h >> head/sys/netinet/tcp_stacks/tcp_rack.h >> head/sys/sys/mbuf.h >>=20 >> Modified: head/sys/conf/files >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/conf/files Tue Sep 24 17:06:32 2019 = (r352656) >> +++ head/sys/conf/files Tue Sep 24 18:18:11 2019 = (r352657) >> @@ -3808,6 +3808,7 @@ kern/subr_epoch.c standard >> kern/subr_eventhandler.c standard >> kern/subr_fattime.c standard >> kern/subr_firmware.c optional firmware >> +kern/subr_filter.c standard >> kern/subr_gtaskqueue.c standard >> kern/subr_hash.c standard >> kern/subr_hints.c standard >>=20 >> Added: head/sys/kern/subr_filter.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 >> --- /dev/null 00:00:00 1970 (empty, because file is newly = added) >> +++ head/sys/kern/subr_filter.c Tue Sep 24 18:18:11 2019 = (r352657) >> @@ -0,0 +1,482 @@ >> +/*- >> + * Copyright (c) 2016-2019 Netflix, Inc. >> + * All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or = without >> + * modification, are permitted provided that the following = conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * 2. Redistributions in binary form must reproduce the above = copyright >> + * notice, this list of conditions and the following disclaimer = in the >> + * documentation and/or other materials provided with the = distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE 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. >> + */ >> + >> +/* >> + * Author: Randall Stewart >> + */ >> +#include >> +__FBSDID("$FreeBSD$"); >> +#include >> +#include >> +#include >> +#include >> + >> +void >> +reset_time(struct time_filter *tf, uint32_t time_len) >> +{ >> + tf->cur_time_limit =3D time_len; >> +} >> + >> +void >> +reset_time_small(struct time_filter_small *tf, uint32_t time_len) >> +{ >> + tf->cur_time_limit =3D time_len; >> +} >> + >> +/* >> + * A time filter can be a filter for MIN or MAX.=20 >> + * You call setup_time_filter() with the pointer to >> + * the filter structure, the type (FILTER_TYPE_MIN/MAX) and >> + * the time length. You can optionally reset the time length >> + * later with reset_time(). >> + * >> + * You generally call apply_filter_xxx() to apply the new value >> + * to the filter. You also provide a time (now). The filter will >> + * age out entries based on the time now and your time limit >> + * so that you are always maintaining the min or max in that >> + * window of time. Time is a relative thing, it might be ticks >> + * in milliseconds, it might be round trip times, its really >> + * up to you to decide what it is. >> + * >> + * To access the current flitered value you can use the macro >> + * get_filter_value() which returns the correct entry that >> + * has the "current" value in the filter. >> + * >> + * One thing that used to be here is a single apply_filter(). But >> + * this meant that we then had to store the type of filter in >> + * the time_filter structure. In order to keep it at a cache >> + * line size I split it to two functions.=20 >> + * >> + */ >> +int >> +setup_time_filter(struct time_filter *tf, int fil_type, uint32_t = time_len) >> +{ >> + uint64_t set_val; >> + int i; >> +=09 >> + /*=20 >> + * You must specify either a MIN or MAX filter, >> + * though its up to the user to use the correct >> + * apply. >> + */ >> + if ((fil_type !=3D FILTER_TYPE_MIN) && >> + (fil_type !=3D FILTER_TYPE_MAX)) >> + return(EINVAL); >> + >> + if (time_len < NUM_FILTER_ENTRIES) >> + return(EINVAL); >> + =20 >> + if (fil_type =3D=3D FILTER_TYPE_MIN) >> + set_val =3D 0xffffffffffffffff; >> + else >> + set_val =3D 0; >> + >> + for(i=3D0; i> + tf->entries[i].value =3D set_val; >> + tf->entries[i].time_up =3D 0; >> + } >> + tf->cur_time_limit =3D time_len; >> + return(0); >> +} >> + >> +int >> +setup_time_filter_small(struct time_filter_small *tf, int fil_type, = uint32_t time_len) >> +{ >> + uint32_t set_val; >> + int i; >> +=09 >> + /*=20 >> + * You must specify either a MIN or MAX filter, >> + * though its up to the user to use the correct >> + * apply. >> + */ >> + if ((fil_type !=3D FILTER_TYPE_MIN) && >> + (fil_type !=3D FILTER_TYPE_MAX)) >> + return(EINVAL); >> + >> + if (time_len < NUM_FILTER_ENTRIES) >> + return(EINVAL); >> + =20 >> + if (fil_type =3D=3D FILTER_TYPE_MIN) >> + set_val =3D 0xffffffff; >> + else >> + set_val =3D 0; >> + >> + for(i=3D0; i> + tf->entries[i].value =3D set_val; >> + tf->entries[i].time_up =3D 0; >> + } >> + tf->cur_time_limit =3D time_len; >> + return(0); >> +} >> + >> + >> +static void >> +check_update_times(struct time_filter *tf, uint64_t value, uint32_t = now) >> +{ >> + int i, j, fnd; >> + uint32_t tim; >> + uint32_t time_limit; >> + for(i=3D0; i<(NUM_FILTER_ENTRIES-1); i++) { >> + tim =3D now - tf->entries[i].time_up; >> + time_limit =3D (tf->cur_time_limit * >> (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; >> + if (tim >=3D time_limit) { >> + fnd =3D 0; >> + for(j=3D(i+1); j> + if (tf->entries[i].time_up < = tf->entries[j].time_up) { >> + tf->entries[i].value =3D = tf->entries[j].value; >> + tf->entries[i].time_up =3D = tf->entries[j].time_up; >> + fnd =3D 1; >> + break; >> + } >> + } >> + if (fnd =3D=3D 0) { >> + /* Nothing but the same old entry */ >> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + } >> + } >> + i =3D NUM_FILTER_ENTRIES-1; >> + tim =3D now - tf->entries[i].time_up; >> + time_limit =3D (tf->cur_time_limit * = (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; >> + if (tim >=3D time_limit) { >> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> +} >> + >> +static void >> +check_update_times_small(struct time_filter_small *tf, uint32_t = value, uint32_t now) >> +{ >> + int i, j, fnd; >> + uint32_t tim; >> + uint32_t time_limit; >> + for(i=3D0; i<(NUM_FILTER_ENTRIES-1); i++) { >> + tim =3D now - tf->entries[i].time_up; >> + time_limit =3D (tf->cur_time_limit * >> (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; >> + if (tim >=3D time_limit) { >> + fnd =3D 0; >> + for(j=3D(i+1); j> + if (tf->entries[i].time_up < = tf->entries[j].time_up) { >> + tf->entries[i].value =3D = tf->entries[j].value; >> + tf->entries[i].time_up =3D = tf->entries[j].time_up; >> + fnd =3D 1; >> + break; >> + } >> + } >> + if (fnd =3D=3D 0) { >> + /* Nothing but the same old entry */ >> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + } >> + } >> + i =3D NUM_FILTER_ENTRIES-1; >> + tim =3D now - tf->entries[i].time_up; >> + time_limit =3D (tf->cur_time_limit * = (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; >> + if (tim >=3D time_limit) { >> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> +} >> + >> + >> + >> +void >> +filter_reduce_by(struct time_filter *tf, uint64_t reduce_by, = uint32_t now) >> +{ >> + int i; >> + /*=20 >> + * Reduce our filter main by reduce_by and >> + * update its time. Then walk other's and >> + * make them the new value too. >> + */ >> + if (reduce_by < tf->entries[0].value) >> + tf->entries[0].value -=3D reduce_by; >> + else >> + tf->entries[0].value =3D 0; >> + tf->entries[0].time_up =3D now; >> + for(i=3D1; i> + tf->entries[i].value =3D tf->entries[0].value; >> + tf->entries[i].time_up =3D now; >> + } >> +} >> + >> +void >> +filter_reduce_by_small(struct time_filter_small *tf, uint32_t = reduce_by, uint32_t now) >> +{ >> + int i; >> + /*=20 >> + * Reduce our filter main by reduce_by and >> + * update its time. Then walk other's and >> + * make them the new value too. >> + */ >> + if (reduce_by < tf->entries[0].value) >> + tf->entries[0].value -=3D reduce_by; >> + else >> + tf->entries[0].value =3D 0; >> + tf->entries[0].time_up =3D now; >> + for(i=3D1; i> + tf->entries[i].value =3D tf->entries[0].value; >> + tf->entries[i].time_up =3D now; >> + } >> +} >> + >> +void >> +filter_increase_by(struct time_filter *tf, uint64_t incr_by, = uint32_t now) >> +{ >> + int i; >> + /*=20 >> + * Increase our filter main by incr_by and >> + * update its time. Then walk other's and >> + * make them the new value too. >> + */ >> + tf->entries[0].value +=3D incr_by; >> + tf->entries[0].time_up =3D now; >> + for(i=3D1; i> + tf->entries[i].value =3D tf->entries[0].value; >> + tf->entries[i].time_up =3D now; >> + } >> +} >> + >> +void >> +filter_increase_by_small(struct time_filter_small *tf, uint32_t = incr_by, uint32_t now) >> +{ >> + int i; >> + /*=20 >> + * Increase our filter main by incr_by and >> + * update its time. Then walk other's and >> + * make them the new value too. >> + */ >> + tf->entries[0].value +=3D incr_by; >> + tf->entries[0].time_up =3D now; >> + for(i=3D1; i> + tf->entries[i].value =3D tf->entries[0].value; >> + tf->entries[i].time_up =3D now; >> + } >> +} >> + >> +void >> +forward_filter_clock(struct time_filter *tf, uint32_t ticks_forward) >> +{ >> + /* >> + * Bring forward all time values by N ticks. This >> + * postpones expiring slots by that amount. >> + */ >> + int i; >> + >> + for(i=3D0; i> + tf->entries[i].time_up +=3D ticks_forward; >> + } >> +} >> + >> + >> +void >> +forward_filter_clock_small(struct time_filter_small *tf, uint32_t = ticks_forward) >> +{ >> + /* >> + * Bring forward all time values by N ticks. This >> + * postpones expiring slots by that amount. >> + */ >> + int i; >> + >> + for(i=3D0; i> + tf->entries[i].time_up +=3D ticks_forward; >> + } >> +} >> + >> + >> +void >> +tick_filter_clock(struct time_filter *tf, uint32_t now) >> +{ >> + int i; >> + uint32_t tim, time_limit; >> + >> + /* >> + * We start at two positions back. This >> + * is because the oldest worst value is >> + * preserved always, i.e. it can't expire >> + * due to clock ticking with no updated value. >> + * >> + * The other choice would be to fill it in with >> + * zero, but I don't like that option since >> + * some measurement is better than none (even >> + * if its your oldest measurment). >> + */ >> + for(i=3D(NUM_FILTER_ENTRIES-2); i>=3D0 ; i--) { >> + tim =3D now - tf->entries[i].time_up; >> + time_limit =3D (tf->cur_time_limit * >> (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; >> + if (tim >=3D time_limit) { >> + /*=20 >> + * This entry is expired, pull down >> + * the next one up. >> + */ >> + tf->entries[i].value =3D = tf->entries[(i+1)].value; >> + tf->entries[i].time_up =3D = tf->entries[(i+1)].time_up; >> + } >> + >> + } >> +} >> + >> +void >> +tick_filter_clock_small(struct time_filter_small *tf, uint32_t now) >> +{ >> + int i; >> + uint32_t tim, time_limit; >> + >> + /* >> + * We start at two positions back. This >> + * is because the oldest worst value is >> + * preserved always, i.e. it can't expire >> + * due to clock ticking with no updated value. >> + * >> + * The other choice would be to fill it in with >> + * zero, but I don't like that option since >> + * some measurement is better than none (even >> + * if its your oldest measurment). >> + */ >> + for(i=3D(NUM_FILTER_ENTRIES-2); i>=3D0 ; i--) { >> + tim =3D now - tf->entries[i].time_up; >> + time_limit =3D (tf->cur_time_limit * >> (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; >> + if (tim >=3D time_limit) { >> + /*=20 >> + * This entry is expired, pull down >> + * the next one up. >> + */ >> + tf->entries[i].value =3D = tf->entries[(i+1)].value; >> + tf->entries[i].time_up =3D = tf->entries[(i+1)].time_up; >> + } >> + >> + } >> +} >> + >> +uint32_t >> +apply_filter_min(struct time_filter *tf, uint64_t value, uint32_t = now) >> +{ >> + int i, j; >> +=09 >> + if (value <=3D tf->entries[0].value) { >> + /* Zap them all */ >> + for(i=3D0; i> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + return (tf->entries[0].value); >> + } >> + for (j=3D1; j> + if (value <=3D tf->entries[j].value) { >> + for(i=3Dj; i> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + break; >> + } >> + } >> + check_update_times(tf, value, now); >> + return (tf->entries[0].value); >> +} >> + >> +uint32_t >> +apply_filter_min_small(struct time_filter_small *tf, >> + uint32_t value, uint32_t now) >> +{ >> + int i, j; >> +=09 >> + if (value <=3D tf->entries[0].value) { >> + /* Zap them all */ >> + for(i=3D0; i> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + return (tf->entries[0].value); >> + } >> + for (j=3D1; j> + if (value <=3D tf->entries[j].value) { >> + for(i=3Dj; i> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + break; >> + } >> + } >> + check_update_times_small(tf, value, now); >> + return (tf->entries[0].value); >> +} >> + >> +uint32_t >> +apply_filter_max(struct time_filter *tf, uint64_t value, uint32_t = now) >> +{ >> + int i, j; >> +=09 >> + if (value >=3D tf->entries[0].value) { >> + /* Zap them all */ >> + for(i=3D0; i> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + return (tf->entries[0].value); >> + } >> + for (j=3D1; j> + if (value >=3D tf->entries[j].value) { >> + for(i=3Dj; i> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + break; >> + } >> + } >> + check_update_times(tf, value, now); >> + return (tf->entries[0].value); >> +} >> + >> + >> +uint32_t >> +apply_filter_max_small(struct time_filter_small *tf, >> + uint32_t value, uint32_t now) >> +{ >> + int i, j; >> +=09 >> + if (value >=3D tf->entries[0].value) { >> + /* Zap them all */ >> + for(i=3D0; i> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + return (tf->entries[0].value); >> + } >> + for (j=3D1; j> + if (value >=3D tf->entries[j].value) { >> + for(i=3Dj; i> + tf->entries[i].value =3D value; >> + tf->entries[i].time_up =3D now; >> + } >> + break; >> + } >> + } >> + check_update_times_small(tf, value, now); >> + return (tf->entries[0].value); >> +} >>=20 >> Modified: head/sys/modules/tcp/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/modules/tcp/Makefile Tue Sep 24 17:06:32 2019 = (r352656) >> +++ head/sys/modules/tcp/Makefile Tue Sep 24 18:18:11 2019 = (r352657) >> @@ -6,10 +6,12 @@ SYSDIR?=3D${SRCTOP}/sys >> .include "${SYSDIR}/conf/kern.opts.mk" >>=20 >> SUBDIR=3D \ >> + ${_tcp_bbr} \ >> ${_tcp_rack} \ >> ${_tcpmd5} \ >>=20 >> .if ${MK_EXTRA_TCP_STACKS} !=3D "no" || defined(ALL_MODULES) >> +_tcp_bbr=3D bbr >> _tcp_rack=3D rack >> .endif >>=20 >>=20 >> Added: head/sys/modules/tcp/bbr/Makefile >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- /dev/null 00:00:00 1970 (empty, because file is newly = added) >> +++ head/sys/modules/tcp/bbr/Makefile Tue Sep 24 18:18:11 2019 = (r352657) >> @@ -0,0 +1,23 @@ >> +# >> +# $FreeBSD$ >> +# >> + >> +.PATH: ${.CURDIR}/../../../netinet/tcp_stacks >> + >> +STACKNAME=3D bbr >> +KMOD=3D tcp_${STACKNAME} >> +SRCS=3D bbr.c sack_filter.c rack_bbr_common.c >> + >> +SRCS+=3D opt_inet.h opt_inet6.h opt_ipsec.h >> +SRCS+=3D opt_tcpdebug.h >> +SRCS+=3D opt_kern_tls.h >> + >> +# >> +# Enable full debugging >> +# >> +#CFLAGS +=3D -g >> + >> +CFLAGS+=3D -DMODNAME=3D${KMOD} >> +CFLAGS+=3D -DSTACKNAME=3D${STACKNAME} >> + >> +.include >>=20 >> Modified: head/sys/netinet/ip_output.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/netinet/ip_output.c Tue Sep 24 17:06:32 2019 = (r352656) >> +++ head/sys/netinet/ip_output.c Tue Sep 24 18:18:11 2019 = (r352657) >> @@ -212,7 +212,7 @@ ip_output_pfil(struct mbuf **mp, struct ifnet = *ifp, in >>=20 >> static int >> ip_output_send(struct inpcb *inp, struct ifnet *ifp, struct mbuf *m, >> - const struct sockaddr_in *gw, struct route *ro) >> + const struct sockaddr_in *gw, struct route *ro, bool stamp_tag) >> { >> #ifdef KERN_TLS >> struct ktls_session *tls =3D NULL; >> @@ -256,7 +256,7 @@ ip_output_send(struct inpcb *inp, struct ifnet = *ifp, s >> mst =3D inp->inp_snd_tag; >> } >> #endif >> - if (mst !=3D NULL) { >> + if (stamp_tag && mst !=3D NULL) { >> KASSERT(m->m_pkthdr.rcvif =3D=3D NULL, >> ("trying to add a send tag to a forwarded packet")); >> if (mst->ifp !=3D ifp) { >> @@ -791,7 +791,8 @@ sendit: >> */ >> m_clrprotoflags(m); >> IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); >> - error =3D ip_output_send(inp, ifp, m, gw, ro); >> + error =3D ip_output_send(inp, ifp, m, gw, ro, >> + (flags & IP_NO_SND_TAG_RL) ? false : true); >> goto done; >> } >>=20 >> @@ -827,7 +828,7 @@ sendit: >>=20 >> IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), = ifp, >> mtod(m, struct ip *), NULL); >> - error =3D ip_output_send(inp, ifp, m, gw, ro); >> + error =3D ip_output_send(inp, ifp, m, gw, ro, = true); >> } else >> m_freem(m); >> } >>=20 >> Modified: head/sys/netinet/ip_var.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/netinet/ip_var.h Tue Sep 24 17:06:32 2019 = (r352656) >> +++ head/sys/netinet/ip_var.h Tue Sep 24 18:18:11 2019 = (r352657) >> @@ -166,6 +166,7 @@ void kmod_ipstat_dec(int statnum); >> #define IP_ROUTETOIF SO_DONTROUTE /* 0x10 bypass routing = tables */ >> #define IP_ALLOWBROADCAST SO_BROADCAST /* 0x20 can send = broadcast packets */ >> #define IP_NODEFAULTFLOWID 0x40 /* Don't set the = flowid from >> inp */ +#define IP_NO_SND_TAG_RL 0x80 /* Don't send = down the ratelimit >> tag */=20 >> #ifdef __NO_STRICT_ALIGNMENT >> #define IP_HDR_ALIGNED_P(ip) 1 >>=20 >> Modified: head/sys/netinet/tcp.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/netinet/tcp.h Tue Sep 24 17:06:32 2019 = (r352656) >> +++ head/sys/netinet/tcp.h Tue Sep 24 18:18:11 2019 = (r352657) >> @@ -239,6 +239,7 @@ struct tcphdr { >> #define TCP_BBR_ACK_COMP_ALG 1096 /* Not used */ >> #define TCP_BBR_TMR_PACE_OH 1096 /* Recycled in 4.2 */ >> #define TCP_BBR_EXTRA_GAIN 1097 >> +#define TCP_RACK_DO_DETECTION 1097 /* Recycle of extra gain for = rack, attack >> detection */ #define TCP_BBR_RACK_RTT_USE 1098 /* what RTT = should we use 0, 1, or >> 2? */ #define TCP_BBR_RETRAN_WTSO 1099 >> #define TCP_DATA_AFTER_CLOSE 1100 >>=20 >> Added: head/sys/netinet/tcp_stacks/bbr.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 >> --- /dev/null 00:00:00 1970 (empty, because file is newly = added) >> +++ head/sys/netinet/tcp_stacks/bbr.c Tue Sep 24 18:18:11 2019 = (r352657) >> @@ -0,0 +1,15189 @@ >> +/*- >> + * Copyright (c) 2016-2019 >> + * Netflix Inc. >> + * All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or = without >> + * modification, are permitted provided that the following = conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * 2. Redistributions in binary form must reproduce the above = copyright >> + * notice, this list of conditions and the following disclaimer = in the >> + * documentation and/or other materials provided with the = distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE 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. >> + * >> + */ >> +/** >> + * Author: Randall Stewart >> + * This work is based on the ACM Queue paper >> + * BBR - Congestion Based Congestion Control >> + * and also numerous discussions with Neal, Yuchung and Van. >> + */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include "opt_inet.h" >> +#include "opt_inet6.h" >> +#include "opt_ipsec.h" >> +#include "opt_tcpdebug.h" >> +#include "opt_ratelimit.h" >> +#include "opt_kern_tls.h" >> +#include >> +#include >> +#include >> +#ifdef TCP_HHOOK >> +#include >> +#endif >> +#include >> +#include >> +#include >> +#include >> +#include >> +#ifdef KERN_TLS >> +#include >> +#endif >> +#include >> +#include >> +#include >> +#include >> +#ifdef NETFLIX_STATS >> +#include /* Must come after qmath.h and tree.h */ >> +#endif >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> + >> +#define TCPSTATES /* for logging */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include /* required for icmp_var.h */ >> +#include /* for ICMP_BANDLIM */ >> +#include >> +#include >> +#include >> +#include >> +#define TCPOUTFLAGS >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#ifdef TCPDEBUG >> +#include >> +#endif /* TCPDEBUG */ >> +#ifdef TCP_OFFLOAD >> +#include >> +#endif >> +#ifdef INET6 >> +#include >> +#endif >> +#include >> + >> +#include >> +#include >> +#include >> +#include >> + >> +#if defined(IPSEC) || defined(IPSEC_SUPPORT) >> +#include >> +#include >> +#endif /* IPSEC */ >> + >> +#include >> +#include >> +#include >> + >> +#ifdef MAC >> +#include >> +#endif >> + >> +#include "sack_filter.h" >> +#include "tcp_bbr.h" >> +#include "rack_bbr_common.h" >> +uma_zone_t bbr_zone; >> +uma_zone_t bbr_pcb_zone; >> + >> +struct sysctl_ctx_list bbr_sysctl_ctx; >> +struct sysctl_oid *bbr_sysctl_root; >> + >> +#define TCPT_RANGESET_NOSLOP(tv, value, tvmin, tvmax) do { \ >> + (tv) =3D (value); \ >> + if ((u_long)(tv) < (u_long)(tvmin)) \ >> + (tv) =3D (tvmin); \ >> + if ((u_long)(tv) > (u_long)(tvmax)) \ >> + (tv) =3D (tvmax); \ >> +} while(0) >> + >> +/*#define BBR_INVARIANT 1*/ >> + >> +/* >> + * initial window >> + */ >> +static uint32_t bbr_def_init_win =3D 10; >> +static int32_t bbr_persist_min =3D 250000; /* 250ms */ >> +static int32_t bbr_persist_max =3D 1000000; /* 1 Second */ >> +static int32_t bbr_cwnd_may_shrink =3D 0; >> +static int32_t bbr_cwndtarget_rtt_touse =3D BBR_RTT_PROP; >> +static int32_t bbr_num_pktepo_for_del_limit =3D = BBR_NUM_RTTS_FOR_DEL_LIMIT; >> +static int32_t bbr_hardware_pacing_limit =3D 8000; >> +static int32_t bbr_quanta =3D 3; /* How much extra quanta do we = get? */ >> +static int32_t bbr_no_retran =3D 0; >> +static int32_t bbr_tcp_map_entries_limit =3D 1500; >> +static int32_t bbr_tcp_map_split_limit =3D 256; >> + >> +static int32_t bbr_error_base_paceout =3D 10000; /* usec to pace */ >> +static int32_t bbr_max_net_error_cnt =3D 10; >> +/* Should the following be dynamic too -- loss wise */ >> +static int32_t bbr_rtt_gain_thresh =3D 0; >> +/* Measurement controls */ >> +static int32_t bbr_use_google_algo =3D 1; >> +static int32_t bbr_ts_limiting =3D 1; >> +static int32_t bbr_ts_can_raise =3D 0; >> +static int32_t bbr_do_red =3D 600; >> +static int32_t bbr_red_scale =3D 20000; >> +static int32_t bbr_red_mul =3D 1; >> +static int32_t bbr_red_div =3D 2; >> +static int32_t bbr_red_growth_restrict =3D 1; >> +static int32_t bbr_target_is_bbunit =3D 0; >> +static int32_t bbr_drop_limit =3D 0; >> +/* >> + * How much gain do we need to see to >> + * stay in startup? >> + */ >> +static int32_t bbr_marks_rxt_sack_passed =3D 0; >> +static int32_t bbr_start_exit =3D 25; >> +static int32_t bbr_low_start_exit =3D 25; /* When we are in = reduced gain */ >> +static int32_t bbr_startup_loss_thresh =3D 2000; /* 20.00% loss = */ >> +static int32_t bbr_hptsi_max_mul =3D 1; /* These two mul/div = assure a min pacing */ >> +static int32_t bbr_hptsi_max_div =3D 2; /* time, 0 means turned = off. We need this >> + * if we go back ever to where = the pacer >> + * has priority over timers. >> + */ >> +static int32_t bbr_policer_call_from_rack_to =3D 0; >> +static int32_t bbr_policer_detection_enabled =3D 1; >> +static int32_t bbr_min_measurements_req =3D 1; /* We need at = least 2 >> + * measurments before we = are >> + * "good" note that 2 =3D=3D= 1. >> + * This is because we = use a > >> + * comparison. This = means if >> + * min_measure was 0, it = takes >> + * num-measures > min(0) = and >> + * you get 1 measurement = and >> + * you are good. Set to = 1, you >> + * have to have two >> + * measurements (this is = done >> + * to prevent it from = being ok >> + * to have no = measurements). */ >> +static int32_t bbr_no_pacing_until =3D 4; >> + =20 >> +static int32_t bbr_min_usec_delta =3D 20000; /* 20,000 usecs = */ >> +static int32_t bbr_min_peer_delta =3D 20; /* 20 units */ >> +static int32_t bbr_delta_percent =3D 150; /* 15.0 % */ >> + >> +static int32_t bbr_target_cwnd_mult_limit =3D 8; >> +/* >> + * bbr_cwnd_min_val is the number of >> + * segments we hold to in the RTT probe >> + * state typically 4. >> + */ >> +static int32_t bbr_cwnd_min_val =3D BBR_PROBERTT_NUM_MSS; >> + >> + >> +static int32_t bbr_cwnd_min_val_hs =3D BBR_HIGHSPEED_NUM_MSS; >> + >> +static int32_t bbr_gain_to_target =3D 1; >> +static int32_t bbr_gain_gets_extra_too =3D 1; >> +/* >> + * bbr_high_gain is the 2/ln(2) value we need >> + * to double the sending rate in startup. This >> + * is used for both cwnd and hptsi gain's. >> + */ >> +static int32_t bbr_high_gain =3D BBR_UNIT * 2885 / 1000 + 1; >> +static int32_t bbr_startup_lower =3D BBR_UNIT * 1500 / 1000 + 1; >> +static int32_t bbr_use_lower_gain_in_startup =3D 1; >> + >> +/* thresholds for reduction on drain in sub-states/drain */ >> +static int32_t bbr_drain_rtt =3D BBR_SRTT; >> +static int32_t bbr_drain_floor =3D 88; >> +static int32_t google_allow_early_out =3D 1; >> +static int32_t google_consider_lost =3D 1; >> +static int32_t bbr_drain_drop_mul =3D 4; >> +static int32_t bbr_drain_drop_div =3D 5; >> +static int32_t bbr_rand_ot =3D 50; >> +static int32_t bbr_can_force_probertt =3D 0; >> +static int32_t bbr_can_adjust_probertt =3D 1; >> +static int32_t bbr_probertt_sets_rtt =3D 0; >> +static int32_t bbr_can_use_ts_for_rtt =3D 1; >> +static int32_t bbr_is_ratio =3D 0; >> +static int32_t bbr_sub_drain_app_limit =3D 1; >> +static int32_t bbr_prtt_slam_cwnd =3D 1; >> +static int32_t bbr_sub_drain_slam_cwnd =3D 1; >> +static int32_t bbr_slam_cwnd_in_main_drain =3D 1; >> +static int32_t bbr_filter_len_sec =3D 6; /* How long does the = rttProp filter >> + * hold */ >> +static uint32_t bbr_rtt_probe_limit =3D (USECS_IN_SECOND * 4); >> +/* >> + * bbr_drain_gain is the reverse of the high_gain >> + * designed to drain back out the standing queue >> + * that is formed in startup by causing a larger >> + * hptsi gain and thus drainging the packets >> + * in flight. >> + */ >> +static int32_t bbr_drain_gain =3D BBR_UNIT * 1000 / 2885; >> +static int32_t bbr_rttprobe_gain =3D 192; >> + >> +/* >> + * The cwnd_gain is the default cwnd gain applied when >> + * calculating a target cwnd. Note that the cwnd is >> + * a secondary factor in the way BBR works (see the >> + * paper and think about it, it will take some time). >> + * Basically the hptsi_gain spreads the packets out >> + * so you never get more than BDP to the peer even >> + * if the cwnd is high. In our implemenation that >> + * means in non-recovery/retransmission scenarios >> + * cwnd will never be reached by the flight-size. >> + */ >> +static int32_t bbr_cwnd_gain =3D BBR_UNIT * 2; >> +static int32_t bbr_tlp_type_to_use =3D BBR_SRTT; >> +static int32_t bbr_delack_time =3D 100000; /* 100ms in useconds */ >> +static int32_t bbr_sack_not_required =3D 0; /* set to one to allow = non-sack to use bbr >> */ +static int32_t bbr_initial_bw_bps =3D 62500; /* 500kbps in = bytes ps */ >> +static int32_t bbr_ignore_data_after_close =3D 1; >> +static int16_t bbr_hptsi_gain[] =3D { >> + (BBR_UNIT *5 / 4), >> + (BBR_UNIT * 3 / 4), >> + BBR_UNIT, >> + BBR_UNIT, >> + BBR_UNIT, >> + BBR_UNIT, >> + BBR_UNIT, >> + BBR_UNIT >> +}; >> +int32_t bbr_use_rack_resend_cheat =3D 1; >> +int32_t bbr_sends_full_iwnd =3D 1; >> + >> +#define BBR_HPTSI_GAIN_MAX 8 >> +/* >> + * The BBR module incorporates a number of >> + * TCP ideas that have been put out into the IETF >> + * over the last few years: >> + * - Yuchung Cheng's RACK TCP (for which its named) that >> + * will stop us using the number of dup acks and instead >> + * use time as the gage of when we retransmit. >> + * - Reorder Detection of RFC4737 and the Tail-Loss probe draft >> + * of Dukkipati et.al. >> + * - Van Jacobson's et.al BBR. >> + * >> + * RACK depends on SACK, so if an endpoint arrives that >> + * cannot do SACK the state machine below will shuttle the >> + * connection back to using the "default" TCP stack that is >> + * in FreeBSD. >> + * >> + * To implement BBR and RACK the original TCP stack was first = decomposed >> + * into a functional state machine with individual states >> + * for each of the possible TCP connection states. The do_segement >> + * functions role in life is to mandate the connection supports SACK >> + * initially and then assure that the RACK state matches the = conenction >> + * state before calling the states do_segment function. Data = processing >> + * of inbound segments also now happens in the hpts_do_segment in = general >> + * with only one exception. This is so we can keep the connection on >> + * a single CPU. >> + * >> + * Each state is simplified due to the fact that the original = do_segment >> + * has been decomposed and we *know* what state we are in (no >> + * switches on the state) and all tests for SACK are gone. This >> + * greatly simplifies what each state does. >> + * >> + * TCP output is also over-written with a new version since it >> + * must maintain the new rack scoreboard and has had hptsi >> + * integrated as a requirment. Still todo is to eliminate the >> + * use of the callout_() system and use the hpts for all >> + * timers as well. >> + */ >> +static uint32_t bbr_rtt_probe_time =3D 200000; /* 200ms in = micro seconds */ >> +static uint32_t bbr_rtt_probe_cwndtarg =3D 4; /* How many = mss's outstanding */ >> +static const int32_t bbr_min_req_free =3D 2; /* The min we = must have on the >> + * free list */ >> +static int32_t bbr_tlp_thresh =3D 1; >> +static int32_t bbr_reorder_thresh =3D 2; >> +static int32_t bbr_reorder_fade =3D 60000000; /* 0 - never = fade, def >> + * 60,000,000 - 60 = seconds */ >> +static int32_t bbr_pkt_delay =3D 1000; >> +static int32_t bbr_min_to =3D 1000; /* Number of usec's minimum = timeout */ >> +static int32_t bbr_incr_timers =3D 1; >> + >> +static int32_t bbr_tlp_min =3D 10000; /* 10ms in usecs */ >> +static int32_t bbr_delayed_ack_time =3D 200000; /* 200ms in = usecs */ >> +static int32_t bbr_exit_startup_at_loss =3D 1; >> + >> +/* >> + * bbr_lt_bw_ratio is 1/8th >> + * bbr_lt_bw_diff is < 4 Kbit/sec >> + */ >> +static uint64_t bbr_lt_bw_diff =3D 4000 / 8; /* In bytes per = second */ >> +static uint64_t bbr_lt_bw_ratio =3D 8; /* For 1/8th */ >> +static uint32_t bbr_lt_bw_max_rtts =3D 48; /* How many rtt's do we = use >> + * the lt_bw for */ >> +static uint32_t bbr_lt_intvl_min_rtts =3D 4; /* Min num of = RTT's to measure >> + * lt_bw */ >> +static int32_t bbr_lt_intvl_fp =3D 0; /* False = positive epoch diff */ >> +static int32_t bbr_lt_loss_thresh =3D 196; /* Lost vs delivered % = */ >> +static int32_t bbr_lt_fd_thresh =3D 100; /* false = detection % */ >> + >> +static int32_t bbr_verbose_logging =3D 0; >> +/* >> + * Currently regular tcp has a rto_min of 30ms >> + * the backoff goes 12 times so that ends up >> + * being a total of 122.850 seconds before a >> + * connection is killed. >> + */ >> +static int32_t bbr_rto_min_ms =3D 30; /* 30ms same as main = freebsd */ >> +static int32_t bbr_rto_max_sec =3D 4; /* 4 seconds */ >> + >> +/****************************************************/ >> +/* DEFAULT TSO SIZING (cpu performance impacting) */ >> +/****************************************************/ >> +/* What amount is our formula using to get TSO size */ >> +static int32_t bbr_hptsi_per_second =3D 1000; >> + >> +/* >> + * For hptsi under bbr_cross_over connections what is delay=20 >> + * target 7ms (in usec) combined with a seg_max of 2 >> + * gets us close to identical google behavior in=20 >> + * TSO size selection (possibly more 1MSS sends). >> + */ >> +static int32_t bbr_hptsi_segments_delay_tar =3D 7000; >> + >> +/* Does pacing delay include overhead's in its time calculations? */ >> +static int32_t bbr_include_enet_oh =3D 0; >> +static int32_t bbr_include_ip_oh =3D 1; >> +static int32_t bbr_include_tcp_oh =3D 1; >> +static int32_t bbr_google_discount =3D 10; >> + >> +/* Do we use (nf mode) pkt-epoch to drive us or rttProp? */ >> +static int32_t bbr_state_is_pkt_epoch =3D 0; >> +static int32_t bbr_state_drain_2_tar =3D 1; >> +/* What is the max the 0 - bbr_cross_over MBPS TSO target >> + * can reach using our delay target. Note that this >> + * value becomes the floor for the cross over >> + * algorithm. >>=20 >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >=20 >> To unsubscribe, send any mail to = "svn-src-head-unsubscribe@freebsd.org" >=20 > This break kernel builds: >=20 > [...] > /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: implicit > declaration of function 'tcp_chg_pacing_rate' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ > /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: this function > declaration is not a prototype [-Werror,-Wstrict-prototypes] > /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:7: = error: incompatible > integer to pointer conversion assigning to 'const struct = tcp_hwrate_limit_table *' from 'int' > [-Werror,-Wint-conversion] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- all_subdir_toecore --- = Building > = /usr/obj/usr/src/amd64.amd64/sys/THOR/modules/usr/src/sys/modules/toecore/= toecore.ko --- > all_subdir_tcp --- = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: > error: implicit declaration of function 'tcp_rel_pacing_rate' is = invalid in C99 > [-Werror,-Wimplicit-function-declaration] = tcp_rel_pacing_rate(bbr->r_ctl.crte, bbr->rc_tp); ^ > - --- all_subdir_tpm --- > =3D=3D=3D> tpm (all) > - --- all_subdir_tcp --- > = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: = error: this function > declaration is not a prototype [-Werror,-Wstrict-prototypes] --- = all_subdir_trm --- > =3D=3D=3D> trm (all) > - --- all_subdir_tcp --- > = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:14307:21: = error: implicit > declaration of function 'tcp_set_pacing_rate' is invalid in C99 > [-Werror,-Wimplicit-function-declaration] bbr->r_ctl.crte =3D = tcp_set_pacing_rate(bbr->rc_tp,=20 >=20 > - --=20 > O. Hartmann >=20 > Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BC= r > Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 = Abs. 4 BDSG). > -----BEGIN PGP SIGNATURE----- >=20 > iHUEARYIAB0WIQSy8IBxAPDkqVBaTJ44N1ZZPba5RwUCXYpujgAKCRA4N1ZZPba5 > R7bwAQD9cgJgJyb5PqX8A8x9R+H9Tun9b+YSg4TNK3vP/VffHwEA8MN2B/QTvhJc > WISysiLHeOrQKGhCJbtjW2RUbprLfAY=3D > =3D0hIu > -----END PGP SIGNATURE----- ------ Randall Stewart rrs@netflix.com From owner-svn-src-head@freebsd.org Tue Sep 24 19:55: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 B83A312F81E for ; Tue, 24 Sep 2019 19:55:47 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (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 46dBkq0cFRz3QgQ for ; Tue, 24 Sep 2019 19:55:46 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pl1-x641.google.com with SMTP id q15so1407086pll.11 for ; Tue, 24 Sep 2019 12:55:46 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=skIkN2hDol9WPHEkFBDTKJmrv7MQAHQhhfjcw6rXFvs=; b=UrFki9rPIVdUBnE8FodaK7sqFpF8Ji17HN0FqON963QbJ8nqX30BVqPTk1TO1YxVt/ dr0pWEtpaObTq5YxdGlnbUitv29OtNfdjchBF3rh8HbimBXtMWTouKNM5DvwbHmmjJHK akdv+fTdcDjRzS4Lj8YwCShIcRgIP0rVHPku2ABL1/CC/p1Hg145+2fYWiEPIDwgNeKo fJk4l6ojpX51KrSk9XCU3Ou6wLn43fo6yfg+X9RsmnNGXyVBNxbAtem8Fz+4cHxNX/Kk GHclrA3B8SY82fT/aBxDw0fYvTsggKuNkMvTA4JqfchkEfDzthoWvK03xQoxSXSyyp+P Xojw== X-Gm-Message-State: APjAAAVIGHw4JJbZSDnB20TCaWXxlVwkz20kXbU5t7wpPOXflVAjJzIi LThXPNbsCc998cb3aW8F6NBlMg== X-Google-Smtp-Source: APXvYqyuKsNLn7bNgBUMWUL8Gs2z8Dted8roMs/dGhNugtKu9nyD59w364pKfei1O96E02ChG5NKHw== X-Received: by 2002:a17:902:8ec2:: with SMTP id x2mr4550213plo.250.1569354945503; Tue, 24 Sep 2019 12:55:45 -0700 (PDT) Received: from ?IPv6:2607:fb10:7021:1::eb2d? ([2607:fb10:7021:1::eb2d]) by smtp.gmail.com with ESMTPSA id s3sm715530pjq.32.2019.09.24.12.55.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2019 12:55:44 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r352657 - in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys From: Randall Stewart In-Reply-To: Date: Tue, 24 Sep 2019 12:55:42 -0700 Cc: "O. Hartmann" , Randall Ray Stewart , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <201909241818.x8OIIBNr039667@repo.freebsd.org> <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> To: Li-Wen Hsu X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 46dBkq0cFRz3QgQ X-Spamd-Bar: ------------- X-Spamd-Result: default: False [-13.58 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[netflix.com:+]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[1.4.6.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]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.08)[ip: (-0.54), ipnet: 2607:f8b0::/32(-2.63), asn: 15169(-2.19), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+] 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, 24 Sep 2019 19:55:47 -0000 12.0R would not have BBR .. its only in head=E2=80=A6 hmm it could be a = issue with TCP_RATELIMIT not defined though I did compile GENERIC without the extra stacks (and without rate = limit and hpts) and that compiled ok.. R > On Sep 24, 2019, at 12:49 PM, Li-Wen Hsu wrote: >=20 > On Tue, Sep 24, 2019 at 9:29 PM O. Hartmann = wrote: >>=20 >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA256 >>=20 >> Am Tue, 24 Sep 2019 18:18:11 +0000 (UTC) >> Randall Stewart schrieb: >>=20 >>> Author: rrs >>> Date: Tue Sep 24 18:18:11 2019 >>> New Revision: 352657 >>> URL: https://svnweb.freebsd.org/changeset/base/352657 >=20 > ... >=20 >> This break kernel builds: >>=20 >> [...] >> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: implicit >> declaration of function 'tcp_chg_pacing_rate' is invalid in C99 >> [-Werror,-Wimplicit-function-declaration] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ >> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: this function >> declaration is not a prototype [-Werror,-Wstrict-prototypes] >> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:7: = error: incompatible >> integer to pointer conversion assigning to 'const struct = tcp_hwrate_limit_table *' from 'int' >> [-Werror,-Wint-conversion] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- all_subdir_toecore --- = Building >> = /usr/obj/usr/src/amd64.amd64/sys/THOR/modules/usr/src/sys/modules/toecore/= toecore.ko --- >> all_subdir_tcp --- = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: >> error: implicit declaration of function 'tcp_rel_pacing_rate' is = invalid in C99 >> [-Werror,-Wimplicit-function-declaration] = tcp_rel_pacing_rate(bbr->r_ctl.crte, bbr->rc_tp); ^ >> - --- all_subdir_tpm --- >> =3D=3D=3D> tpm (all) >> - --- all_subdir_tcp --- >> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: = error: this function >> declaration is not a prototype [-Werror,-Wstrict-prototypes] --- = all_subdir_trm --- >> =3D=3D=3D> trm (all) >> - --- all_subdir_tcp --- >> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:14307:21: = error: implicit >> declaration of function 'tcp_set_pacing_rate' is invalid in C99 >> [-Werror,-Wimplicit-function-declaration] bbr->r_ctl.crte =3D = tcp_set_pacing_rate(bbr->rc_tp, >=20 > CI completed a clean build on 12.0-R: > https://ci.freebsd.org/job/FreeBSD-head-amd64-build/14672/ >=20 > What's your build environment and platform? >=20 > Best, > Li-Wen ------ Randall Stewart rrs@netflix.com From owner-svn-src-head@freebsd.org Tue Sep 24 20:01:21 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 4CC6D12FA42; Tue, 24 Sep 2019 20:01:21 +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 46dBsF0CGTz3R0n; Tue, 24 Sep 2019 20:01:21 +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 DF8CF48E8; Tue, 24 Sep 2019 20:01:20 +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 x8OK1KHG099969; Tue, 24 Sep 2019 20:01:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OK1KAV099968; Tue, 24 Sep 2019 20:01:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909242001.x8OK1KAV099968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 24 Sep 2019 20:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352658 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352658 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, 24 Sep 2019 20:01:21 -0000 Author: mav Date: Tue Sep 24 20:01:20 2019 New Revision: 352658 URL: https://svnweb.freebsd.org/changeset/base/352658 Log: Fix/improve interrupt threads scheduling. Doing some tests with very high interrupt rates I've noticed that one of conditions I added in r232207 to make interrupt threads in most cases run on local CPU never worked as expected (worked only if previous time it was executed on some other CPU, that is quite opposite). It caused additional CPU usage to run full CPU search and could schedule interrupt threads to some other CPU. This patch removes that code and instead reuses existing non-interrupt code path with some tweaks for interrupt case: - On SMT systems, if current thread is idle, don't look on other threads. Even if they are busy, it may take more time to do fill search and bounce the interrupt thread to other core then execute it locally, even sharing CPU resources. It is other threads should migrate, not bound interrupts. - Try hard to keep interrupt threads within LLC of their original CPU. This improves scheduling cost and supposedly cache and memory locality. On a test system with 72 threads doing 2.2M IOPS to NVMe this saves few percents of CPU time while adding few percents to IOPS. MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue Sep 24 18:18:11 2019 (r352657) +++ head/sys/kern/sched_ule.c Tue Sep 24 20:01:20 2019 (r352658) @@ -1251,7 +1251,7 @@ sched_pickcpu(struct thread *td, int flags) struct td_sched *ts; struct tdq *tdq; cpuset_t mask; - int cpu, pri, self; + int cpu, pri, self, intr; self = PCPU_GET(cpuid); ts = td_get_sched(td); @@ -1268,16 +1268,12 @@ sched_pickcpu(struct thread *td, int flags) * Prefer to run interrupt threads on the processors that generate * the interrupt. */ - pri = td->td_priority; if (td->td_priority <= PRI_MAX_ITHD && THREAD_CAN_SCHED(td, self) && - curthread->td_intr_nesting_level && ts->ts_cpu != self) { - SCHED_STAT_INC(pickcpu_intrbind); + curthread->td_intr_nesting_level) { ts->ts_cpu = self; - if (TDQ_SELF()->tdq_lowpri > pri) { - SCHED_STAT_INC(pickcpu_affinity); - return (ts->ts_cpu); - } - } + intr = 1; + } else + intr = 0; /* * If the thread can run on the last cpu and the affinity has not * expired and it is idle, run it there. @@ -1287,7 +1283,7 @@ sched_pickcpu(struct thread *td, int flags) if (THREAD_CAN_SCHED(td, ts->ts_cpu) && tdq->tdq_lowpri >= PRI_MIN_IDLE && SCHED_AFFINITY(ts, CG_SHARE_L2)) { - if (cg->cg_flags & CG_FLAG_THREAD) { + if (!intr && cg->cg_flags & CG_FLAG_THREAD) { CPUSET_FOREACH(cpu, cg->cg_mask) { if (TDQ_CPU(cpu)->tdq_lowpri < PRI_MIN_IDLE) break; @@ -1301,32 +1297,55 @@ sched_pickcpu(struct thread *td, int flags) } /* * Search for the last level cache CPU group in the tree. - * Skip caches with expired affinity time and SMT groups. - * Affinity to higher level caches will be handled less aggressively. + * Skip SMT, identical groups and caches with expired affinity. + * Interrupt threads affinity is explicit and never expires. */ for (ccg = NULL; cg != NULL; cg = cg->cg_parent) { if (cg->cg_flags & CG_FLAG_THREAD) continue; - if (!SCHED_AFFINITY(ts, cg->cg_level)) + if (cg->cg_children == 1 || cg->cg_count == 1) continue; + if (cg->cg_level == CG_SHARE_NONE || + (!intr && !SCHED_AFFINITY(ts, cg->cg_level))) + continue; ccg = cg; } - if (ccg != NULL) - cg = ccg; + /* Found LLC shared by all CPUs, so do a global search. */ + if (ccg == cpu_top) + ccg = NULL; cpu = -1; - /* Search the group for the less loaded idle CPU we can run now. */ mask = td->td_cpuset->cs_mask; - if (cg != NULL && cg != cpu_top && - CPU_CMP(&cg->cg_mask, &cpu_top->cg_mask) != 0) - cpu = sched_lowest(cg, mask, max(pri, PRI_MAX_TIMESHARE), + pri = td->td_priority; + /* + * Try hard to keep interrupts within found LLC. Search the LLC for + * the least loaded CPU we can run now. For NUMA systems it should + * be within target domain, and it also reduces scheduling overhead. + */ + if (ccg != NULL && intr) { + cpu = sched_lowest(ccg, mask, pri, INT_MAX, ts->ts_cpu); + if (cpu >= 0) + SCHED_STAT_INC(pickcpu_intrbind); + } else + /* Search the LLC for the least loaded idle CPU we can run now. */ + if (ccg != NULL) { + cpu = sched_lowest(ccg, mask, max(pri, PRI_MAX_TIMESHARE), INT_MAX, ts->ts_cpu); - /* Search globally for the less loaded CPU we can run now. */ - if (cpu == -1) + if (cpu >= 0) + SCHED_STAT_INC(pickcpu_affinity); + } + /* Search globally for the least loaded CPU we can run now. */ + if (cpu < 0) { cpu = sched_lowest(cpu_top, mask, pri, INT_MAX, ts->ts_cpu); - /* Search globally for the less loaded CPU. */ - if (cpu == -1) + if (cpu >= 0) + SCHED_STAT_INC(pickcpu_lowest); + } + /* Search globally for the least loaded CPU. */ + if (cpu < 0) { cpu = sched_lowest(cpu_top, mask, -1, INT_MAX, ts->ts_cpu); - KASSERT(cpu != -1, ("sched_pickcpu: Failed to find a cpu.")); + if (cpu >= 0) + SCHED_STAT_INC(pickcpu_lowest); + } + KASSERT(cpu < 0, ("sched_pickcpu: Failed to find a cpu.")); KASSERT(!CPU_ABSENT(cpu), ("sched_pickcpu: Picked absent CPU %d.", cpu)); /* * Compare the lowest loaded cpu to current cpu. @@ -1337,8 +1356,7 @@ sched_pickcpu(struct thread *td, int flags) TDQ_SELF()->tdq_load <= tdq->tdq_load + 1) { SCHED_STAT_INC(pickcpu_local); cpu = self; - } else - SCHED_STAT_INC(pickcpu_lowest); + } if (cpu != ts->ts_cpu) SCHED_STAT_INC(pickcpu_migration); return (cpu); From owner-svn-src-head@freebsd.org Tue Sep 24 20:01: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 DFEC112FA33; Tue, 24 Sep 2019 20:01:19 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f194.google.com (mail-yb1-f194.google.com [209.85.219.194]) (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 46dBsC0nnxz3R0X; Tue, 24 Sep 2019 20:01:18 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f194.google.com with SMTP id u15so161264ybm.6; Tue, 24 Sep 2019 13:01:18 -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:content-transfer-encoding; bh=6dxpSfYTP4cAvtpK5dd0ACWlVadmnQKkbXi6YWFiLZA=; b=AR+aR7j8H7ZbFpr+eWMoZY0LN1ZkK/xk3bxxzsmZRj36rIVDZOOBcToeasGyAOBu+4 FdLljJaat6n3FAsZ7PPGZbj4EzFNBsKgZGn6672bK1/Yjr/2//rnaXXrCg25SRPO08fr yhcl1HLrOrDy4/iKvo7EHAMHFIeg9JeMGQTdre1AMj7+K7s1v01DZjymmEJh/CrtJset JR/FktfrWSyPt5BKt5fjJWGqynAbFkw0cxY/GAFBvkLxNU8DuFk9MlPdq/EEq0w8d7A6 SAeYtoBRjnCs5L85mPNJnMMQX1T+TZuVpQPM9lNONmswpOVAcn1Ra50iXBRUTPxc9z8h 7hPA== X-Gm-Message-State: APjAAAVPjGtLuBqihzYPCitRDhEYb8Ef3hSp2+C8TiiGKW9dGaA0+rhz JzAvtqLWy5ez0BuU219+EBO/wG0fJGos/cMDr08= X-Google-Smtp-Source: APXvYqxMabm2iKvDdrXoi2SPvTJ8zeXr1VA48sj739io9bLIG7lnI7mDllW2zBVrWa5ZMzkKeC6Fja/S7zJVZUVdqAM= X-Received: by 2002:a25:af09:: with SMTP id a9mr379828ybh.405.1569355277711; Tue, 24 Sep 2019 13:01:17 -0700 (PDT) MIME-Version: 1.0 References: <201909241818.x8OIIBNr039667@repo.freebsd.org> <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> In-Reply-To: From: Li-Wen Hsu Date: Tue, 24 Sep 2019 22:01:05 +0200 Message-ID: Subject: Re: svn commit: r352657 - in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys To: Randall Stewart Cc: "O. Hartmann" , Randall Ray Stewart , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46dBsC0nnxz3R0X X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.219.194 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-3.11 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; 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]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[194.219.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.11)[ipnet: 209.85.128.0/17(-3.30), asn: 15169(-2.19), country: US(-0.05)]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[194.219.85.209.rep.mailspike.net : 127.0.0.17]; 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)[]; 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: Tue, 24 Sep 2019 20:01:19 -0000 I mean the head (r352657) world and GENERIC kernel can be built successfully on 12.0-R, which is we guaranteed. Also the LINT kernel build is fine on CI: https://ci.freebsd.org/job/FreeBSD-head-amd64-LINT/13781/ So I was curious about the build environment of that build failure. Best, Li-Wen On Tue, Sep 24, 2019 at 9:55 PM Randall Stewart wrote: > > 12.0R would not have BBR .. its only in head=E2=80=A6 hmm it could be a i= ssue with TCP_RATELIMIT not defined > though I did compile GENERIC without the extra stacks (and without rate l= imit and hpts) and that > compiled ok.. > > R > > > On Sep 24, 2019, at 12:49 PM, Li-Wen Hsu wrote: > > > > On Tue, Sep 24, 2019 at 9:29 PM O. Hartmann wr= ote: > >> > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA256 > >> > >> Am Tue, 24 Sep 2019 18:18:11 +0000 (UTC) > >> Randall Stewart schrieb: > >> > >>> Author: rrs > >>> Date: Tue Sep 24 18:18:11 2019 > >>> New Revision: 352657 > >>> URL: https://svnweb.freebsd.org/changeset/base/352657 > > > > ... > > > >> This break kernel builds: > >> > >> [...] > >> /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9:= error: implicit > >> declaration of function 'tcp_chg_pacing_rate' is invalid in C99 > >> [-Werror,-Wimplicit-function-declaration] nrte =3D tcp_chg_pacing_rate= (bbr->r_ctl.crte, ^ > >> /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9:= error: this function > >> declaration is not a prototype [-Werror,-Wstrict-prototypes] > >> /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:7:= error: incompatible > >> integer to pointer conversion assigning to 'const struct tcp_hwrate_li= mit_table *' from 'int' > >> [-Werror,-Wint-conversion] nrte =3D tcp_chg_pacing_rate(bbr->r_ctl.crt= e, ^ > >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- all_subdir_toecore --- Buildi= ng > >> /usr/obj/usr/src/amd64.amd64/sys/THOR/modules/usr/src/sys/modules/toec= ore/toecore.ko --- > >> all_subdir_tcp --- /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_s= tacks/bbr.c:10443:4: > >> error: implicit declaration of function 'tcp_rel_pacing_rate' is inval= id in C99 > >> [-Werror,-Wimplicit-function-declaration] tcp_rel_pacing_rate(bbr->r_c= tl.crte, bbr->rc_tp); ^ > >> - --- all_subdir_tpm --- > >> =3D=3D=3D> tpm (all) > >> - --- all_subdir_tcp --- > >> /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4= : error: this function > >> declaration is not a prototype [-Werror,-Wstrict-prototypes] --- all_s= ubdir_trm --- > >> =3D=3D=3D> trm (all) > >> - --- all_subdir_tcp --- > >> /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:14307:2= 1: error: implicit > >> declaration of function 'tcp_set_pacing_rate' is invalid in C99 > >> [-Werror,-Wimplicit-function-declaration] bbr->r_ctl.crte =3D tcp_set_= pacing_rate(bbr->rc_tp, > > > > CI completed a clean build on 12.0-R: > > https://ci.freebsd.org/job/FreeBSD-head-amd64-build/14672/ > > > > What's your build environment and platform? > > > > Best, > > Li-Wen > > ------ > Randall Stewart > rrs@netflix.com > > > From owner-svn-src-head@freebsd.org Tue Sep 24 20:01: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 EEC6012FAFB for ; Tue, 24 Sep 2019 20:01:42 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (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 46dBsf2LDJz3RH6 for ; Tue, 24 Sep 2019 20:01:42 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pl1-x642.google.com with SMTP id s17so1424484plp.6 for ; Tue, 24 Sep 2019 13:01:42 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2Tkqh7Zxds5ENFb6ljuQeoTIpsgedrdAKZFi6TKhH4g=; b=Ydugxt9ZFhb/e8nb8TQ8v3iEtmDeLBEuRwkY9llRHBXpfaTu50U7PdVhW6SU1fRCxp PcsWJ6PBn3nzRHoVfz99B9/soq06+12nZnHDYy3QP/9LlV4SQza2XLcQgjmuCbQHKDUp PFv6MBI5JaAm7Bs5Fihp/oNvCFT3IFP3MvT/OvI5DqgA6kwJI0gcRjFFliJF/JXSHhxH GHXMEHhiuLhCilWjm0KRnuVq5NugGRyakTcjSMSZm0/ikvjOZ9IyRNt9SRxNhkqlbski 1MVFEumMifeEFggnhES0fB/CnjSTijfX6cXjeDeK1RaAhpUgL4ZfWrv0rbZhi4zsWv6F tjPQ== X-Gm-Message-State: APjAAAXWuDlsPIjKt837fJAQPL9f3jeOx18So3Hles++AtWYvXyou2OP Lr4Is8LTPq0ph6+uoXQc9jTDQA== X-Google-Smtp-Source: APXvYqyEz3LaEwqYjzb4WQHpynpIKFqNYbbW85qF3hNhc5TzdVzuOSSoC4mMcTCMFNMtsRf8HIHYiQ== X-Received: by 2002:a17:902:9a49:: with SMTP id x9mr4863051plv.244.1569355300847; Tue, 24 Sep 2019 13:01:40 -0700 (PDT) Received: from ?IPv6:2607:fb10:7021:1::eb2d? ([2607:fb10:7021:1::eb2d]) by smtp.gmail.com with ESMTPSA id g11sm3151626pgu.11.2019.09.24.13.01.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2019 13:01:40 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r352657 - in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys From: Randall Stewart In-Reply-To: Date: Tue, 24 Sep 2019 13:01:37 -0700 Cc: "O. Hartmann" , Randall Ray Stewart , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <201909241818.x8OIIBNr039667@repo.freebsd.org> <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> To: Li-Wen Hsu X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 46dBsf2LDJz3RH6 X-Spamd-Bar: ------------- X-Spamd-Result: default: False [-13.54 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[netflix.com:+]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[2.4.6.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]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.04)[ip: (-0.35), ipnet: 2607:f8b0::/32(-2.63), asn: 15169(-2.19), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+] 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, 24 Sep 2019 20:01:43 -0000 Ok I have found it Its a reversal in an ifdef in tcp_ratelimit.h .. it supposed to be that = if its not define (RATELIMIT) the main interfaces return errors.. and the ifdef kernel/ratelimit is reversed of what it should be. Let me fix that :) R > On Sep 24, 2019, at 12:55 PM, Randall Stewart wrote: >=20 > 12.0R would not have BBR .. its only in head=E2=80=A6 hmm it could be = a issue with TCP_RATELIMIT not defined > though I did compile GENERIC without the extra stacks (and without = rate limit and hpts) and that > compiled ok.. >=20 > R >=20 >> On Sep 24, 2019, at 12:49 PM, Li-Wen Hsu wrote: >>=20 >> On Tue, Sep 24, 2019 at 9:29 PM O. Hartmann = wrote: >>>=20 >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA256 >>>=20 >>> Am Tue, 24 Sep 2019 18:18:11 +0000 (UTC) >>> Randall Stewart schrieb: >>>=20 >>>> Author: rrs >>>> Date: Tue Sep 24 18:18:11 2019 >>>> New Revision: 352657 >>>> URL: https://svnweb.freebsd.org/changeset/base/352657 >>=20 >> ... >>=20 >>> This break kernel builds: >>>=20 >>> [...] >>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: implicit >>> declaration of function 'tcp_chg_pacing_rate' is invalid in C99 >>> [-Werror,-Wimplicit-function-declaration] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ >>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: this function >>> declaration is not a prototype [-Werror,-Wstrict-prototypes] >>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:7: = error: incompatible >>> integer to pointer conversion assigning to 'const struct = tcp_hwrate_limit_table *' from 'int' >>> [-Werror,-Wint-conversion] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- all_subdir_toecore --- = Building >>> = /usr/obj/usr/src/amd64.amd64/sys/THOR/modules/usr/src/sys/modules/toecore/= toecore.ko --- >>> all_subdir_tcp --- = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: >>> error: implicit declaration of function 'tcp_rel_pacing_rate' is = invalid in C99 >>> [-Werror,-Wimplicit-function-declaration] = tcp_rel_pacing_rate(bbr->r_ctl.crte, bbr->rc_tp); ^ >>> - --- all_subdir_tpm --- >>> =3D=3D=3D> tpm (all) >>> - --- all_subdir_tcp --- >>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: = error: this function >>> declaration is not a prototype [-Werror,-Wstrict-prototypes] --- = all_subdir_trm --- >>> =3D=3D=3D> trm (all) >>> - --- all_subdir_tcp --- >>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:14307:21: = error: implicit >>> declaration of function 'tcp_set_pacing_rate' is invalid in C99 >>> [-Werror,-Wimplicit-function-declaration] bbr->r_ctl.crte =3D = tcp_set_pacing_rate(bbr->rc_tp, >>=20 >> CI completed a clean build on 12.0-R: >> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/14672/ >>=20 >> What's your build environment and platform? >>=20 >> Best, >> Li-Wen >=20 > ------ > Randall Stewart > rrs@netflix.com >=20 >=20 >=20 ------ Randall Stewart rrs@netflix.com From owner-svn-src-head@freebsd.org Tue Sep 24 20:04: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 A9ABD12FC0F; Tue, 24 Sep 2019 20:04:31 +0000 (UTC) (envelope-from rrs@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 46dBwv44KPz3wht; Tue, 24 Sep 2019 20:04:31 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6F0B94A61; Tue, 24 Sep 2019 20:04:31 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8OK4VEM003892; Tue, 24 Sep 2019 20:04:31 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OK4VPH003891; Tue, 24 Sep 2019 20:04:31 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201909242004.x8OK4VPH003891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 24 Sep 2019 20:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352659 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352659 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, 24 Sep 2019 20:04:31 -0000 Author: rrs Date: Tue Sep 24 20:04:31 2019 New Revision: 352659 URL: https://svnweb.freebsd.org/changeset/base/352659 Log: Fix the ifdefs in tcp_ratelimit.h. They were reversed so that instead of functions only being inside the _KERNEL and the absence of RATELIMIT causing us to have NULL/error returning interfaces we ended up with non-kernel getting the error path. opps.. Modified: head/sys/netinet/tcp_ratelimit.h Modified: head/sys/netinet/tcp_ratelimit.h ============================================================================== --- head/sys/netinet/tcp_ratelimit.h Tue Sep 24 20:01:20 2019 (r352658) +++ head/sys/netinet/tcp_ratelimit.h Tue Sep 24 20:04:31 2019 (r352659) @@ -87,8 +87,8 @@ CK_LIST_HEAD(head_tcp_rate_set, tcp_rate_set); #define RS_PACING_LT 0x0008 /* Less than requested rate */ #define RS_PACING_SUB_OK 0x0010 /* If a rate can't be found get the * next best rate (highest or lowest). */ -#ifdef RATELIMIT #ifdef _KERNEL +#ifdef RATELIMIT #define DETAILED_RATELIMIT_SYSCTL 1 /* * Undefine this if you don't want * detailed rates to appear in From owner-svn-src-head@freebsd.org Tue Sep 24 20:07: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 DE53412FCC5 for ; Tue, 24 Sep 2019 20:07:03 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (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 46dBzq36gqz3ws6 for ; Tue, 24 Sep 2019 20:07:03 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pf1-x443.google.com with SMTP id x127so1984856pfb.7 for ; Tue, 24 Sep 2019 13:07: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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UrwhRNwKfPeN7bUgmUhaWqowqJ5EUgAT10I25VdFHXI=; b=e+YpiWNIZLJ9Nb4tuNTJusR3LsLTziBlfBZwjlWB9UYQiLbfKNw0QWwiz7dt7v2/Qy RLXy1pO3lWaKF2ZS/sOsZ1CyKhrXc/cQYdDCzc3IhWNyovT3hvJ/qHfuH8HZ4eHj5IF3 WAgMJGwXUV3vhQaH96KsirzlNMeqd4jzo11FKOAnQTYeBM6zCWPJ26uzhGLLnjOPkV8p gy4l4dqLon2dBcnK+QE5jZI7xFqB3nYbhJppwrC1N93mlTo9R/GOW2hUKbTUF9O1dlzy 4ZWYpid85ynZov7ZouciKRU7IRJbH/LKvulzeHHw0V2U+bwhpBRjaUcD8LiDt+cLZZYL 1meQ== X-Gm-Message-State: APjAAAX0z+sRpkw7MkdV8AwGe9mtkxE3qo2p1j2vfBayzSm6OOC4feOO EQh0c5TVjHluzUkjltLNLSTcNg== X-Google-Smtp-Source: APXvYqxLpg84h37DFdqkhEC3beeLlqeX4++NvobNoreSK/zogwWEGnmU92h/u/N9gsSC0dseLRpp1w== X-Received: by 2002:a63:2884:: with SMTP id o126mr4672382pgo.279.1569355621616; Tue, 24 Sep 2019 13:07:01 -0700 (PDT) Received: from ?IPv6:2607:fb10:7021:1::eb2d? ([2607:fb10:7021:1::eb2d]) by smtp.gmail.com with ESMTPSA id 16sm2705017pfn.35.2019.09.24.13.07.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2019 13:07:01 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r352657 - in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys From: Randall Stewart In-Reply-To: Date: Tue, 24 Sep 2019 13:06:58 -0700 Cc: "O. Hartmann" , Randall Ray Stewart , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <56FBEE27-FBDA-44E0-BBBF-F5D9A4755047@netflix.com> References: <201909241818.x8OIIBNr039667@repo.freebsd.org> <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> To: Li-Wen Hsu X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 46dBzq36gqz3ws6 X-Spamd-Bar: ------------- X-Spamd-Result: default: False [-13.57 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[netflix.com:+]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[3.4.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]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.07)[ip: (-0.46), ipnet: 2607:f8b0::/32(-2.63), asn: 15169(-2.19), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+] 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, 24 Sep 2019 20:07:03 -0000 Right Thats because GENERIC does not add the optional TCP stacks. Ok the problem is fixed with r352659 The tcp_ratelimit.h had a mixed up ifdef i.e. #ifdef RATELIMIT #ifdef _KERNEL definitions #else macro definitions that return error #endif #endif Which should have been the opposite #ifdef _KERNEL #ifdef RATELIMIT =20 definitions #else macros def=E2=80=99s returning errors #endif #endif Reversing that will fix the issue if you add the extra stacks but fail = to add RATELIMIT R > On Sep 24, 2019, at 1:01 PM, Li-Wen Hsu wrote: >=20 > I mean the head (r352657) world and GENERIC kernel can be built > successfully on 12.0-R, which is we guaranteed. > Also the LINT kernel build is fine on CI: > https://ci.freebsd.org/job/FreeBSD-head-amd64-LINT/13781/ >=20 > So I was curious about the build environment of that build failure. >=20 > Best, > Li-Wen >=20 > On Tue, Sep 24, 2019 at 9:55 PM Randall Stewart = wrote: >>=20 >> 12.0R would not have BBR .. its only in head=E2=80=A6 hmm it could be = a issue with TCP_RATELIMIT not defined >> though I did compile GENERIC without the extra stacks (and without = rate limit and hpts) and that >> compiled ok.. >>=20 >> R >>=20 >>> On Sep 24, 2019, at 12:49 PM, Li-Wen Hsu wrote: >>>=20 >>> On Tue, Sep 24, 2019 at 9:29 PM O. Hartmann = wrote: >>>>=20 >>>> -----BEGIN PGP SIGNED MESSAGE----- >>>> Hash: SHA256 >>>>=20 >>>> Am Tue, 24 Sep 2019 18:18:11 +0000 (UTC) >>>> Randall Stewart schrieb: >>>>=20 >>>>> Author: rrs >>>>> Date: Tue Sep 24 18:18:11 2019 >>>>> New Revision: 352657 >>>>> URL: https://svnweb.freebsd.org/changeset/base/352657 >>>=20 >>> ... >>>=20 >>>> This break kernel builds: >>>>=20 >>>> [...] >>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: implicit >>>> declaration of function 'tcp_chg_pacing_rate' is invalid in C99 >>>> [-Werror,-Wimplicit-function-declaration] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ >>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: this function >>>> declaration is not a prototype [-Werror,-Wstrict-prototypes] >>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:7: = error: incompatible >>>> integer to pointer conversion assigning to 'const struct = tcp_hwrate_limit_table *' from 'int' >>>> [-Werror,-Wint-conversion] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ >>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- all_subdir_toecore --- = Building >>>> = /usr/obj/usr/src/amd64.amd64/sys/THOR/modules/usr/src/sys/modules/toecore/= toecore.ko --- >>>> all_subdir_tcp --- = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: >>>> error: implicit declaration of function 'tcp_rel_pacing_rate' is = invalid in C99 >>>> [-Werror,-Wimplicit-function-declaration] = tcp_rel_pacing_rate(bbr->r_ctl.crte, bbr->rc_tp); ^ >>>> - --- all_subdir_tpm --- >>>> =3D=3D=3D> tpm (all) >>>> - --- all_subdir_tcp --- >>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: = error: this function >>>> declaration is not a prototype [-Werror,-Wstrict-prototypes] --- = all_subdir_trm --- >>>> =3D=3D=3D> trm (all) >>>> - --- all_subdir_tcp --- >>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:14307:21: = error: implicit >>>> declaration of function 'tcp_set_pacing_rate' is invalid in C99 >>>> [-Werror,-Wimplicit-function-declaration] bbr->r_ctl.crte =3D = tcp_set_pacing_rate(bbr->rc_tp, >>>=20 >>> CI completed a clean build on 12.0-R: >>> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/14672/ >>>=20 >>> What's your build environment and platform? >>>=20 >>> Best, >>> Li-Wen >>=20 >> ------ >> Randall Stewart >> rrs@netflix.com >>=20 >>=20 >>=20 ------ Randall Stewart rrs@netflix.com From owner-svn-src-head@freebsd.org Tue Sep 24 20:11: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 35ED412FF1E; Tue, 24 Sep 2019 20:11:56 +0000 (UTC) (envelope-from rrs@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 46dC5S0hhRz3xJL; Tue, 24 Sep 2019 20:11:56 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EF5004BEC; Tue, 24 Sep 2019 20:11:55 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8OKBthE008408; Tue, 24 Sep 2019 20:11:55 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OKBtCn008407; Tue, 24 Sep 2019 20:11:55 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201909242011.x8OKBtCn008407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 24 Sep 2019 20:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352660 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 352660 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, 24 Sep 2019 20:11:56 -0000 Author: rrs Date: Tue Sep 24 20:11:55 2019 New Revision: 352660 URL: https://svnweb.freebsd.org/changeset/base/352660 Log: don't call in_ratelmit detach when RATELIMIT is not compiled in the kernel. Modified: head/sys/netinet/tcp_stacks/bbr.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Tue Sep 24 20:04:31 2019 (r352659) +++ head/sys/netinet/tcp_stacks/bbr.c Tue Sep 24 20:11:55 2019 (r352660) @@ -14784,10 +14784,12 @@ bbr_set_sockopt(struct socket *so, struct sockopt *sop bbr->bbr_attempt_hdwr_pace = 0; } else { bbr->bbr_hdw_pace_ena = 0; +#ifdef RATELIMIT if (bbr->bbr_hdrw_pacing) { bbr->bbr_hdrw_pacing = 0; in_pcbdetach_txrtlmt(bbr->rc_inp); } +#endif } break; From owner-svn-src-head@freebsd.org Tue Sep 24 20:13: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 2295D12FFAD for ; Tue, 24 Sep 2019 20:13:42 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (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 46dC7T2HXRz3xSs for ; Tue, 24 Sep 2019 20:13:41 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pl1-x641.google.com with SMTP id y10so1449199plp.2 for ; Tue, 24 Sep 2019 13:13:40 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WImkZOy8Yzk/tjhCmu5VSfbbeF2OSCIF2DDj6g6OI2E=; b=lwA/IUmAjtaRoRxtL0CDPacEIlLiqd5KCdJVfR6VbK6n6qhSl23pmHPzoY3728NfNm L1TARXkDzNyN/ceEPa8EE+7jzJ016G1hNMd44S6qvnLiiqBEfRMPHCZ/OSVjwbv5k7yk DtuVeP6d+BW2aBvtiSo3dP2NcAF/GzgA0JjaW5fKhK/BvGlPIa2JiKjpC9HOPoAt+d4f rQRu+y2SRhYokoBUctkmxXfIBF+srK325fhaseXKAbpWMHvLOyatlNwKO0uswqGm992u etptaj+havk3YyIn9J+ZBhn3O/DCkN4TI4rGl1s6jnvHvKPx8nmY8fDdxTtazq54SXnI q3Lg== X-Gm-Message-State: APjAAAXGlzwYF1L+6BWFDLyWhLYrkMRr3Nb4bfvCHSYWlC+xUZ75V3LG mylAoYq6I9Y6ovhL5x7TW36jzg== X-Google-Smtp-Source: APXvYqz1xQFjNQjC5+dhqhPZSxGh1okOm7++8QkjBlnBDtW6eb51bCVE79C8dVwPLyheMawWfyD96g== X-Received: by 2002:a17:902:7282:: with SMTP id d2mr4960156pll.140.1569356019675; Tue, 24 Sep 2019 13:13:39 -0700 (PDT) Received: from ?IPv6:2607:fb10:7021:1::eb2d? ([2607:fb10:7021:1::eb2d]) by smtp.gmail.com with ESMTPSA id u31sm8595370pgn.93.2019.09.24.13.13.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2019 13:13:39 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r352657 - in head/sys: conf kern modules/tcp modules/tcp/bbr netinet netinet/tcp_stacks sys From: Randall Stewart In-Reply-To: <56FBEE27-FBDA-44E0-BBBF-F5D9A4755047@netflix.com> Date: Tue, 24 Sep 2019 13:13:37 -0700 Cc: "O. Hartmann" , Randall Ray Stewart , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: References: <201909241818.x8OIIBNr039667@repo.freebsd.org> <20190924212918.01e52920@thor.intern.walstatt.dynvpn.de> <56FBEE27-FBDA-44E0-BBBF-F5D9A4755047@netflix.com> To: Li-Wen Hsu X-Mailer: Apple Mail (2.3445.9.1) X-Rspamd-Queue-Id: 46dC7T2HXRz3xSs X-Spamd-Bar: ------------- X-Spamd-Result: default: False [-13.59 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[netflix.com:+]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; RCVD_IN_DNSWL_NONE(0.00)[1.4.6.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]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.09)[ip: (-0.56), ipnet: 2607:f8b0::/32(-2.63), asn: 15169(-2.19), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+] 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, 24 Sep 2019 20:13:42 -0000 Hmm It looks like BBR needs an update too since it calls the inpcb detach of = the ratelimit function too=E2=80=A6 I may need to reassess this since it should use only the tcp_ratelimit = interfaces=E2=80=A6 but for now an simple ifdef will work make sure to pick up r352660 (and actually it might be best to include ratelimit.. it costs little = and makes it so if you do get a nic that supports rate limiting you will be able to take = advantage of it) R > On Sep 24, 2019, at 1:06 PM, Randall Stewart wrote: >=20 > Right >=20 > Thats because GENERIC does not add the optional TCP stacks. >=20 > Ok the problem is fixed with r352659 >=20 > The tcp_ratelimit.h had a mixed up ifdef >=20 > i.e. >=20 > #ifdef RATELIMIT > #ifdef _KERNEL >=20 > definitions >=20 > #else >=20 > macro definitions that return error > #endif > #endif >=20 >=20 > Which should have been the opposite >=20 > #ifdef _KERNEL > #ifdef RATELIMIT >=20 > definitions >=20 > #else >=20 >=20 > macros def=E2=80=99s returning errors >=20 > #endif > #endif >=20 > Reversing that will fix the issue if you add the extra stacks but fail = to add RATELIMIT >=20 > R >=20 >> On Sep 24, 2019, at 1:01 PM, Li-Wen Hsu wrote: >>=20 >> I mean the head (r352657) world and GENERIC kernel can be built >> successfully on 12.0-R, which is we guaranteed. >> Also the LINT kernel build is fine on CI: >> https://ci.freebsd.org/job/FreeBSD-head-amd64-LINT/13781/ >>=20 >> So I was curious about the build environment of that build failure. >>=20 >> Best, >> Li-Wen >>=20 >> On Tue, Sep 24, 2019 at 9:55 PM Randall Stewart = wrote: >>>=20 >>> 12.0R would not have BBR .. its only in head=E2=80=A6 hmm it could = be a issue with TCP_RATELIMIT not defined >>> though I did compile GENERIC without the extra stacks (and without = rate limit and hpts) and that >>> compiled ok.. >>>=20 >>> R >>>=20 >>>> On Sep 24, 2019, at 12:49 PM, Li-Wen Hsu wrote: >>>>=20 >>>> On Tue, Sep 24, 2019 at 9:29 PM O. Hartmann = wrote: >>>>>=20 >>>>> -----BEGIN PGP SIGNED MESSAGE----- >>>>> Hash: SHA256 >>>>>=20 >>>>> Am Tue, 24 Sep 2019 18:18:11 +0000 (UTC) >>>>> Randall Stewart schrieb: >>>>>=20 >>>>>> Author: rrs >>>>>> Date: Tue Sep 24 18:18:11 2019 >>>>>> New Revision: 352657 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/352657 >>>>=20 >>>> ... >>>>=20 >>>>> This break kernel builds: >>>>>=20 >>>>> [...] >>>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: implicit >>>>> declaration of function 'tcp_chg_pacing_rate' is invalid in C99 >>>>> [-Werror,-Wimplicit-function-declaration] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ >>>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:9: = error: this function >>>>> declaration is not a prototype [-Werror,-Wstrict-prototypes] >>>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:5613:7: = error: incompatible >>>>> integer to pointer conversion assigning to 'const struct = tcp_hwrate_limit_table *' from 'int' >>>>> [-Werror,-Wint-conversion] nrte =3D = tcp_chg_pacing_rate(bbr->r_ctl.crte, ^ >>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- all_subdir_toecore --- = Building >>>>> = /usr/obj/usr/src/amd64.amd64/sys/THOR/modules/usr/src/sys/modules/toecore/= toecore.ko --- >>>>> all_subdir_tcp --- = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: >>>>> error: implicit declaration of function 'tcp_rel_pacing_rate' is = invalid in C99 >>>>> [-Werror,-Wimplicit-function-declaration] = tcp_rel_pacing_rate(bbr->r_ctl.crte, bbr->rc_tp); ^ >>>>> - --- all_subdir_tpm --- >>>>> =3D=3D=3D> tpm (all) >>>>> - --- all_subdir_tcp --- >>>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:10443:4: = error: this function >>>>> declaration is not a prototype [-Werror,-Wstrict-prototypes] --- = all_subdir_trm --- >>>>> =3D=3D=3D> trm (all) >>>>> - --- all_subdir_tcp --- >>>>> = /usr/src/sys/modules/tcp/bbr/../../../netinet/tcp_stacks/bbr.c:14307:21: = error: implicit >>>>> declaration of function 'tcp_set_pacing_rate' is invalid in C99 >>>>> [-Werror,-Wimplicit-function-declaration] bbr->r_ctl.crte =3D = tcp_set_pacing_rate(bbr->rc_tp, >>>>=20 >>>> CI completed a clean build on 12.0-R: >>>> https://ci.freebsd.org/job/FreeBSD-head-amd64-build/14672/ >>>>=20 >>>> What's your build environment and platform? >>>>=20 >>>> Best, >>>> Li-Wen >>>=20 >>> ------ >>> Randall Stewart >>> rrs@netflix.com >>>=20 >>>=20 >>>=20 >=20 > ------ > Randall Stewart > rrs@netflix.com >=20 >=20 >=20 ------ Randall Stewart rrs@netflix.com From owner-svn-src-head@freebsd.org Tue Sep 24 20:36: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 5994EF0A5D; Tue, 24 Sep 2019 20:36:44 +0000 (UTC) (envelope-from rrs@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 46dCf41T7Gz3ygN; Tue, 24 Sep 2019 20:36:44 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1621D4FD9; Tue, 24 Sep 2019 20:36:44 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8OKahSG021760; Tue, 24 Sep 2019 20:36:43 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OKahnv021758; Tue, 24 Sep 2019 20:36:43 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201909242036.x8OKahnv021758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 24 Sep 2019 20:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352661 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 352661 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, 24 Sep 2019 20:36:44 -0000 Author: rrs Date: Tue Sep 24 20:36:43 2019 New Revision: 352661 URL: https://svnweb.freebsd.org/changeset/base/352661 Log: lets put (void) in a couple of functions to keep older platforms that are stuck with gcc happy (ppc). The changes are needed in both bbr and rack. Obtained from: Michael Tuexen (mtuexen@) Modified: head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Tue Sep 24 20:11:55 2019 (r352660) +++ head/sys/netinet/tcp_stacks/bbr.c Tue Sep 24 20:36:43 2019 (r352661) @@ -1174,7 +1174,7 @@ sysctl_bbr_clear_lost(SYSCTL_HANDLER_ARGS) } static void -bbr_init_sysctls() +bbr_init_sysctls(void) { struct sysctl_oid *bbr_probertt; struct sysctl_oid *bbr_hptsi; @@ -1875,7 +1875,7 @@ bbr_progress_timeout_check(struct tcp_bbr *bbr) } static void -bbr_counter_destroy() +bbr_counter_destroy(void) { COUNTER_ARRAY_FREE(bbr_stat_arry, BBR_STAT_SIZE); COUNTER_ARRAY_FREE(bbr_opts_arry, BBR_OPTS_SIZE); Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Tue Sep 24 20:11:55 2019 (r352660) +++ head/sys/netinet/tcp_stacks/rack.c Tue Sep 24 20:36:43 2019 (r352661) @@ -514,7 +514,7 @@ sysctl_rack_clear(SYSCTL_HANDLER_ARGS) static void -rack_init_sysctls() +rack_init_sysctls(void) { struct sysctl_oid *rack_counters; struct sysctl_oid *rack_attack; @@ -1512,7 +1512,7 @@ rack_log_sad(struct tcp_rack *rack, int event) #endif static void -rack_counter_destroy() +rack_counter_destroy(void) { counter_u64_free(rack_badfr); counter_u64_free(rack_badfr_bytes); From owner-svn-src-head@freebsd.org Tue Sep 24 20:49: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 DCEB5F11A0; Tue, 24 Sep 2019 20:49:33 +0000 (UTC) (envelope-from grembo@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 46dCws5Wl0z40cX; Tue, 24 Sep 2019 20:49:33 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A0C2E51BF; Tue, 24 Sep 2019 20:49:33 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8OKnXFX028011; Tue, 24 Sep 2019 20:49:33 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OKnXFJ028009; Tue, 24 Sep 2019 20:49:33 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201909242049.x8OKnXFJ028009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Tue, 24 Sep 2019 20:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352662 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: grembo X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 352662 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, 24 Sep 2019 20:49:33 -0000 Author: grembo (ports committer) Date: Tue Sep 24 20:49:33 2019 New Revision: 352662 URL: https://svnweb.freebsd.org/changeset/base/352662 Log: freebsd-update: Add `updatesready' and `showconfig' commands `freebsd-update updatesready' can be used to check if there are any pending fetched updates that can be installed. `freebsd-update showconfig' writes freebsd-update's configuration to stdout. This also changes the exit code of `freebsd-update install' to 2 in case there are no updates pending to be installed and there wasn't a fetch phase in the same invocation. This allows scripts to tell apart these error conditions without breaking existing jail managers. See freebsd-update(8) for details. PR: 240757, 240177, 229346 Reviewed by: manpages (bcr), sectam (emaste), yuripv Differential Revision: https://reviews.freebsd.org/D21473 Modified: head/usr.sbin/freebsd-update/freebsd-update.8 head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Tue Sep 24 20:36:43 2019 (r352661) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Tue Sep 24 20:49:33 2019 (r352662) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2017 +.Dd September 24, 2019 .Dt FREEBSD-UPDATE 8 .Os .Sh NAME @@ -155,13 +155,24 @@ Note that this command may require up to 500 MB of spa depending on which components of the .Fx base system are installed. +.It Cm updatesready +Check if there are fetched updates ready to install. +Returns exit code 2 if there are no updates to install. .It Cm install Install the most recently fetched updates or upgrade. +Returns exit code 2 if there are no updates to install +and the +.Cm fetch +command wasn't passed as an earlier argument in the same +invocation. .It Cm rollback Uninstall the most recently installed updates. .It Cm IDS Compare the system against a "known good" index of the installed release. +.It Cm showconfig +Show configuration options after parsing conffile and command +line options. .El .Sh TIPS .Bl -bullet Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Sep 24 20:36:43 2019 (r352661) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Sep 24 20:49:33 2019 (r352662) @@ -62,9 +62,11 @@ Commands: cron -- Sleep rand(3600) seconds, fetch updates, and send an email if updates were found upgrade -- Fetch upgrades to FreeBSD version specified via -r option + updatesready -- Check if there are fetched updates ready to install install -- Install downloaded updates or upgrades rollback -- Uninstall most recently installed updates IDS -- Compare the system against an index of "known good" files + showconfig -- Show configuration EOF exit 0 } @@ -503,7 +505,8 @@ parse_cmdline () { ;; # Commands - cron | fetch | upgrade | install | rollback | IDS) + cron | fetch | upgrade | updatesready | install | rollback |\ + IDS | showconfig) COMMANDS="${COMMANDS} $1" ;; @@ -827,7 +830,7 @@ install_check_params () { echo "No updates are available to install." if [ $ISFETCHED -eq 0 ]; then echo "Run '$0 fetch' first." - exit 1 + exit 2 fi exit 0 fi @@ -3333,6 +3336,21 @@ cmd_upgrade () { upgrade_run || exit 1 } +# Check if there are fetched updates ready to install +cmd_updatesready () { + # Construct a unique name from ${BASEDIR} + BDHASH=`echo ${BASEDIR} | sha256 -q` + + # Check that we have updates ready to install + if ! [ -L ${BDHASH}-install ]; then + echo "No updates are available to install." + exit 2 + fi + + echo "There are updates available to install." + echo "Run '$0 install' to proceed." +} + # Install downloaded updates. cmd_install () { install_check_params @@ -3349,6 +3367,13 @@ cmd_rollback () { cmd_IDS () { IDS_check_params IDS_run || exit 1 +} + +# Output configuration. +cmd_showconfig () { + for X in ${CONFIGOPTIONS}; do + echo $X=$(eval echo \$${X}) + done } #### Entry point From owner-svn-src-head@freebsd.org Tue Sep 24 21:38: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 E2A98F22A6; Tue, 24 Sep 2019 21:38:57 +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 46dF1s4YYvz42wx; Tue, 24 Sep 2019 21:38:57 +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 7AE25363A86; Wed, 25 Sep 2019 07:38:53 +1000 (AEST) Date: Wed, 25 Sep 2019 07:38:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Randall Stewart cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352661 - head/sys/netinet/tcp_stacks In-Reply-To: <201909242036.x8OKahnv021758@repo.freebsd.org> Message-ID: <20190925070207.Y3271@besplex.bde.org> References: <201909242036.x8OKahnv021758@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=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=wm8JRkVb45S15BNH0CwA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 46dF1s4YYvz42wx X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,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: Tue, 24 Sep 2019 21:38:57 -0000 On Tue, 24 Sep 2019, Randall Stewart wrote: > Log: > lets put (void) in a couple of functions to keep older platforms that > are stuck with gcc happy (ppc). The changes are needed in both bbr and > rack. You mean "Don't use K&R declarations. clang is too broken to warn about K&R declarations even when requested to do so using -Wstrict-prototypes, but some archss (e.g., ppc) haven't been downgraded to use clang yet, so K&R declarations in kernel code are still detected in FreeBSD eventually. WERROR was recently broken for gcc-4.2 by making warnings not fatal, so the changes are not strictly needed. I use gcc-4.2 on x86 for all except about 10 files with ifuncs, and the broken WERROR causes serious problems: gcc-4.2 doesn't support ifuncs, so I have to downgrade to clang to compile files with ifuncs. ifuncs only generate warnings and this used to be fatal, so files ifuncs were easy to find. Now, garbage object files are created and the errors are obscure linkage errors. Of course, I fix this by restoring WERROR=-Werror. This clearly shows the bitrot that tcp_lro.c doesn't compile. It has casts of pointers uint64_t instead of to uintptr_t. On i386, these types have different sizes, so gcc detects the type mismatch. clang is too broken to report this type mismatch. The upcast happens to be safe on x86 but gcc's warning is good for portability (source portability to compilers that detect the type mismatch in some way, and binary portabiily to future arches with pointers larger than uint64_t). Bruce From owner-svn-src-head@freebsd.org Tue Sep 24 21:41: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 D11CCF24A4; Tue, 24 Sep 2019 21:41:19 +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 46dF4b5DCZz43Kg; Tue, 24 Sep 2019 21:41:19 +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 969CF5C52; Tue, 24 Sep 2019 21:41:19 +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 x8OLfJv1062369; Tue, 24 Sep 2019 21:41:19 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8OLfJ8U062368; Tue, 24 Sep 2019 21:41:19 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201909242141.x8OLfJ8U062368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 24 Sep 2019 21:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352663 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 352663 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, 24 Sep 2019 21:41:19 -0000 Author: jkim Date: Tue Sep 24 21:41:19 2019 New Revision: 352663 URL: https://svnweb.freebsd.org/changeset/base/352663 Log: Fix white spaces. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Sep 24 20:49:33 2019 (r352662) +++ head/sys/conf/files Tue Sep 24 21:41:19 2019 (r352663) @@ -3808,7 +3808,7 @@ kern/subr_epoch.c standard kern/subr_eventhandler.c standard kern/subr_fattime.c standard kern/subr_firmware.c optional firmware -kern/subr_filter.c standard +kern/subr_filter.c standard kern/subr_gtaskqueue.c standard kern/subr_hash.c standard kern/subr_hints.c standard @@ -4279,8 +4279,8 @@ netinet/tcp_log_buf.c optional tcp_blackbox inet | tc netinet/tcp_lro.c optional inet | inet6 netinet/tcp_output.c optional inet | inet6 netinet/tcp_offload.c optional tcp_offload inet | tcp_offload inet6 -netinet/tcp_hpts.c optional tcphpts inet | tcphpts inet6 -netinet/tcp_ratelimit.c optional ratelimit inet | ratelimit inet6 +netinet/tcp_hpts.c optional tcphpts inet | tcphpts inet6 +netinet/tcp_ratelimit.c optional ratelimit inet | ratelimit inet6 netinet/tcp_pcap.c optional inet tcppcap | inet6 tcppcap \ compile-with "${NORMAL_C} ${NO_WNONNULL}" netinet/tcp_reass.c optional inet | inet6 From owner-svn-src-head@freebsd.org Tue Sep 24 23:38: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 E133CF52A5; Tue, 24 Sep 2019 23:38:11 +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 46dHgR5G03z49fD; Tue, 24 Sep 2019 23:38:11 +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 92EDE703A; Tue, 24 Sep 2019 23:38:11 +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 x8ONcB2R028646; Tue, 24 Sep 2019 23:38:11 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8ONcAd2028641; Tue, 24 Sep 2019 23:38:10 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201909242338.x8ONcAd2028641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 24 Sep 2019 23:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352664 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 352664 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, 24 Sep 2019 23:38:11 -0000 Author: rmacklem Date: Tue Sep 24 23:38:10 2019 New Revision: 352664 URL: https://svnweb.freebsd.org/changeset/base/352664 Log: Replace all mtx_lock()/mtx_unlock() on the iod lock with macros. Since the NFS node mutex needs to change to an sx lock so it can be held when vnode_pager_setsize() is called and the iod lock is held when the NFS node lock is acquired, the iod mutex will need to be changed to an sx lock as well. To simply the future commit that changes both the NFS node lock and iod lock to sx locks, this commit replaces all mtx_lock()/mtx_unlock() calls on the iod lock with macros. There is no semantic change as a result of this commit. I don't know when the future commit will happen and be MFC'd, so I have set the MFC on this commit to one week so that it can be MFC'd at the same time. Suggested by: kib MFC after: 1 week Modified: head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clnfsiod.c head/sys/fs/nfsclient/nfs_clsubs.c head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Tue Sep 24 21:41:19 2019 (r352663) +++ head/sys/fs/nfs/nfsport.h Tue Sep 24 23:38:10 2019 (r352664) @@ -690,6 +690,8 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSUNLOCKNODE(n) mtx_unlock(&((n)->n_mtx)) #define NFSLOCKMNT(m) mtx_lock(&((m)->nm_mtx)) #define NFSUNLOCKMNT(m) mtx_unlock(&((m)->nm_mtx)) +#define NFSLOCKIOD() mtx_lock(&ncl_iod_mutex) +#define NFSUNLOCKIOD() mtx_unlock(&ncl_iod_mutex) #define NFSLOCKREQUEST(r) mtx_lock(&((r)->r_mtx)) #define NFSUNLOCKREQUEST(r) mtx_unlock(&((r)->r_mtx)) #define NFSLOCKSOCKREQ(r) mtx_lock(&((r)->nr_mtx)) Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Tue Sep 24 21:41:19 2019 (r352663) +++ head/sys/fs/nfsclient/nfs_clbio.c Tue Sep 24 23:38:10 2019 (r352664) @@ -1410,11 +1410,11 @@ ncl_asyncio(struct nfsmount *nmp, struct buf *bp, stru * To avoid this deadlock, don't allow the async nfsiod threads to * perform Readdirplus RPCs. */ - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); if ((bp->b_iocmd == BIO_WRITE && (bp->b_flags & B_NEEDCOMMIT) && (nmp->nm_bufqiods > ncl_numasync / 2)) || (bp->b_vp->v_type == VDIR && (nmp->nm_flag & NFSMNT_RDIRPLUS))) { - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return(EIO); } again: @@ -1481,7 +1481,7 @@ again: if (error) { error2 = newnfs_sigintr(nmp, td); if (error2) { - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (error2); } if (slpflag == PCATCH) { @@ -1522,11 +1522,11 @@ again: VTONFS(bp->b_vp)->n_directio_asyncwr++; NFSUNLOCKNODE(VTONFS(bp->b_vp)); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (0); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); /* * All the iods are busy on other mounts, so return EIO to Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnfsiod.c Tue Sep 24 21:41:19 2019 (r352663) +++ head/sys/fs/nfsclient/nfs_clnfsiod.c Tue Sep 24 23:38:10 2019 (r352664) @@ -106,7 +106,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) error = sysctl_handle_int(oidp, &newmin, 0, req); if (error || (req->newptr == NULL)) return (error); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); if (newmin > ncl_iodmax) { error = EINVAL; goto out; @@ -121,7 +121,7 @@ sysctl_iodmin(SYSCTL_HANDLER_ARGS) for (i = nfs_iodmin - ncl_numasync; i > 0; i--) nfs_nfsiodnew_sync(); out: - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, @@ -140,7 +140,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) return (error); if (newmax > NFS_MAXASYNCDAEMON) return (EINVAL); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); ncl_iodmax = newmax; if (ncl_numasync <= ncl_iodmax) goto out; @@ -157,7 +157,7 @@ sysctl_iodmax(SYSCTL_HANDLER_ARGS) iod--; } out: - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); return (0); } SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, @@ -178,10 +178,10 @@ nfs_nfsiodnew_sync(void) } if (i == ncl_iodmax) return (0); - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID, 0, "newnfs %d", i); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); if (error == 0) { ncl_numasync++; ncl_iodwant[i] = NFSIOD_AVAILABLE; @@ -194,12 +194,12 @@ void ncl_nfsiodnew_tq(__unused void *arg, int pending) { - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); while (pending > 0) { pending--; nfs_nfsiodnew_sync(); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); } void @@ -217,7 +217,7 @@ nfsiod_setup(void *dummy) TUNABLE_INT_FETCH("vfs.nfs.iodmin", &nfs_iodmin); nfscl_init(); - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); /* Silently limit the start number of nfsiod's */ if (nfs_iodmin > NFS_MAXASYNCDAEMON) nfs_iodmin = NFS_MAXASYNCDAEMON; @@ -227,7 +227,7 @@ nfsiod_setup(void *dummy) if (error == -1) panic("nfsiod_setup: nfs_nfsiodnew failed"); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); } SYSINIT(newnfsiod, SI_SUB_KTHREAD_IDLE, SI_ORDER_ANY, nfsiod_setup, NULL); @@ -248,7 +248,7 @@ nfssvc_iod(void *instance) int myiod, timo; int error = 0; - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); myiod = (int *)instance - nfs_asyncdaemon; /* * Main loop @@ -291,7 +291,7 @@ nfssvc_iod(void *instance) nmp->nm_bufqwant = 0; wakeup(&nmp->nm_bufq); } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); if (bp->b_flags & B_DIRECT) { KASSERT((bp->b_iocmd == BIO_WRITE), ("nfscvs_iod: BIO_WRITE not set")); (void)ncl_doio_directwrite(bp); @@ -303,7 +303,7 @@ nfssvc_iod(void *instance) (void) ncl_doio(bp->b_vp, bp, bp->b_wcred, NULL, 0); } - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); /* * Make sure the nmp hasn't been dismounted as soon as * ncl_doio() completes for the last buffer. @@ -335,7 +335,7 @@ finish: /* Someone may be waiting for the last nfsiod to terminate. */ if (--ncl_numasync == 0) wakeup(&ncl_numasync); - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); if ((error == 0) || (error == EWOULDBLOCK)) kproc_exit(0); /* Abnormal termination */ Modified: head/sys/fs/nfsclient/nfs_clsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clsubs.c Tue Sep 24 21:41:19 2019 (r352663) +++ head/sys/fs/nfsclient/nfs_clsubs.c Tue Sep 24 23:38:10 2019 (r352664) @@ -102,7 +102,7 @@ ncl_uninit(struct vfsconf *vfsp) * Tell all nfsiod processes to exit. Clear ncl_iodmax, and wakeup * any sleeping nfsiods so they check ncl_iodmax and exit. */ - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); ncl_iodmax = 0; for (i = 0; i < ncl_numasync; i++) if (ncl_iodwant[i] == NFSIOD_AVAILABLE) @@ -110,7 +110,7 @@ ncl_uninit(struct vfsconf *vfsp) /* The last nfsiod to exit will wake us up when ncl_numasync hits 0 */ while (ncl_numasync) msleep(&ncl_numasync, &ncl_iod_mutex, PWAIT, "ioddie", 0); - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); ncl_nhuninit(); return (0); #else Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Tue Sep 24 21:41:19 2019 (r352663) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Tue Sep 24 23:38:10 2019 (r352664) @@ -1713,13 +1713,13 @@ nfs_unmount(struct mount *mp, int mntflags) mtx_unlock(&nmp->nm_mtx); } /* Make sure no nfsiods are assigned to this mount. */ - mtx_lock(&ncl_iod_mutex); + NFSLOCKIOD(); for (i = 0; i < NFS_MAXASYNCDAEMON; i++) if (ncl_iodmount[i] == nmp) { ncl_iodwant[i] = NFSIOD_AVAILABLE; ncl_iodmount[i] = NULL; } - mtx_unlock(&ncl_iod_mutex); + NFSUNLOCKIOD(); /* * We can now set mnt_data to NULL and wait for From owner-svn-src-head@freebsd.org Wed Sep 25 00:24: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 3C383F60F3; Wed, 25 Sep 2019 00:24:58 +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 46dJjQ0wJ0z4CKR; Wed, 25 Sep 2019 00:24:58 +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 F249C78FE; Wed, 25 Sep 2019 00:24:57 +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 x8P0Ov0U057529; Wed, 25 Sep 2019 00:24:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8P0OveP057528; Wed, 25 Sep 2019 00:24:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909250024.x8P0OveP057528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 25 Sep 2019 00:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352665 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 352665 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: Wed, 25 Sep 2019 00:24:58 -0000 Author: imp Date: Wed Sep 25 00:24:57 2019 New Revision: 352665 URL: https://svnweb.freebsd.org/changeset/base/352665 Log: After my comnd changes, the number of threads and size weren't set. In addition, the flags are optional, but were made to be mandatory. Set these things, as well as santiy check the specified size. Submitted by: Stefan Rink PR: 240798 Modified: head/sbin/nvmecontrol/perftest.c Modified: head/sbin/nvmecontrol/perftest.c ============================================================================== --- head/sbin/nvmecontrol/perftest.c Tue Sep 24 23:38:10 2019 (r352664) +++ head/sbin/nvmecontrol/perftest.c Wed Sep 25 00:24:57 2019 (r352665) @@ -143,9 +143,9 @@ perftest(const struct cmd *f, int argc, char *argv[]) if (arg_parse(argc, argv, f)) return; - if (opt.flags == NULL || opt.op == NULL) + if (opt.op == NULL) arg_help(argc, argv, f); - if (strcmp(opt.flags, "refthread") == 0) + if (opt.flags != NULL && strcmp(opt.flags, "refthread") == 0) io_test.flags |= NVME_TEST_FLAG_REFTHREAD; if (opt.intr != NULL) { if (strcmp(opt.intr, "bio") == 0 || @@ -163,6 +163,7 @@ perftest(const struct cmd *f, int argc, char *argv[]) fprintf(stderr, "Bad number of threads %d\n", opt.threads); arg_help(argc, argv, f); } + io_test.num_threads = opt.threads; if (strcasecmp(opt.op, "read") == 0) io_test.opc = NVME_OPC_READ; else if (strcasecmp(opt.op, "write") == 0) @@ -176,6 +177,11 @@ perftest(const struct cmd *f, int argc, char *argv[]) arg_help(argc, argv, f); } io_test.time = opt.time; + if (opt.size < 0) { + fprintf(stderr, "Invalid size.\n"); + arg_help(argc, argv, f); + } + io_test.size = opt.size; open_dev(opt.dev, &fd, 1, 1); if (ioctl(fd, ioctl_cmd, &io_test) < 0) err(1, "ioctl NVME_IO_TEST failed"); From owner-svn-src-head@freebsd.org Wed Sep 25 01:23: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 A7C63F7726; Wed, 25 Sep 2019 01:23:09 +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 46dL0Y3ygHz4Fbk; Wed, 25 Sep 2019 01:23:09 +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 6C55C8383; Wed, 25 Sep 2019 01:23:09 +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 x8P1N93s092556; Wed, 25 Sep 2019 01:23:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8P1N9gj092555; Wed, 25 Sep 2019 01:23:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201909250123.x8P1N9gj092555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 25 Sep 2019 01:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352666 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 352666 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: Wed, 25 Sep 2019 01:23:09 -0000 Author: jhibbits Date: Wed Sep 25 01:23:08 2019 New Revision: 352666 URL: https://svnweb.freebsd.org/changeset/base/352666 Log: powerpc: Allocate DPCPU block from domain-local memory This should improve NUMA scalability a little, by binding to the CPU's NUMA domain. This matches what's done on amd64. Modified: head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Wed Sep 25 00:24:57 2019 (r352665) +++ head/sys/powerpc/powerpc/mp_machdep.c Wed Sep 25 01:23:08 2019 (r352666) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -149,7 +150,7 @@ cpu_mp_start(void) { struct cpuref bsp, cpu; struct pcpu *pc; - int error; + int domain, error; error = platform_smp_get_bsp(&bsp); KASSERT(error == 0, ("Don't know BSP")); @@ -166,12 +167,18 @@ cpu_mp_start(void) cpu.cr_cpuid); goto next; } + + if (vm_ndomains > 1) + domain = cpu.cr_domain; + else + domain = 0; + if (cpu.cr_cpuid != bsp.cr_cpuid) { void *dpcpu; pc = &__pcpu[cpu.cr_cpuid]; - dpcpu = (void *)kmem_malloc(DPCPU_SIZE, M_WAITOK | - M_ZERO); + dpcpu = (void *)kmem_malloc_domainset(DOMAINSET_PREF(domain), + DPCPU_SIZE, M_WAITOK | M_ZERO); pcpu_init(pc, cpu.cr_cpuid, sizeof(*pc)); dpcpu_init(dpcpu, cpu.cr_cpuid); } else { @@ -179,12 +186,8 @@ cpu_mp_start(void) pc->pc_cpuid = bsp.cr_cpuid; pc->pc_bsp = 1; } + pc->pc_domain = domain; pc->pc_hwref = cpu.cr_hwref; - - if (vm_ndomains > 1) - pc->pc_domain = cpu.cr_domain; - else - pc->pc_domain = 0; CPU_SET(pc->pc_cpuid, &cpuset_domain[pc->pc_domain]); KASSERT(pc->pc_domain < MAXMEMDOM, ("bad domain value %d\n", From owner-svn-src-head@freebsd.org Wed Sep 25 01:23: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 0EDE0F77E6; Wed, 25 Sep 2019 01:23:53 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (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 46dL1N3TKyz4Fkx; Wed, 25 Sep 2019 01:23:52 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pl1-x635.google.com with SMTP id y10so1705770plp.2; Tue, 24 Sep 2019 18:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LhezTJFYNPsCwdZt7JSATbNGtZ4OPo6LPjsbthJGrlw=; b=KBwRgj+0NhXGsJ9xIlg7TZV7Ng/bQCk/4NoTzHXYJ4x2E/jzS0w5/DHqZ22LGFsBNi pSm4sDGGVYHedFXc0IsCZvS9N9iVd1fabOQEwiuNmt2Q1pkvrr/zz/YzjvUHm3zzkVmz fwQh6u4ZQr1zzSpF881OKVB32bd54tArkTvNJKHJleLkAqRYMkWh7TPlhIVb88ik4FtQ ZEhx3E9J/E8G481IbqiVz/lMSDjc/qrPHj6/tBpEpjUoWtuGK+YdpuUAuKoY8wQ1mTZb /SiC7lD7QxEZNCZdVlKHk5CpIv+96BtJeVDKXE2hlTBtKYMj8pDGo6b4SYbcOq9BHksV V3/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=LhezTJFYNPsCwdZt7JSATbNGtZ4OPo6LPjsbthJGrlw=; b=bv9QJ45dd4jyO1E0QXU4Ouufm11IJc1o2qvLqtbIKZ8pbM2gbpQc4LvfPextZtHr3p d8MOd2NM0ooET8wWKCVB2Jvm6/yNekUaWbT2te9N0T3517vVuthojCZ89mPAtH9vwMUY I97Tz4R/AlklYmjZ+f/WGRc7gSjA+PLWOew7OhCAmX7wURz6R2PoMZ3SbQS1PzBx/MTj iEg6TQAyhvJmEPuCVB5rQlrvMk9xSjS/wlL+aEARpTsXCKH1TxDwvc+w2+fShqIgtDH0 NnVsV5FpimfSOmI8XikgANGyuALp8ALGtu0jQIHRaAAeTAfzg48aG6+WD5bPcmUMJtOF iPKg== X-Gm-Message-State: APjAAAVwMIlDTPdGYQXYaKbN+e9a3+Lr5MyOyiagK1pVNwwhIcsEeOid avVzBUyJS9WgsThtC7F29T/Ghl0B X-Google-Smtp-Source: APXvYqx//nzM+JNjYOkXIccnmS8cVUfI89xiw1uLAyD/QuaujHulrTAq/hM/QRotlShGLlRTfu+Rjg== X-Received: by 2002:a17:902:322:: with SMTP id 31mr6433422pld.150.1569374630809; Tue, 24 Sep 2019 18:23:50 -0700 (PDT) Received: from ?IPv6:2403:5800:7100:5d01:8879:6a99:8a32:d59f? (2403-5800-7100-5d01-8879-6a99-8a32-d59f.ip6.aussiebb.net. [2403:5800:7100:5d01:8879:6a99:8a32:d59f]) by smtp.gmail.com with ESMTPSA id u9sm388710pfl.138.2019.09.24.18.23.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Sep 2019 18:23:50 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r352662 - head/usr.sbin/freebsd-update To: Michael Gmelin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909242049.x8OKnXFJ028009@repo.freebsd.org> From: Kubilay Kocak Message-ID: <794f4e65-80c8-46f7-f172-4b89a68891cd@FreeBSD.org> Date: Wed, 25 Sep 2019 11:23:46 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Thunderbird/70.0 MIME-Version: 1.0 In-Reply-To: <201909242049.x8OKnXFJ028009@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46dL1N3TKyz4Fkx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=KBwRgj+0; dmarc=none; spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::635 as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com X-Spamd-Result: default: False [-4.87 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; IP_SCORE(-2.67)[ip: (-8.50), ipnet: 2607:f8b0::/32(-2.63), asn: 15169(-2.19), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_IN_DNSWL_NONE(0.00)[5.3.6.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)[] 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: Wed, 25 Sep 2019 01:23:53 -0000 On 25/09/2019 6:49 am, Michael Gmelin wrote: > Author: grembo (ports committer) > Date: Tue Sep 24 20:49:33 2019 > New Revision: 352662 > URL: https://svnweb.freebsd.org/changeset/base/352662 > > Log: > freebsd-update: Add `updatesready' and `showconfig' commands > > `freebsd-update updatesready' can be used to check if there are any pending > fetched updates that can be installed. > > `freebsd-update showconfig' writes freebsd-update's configuration to > stdout. > > This also changes the exit code of `freebsd-update install' to 2 in case > there are no updates pending to be installed and there wasn't a fetch phase > in the same invocation. This allows scripts to tell apart these error > conditions without breaking existing jail managers. > > See freebsd-update(8) for details. > > PR: 240757, 240177, 229346 > Reviewed by: manpages (bcr), sectam (emaste), yuripv > Differential Revision: https://reviews.freebsd.org/D21473 Would love to see these MFC'd. Consistency between freebsd-update on all our supported versions for one of our major user features would be awesome. > Modified: > head/usr.sbin/freebsd-update/freebsd-update.8 > head/usr.sbin/freebsd-update/freebsd-update.sh > > Modified: head/usr.sbin/freebsd-update/freebsd-update.8 > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.8 Tue Sep 24 20:36:43 2019 (r352661) > +++ head/usr.sbin/freebsd-update/freebsd-update.8 Tue Sep 24 20:49:33 2019 (r352662) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd June 14, 2017 > +.Dd September 24, 2019 > .Dt FREEBSD-UPDATE 8 > .Os > .Sh NAME > @@ -155,13 +155,24 @@ Note that this command may require up to 500 MB of spa > depending on which components of the > .Fx > base system are installed. > +.It Cm updatesready > +Check if there are fetched updates ready to install. > +Returns exit code 2 if there are no updates to install. > .It Cm install > Install the most recently fetched updates or upgrade. > +Returns exit code 2 if there are no updates to install > +and the > +.Cm fetch > +command wasn't passed as an earlier argument in the same > +invocation. > .It Cm rollback > Uninstall the most recently installed updates. > .It Cm IDS > Compare the system against a "known good" index of the > installed release. > +.It Cm showconfig > +Show configuration options after parsing conffile and command > +line options. > .El > .Sh TIPS > .Bl -bullet > > Modified: head/usr.sbin/freebsd-update/freebsd-update.sh > ============================================================================== > --- head/usr.sbin/freebsd-update/freebsd-update.sh Tue Sep 24 20:36:43 2019 (r352661) > +++ head/usr.sbin/freebsd-update/freebsd-update.sh Tue Sep 24 20:49:33 2019 (r352662) > @@ -62,9 +62,11 @@ Commands: > cron -- Sleep rand(3600) seconds, fetch updates, and send an > email if updates were found > upgrade -- Fetch upgrades to FreeBSD version specified via -r option > + updatesready -- Check if there are fetched updates ready to install > install -- Install downloaded updates or upgrades > rollback -- Uninstall most recently installed updates > IDS -- Compare the system against an index of "known good" files > + showconfig -- Show configuration > EOF > exit 0 > } > @@ -503,7 +505,8 @@ parse_cmdline () { > ;; > > # Commands > - cron | fetch | upgrade | install | rollback | IDS) > + cron | fetch | upgrade | updatesready | install | rollback |\ > + IDS | showconfig) > COMMANDS="${COMMANDS} $1" > ;; > > @@ -827,7 +830,7 @@ install_check_params () { > echo "No updates are available to install." > if [ $ISFETCHED -eq 0 ]; then > echo "Run '$0 fetch' first." > - exit 1 > + exit 2 > fi > exit 0 > fi > @@ -3333,6 +3336,21 @@ cmd_upgrade () { > upgrade_run || exit 1 > } > > +# Check if there are fetched updates ready to install > +cmd_updatesready () { > + # Construct a unique name from ${BASEDIR} > + BDHASH=`echo ${BASEDIR} | sha256 -q` > + > + # Check that we have updates ready to install > + if ! [ -L ${BDHASH}-install ]; then > + echo "No updates are available to install." > + exit 2 > + fi > + > + echo "There are updates available to install." > + echo "Run '$0 install' to proceed." > +} > + > # Install downloaded updates. > cmd_install () { > install_check_params > @@ -3349,6 +3367,13 @@ cmd_rollback () { > cmd_IDS () { > IDS_check_params > IDS_run || exit 1 > +} > + > +# Output configuration. > +cmd_showconfig () { > + for X in ${CONFIGOPTIONS}; do > + echo $X=$(eval echo \$${X}) > + done > } > > #### Entry point > _______________________________________________ > 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 Wed Sep 25 01:39: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 691B4F7B6A; Wed, 25 Sep 2019 01:39: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 46dLMz1kWmz4GBw; Wed, 25 Sep 2019 01:39:59 +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 1E7AF854C; Wed, 25 Sep 2019 01:39:59 +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 x8P1dxiM098432; Wed, 25 Sep 2019 01:39:59 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8P1dw15098431; Wed, 25 Sep 2019 01:39:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201909250139.x8P1dw15098431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 25 Sep 2019 01:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352667 - 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: 352667 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: Wed, 25 Sep 2019 01:39:59 -0000 Author: jhibbits Date: Wed Sep 25 01:39:58 2019 New Revision: 352667 URL: https://svnweb.freebsd.org/changeset/base/352667 Log: powerpc/atomic: Follow recommendations on atomic primitive comparisons Both IBM and Freescale programming examples presume the cmpset operands will favor equal, and pessimize the non-equal case instead. Do the same for atomic_cmpset_* and atomic_fcmpset_*. This slightly pessimizes the failure case, in favor of the success case. MFC after: 3 weeks Modified: head/sys/powerpc/include/atomic.h Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Wed Sep 25 01:23:08 2019 (r352666) +++ head/sys/powerpc/include/atomic.h Wed Sep 25 01:39:58 2019 (r352667) @@ -568,7 +568,7 @@ atomic_cmpset_int(volatile u_int* p, u_int cmpval, u_i __asm __volatile ( "1:\tlwarx %0, 0, %2\n\t" /* load old value */ "cmplw %3, %0\n\t" /* compare */ - "bne 2f\n\t" /* exit if not equal */ + "bne- 2f\n\t" /* exit if not equal */ "stwcx. %4, 0, %2\n\t" /* attempt to store */ "bne- 1b\n\t" /* spin if failed */ "li %0, 1\n\t" /* success - retval = 1 */ @@ -592,12 +592,12 @@ atomic_cmpset_long(volatile u_long* p, u_long cmpval, #ifdef __powerpc64__ "1:\tldarx %0, 0, %2\n\t" /* load old value */ "cmpld %3, %0\n\t" /* compare */ - "bne 2f\n\t" /* exit if not equal */ + "bne- 2f\n\t" /* exit if not equal */ "stdcx. %4, 0, %2\n\t" /* attempt to store */ #else "1:\tlwarx %0, 0, %2\n\t" /* load old value */ "cmplw %3, %0\n\t" /* compare */ - "bne 2f\n\t" /* exit if not equal */ + "bne- 2f\n\t" /* exit if not equal */ "stwcx. %4, 0, %2\n\t" /* attempt to store */ #endif "bne- 1b\n\t" /* spin if failed */ @@ -684,7 +684,7 @@ atomic_fcmpset_int(volatile u_int *p, u_int *cmpval, u __asm __volatile ( "lwarx %0, 0, %3\n\t" /* load old value */ "cmplw %4, %0\n\t" /* compare */ - "bne 1f\n\t" /* exit if not equal */ + "bne- 1f\n\t" /* exit if not equal */ "stwcx. %5, 0, %3\n\t" /* attempt to store */ "bne- 1f\n\t" /* exit if failed */ "li %0, 1\n\t" /* success - retval = 1 */ @@ -709,12 +709,12 @@ atomic_fcmpset_long(volatile u_long *p, u_long *cmpval #ifdef __powerpc64__ "ldarx %0, 0, %3\n\t" /* load old value */ "cmpld %4, %0\n\t" /* compare */ - "bne 1f\n\t" /* exit if not equal */ + "bne- 1f\n\t" /* exit if not equal */ "stdcx. %5, 0, %3\n\t" /* attempt to store */ #else "lwarx %0, 0, %3\n\t" /* load old value */ "cmplw %4, %0\n\t" /* compare */ - "bne 1f\n\t" /* exit if not equal */ + "bne- 1f\n\t" /* exit if not equal */ "stwcx. %5, 0, %3\n\t" /* attempt to store */ #endif "bne- 1f\n\t" /* exit if failed */ From owner-svn-src-head@freebsd.org Wed Sep 25 02:37: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 A0A73F87EC; Wed, 25 Sep 2019 02:37:42 +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 46dMfZ3jjjz4Hwv; Wed, 25 Sep 2019 02:37:42 +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 4556B8FD6; Wed, 25 Sep 2019 02:37:42 +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 x8P2bgaJ033454; Wed, 25 Sep 2019 02:37:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8P2bf0X033449; Wed, 25 Sep 2019 02:37:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909250237.x8P2bf0X033449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 02:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352668 - in head/usr.sbin/cron: cron crontab lib X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.sbin/cron: cron crontab lib X-SVN-Commit-Revision: 352668 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: Wed, 25 Sep 2019 02:37:42 -0000 Author: kevans Date: Wed Sep 25 02:37:40 2019 New Revision: 352668 URL: https://svnweb.freebsd.org/changeset/base/352668 Log: cron: add log suppression and mail suppression for successful runs This commit adds two new extensions to crontab, ported from OpenBSD: - -n: suppress mail on succesful run - -q: suppress logging of command execution The -q option appears decades old, but -n is relatively new. The original proposal by Job Snijder can be found here [1], and gives very convincing reasons for inclusion in base. This patch is a nearly identical port of OpenBSD cron for -q and -n features. It is written to follow existing conventions and style of the existing codebase. Example usage: # should only send email, but won't show up in log * * * * * -q date # should not send email * * * * * -n date # should not send email or log * * * * * -n -q date # should send email because of ping failure * * * * * -n -q ping -c 1 5.5.5.5 [1]: https://marc.info/?l=openbsd-tech&m=152874866117948&w=2 PR: 237538 Submitted by: Naveen Nathan Reviewed by: bcr (manpages) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20046 Modified: head/usr.sbin/cron/cron/cron.h head/usr.sbin/cron/cron/do_command.c head/usr.sbin/cron/cron/popen.c head/usr.sbin/cron/crontab/crontab.5 head/usr.sbin/cron/lib/entry.c Modified: head/usr.sbin/cron/cron/cron.h ============================================================================== --- head/usr.sbin/cron/cron/cron.h Wed Sep 25 01:39:58 2019 (r352667) +++ head/usr.sbin/cron/cron/cron.h Wed Sep 25 02:37:40 2019 (r352668) @@ -191,6 +191,8 @@ typedef struct _entry { #define NOT_UNTIL 0x10 #define SEC_RES 0x20 #define INTERVAL 0x40 +#define DONT_LOG 0x80 +#define MAIL_WHEN_ERR 0x100 time_t lastrun; } entry; @@ -257,7 +259,7 @@ user *load_user(int, struct passwd *, char *), entry *load_entry(FILE *, void (*)(char *), struct passwd *, char **); -FILE *cron_popen(char *, char *, entry *); +FILE *cron_popen(char *, char *, entry *, PID_T *); /* in the C tradition, we only create Modified: head/usr.sbin/cron/cron/do_command.c ============================================================================== --- head/usr.sbin/cron/cron/do_command.c Wed Sep 25 01:39:58 2019 (r352667) +++ head/usr.sbin/cron/cron/do_command.c Wed Sep 25 02:37:40 2019 (r352668) @@ -41,6 +41,7 @@ static const char rcsid[] = static void child_process(entry *, user *), do_univ(user *); +static WAIT_T wait_on_child(PID_T, const char *); void do_command(e, u) @@ -94,7 +95,10 @@ child_process(e, u) int stdin_pipe[2], stdout_pipe[2]; register char *input_data; char *usernm, *mailto, *mailfrom; - int children = 0; + PID_T jobpid, stdinjob, mailpid; + register FILE *mail; + register int bytes = 1; + int status = 0; # if defined(LOGIN_CAP) struct passwd *pwd; login_cap_t *lc; @@ -216,7 +220,7 @@ child_process(e, u) /* fork again, this time so we can exec the user's command. */ - switch (vfork()) { + switch (jobpid = vfork()) { case -1: log_it("CRON",getpid(),"error","can't vfork"); exit(ERROR_EXIT); @@ -237,7 +241,7 @@ child_process(e, u) * the actual user command shell was going to get and the * PID is part of the log message. */ - /*local*/{ + if ((e->flags & DONT_LOG) == 0) { char *x = mkprints((u_char *)e->cmd, strlen(e->cmd)); log_it(usernm, getpid(), "CMD", x); @@ -359,8 +363,6 @@ child_process(e, u) break; } - children++; - /* middle process, child of original cron, parent of process running * the user's command. */ @@ -384,7 +386,7 @@ child_process(e, u) * we would block here. thus we must fork again. */ - if (*input_data && fork() == 0) { + if (*input_data && (stdinjob = fork()) == 0) { register FILE *out = fdopen(stdin_pipe[WRITE_PIPE], "w"); register int need_newline = FALSE; register int escaped = FALSE; @@ -440,8 +442,6 @@ child_process(e, u) */ close(stdin_pipe[WRITE_PIPE]); - children++; - /* * read output from the grandchild. it's stderr has been redirected to * it's stdout, which has been redirected to our pipe. if there is any @@ -462,10 +462,6 @@ child_process(e, u) ch = getc(in); if (ch != EOF) { - register FILE *mail; - register int bytes = 1; - int status = 0; - Debug(DPROC|DEXT, ("[%d] got data (%x:%c) from grandchild\n", getpid(), ch, ch)) @@ -500,7 +496,7 @@ child_process(e, u) hostname[sizeof(hostname) - 1] = '\0'; (void) snprintf(mailcmd, sizeof(mailcmd), MAILARGS, MAILCMD); - if (!(mail = cron_popen(mailcmd, "w", e))) { + if (!(mail = cron_popen(mailcmd, "w", e, &mailpid))) { warn("%s", MAILCMD); (void) _exit(ERROR_EXIT); } @@ -538,28 +534,56 @@ child_process(e, u) if (mailto) putc(ch, mail); } + } + /*if data from grandchild*/ - /* only close pipe if we opened it -- i.e., we're - * mailing... - */ + Debug(DPROC, ("[%d] got EOF from grandchild\n", getpid())) - if (mailto) { - Debug(DPROC, ("[%d] closing pipe to mail\n", - getpid())) - /* Note: the pclose will probably see - * the termination of the grandchild - * in addition to the mail process, since - * it (the grandchild) is likely to exit - * after closing its stdout. - */ - status = cron_pclose(mail); - } + /* also closes stdout_pipe[READ_PIPE] */ + fclose(in); + } + /* wait for children to die. + */ + if (jobpid > 0) { + WAIT_T waiter; + + waiter = wait_on_child(jobpid, "grandchild command job"); + + /* If everything went well, and -n was set, _and_ we have mail, + * we won't be mailing... so shoot the messenger! + */ + if (WIFEXITED(waiter) && WEXITSTATUS(waiter) == 0 + && (e->flags & MAIL_WHEN_ERR) == MAIL_WHEN_ERR + && mailto) { + Debug(DPROC, ("[%d] %s executed successfully, mail suppressed\n", + getpid(), "grandchild command job")) + kill(mailpid, SIGKILL); + (void)fclose(mail); + mailto = NULL; + } + + + /* only close pipe if we opened it -- i.e., we're + * mailing... + */ + + if (mailto) { + Debug(DPROC, ("[%d] closing pipe to mail\n", + getpid())) + /* Note: the pclose will probably see + * the termination of the grandchild + * in addition to the mail process, since + * it (the grandchild) is likely to exit + * after closing its stdout. + */ + status = cron_pclose(mail); + /* if there was output and we could not mail it, * log the facts so the poor user can figure out * what's going on. */ - if (mailto && status) { + if (status) { char buf[MAX_TEMPSTR]; snprintf(buf, sizeof(buf), @@ -568,35 +592,38 @@ child_process(e, u) status); log_it(usernm, getpid(), "MAIL", buf); } + } + } - } /*if data from grandchild*/ + if (*input_data && stdinjob > 0) + wait_on_child(stdinjob, "grandchild stdinjob"); +} - Debug(DPROC, ("[%d] got EOF from grandchild\n", getpid())) +static WAIT_T +wait_on_child(PID_T childpid, const char *name) { + WAIT_T waiter; + PID_T pid; - fclose(in); /* also closes stdout_pipe[READ_PIPE] */ - } + Debug(DPROC, ("[%d] waiting for %s (%d) to finish\n", + getpid(), name, childpid)) - /* wait for children to die. - */ - for (; children > 0; children--) - { - WAIT_T waiter; - PID_T pid; +#ifdef POSIX + while ((pid = waitpid(childpid, &waiter, 0)) < 0 && errno == EINTR) +#else + while ((pid = wait4(childpid, &waiter, 0, NULL)) < 0 && errno == EINTR) +#endif + ; - Debug(DPROC, ("[%d] waiting for grandchild #%d to finish\n", - getpid(), children)) - pid = wait(&waiter); - if (pid < OK) { - Debug(DPROC, ("[%d] no more grandchildren--mail written?\n", - getpid())) - break; - } - Debug(DPROC, ("[%d] grandchild #%d finished, status=%04x", - getpid(), pid, WEXITSTATUS(waiter))) - if (WIFSIGNALED(waiter) && WCOREDUMP(waiter)) - Debug(DPROC, (", dumped core")) - Debug(DPROC, ("\n")) - } + if (pid < OK) + return waiter; + + Debug(DPROC, ("[%d] %s (%d) finished, status=%04x", + getpid(), name, pid, WEXITSTATUS(waiter))) + if (WIFSIGNALED(waiter) && WCOREDUMP(waiter)) + Debug(DPROC, (", dumped core")) + Debug(DPROC, ("\n")) + + return waiter; } Modified: head/usr.sbin/cron/cron/popen.c ============================================================================== --- head/usr.sbin/cron/cron/popen.c Wed Sep 25 01:39:58 2019 (r352667) +++ head/usr.sbin/cron/cron/popen.c Wed Sep 25 02:37:40 2019 (r352668) @@ -55,9 +55,10 @@ static PID_T *pids; static int fds; FILE * -cron_popen(program, type, e) +cron_popen(program, type, e, pidptr) char *program, *type; entry *e; + PID_T *pidptr; { register char *cp; FILE *iop; @@ -218,6 +219,9 @@ pfree: free((char *)argv[argc]); } #endif + + *pidptr = pid; + return(iop); } Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Wed Sep 25 01:39:58 2019 (r352667) +++ head/usr.sbin/cron/crontab/crontab.5 Wed Sep 25 02:37:40 2019 (r352668) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 19, 2019 +.Dd September 24, 2019 .Dt CRONTAB 5 .Os .Sh NAME @@ -199,6 +199,8 @@ lists of names are not allowed. .Pp The ``sixth'' field (the rest of the line) specifies the command to be run. +One or more command options may precede the command to modify processing +behavior. The entire command portion of the line, up to a newline or % character, will be executed by .Pa /bin/sh @@ -211,6 +213,22 @@ Percent-signs (%) in the command, unless escaped with after the first % will be sent to the command as standard input. .Pp +The following command options can be supplied: +.Bl -tag -width Ds +.It Fl n +No mail is sent after a successful run. +The execution output will only be mailed if the command exits with a non-zero +exit code. +The +.Fl n +option is an attempt to cure potentially copious volumes of mail coming from +.Xr cron 8 . +.It Fl q +Execution will not be logged. +.El +.sp +Duplicate options are not allowed. +.Pp Note: The day of a command's execution can be specified by two fields \(em day of month, and day of week. If both fields are @@ -271,6 +289,10 @@ MAILTO=paul 5 4 * * sun echo "run at 5 after 4 every sunday" # run at 5 minutes intervals, no matter how long it takes @300 svnlite up /usr/src +# run every minute, suppress logging +* * * * * -q date +# run every minute, only send mail if ping fails +* * * * * -n ping -c 1 freebsd.org .Ed .Sh SEE ALSO .Xr crontab 1 , @@ -314,6 +336,14 @@ All of the .Sq @ directives that can appear in place of the first five fields are extensions. +.Pp +Command processing can be modified using command options. +The +.Sq -q +option suppresses logging. +The +.Sq -n +option does not mail on successful run. .Sh AUTHORS .An Paul Vixie Aq Mt paul@vix.com .Sh BUGS Modified: head/usr.sbin/cron/lib/entry.c ============================================================================== --- head/usr.sbin/cron/lib/entry.c Wed Sep 25 01:39:58 2019 (r352667) +++ head/usr.sbin/cron/lib/entry.c Wed Sep 25 02:37:40 2019 (r352668) @@ -35,7 +35,8 @@ static const char rcsid[] = typedef enum ecode { e_none, e_minute, e_hour, e_dom, e_month, e_dow, - e_cmd, e_timespec, e_username, e_group, e_mem + e_cmd, e_timespec, e_username, e_group, e_option, + e_mem #ifdef LOGIN_CAP , e_class #endif @@ -58,6 +59,7 @@ static char *ecodes[] = "bad time specifier", "bad username", "bad group name", + "bad option", "out of memory", #ifdef LOGIN_CAP "bad class name", @@ -428,6 +430,53 @@ load_entry(file, error_func, pw, envp) goto eof; } #endif + + Debug(DPARS, ("load_entry()...checking for command options\n")) + + ch = get_char(file); + + while (ch == '-') { + Debug(DPARS|DEXT, ("load_entry()...expecting option\n")) + switch (ch = get_char(file)) { + case 'n': + Debug(DPARS|DEXT, ("load_entry()...got MAIL_WHEN_ERR ('n') option\n")) + /* only allow the user to set the option once */ + if ((e->flags & MAIL_WHEN_ERR) == MAIL_WHEN_ERR) { + Debug(DPARS|DEXT, ("load_entry()...duplicate MAIL_WHEN_ERR ('n') option\n")) + ecode = e_option; + goto eof; + } + e->flags |= MAIL_WHEN_ERR; + break; + case 'q': + Debug(DPARS|DEXT, ("load_entry()...got DONT_LOG ('q') option\n")) + /* only allow the user to set the option once */ + if ((e->flags & DONT_LOG) == DONT_LOG) { + Debug(DPARS|DEXT, ("load_entry()...duplicate DONT_LOG ('q') option\n")) + ecode = e_option; + goto eof; + } + e->flags |= DONT_LOG; + break; + default: + Debug(DPARS|DEXT, ("load_entry()...invalid option '%c'\n", ch)) + ecode = e_option; + goto eof; + } + ch = get_char(file); + if (ch!='\t' && ch!=' ') { + ecode = e_option; + goto eof; + } + + Skip_Blanks(ch, file) + if (ch == EOF || ch == '\n') { + ecode = e_cmd; + goto eof; + } + } + + unget_char(ch, file); Debug(DPARS, ("load_entry()...about to parse command\n")) From owner-svn-src-head@freebsd.org Wed Sep 25 05:13: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 6F46AFB438; Wed, 25 Sep 2019 05:13:23 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (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 46dR6C211Xz4QJV; Wed, 25 Sep 2019 05:13:22 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x8.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay05.pair.com (Postfix) with ESMTP id 376FD1A2D75; Wed, 25 Sep 2019 01:13:21 -0400 (EDT) Received: from x8.osted.lan (localhost [127.0.0.1]) by x8.osted.lan (8.15.2/8.15.2) with ESMTPS id x8P5DHCD077986 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 25 Sep 2019 07:13:18 +0200 (CEST) (envelope-from pho@x8.osted.lan) Received: (from pho@localhost) by x8.osted.lan (8.15.2/8.15.2/Submit) id x8P5DHlc077985; Wed, 25 Sep 2019 07:13:17 +0200 (CEST) (envelope-from pho) Date: Wed, 25 Sep 2019 07:13:17 +0200 From: Peter Holm To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352658 - head/sys/kern Message-ID: <20190925051317.GA77827@x8.osted.lan> References: <201909242001.x8OK1KAV099968@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909242001.x8OK1KAV099968@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 46dR6C211Xz4QJV X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.986,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: Wed, 25 Sep 2019 05:13:23 -0000 On Tue, Sep 24, 2019 at 08:01:20PM +0000, Alexander Motin wrote: > Author: mav > Date: Tue Sep 24 20:01:20 2019 > New Revision: 352658 > URL: https://svnweb.freebsd.org/changeset/base/352658 > > Log: > Fix/improve interrupt threads scheduling. > > Doing some tests with very high interrupt rates I've noticed that one of > conditions I added in r232207 to make interrupt threads in most cases > run on local CPU never worked as expected (worked only if previous time > it was executed on some other CPU, that is quite opposite). It caused > additional CPU usage to run full CPU search and could schedule interrupt > threads to some other CPU. > > This patch removes that code and instead reuses existing non-interrupt > code path with some tweaks for interrupt case: > - On SMT systems, if current thread is idle, don't look on other threads. > Even if they are busy, it may take more time to do fill search and bounce > the interrupt thread to other core then execute it locally, even sharing > CPU resources. It is other threads should migrate, not bound interrupts. > - Try hard to keep interrupt threads within LLC of their original CPU. > This improves scheduling cost and supposedly cache and memory locality. > > On a test system with 72 threads doing 2.2M IOPS to NVMe this saves few > percents of CPU time while adding few percents to IOPS. > > MFC after: 1 month > Sponsored by: iXsystems, Inc. > > Modified: > head/sys/kern/sched_ule.c > > Modified: head/sys/kern/sched_ule.c > ============================================================================== > --- head/sys/kern/sched_ule.c Tue Sep 24 18:18:11 2019 (r352657) > +++ head/sys/kern/sched_ule.c Tue Sep 24 20:01:20 2019 (r352658) > @@ -1251,7 +1251,7 @@ sched_pickcpu(struct thread *td, int flags) Could this be yours? FreeBSD/SMP: Multiprocessor System Detected: 24 CPUs FreeBSD/SMP: 2 package(s) x 6 core(s) x 2 hardware threads random: unblocking device. Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 32, using default 16 (20190703/tbfadt-850) ioapic0 irqs 0-23 ioapic1 irqs 24-47 ioapic2 irqs 48-71 Launching APs: 13 6 18 17 5 9 8 19 7 10 1 11 2 12 14 15 20 4 21 16 22 3 23 panic: sched_pickcpu: Failed to find a cpu. cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff8254a830 vpanic() at vpanic+0x19d/frame 0xffffffff8254a880 panic() at panic+0x43/frame 0xffffffff8254a8e0 sched_pickcpu() at sched_pickcpu+0x4c1/frame 0xffffffff8254a990 sched_add() at sched_add+0x6e/frame 0xffffffff8254a9d0 gtaskqueue_start_threads() at gtaskqueue_start_threads+0x124/frame 0xffffffff8254aa70 taskqgroup_cpu_create() at taskqgroup_cpu_create+0x135/frame 0xffffffff8254aab0 taskqgroup_adjust() at taskqgroup_adjust+0x1ad/frame 0xffffffff8254ab20 mi_startup() at mi_startup+0x210/frame 0xffffffff8254ab70 btext() at btext+0x2c KDB: enter: panic [ thread pid 0 tid 100000 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why db> - Peter From owner-svn-src-head@freebsd.org Wed Sep 25 06:58: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 97BBAFC985; Wed, 25 Sep 2019 06:58:01 +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 46dTQx3TrDz4TbD; Wed, 25 Sep 2019 06:58:01 +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 4427273F8; Wed, 25 Sep 2019 06:58:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 40C60BA788; Wed, 25 Sep 2019 08:57:54 +0200 (CEST) Date: Wed, 25 Sep 2019 08:57:54 +0200 From: Baptiste Daroussin To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352668 - in head/usr.sbin/cron: cron crontab lib Message-ID: <20190925065753.vmw4ls426xighbag@ivaldir.net> References: <201909250237.x8P2bf0X033449@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aofd5rerjkkeva7v" Content-Disposition: inline In-Reply-To: <201909250237.x8P2bf0X033449@repo.freebsd.org> User-Agent: NeoMutt/20180716 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: Wed, 25 Sep 2019 06:58:01 -0000 --aofd5rerjkkeva7v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 25, 2019 at 02:37:41AM +0000, Kyle Evans wrote: > Author: kevans > Date: Wed Sep 25 02:37:40 2019 > New Revision: 352668 > URL: https://svnweb.freebsd.org/changeset/base/352668 >=20 > Log: > cron: add log suppression and mail suppression for successful runs > =20 > This commit adds two new extensions to crontab, ported from OpenBSD: > - -n: suppress mail on succesful run > - -q: suppress logging of command execution > =20 > The -q option appears decades old, but -n is relatively new. The > original proposal by Job Snijder can be found here [1], and gives very > convincing reasons for inclusion in base. > =20 > This patch is a nearly identical port of OpenBSD cron for -q and -n > features. It is written to follow existing conventions and style of the > existing codebase. > =20 > Example usage: > =20 > # should only send email, but won't show up in log > * * * * * -q date > =20 > # should not send email > * * * * * -n date > =20 > # should not send email or log > * * * * * -n -q date > =20 > # should send email because of ping failure > * * * * * -n -q ping -c 1 5.5.5.5 > =20 > [1]: https://marc.info/?l=3Dopenbsd-tech&m=3D152874866117948&w=3D2 > =20 > PR: 237538 > Submitted by: Naveen Nathan > Reviewed by: bcr (manpages) > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D20046 >=20 I do think this deserves an entry in the release notes Best regards, Bapt --aofd5rerjkkeva7v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAl2LD+oACgkQY4mL3PG3 PlqJ0RAAsqmpxsx9ytELqIRNgoiAjkB3CwHM1skUQ5HcCKxBxc3RIiiM4eheXA8X Olj6wt0EFPx/tIlLGonfmgMomqqgulJBJoykn7SbFYVrebI9XoFu7uYbG+NVrAiT qjP8I+OpA0LWgcFgDndGTxscAuntY4vNiLd+4tgy9luf5kcj5HOqKLhwlG+gQ2eF ODKI0/BG/5zoVOk355PNJMxsPBw5SRGO9PAMwMbvXT7n1knUUSiwgu6sWToDhoCO YGxgmQC6sle1kdijnVeaGysahu7vAd2b9crSIjaHBp4wMqeXHD45YhjzbUz/c7Me LkKXAD/r1ZJ57/HGZHGSul0DhhxfxNLxFnmHZgOIjy5tNlUup3quLOM5uP/kVPPV DT+a0k6vfzMker0Ph75X30zys1E9hCLiZy3WYYD3yNpBZqattRsp+mXvGvctZ/8A vbOoZgXVaxMXFj0gsjwp0CGRDqrJtjctzTPq+F2VmaEgkfj9U/5ONv7lh8wQXcSD l/HgV+9iw+FrwNI4hHVSI8cEUEMLvRFRMtWs0QTaYVrOKPt/wftX7OAbfB/py5VD wVvXHP56FKxVVQzjL7r6+Oaefq3xXmGzCTUBTRcA3aizi8BrVzxbR3qYZapO7HTR 9k1tzewpSftQZOOCyHjrUmwHWawZP324NEG3Ul2g1TWccYQvlVo= =QugW -----END PGP SIGNATURE----- --aofd5rerjkkeva7v-- From owner-svn-src-head@freebsd.org Wed Sep 25 07:09: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 01FB6FCBF9; Wed, 25 Sep 2019 07:09:26 +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 46dTh56DPNz4V1K; Wed, 25 Sep 2019 07:09:25 +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 B4BC5C1AD; Wed, 25 Sep 2019 07:09:25 +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 x8P79Pgh092836; Wed, 25 Sep 2019 07:09:25 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8P79Phf092834; Wed, 25 Sep 2019 07:09:25 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909250709.x8P79Phf092834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 25 Sep 2019 07:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352669 - in head/stand: efi/libefi i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand: efi/libefi i386/libi386 X-SVN-Commit-Revision: 352669 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: Wed, 25 Sep 2019 07:09:26 -0000 Author: tsoome Date: Wed Sep 25 07:09:25 2019 New Revision: 352669 URL: https://svnweb.freebsd.org/changeset/base/352669 Log: loader: add teken.fg_color and teken.bg_color variables Add settable variables to control teken default color attributes. The supported colors are 0-7 or basic color names: black, red, green, brown, blue, magenta, cyan, white. The current implementation does add some duplication which will be addressed later. Modified: head/stand/efi/libefi/efi_console.c head/stand/i386/libi386/vidconsole.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Wed Sep 25 02:37:40 2019 (r352668) +++ head/stand/efi/libefi/efi_console.c Wed Sep 25 07:09:25 2019 (r352669) @@ -343,6 +343,91 @@ efi_cons_probe(struct console *cp) cp->c_flags |= C_PRESENTIN | C_PRESENTOUT; } +static bool +color_name_to_teken(const char *name, int *val) +{ + if (strcasecmp(name, "black") == 0) { + *val = TC_BLACK; + return (true); + } + if (strcasecmp(name, "red") == 0) { + *val = TC_RED; + return (true); + } + if (strcasecmp(name, "green") == 0) { + *val = TC_GREEN; + return (true); + } + if (strcasecmp(name, "brown") == 0) { + *val = TC_BROWN; + return (true); + } + if (strcasecmp(name, "blue") == 0) { + *val = TC_BLUE; + return (true); + } + if (strcasecmp(name, "magenta") == 0) { + *val = TC_MAGENTA; + return (true); + } + if (strcasecmp(name, "cyan") == 0) { + *val = TC_CYAN; + return (true); + } + if (strcasecmp(name, "white") == 0) { + *val = TC_WHITE; + return (true); + } + return (false); +} + +static int +efi_set_colors(struct env_var *ev, int flags, const void *value) +{ + int val = 0; + char buf[2]; + const void *evalue; + const teken_attr_t *ap; + teken_attr_t a; + + if (value == NULL) + return (CMD_OK); + + if (color_name_to_teken(value, &val)) { + snprintf(buf, sizeof (buf), "%d", val); + evalue = buf; + } else { + char *end; + + errno = 0; + val = (int)strtol(value, &end, 0); + if (errno != 0 || *end != '\0') { + printf("Allowed values are either ansi color name or " + "number from range [0-7].\n"); + return (CMD_OK); + } + evalue = value; + } + + ap = teken_get_defattr(&teken); + a = *ap; + if (strcmp(ev->ev_name, "teken.fg_color") == 0) { + /* is it already set? */ + if (ap->ta_fgcolor == val) + return (CMD_OK); + a.ta_fgcolor = val; + } + if (strcmp(ev->ev_name, "teken.bg_color") == 0) { + /* is it already set? */ + if (ap->ta_bgcolor == val) + return (CMD_OK); + a.ta_bgcolor = val; + } + env_setenv(ev->ev_name, flags | EV_NOHOOK, evalue, NULL, NULL); + teken_set_defattr(&teken, &a); + return (CMD_OK); +} + bool efi_cons_update_mode(void) { @@ -373,6 +458,13 @@ efi_cons_update_mode(void) teken_set_winsize(&teken, &tp); a = teken_get_defattr(&teken); + + snprintf(env, sizeof(env), "%d", a->ta_fgcolor); + env_setenv("teken.fg_color", EV_VOLATILE, env, efi_set_colors, + env_nounset); + snprintf(env, sizeof(env), "%d", a->ta_bgcolor); + env_setenv("teken.bg_color", EV_VOLATILE, env, efi_set_colors, + env_nounset); for (int row = 0; row < rows; row++) for (int col = 0; col < cols; col++) { Modified: head/stand/i386/libi386/vidconsole.c ============================================================================== --- head/stand/i386/libi386/vidconsole.c Wed Sep 25 02:37:40 2019 (r352668) +++ head/stand/i386/libi386/vidconsole.c Wed Sep 25 07:09:25 2019 (r352669) @@ -569,7 +569,97 @@ vidc_probe(struct console *cp) cp->c_flags |= C_PRESENTOUT; } +static bool +color_name_to_teken(const char *name, int *val) +{ + if (strcasecmp(name, "black") == 0) { + *val = TC_BLACK; + return (true); + } + if (strcasecmp(name, "red") == 0) { + *val = TC_RED; + return (true); + } + if (strcasecmp(name, "green") == 0) { + *val = TC_GREEN; + return (true); + } + if (strcasecmp(name, "brown") == 0) { + *val = TC_BROWN; + return (true); + } + if (strcasecmp(name, "blue") == 0) { + *val = TC_BLUE; + return (true); + } + if (strcasecmp(name, "magenta") == 0) { + *val = TC_MAGENTA; + return (true); + } + if (strcasecmp(name, "cyan") == 0) { + *val = TC_CYAN; + return (true); + } + if (strcasecmp(name, "white") == 0) { + *val = TC_WHITE; + return (true); + } + return (false); +} + static int +vidc_set_colors(struct env_var *ev, int flags, const void *value) +{ + int val = 0; + char buf[2]; + const void *evalue; + const teken_attr_t *ap; + teken_attr_t a; + + if (value == NULL) + return (CMD_OK); + + if (color_name_to_teken(value, &val)) { + snprintf(buf, sizeof (buf), "%d", val); + evalue = buf; + } else { + char *end; + + errno = 0; + val = (int)strtol(value, &end, 0); + if (errno != 0 || *end != '\0') { + printf("Allowed values are either ansi color name or " + "number from range [0-7].\n"); + return (CMD_OK); + } + evalue = value; + } + + ap = teken_get_defattr(&teken); + a = *ap; + if (strcmp(ev->ev_name, "teken.fg_color") == 0) { + /* is it already set? */ + if (ap->ta_fgcolor == val) + return (CMD_OK); + a.ta_fgcolor = val; + } + if (strcmp(ev->ev_name, "teken.bg_color") == 0) { + /* is it already set? */ + if (ap->ta_bgcolor == val) + return (CMD_OK); + a.ta_bgcolor = val; + } + + /* Improve visibility */ + if (a.ta_bgcolor == TC_WHITE) + a.ta_bgcolor |= TC_LIGHT; + + env_setenv(ev->ev_name, flags | EV_NOHOOK, evalue, NULL, NULL); + teken_set_defattr(&teken, &a); + return (CMD_OK); +} + +static int vidc_init(int arg) { const teken_attr_t *a; @@ -603,14 +693,21 @@ vidc_init(int arg) if (buffer == NULL) return (1); - teken_init(&teken, &tf, NULL); - teken_set_winsize(&teken, &tp); - a = teken_get_defattr(&teken); - snprintf(env, sizeof (env), "%u", tp.tp_row); setenv("LINES", env, 1); snprintf(env, sizeof (env), "%u", tp.tp_col); setenv("COLUMNS", env, 1); + + teken_init(&teken, &tf, NULL); + teken_set_winsize(&teken, &tp); + a = teken_get_defattr(&teken); + + snprintf(env, sizeof(env), "%d", a->ta_fgcolor); + env_setenv("teken.fg_color", EV_VOLATILE, env, vidc_set_colors, + env_nounset); + snprintf(env, sizeof(env), "%d", a->ta_bgcolor); + env_setenv("teken.bg_color", EV_VOLATILE, env, vidc_set_colors, + env_nounset); for (int row = 0; row < tp.tp_row; row++) for (int col = 0; col < tp.tp_col; col++) { From owner-svn-src-head@freebsd.org Wed Sep 25 07:29: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 0CF53FD49B; Wed, 25 Sep 2019 07:29:33 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46dV7H6FGqz4W5P; Wed, 25 Sep 2019 07:29:31 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from [IPv6:2a02:8109:1140:c3d:4b5:8d31:c6ee:9572] (unknown [IPv6:2a02:8109:1140:c3d:4b5:8d31:c6ee:9572]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 9C09B721BBD15; Wed, 25 Sep 2019 09:29:26 +0200 (CEST) From: Michael Tuexen Message-Id: <36A3B2B8-3230-4B97-AABC-BEA9F040AC24@fh-muenster.de> Content-Type: multipart/signed; boundary="Apple-Mail=_719C584B-CAA1-41CD-BF5E-EE177C265314"; protocol="application/pkcs7-signature"; micalg=sha-256 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r352658 - head/sys/kern Date: Wed, 25 Sep 2019 09:29:25 +0200 In-Reply-To: <20190925051317.GA77827@x8.osted.lan> Cc: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Peter Holm References: <201909242001.x8OK1KAV099968@repo.freebsd.org> <20190925051317.GA77827@x8.osted.lan> X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 46dV7H6FGqz4W5P X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of tuexen@fh-muenster.de has no SPF policy when checking 2001:638:a02:a001:20e:cff:fe4a:feaa) smtp.mailfrom=tuexen@fh-muenster.de X-Spamd-Result: default: False [4.66 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RSPAMD_URIBL(4.50)[syzkaller.appspot.com]; FROM_HAS_DN(0.00)[]; SIGNED_SMIME(-2.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[fh-muenster.de]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_MEDIUM(0.97)[0.968,0]; IP_SCORE(-0.58)[ip: (-5.31), ipnet: 2001:638::/32(2.35), asn: 680(0.07), country: DE(-0.01)]; MV_CASE(0.50)[]; NEURAL_SPAM_LONG(0.57)[0.569,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[a.a.e.f.a.4.e.f.f.f.c.0.e.0.2.0.1.0.0.a.2.0.a.0.8.3.6.0.1.0.0.2.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(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: Wed, 25 Sep 2019 07:29:33 -0000 --Apple-Mail=_719C584B-CAA1-41CD-BF5E-EE177C265314 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 25. Sep 2019, at 07:13, Peter Holm wrote: >=20 > On Tue, Sep 24, 2019 at 08:01:20PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Tue Sep 24 20:01:20 2019 >> New Revision: 352658 >> URL: https://svnweb.freebsd.org/changeset/base/352658 >>=20 >> Log: >> Fix/improve interrupt threads scheduling. >>=20 >> Doing some tests with very high interrupt rates I've noticed that = one of >> conditions I added in r232207 to make interrupt threads in most = cases >> run on local CPU never worked as expected (worked only if previous = time >> it was executed on some other CPU, that is quite opposite). It = caused >> additional CPU usage to run full CPU search and could schedule = interrupt >> threads to some other CPU. >>=20 >> This patch removes that code and instead reuses existing = non-interrupt >> code path with some tweaks for interrupt case: >> - On SMT systems, if current thread is idle, don't look on other = threads. >> Even if they are busy, it may take more time to do fill search and = bounce >> the interrupt thread to other core then execute it locally, even = sharing >> CPU resources. It is other threads should migrate, not bound = interrupts. >> - Try hard to keep interrupt threads within LLC of their original = CPU. >> This improves scheduling cost and supposedly cache and memory = locality. >>=20 >> On a test system with 72 threads doing 2.2M IOPS to NVMe this saves = few >> percents of CPU time while adding few percents to IOPS. >>=20 >> MFC after: 1 month >> Sponsored by: iXsystems, Inc. >>=20 >> Modified: >> head/sys/kern/sched_ule.c >>=20 >> Modified: head/sys/kern/sched_ule.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/kern/sched_ule.c Tue Sep 24 18:18:11 2019 = (r352657) >> +++ head/sys/kern/sched_ule.c Tue Sep 24 20:01:20 2019 = (r352658) >> @@ -1251,7 +1251,7 @@ sched_pickcpu(struct thread *td, int flags) >=20 > Could this be yours? >=20 > FreeBSD/SMP: Multiprocessor System Detected: 24 CPUs > FreeBSD/SMP: 2 package(s) x 6 core(s) x 2 hardware threads > random: unblocking device. > Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 32, = using default 16 (20190703/tbfadt-850) > ioapic0 irqs 0-23 > ioapic1 irqs 24-47 > ioapic2 irqs 48-71 > Launching APs: 13 6 18 17 5 9 8 19 7 10 1 11 2 12 14 15 20 4 21 16 22 = 3 23 > panic: sched_pickcpu: Failed to find a cpu. > cpuid =3D 0 > time =3D 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame = 0xffffffff8254a830 > vpanic() at vpanic+0x19d/frame 0xffffffff8254a880 > panic() at panic+0x43/frame 0xffffffff8254a8e0 > sched_pickcpu() at sched_pickcpu+0x4c1/frame 0xffffffff8254a990 > sched_add() at sched_add+0x6e/frame 0xffffffff8254a9d0 > gtaskqueue_start_threads() at gtaskqueue_start_threads+0x124/frame = 0xffffffff8254aa70 > taskqgroup_cpu_create() at taskqgroup_cpu_create+0x135/frame = 0xffffffff8254aab0 > taskqgroup_adjust() at taskqgroup_adjust+0x1ad/frame = 0xffffffff8254ab20 > mi_startup() at mi_startup+0x210/frame 0xffffffff8254ab70 > btext() at btext+0x2c > KDB: enter: panic > [ thread pid 0 tid 100000 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > db> Also triggered by syzkaller: = https://syzkaller.appspot.com/bug?id=3D27e65a528a1431f0aeea7b7814e685bddf7= 69747 Best regards Michael >=20 > - Peter --Apple-Mail=_719C584B-CAA1-41CD-BF5E-EE177C265314 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCEKow ggUSMIID+qADAgECAgkA4wvV+K8l2YEwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAkRFMSsw KQYDVQQKDCJULVN5c3RlbXMgRW50ZXJwcmlzZSBTZXJ2aWNlcyBHbWJIMR8wHQYDVQQLDBZULVN5 c3RlbXMgVHJ1c3QgQ2VudGVyMSUwIwYDVQQDDBxULVRlbGVTZWMgR2xvYmFsUm9vdCBDbGFzcyAy MB4XDTE2MDIyMjEzMzgyMloXDTMxMDIyMjIzNTk1OVowgZUxCzAJBgNVBAYTAkRFMUUwQwYDVQQK EzxWZXJlaW4genVyIEZvZXJkZXJ1bmcgZWluZXMgRGV1dHNjaGVuIEZvcnNjaHVuZ3NuZXR6ZXMg ZS4gVi4xEDAOBgNVBAsTB0RGTi1QS0kxLTArBgNVBAMTJERGTi1WZXJlaW4gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkgMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMtg1/9moUHN0vqH l4pzq5lN6mc5WqFggEcVToyVsuXPztNXS43O+FZsFVV2B+pG/cgDRWM+cNSrVICxI5y+NyipCf8F XRgPxJiZN7Mg9mZ4F4fCnQ7MSjLnFp2uDo0peQcAIFTcFV9Kltd4tjTTwXS1nem/wHdN6r1ZB+Ba L2w8pQDcNb1lDY9/Mm3yWmpLYgHurDg0WUU2SQXaeMpqbVvAgWsRzNI8qIv4cRrKO+KA3Ra0Z3qL NupOkSk9s1FcragMvp0049ENF4N1xDkesJQLEvHVaY4l9Lg9K7/AjsMeO6W/VRCrKq4Xl14zzsjz 9AkH4wKGMUZrAcUQDBHHWekCAwEAAaOCAXQwggFwMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU k+PYMiba1fFKpZFK4OpL4qIMz+EwHwYDVR0jBBgwFoAUv1kgNgB5oKAia4zV8mHSuCzLgkowEgYD VR0TAQH/BAgwBgEB/wIBAjAzBgNVHSAELDAqMA8GDSsGAQQBga0hgiwBAQQwDQYLKwYBBAGBrSGC LB4wCAYGZ4EMAQICMEwGA1UdHwRFMEMwQaA/oD2GO2h0dHA6Ly9wa2kwMzM2LnRlbGVzZWMuZGUv cmwvVGVsZVNlY19HbG9iYWxSb290X0NsYXNzXzIuY3JsMIGGBggrBgEFBQcBAQR6MHgwLAYIKwYB BQUHMAGGIGh0dHA6Ly9vY3NwMDMzNi50ZWxlc2VjLmRlL29jc3ByMEgGCCsGAQUFBzAChjxodHRw Oi8vcGtpMDMzNi50ZWxlc2VjLmRlL2NydC9UZWxlU2VjX0dsb2JhbFJvb3RfQ2xhc3NfMi5jZXIw DQYJKoZIhvcNAQELBQADggEBAIcL/z4Cm2XIVi3WO5qYi3FP2ropqiH5Ri71sqQPrhE4eTizDnS6 dl2e6BiClmLbTDPo3flq3zK9LExHYFV/53RrtCyD2HlrtrdNUAtmB7Xts5et6u5/MOaZ/SLick0+ hFvu+c+Z6n/XUjkurJgARH5pO7917tALOxrN5fcPImxHhPalR6D90Bo0fa3SPXez7vTXTf/D6OWS T1k+kEcQSrCFWMBvf/iu7QhCnh7U3xQuTY+8npTD5+32GPg8SecmqKc22CzeIs2LgtjZeOJVEqM7 h0S2EQvVDFKvaYwPBt/QolOLV5h7z/0HJPT8vcP9SpIClxvyt7bPZYoaorVyGTkwggWsMIIElKAD AgECAgcbY7rQHiw9MA0GCSqGSIb3DQEBCwUAMIGVMQswCQYDVQQGEwJERTFFMEMGA1UEChM8VmVy ZWluIHp1ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUuIFYu MRAwDgYDVQQLEwdERk4tUEtJMS0wKwYDVQQDEyRERk4tVmVyZWluIENlcnRpZmljYXRpb24gQXV0 aG9yaXR5IDIwHhcNMTYwNTI0MTEzODQwWhcNMzEwMjIyMjM1OTU5WjCBjTELMAkGA1UEBhMCREUx RTBDBgNVBAoMPFZlcmVpbiB6dXIgRm9lcmRlcnVuZyBlaW5lcyBEZXV0c2NoZW4gRm9yc2NodW5n c25ldHplcyBlLiBWLjEQMA4GA1UECwwHREZOLVBLSTElMCMGA1UEAwwcREZOLVZlcmVpbiBHbG9i YWwgSXNzdWluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ07eRxH3h+Gy8Zp 1xCeOdfZojDbchwFfylfS2jxrRnWTOFrG7ELf6Gr4HuLi9gtzm6IOhDuV+UefwRRNuu6cG1joL6W LkDh0YNMZj0cZGnlm6Stcq5oOVGHecwX064vXWNxSzl660Knl5BpBb+Q/6RAcL0D57+eGIgfn5mI TQ5HjUhfZZkQ0tkqSe3BuS0dnxLLFdM/fx5ULzquk1enfnjK1UriGuXtQX1TX8izKvWKMKztFwUk P7agCwf9TRqaA1KgNpzeJIdl5Of6x5ZzJBTN0OgbaJ4YWa52fvfRCng8h0uwN89Tyjo4EPPLR22M ZD08WkVKusqAfLjz56dMTM0CAwEAAaOCAgUwggIBMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYDVR0P AQH/BAQDAgEGMCkGA1UdIAQiMCAwDQYLKwYBBAGBrSGCLB4wDwYNKwYBBAGBrSGCLAEBBDAdBgNV HQ4EFgQUazqYi/nyU4na4K2yMh4JH+iqO3QwHwYDVR0jBBgwFoAUk+PYMiba1fFKpZFK4OpL4qIM z+EwgY8GA1UdHwSBhzCBhDBAoD6gPIY6aHR0cDovL2NkcDEucGNhLmRmbi5kZS9nbG9iYWwtcm9v dC1nMi1jYS9wdWIvY3JsL2NhY3JsLmNybDBAoD6gPIY6aHR0cDovL2NkcDIucGNhLmRmbi5kZS9n bG9iYWwtcm9vdC1nMi1jYS9wdWIvY3JsL2NhY3JsLmNybDCB3QYIKwYBBQUHAQEEgdAwgc0wMwYI KwYBBQUHMAGGJ2h0dHA6Ly9vY3NwLnBjYS5kZm4uZGUvT0NTUC1TZXJ2ZXIvT0NTUDBKBggrBgEF BQcwAoY+aHR0cDovL2NkcDEucGNhLmRmbi5kZS9nbG9iYWwtcm9vdC1nMi1jYS9wdWIvY2FjZXJ0 L2NhY2VydC5jcnQwSgYIKwYBBQUHMAKGPmh0dHA6Ly9jZHAyLnBjYS5kZm4uZGUvZ2xvYmFsLXJv b3QtZzItY2EvcHViL2NhY2VydC9jYWNlcnQuY3J0MA0GCSqGSIb3DQEBCwUAA4IBAQCBeEWkTqR/ DlXwCbFqPnjMaDWpHPOVnj/z+N9rOHeJLI21rT7H8pTNoAauusyosa0zCLYkhmI2THhuUPDVbmCN T1IxQ5dGdfBi5G5mUcFCMWdQ5UnnOR7Ln8qGSN4IFP8VSytmm6A4nwDO/afr0X9XLchMX9wQEZc+ lgQCXISoKTlslPwQkgZ7nu7YRrQbtQMMONncsKk/cQYLsgMHM8KNSGMlJTx6e1du94oFOO+4oK4v 9NsH1VuEGMGpuEvObJAaguS5Pfp38dIfMwK/U+d2+dwmJUFvL6Yb+qQTkPp8ftkLYF3sv8pBoGH7 EUkp2KgtdRXYShjqFu9VNCIaE40GMIIF4DCCBMigAwIBAgIMIRX9tDE2QqO3mVLXMA0GCSqGSIb3 DQEBCwUAMIGNMQswCQYDVQQGEwJERTFFMEMGA1UECgw8VmVyZWluIHp1ciBGb2VyZGVydW5nIGVp bmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUuIFYuMRAwDgYDVQQLDAdERk4tUEtJMSUw IwYDVQQDDBxERk4tVmVyZWluIEdsb2JhbCBJc3N1aW5nIENBMB4XDTE5MDYwNDE0MjkxMFoXDTIy MDYwMzE0MjkxMFowfDELMAkGA1UEBhMCREUxIDAeBgNVBAoMF0ZhY2hob2Noc2NodWxlIE11ZW5z dGVyMTIwMAYDVQQLDClGYWNoYmVyZWljaCBFbGVrdHJvdGVjaG5payB1bmQgSW5mb3JtYXRpazEX MBUGA1UEAwwOTWljaGFlbCBUdWV4ZW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDM r8qQcPxLFCxzPtXvRyM9KeQaxyMA8gwUNc7IIiATs6mRQFe5ib/mvwT9nc0bAa+94go6HJDiD3FJ NkTo4u8aBsIcTt5pJtdBQLm88PLakbe3+fp/00//n7xxbTh7mAtFVCf25LxDCKkrdGk/+jglRq/R VdwhZZ3VpYCrx8YfI/hIzdRL3+4I4z/mnQ8K0X8d2MVVPG+9nBEngdnYGez5f/8wIVOgEYYBc21k yvMnVXLu2Ing+LwBd0gDG9Vasv87MNHCOZfJTNBlLhI2UDei/uNg9Zd4ynlMpPWZ7v0oiDWvmv8E OuD4oric8heyD0OYK2FL4qcVC4dn4pnyulfHAgMBAAGjggJOMIICSjA+BgNVHSAENzA1MA8GDSsG AQQBga0hgiwBAQQwEAYOKwYBBAGBrSGCLAEBBAQwEAYOKwYBBAGBrSGCLAIBBAQwCQYDVR0TBAIw ADAOBgNVHQ8BAf8EBAMCBeAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMEMB0GA1UdDgQW BBTxiodBVL/lA4p5iNesIsJRhhgd6zAfBgNVHSMEGDAWgBRrOpiL+fJTidrgrbIyHgkf6Ko7dDAg BgNVHREEGTAXgRV0dWV4ZW5AZmgtbXVlbnN0ZXIuZGUwgY0GA1UdHwSBhTCBgjA/oD2gO4Y5aHR0 cDovL2NkcDEucGNhLmRmbi5kZS9kZm4tY2EtZ2xvYmFsLWcyL3B1Yi9jcmwvY2FjcmwuY3JsMD+g PaA7hjlodHRwOi8vY2RwMi5wY2EuZGZuLmRlL2Rmbi1jYS1nbG9iYWwtZzIvcHViL2NybC9jYWNy bC5jcmwwgdsGCCsGAQUFBwEBBIHOMIHLMDMGCCsGAQUFBzABhidodHRwOi8vb2NzcC5wY2EuZGZu LmRlL09DU1AtU2VydmVyL09DU1AwSQYIKwYBBQUHMAKGPWh0dHA6Ly9jZHAxLnBjYS5kZm4uZGUv ZGZuLWNhLWdsb2JhbC1nMi9wdWIvY2FjZXJ0L2NhY2VydC5jcnQwSQYIKwYBBQUHMAKGPWh0dHA6 Ly9jZHAyLnBjYS5kZm4uZGUvZGZuLWNhLWdsb2JhbC1nMi9wdWIvY2FjZXJ0L2NhY2VydC5jcnQw DQYJKoZIhvcNAQELBQADggEBABs3VlmIZ1VF3HkaQdjInZYmamRabbdgJ7cz6m6o/agKL7+Vhwx7 1BaaYs2gMa5Nu/GJ3YfdqIsUlYtKdl58Yhp/89E6xBfJkItS+rE8RFdf2XgklGlx7GmsvdA3tId5 b6K6r9a5wpVN0epxY6K8wwpzEib6fJLcHylybQXZ7JSOaLRLp6WU3QPoyTT7FpvAe/0b2MSCbPX4 fc53PCn2aGgXuRFVQeCn1SP1BF3QW1ppkFhcF6G+0JcUxYFAXE6r/71WZBvUHqoG/th2hAwQnS+Y KhUYh4SZQH3/ursXXJYXQ5vyIhkN1FZlmtWA8+ofdCnoqSTbiSX2Aa/kKbTapwgxggOdMIIDmQIB ATCBnjCBjTELMAkGA1UEBhMCREUxRTBDBgNVBAoMPFZlcmVpbiB6dXIgRm9lcmRlcnVuZyBlaW5l cyBEZXV0c2NoZW4gRm9yc2NodW5nc25ldHplcyBlLiBWLjEQMA4GA1UECwwHREZOLVBLSTElMCMG A1UEAwwcREZOLVZlcmVpbiBHbG9iYWwgSXNzdWluZyBDQQIMIRX9tDE2QqO3mVLXMA0GCWCGSAFl AwQCAQUAoIIBzzAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xOTA5 MjUwNzI5MjZaMC8GCSqGSIb3DQEJBDEiBCAqayGWam7OZD4st222wkWCKA5ZJ6KpnfboCrU4hftN jzCBrwYJKwYBBAGCNxAEMYGhMIGeMIGNMQswCQYDVQQGEwJERTFFMEMGA1UECgw8VmVyZWluIHp1 ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUuIFYuMRAwDgYD VQQLDAdERk4tUEtJMSUwIwYDVQQDDBxERk4tVmVyZWluIEdsb2JhbCBJc3N1aW5nIENBAgwhFf20 MTZCo7eZUtcwgbEGCyqGSIb3DQEJEAILMYGhoIGeMIGNMQswCQYDVQQGEwJERTFFMEMGA1UECgw8 VmVyZWluIHp1ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUu IFYuMRAwDgYDVQQLDAdERk4tUEtJMSUwIwYDVQQDDBxERk4tVmVyZWluIEdsb2JhbCBJc3N1aW5n IENBAgwhFf20MTZCo7eZUtcwDQYJKoZIhvcNAQEBBQAEggEASdZiuu9dg1/CaQshzV9M7hO541fy Mhza3p+xyIHGpg6m0N/0FUuETeXViPRvwduc82TyePwr2q9gmDOycXy0wpd8pMd5fOgfxaRNUc+S Vrs8BGj89EKTbqSCdGX0KxmTABKYgo0b5DWfU/ZaYy5dY3e0dJUHsnuVuJfJjyKliBXYP0HupSpa dZy2xN+DvutXddn9d8gm07mKhg7ctpCECjcvJg3ByH3h3mRh7MCL6L4tUtDtShLiUxCW5CBpXGTE ivkGF02uOYN6/AC/hWNMNpNL24BXWxWNmuBExqx8EPufUJPqJrIbKhZAWb0BDOlLRdqlRmpiHjLQ Hwb88h5NZAAAAAAAAA== --Apple-Mail=_719C584B-CAA1-41CD-BF5E-EE177C265314-- From owner-svn-src-head@freebsd.org Wed Sep 25 07:36: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 CB553FD6B7; Wed, 25 Sep 2019 07:36:36 +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 46dVHS4rljz4WV2; Wed, 25 Sep 2019 07:36:36 +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 86B85C711; Wed, 25 Sep 2019 07:36:36 +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 x8P7aaXV010469; Wed, 25 Sep 2019 07:36:36 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8P7aaUd010466; Wed, 25 Sep 2019 07:36:36 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909250736.x8P7aaUd010466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 25 Sep 2019 07:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352670 - in head/stand: efi/libefi i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand: efi/libefi i386/libi386 X-SVN-Commit-Revision: 352670 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: Wed, 25 Sep 2019 07:36:36 -0000 Author: tsoome Date: Wed Sep 25 07:36:35 2019 New Revision: 352670 URL: https://svnweb.freebsd.org/changeset/base/352670 Log: loader: fix indentation in efi_console and vidconsole Remove extra tab. Reported by: yuripv Modified: head/stand/efi/libefi/efi_console.c head/stand/i386/libi386/vidconsole.c Modified: head/stand/efi/libefi/efi_console.c ============================================================================== --- head/stand/efi/libefi/efi_console.c Wed Sep 25 07:09:25 2019 (r352669) +++ head/stand/efi/libefi/efi_console.c Wed Sep 25 07:36:35 2019 (r352670) @@ -374,7 +374,7 @@ color_name_to_teken(const char *name, int *val) *val = TC_CYAN; return (true); } - if (strcasecmp(name, "white") == 0) { + if (strcasecmp(name, "white") == 0) { *val = TC_WHITE; return (true); } Modified: head/stand/i386/libi386/vidconsole.c ============================================================================== --- head/stand/i386/libi386/vidconsole.c Wed Sep 25 07:09:25 2019 (r352669) +++ head/stand/i386/libi386/vidconsole.c Wed Sep 25 07:36:35 2019 (r352670) @@ -600,7 +600,7 @@ color_name_to_teken(const char *name, int *val) *val = TC_CYAN; return (true); } - if (strcasecmp(name, "white") == 0) { + if (strcasecmp(name, "white") == 0) { *val = TC_WHITE; return (true); } From owner-svn-src-head@freebsd.org Wed Sep 25 07:51:30 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 E438BFDA69; Wed, 25 Sep 2019 07:51:30 +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 46dVcf5pzXz4X34; Wed, 25 Sep 2019 07:51:30 +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 AAFBACA51; Wed, 25 Sep 2019 07:51:30 +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 x8P7pUWp020806; Wed, 25 Sep 2019 07:51:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8P7pUqm020805; Wed, 25 Sep 2019 07:51:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909250751.x8P7pUqm020805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 25 Sep 2019 07:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352671 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 352671 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: Wed, 25 Sep 2019 07:51:31 -0000 Author: imp Date: Wed Sep 25 07:51:30 2019 New Revision: 352671 URL: https://svnweb.freebsd.org/changeset/base/352671 Log: Size is unsigned, so remove the test entirely. The kernel won't crash if you have a bad value and I'd rather not have nvmecontrol know the internal details about how the nvme driver limits the transfer size. Modified: head/sbin/nvmecontrol/perftest.c Modified: head/sbin/nvmecontrol/perftest.c ============================================================================== --- head/sbin/nvmecontrol/perftest.c Wed Sep 25 07:36:35 2019 (r352670) +++ head/sbin/nvmecontrol/perftest.c Wed Sep 25 07:51:30 2019 (r352671) @@ -177,10 +177,6 @@ perftest(const struct cmd *f, int argc, char *argv[]) arg_help(argc, argv, f); } io_test.time = opt.time; - if (opt.size < 0) { - fprintf(stderr, "Invalid size.\n"); - arg_help(argc, argv, f); - } io_test.size = opt.size; open_dev(opt.dev, &fd, 1, 1); if (ioctl(fd, ioctl_cmd, &io_test) < 0) From owner-svn-src-head@freebsd.org Wed Sep 25 11:58: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 C3347124723; Wed, 25 Sep 2019 11:58:54 +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 46dc664lrDz3JGN; Wed, 25 Sep 2019 11:58:54 +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 866D0F539; Wed, 25 Sep 2019 11:58:54 +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 x8PBwsSu063920; Wed, 25 Sep 2019 11:58:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PBwstv063919; Wed, 25 Sep 2019 11:58:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909251158.x8PBwstv063919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 25 Sep 2019 11:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352677 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352677 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: Wed, 25 Sep 2019 11:58:54 -0000 Author: mav Date: Wed Sep 25 11:58:54 2019 New Revision: 352677 URL: https://svnweb.freebsd.org/changeset/base/352677 Log: Fix wrong assertion in r352658. MFC after: 1 month Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Sep 25 10:46:05 2019 (r352676) +++ head/sys/kern/sched_ule.c Wed Sep 25 11:58:54 2019 (r352677) @@ -1345,7 +1345,7 @@ sched_pickcpu(struct thread *td, int flags) if (cpu >= 0) SCHED_STAT_INC(pickcpu_lowest); } - KASSERT(cpu < 0, ("sched_pickcpu: Failed to find a cpu.")); + KASSERT(cpu >= 0, ("sched_pickcpu: Failed to find a cpu.")); KASSERT(!CPU_ABSENT(cpu), ("sched_pickcpu: Picked absent CPU %d.", cpu)); /* * Compare the lowest loaded cpu to current cpu. From owner-svn-src-head@freebsd.org Wed Sep 25 12:03: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 CE02F1256B8; Wed, 25 Sep 2019 12:03:18 +0000 (UTC) (envelope-from mavbsd@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 46dcCB0c24z3KDg; Wed, 25 Sep 2019 12:03:18 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-ot1-x343.google.com with SMTP id g13so4529424otp.8; Wed, 25 Sep 2019 05:03: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:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I8ZI+/lK0mYcd2kISTpB3smaN2n33gToXJ0I7l/6/KM=; b=GaxRlweJnqnQVjrSxYzZ0OdHgI06BJ0NzLKNvdrSz2uB0Z8L2Tx7L7COJxuUTn5f/+ JZuBi9FzUgU5wYh8qWkmPHsIlcTYJaUZxZCKSrmfUX6HHDFNfwYSccxI8D043p1+U1o7 ClwmTZPB/idlSS8x3od6mihzr15LnarQyzgFFJLXdlZ9faodNM47c7byFdutULsrNFMm XdaHZUDJMUgZqx1NO5TIdmaozYsJyhx1E2DBwM6vnQsY6iXlC6B0ok5yDgVFANvQMCJq Uvc64gCbGb1iSecLvtxoyQOr6IKaUL08c4HrURTlrpneYj9QfD3L1Y6CA7m400Gro3Ly q2xw== 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:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=I8ZI+/lK0mYcd2kISTpB3smaN2n33gToXJ0I7l/6/KM=; b=CjAY0njy9te51XYLd0MUioO93LQEtXieqmxG7N6AYSN6Q7X3uMUT1nkm8CUUQ9Aido gnSM5zN9w76yCEdhoNlDwayv/36IUx+8+9lL/rbp5t2ucao2xFtwP7H9PuZwyKGD4wHq MMGq1F45uW3/OONhghlbYIuiLqzK2LImw2iHuiijL5q9yYYXIBnnYN3OtsiQHaEPiicH RuS41LcnnlxuKyDJvJiI2wDWBytxrBiQJ8mblHkSyCVUV12dzpSoaKUg63QVCj2GY8JO Sw9IrCmFQysKQsbJye/8CckA87gxnhoPRMPASd8n85AT20Flp/2/KSnSiOflGo5idser ZS0Q== X-Gm-Message-State: APjAAAVRtbPx3s7DexSiMTlyNstMQMQ0BXrGKlCFhNOkZ1m8mefIARaA S5y1U8Q2Lsu44t3Aln3jQgem7qpq X-Google-Smtp-Source: APXvYqz4I/N5vuVRHtB0SKpns3hy7wLx9bKOlfv9cEF5geINweqEkiSqskYhLqa05+sLJptO0lkThQ== X-Received: by 2002:a9d:3b02:: with SMTP id z2mr5433020otb.71.1569412996413; Wed, 25 Sep 2019 05:03:16 -0700 (PDT) Received: from spectre.mavhome.dp.ua (104-55-12-234.lightspeed.knvltn.sbcglobal.net. [104.55.12.234]) by smtp.gmail.com with ESMTPSA id w13sm1376969oih.54.2019.09.25.05.03.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Sep 2019 05:03:15 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r352658 - head/sys/kern To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909242001.x8OK1KAV099968@repo.freebsd.org> <20190925051317.GA77827@x8.osted.lan> From: Alexander Motin Autocrypt: addr=mav@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IUFsZXhhbmRlciBNb3RpbiA8bWF2QEZyZWVCU0Qub3JnPokBVwQTAQoAQQIbAwULCQgH AwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMKuBQkN McyiAAoJEIMYw5VbqyJ/tuUIAOG3ONOSNYqjK4eTZ1TVh9jdUBAhWk5nhDFnODN49Wj0AbYm 7aIqy8O1hnCDSZG5LttjSAo3UfXJZDKQM0BLb0gpRMBnAYqO6tdolLNqAbPGJBnGoPjsh24y 6KcbDaNnis+lD4GwPXwQM+92wZGhCUFElPV9NciZGVS65TNIgk7X+yEjjhD1MSWKKijZ1r9Z zIt4OzUTxxNOvzdlABZS88nNRdJkatOQJPmFdd1mpP6UzTNCiLUo1pIqOEtJgvVVDYq5WHY6 tciWWYdmZG/tIBexJmv2mV2OLVjXR6ZeKmntVH14H72/wRHJuYHQC+r5SVRcWWayrThsY6jZ Yr4+raS5AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6Z AXgDtmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8Flv mI/c40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt 3ytU8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZ R1EdEIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm5 9R8AEQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczM AAoJEIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLq A6xe6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHu uC5vgPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15Gc sS9YcQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9 TevwGsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCg lz65AQ0EU7PEDAEIAOZgWf2cJIu+58IzP2dkXE/urj3tr4OqrB/yHGWUf71Lz6D0Fi6ZAXgD tmcFLGPfMyWuLAvSM+xmoguk7zC4hRBYvQycmIhuqBq1jO1Wp/Z+lpoPM/1cDYLn8FlvmI/c 40MhUZh345DA4jYWWaZNjQHUWVQ1fPf595vdVVMPT/abE8E5DaF6fSkRmqFTmfYRkfbt3ytU 8NdUapDcJVY7cEP2nJBVNZPnOIObR/ZIgSxjjrG5o34yXoqeup8JvwEv+/NylzzuyXEZR1Ed EIzQ/a1nh/0j4NXtzZEqKW4aTWlmSqb6wN8jh1OSOOqkYsfnE3nfxcZbxi4IRoNQYlm59R8A EQEAAYkBPAQYAQoAJgIbDBYhBOmM88TmnMPNDledVYMYw5VbqyJ/BQJZYMLYBQkNMczMAAoJ EIMYw5VbqyJ/TqgH/RQHClkvecE0262lwKoP/m0Mh4I5TLRgoJJn8S7G1BnqohYJkiLqA6xe 6urGD7OqdNAl12UbrjWbdJV+zvea3vJoM4MZuYiYrGaXWxzFXqWJcPwMU9sAh8MRghHuuC5v gPb45Tnftw9/+n0i8GfVhQhOqepUGdQg4NPcXviSkoAvig6pp9Lcxisn0groUQKt15GcsS9Y cQWg3j9Hnipc6Mu416HX98Fb113NHJqc2geTHLkRyuBFOoyIqB6N9GKjzOAIzxxsVdl9Tevw Gsrp4M4/RFzWbSgsbOnbE7454lmuVZGfReEjnUm8RHp9Q2UWKXlp3exlZjvOp/uVEpCglz4= Message-ID: Date: Wed, 25 Sep 2019 08:03:13 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <20190925051317.GA77827@x8.osted.lan> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46dcCB0c24z3KDg X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=GaxRlweJ; dmarc=none; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::343 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-2.56 / 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)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; 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_COUNT_THREE(0.00)[3]; IP_SCORE(-0.37)[ip: (3.02), ipnet: 2607:f8b0::/32(-2.61), asn: 15169(-2.18), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; 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_MEDIUM(-1.00)[-0.998,0]; FORGED_SENDER(0.30)[mav@FreeBSD.org,mavbsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[mav@FreeBSD.org,mavbsd@gmail.com]; 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: Wed, 25 Sep 2019 12:03:18 -0000 On 25.09.2019 01:13, Peter Holm wrote: > On Tue, Sep 24, 2019 at 08:01:20PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Tue Sep 24 20:01:20 2019 >> New Revision: 352658 >> URL: https://svnweb.freebsd.org/changeset/base/352658 >> >> Log: >> Fix/improve interrupt threads scheduling. >> >> Doing some tests with very high interrupt rates I've noticed that one of >> conditions I added in r232207 to make interrupt threads in most cases >> run on local CPU never worked as expected (worked only if previous time >> it was executed on some other CPU, that is quite opposite). It caused >> additional CPU usage to run full CPU search and could schedule interrupt >> threads to some other CPU. >> >> This patch removes that code and instead reuses existing non-interrupt >> code path with some tweaks for interrupt case: >> - On SMT systems, if current thread is idle, don't look on other threads. >> Even if they are busy, it may take more time to do fill search and bounce >> the interrupt thread to other core then execute it locally, even sharing >> CPU resources. It is other threads should migrate, not bound interrupts. >> - Try hard to keep interrupt threads within LLC of their original CPU. >> This improves scheduling cost and supposedly cache and memory locality. >> >> On a test system with 72 threads doing 2.2M IOPS to NVMe this saves few >> percents of CPU time while adding few percents to IOPS. >> >> MFC after: 1 month >> Sponsored by: iXsystems, Inc. >> >> Modified: >> head/sys/kern/sched_ule.c >> >> Modified: head/sys/kern/sched_ule.c >> ============================================================================== >> --- head/sys/kern/sched_ule.c Tue Sep 24 18:18:11 2019 (r352657) >> +++ head/sys/kern/sched_ule.c Tue Sep 24 20:01:20 2019 (r352658) >> @@ -1251,7 +1251,7 @@ sched_pickcpu(struct thread *td, int flags) > > Could this be yours? > > FreeBSD/SMP: Multiprocessor System Detected: 24 CPUs > FreeBSD/SMP: 2 package(s) x 6 core(s) x 2 hardware threads > random: unblocking device. > Firmware Warning (ACPI): Invalid length for FADT/Pm1aControlBlock: 32, using default 16 (20190703/tbfadt-850) > ioapic0 irqs 0-23 > ioapic1 irqs 24-47 > ioapic2 irqs 48-71 > Launching APs: 13 6 18 17 5 9 8 19 7 10 1 11 2 12 14 15 20 4 21 16 22 3 23 > panic: sched_pickcpu: Failed to find a cpu. > cpuid = 0 > time = 1 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff8254a830 > vpanic() at vpanic+0x19d/frame 0xffffffff8254a880 > panic() at panic+0x43/frame 0xffffffff8254a8e0 > sched_pickcpu() at sched_pickcpu+0x4c1/frame 0xffffffff8254a990 > sched_add() at sched_add+0x6e/frame 0xffffffff8254a9d0 > gtaskqueue_start_threads() at gtaskqueue_start_threads+0x124/frame 0xffffffff8254aa70 > taskqgroup_cpu_create() at taskqgroup_cpu_create+0x135/frame 0xffffffff8254aab0 > taskqgroup_adjust() at taskqgroup_adjust+0x1ad/frame 0xffffffff8254ab20 > mi_startup() at mi_startup+0x210/frame 0xffffffff8254ab70 > btext() at btext+0x2c > KDB: enter: panic > [ thread pid 0 tid 100000 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > db> Should be fixed by r352677. Sorry. -- Alexander Motin From owner-svn-src-head@freebsd.org Wed Sep 25 12:57:16 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 DF6EF126443; Wed, 25 Sep 2019 12:57:16 +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 46ddPS5Xp5z3MDm; Wed, 25 Sep 2019 12:57:16 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 962989D28; Wed, 25 Sep 2019 12:57:16 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f175.google.com with SMTP id 3so6392215qta.1; Wed, 25 Sep 2019 05:57:16 -0700 (PDT) X-Gm-Message-State: APjAAAW1b81nbcNTxOq8L7T6eMMw37HSQM8JynIgIAmMps/jIztHebdC 2j6of2UrL49gfee1M9OO+3sV6RVwRAJ/k55V6EA= X-Google-Smtp-Source: APXvYqzbgJoUmRwKOiw9YGZ5INh/lHMNAsAMfr1XNkrCdajpCWA2ZAfM7foUIsiqLax4GRp/ExgtqFJ0xpIISDIplmU= X-Received: by 2002:ac8:5306:: with SMTP id t6mr8642445qtn.53.1569416235825; Wed, 25 Sep 2019 05:57:15 -0700 (PDT) MIME-Version: 1.0 References: <201909250237.x8P2bf0X033449@repo.freebsd.org> <20190925065753.vmw4ls426xighbag@ivaldir.net> In-Reply-To: <20190925065753.vmw4ls426xighbag@ivaldir.net> From: Kyle Evans Date: Wed, 25 Sep 2019 07:57:04 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352668 - in head/usr.sbin/cron: cron crontab lib To: Baptiste Daroussin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" 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: Wed, 25 Sep 2019 12:57:16 -0000 On Wed, Sep 25, 2019 at 1:58 AM Baptiste Daroussin wrote: > > On Wed, Sep 25, 2019 at 02:37:41AM +0000, Kyle Evans wrote: > > Author: kevans > > Date: Wed Sep 25 02:37:40 2019 > > New Revision: 352668 > > URL: https://svnweb.freebsd.org/changeset/base/352668 > > > > Log: > > cron: add log suppression and mail suppression for successful runs > > > > This commit adds two new extensions to crontab, ported from OpenBSD: > > - -n: suppress mail on succesful run > > - -q: suppress logging of command execution > > > > The -q option appears decades old, but -n is relatively new. The > > original proposal by Job Snijder can be found here [1], and gives very > > convincing reasons for inclusion in base. > > > > This patch is a nearly identical port of OpenBSD cron for -q and -n > > features. It is written to follow existing conventions and style of the > > existing codebase. > > > > Example usage: > > > > # should only send email, but won't show up in log > > * * * * * -q date > > > > # should not send email > > * * * * * -n date > > > > # should not send email or log > > * * * * * -n -q date > > > > # should send email because of ping failure > > * * * * * -n -q ping -c 1 5.5.5.5 > > > > [1]: https://marc.info/?l=openbsd-tech&m=152874866117948&w=2 > > > > PR: 237538 > > Submitted by: Naveen Nathan > > Reviewed by: bcr (manpages) > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D20046 > > > I do think this deserves an entry in the release notes > Ahh, I'm inclined to agree. I'll write up a RELNOTES entry here shortly. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Wed Sep 25 13:04: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 BD346126787; Wed, 25 Sep 2019 13:04:35 +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 46ddYv3SKwz3Mt8; Wed, 25 Sep 2019 13:04:35 +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 55F89181DA; Wed, 25 Sep 2019 13:04:35 +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 x8PD4ZUj004597; Wed, 25 Sep 2019 13:04:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PD4ZWQ004596; Wed, 25 Sep 2019 13:04:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251304.x8PD4ZWQ004596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 13:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352679 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352679 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: Wed, 25 Sep 2019 13:04:35 -0000 Author: kevans Date: Wed Sep 25 13:04:34 2019 New Revision: 352679 URL: https://svnweb.freebsd.org/changeset/base/352679 Log: RELNOTES: Document r352668 (crontab -n and -q options) Suggested by: bapt Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Wed Sep 25 12:58:49 2019 (r352678) +++ head/RELNOTES Wed Sep 25 13:04:34 2019 (r352679) @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r352668: + cron(8) now supports the -n (suppress mail on succesful run) and -q + (suppress logging of command execution) options in the crontab format. + See the crontab(5) manpage for details. + r352304: ntpd is no longer by default locked in memory. rlimit memlock 32 or rlimit memlock 0 can be used to restore this behaviour. From owner-svn-src-head@freebsd.org Wed Sep 25 13:21: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 53301126DD7; Wed, 25 Sep 2019 13:21:08 +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 46ddx01Xtcz3NZQ; Wed, 25 Sep 2019 13:21:08 +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 1244C183D9; Wed, 25 Sep 2019 13:21:08 +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 x8PDL7qA011444; Wed, 25 Sep 2019 13:21:07 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PDL7o9011443; Wed, 25 Sep 2019 13:21:07 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909251321.x8PDL7o9011443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 25 Sep 2019 13:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352680 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352680 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: Wed, 25 Sep 2019 13:21:08 -0000 Author: tsoome Date: Wed Sep 25 13:21:07 2019 New Revision: 352680 URL: https://svnweb.freebsd.org/changeset/base/352680 Log: kernel: terminal_init() should check for teken colors from kenv Check for teken.fg_color and teken.bg_color and prepare the color attributes accordingly. When white background is used, make it light to improve visibility. When black background is used, make kernel messages light. Modified: head/sys/kern/subr_terminal.c Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Wed Sep 25 13:04:34 2019 (r352679) +++ head/sys/kern/subr_terminal.c Wed Sep 25 13:21:07 2019 (r352680) @@ -124,13 +124,13 @@ static teken_funcs_t terminal_drawmethods = { }; /* Kernel message formatting. */ -static const teken_attr_t kernel_message = { +static teken_attr_t kernel_message = { .ta_fgcolor = TCHAR_FGCOLOR(TERMINAL_KERN_ATTR), .ta_bgcolor = TCHAR_BGCOLOR(TERMINAL_KERN_ATTR), .ta_format = TCHAR_FORMAT(TERMINAL_KERN_ATTR) }; -static const teken_attr_t default_message = { +static teken_attr_t default_message = { .ta_fgcolor = TCHAR_FGCOLOR(TERMINAL_NORM_ATTR), .ta_bgcolor = TCHAR_BGCOLOR(TERMINAL_NORM_ATTR), .ta_format = TCHAR_FORMAT(TERMINAL_NORM_ATTR) @@ -168,10 +168,33 @@ static const teken_attr_t default_message = { static void terminal_init(struct terminal *tm) { + int fg, bg; if (tm->tm_flags & TF_CONS) mtx_init(&tm->tm_mtx, "trmlck", NULL, MTX_SPIN); + teken_init(&tm->tm_emulator, &terminal_drawmethods, tm); + + TUNABLE_INT_FETCH("teken.fg_color", &fg); + TUNABLE_INT_FETCH("teken.bg_color", &bg); + + if (fg != -1) { + default_message.ta_fgcolor = fg; + kernel_message.ta_fgcolor = fg; + } + if (bg != -1) { + default_message.ta_bgcolor = bg; + kernel_message.ta_bgcolor = bg; + } + + if (default_message.ta_bgcolor == TC_WHITE) { + default_message.ta_bgcolor |= TC_LIGHT; + kernel_message.ta_bgcolor |= TC_LIGHT; + } + + if (default_message.ta_bgcolor == TC_BLACK && + default_message.ta_fgcolor < TC_NCOLORS) + kernel_message.ta_fgcolor |= TC_LIGHT; teken_set_defattr(&tm->tm_emulator, &default_message); } From owner-svn-src-head@freebsd.org Wed Sep 25 13:24: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 066A91270A2; Wed, 25 Sep 2019 13:24:33 +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 46df0w6RN5z3P1R; Wed, 25 Sep 2019 13:24:32 +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 C05451857E; Wed, 25 Sep 2019 13:24:32 +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 x8PDOW8m016293; Wed, 25 Sep 2019 13:24:32 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PDOVWo016288; Wed, 25 Sep 2019 13:24:31 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909251324.x8PDOVWo016288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 25 Sep 2019 13:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352681 - in head/sys/dev/vt: . hw/fb X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/sys/dev/vt: . hw/fb X-SVN-Commit-Revision: 352681 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: Wed, 25 Sep 2019 13:24:33 -0000 Author: tsoome Date: Wed Sep 25 13:24:31 2019 New Revision: 352681 URL: https://svnweb.freebsd.org/changeset/base/352681 Log: vt: use colors from terminal emulator Instead of hardcoded colors, use terminal state. This also means, we need to record the pointer to terminal state with vtbuf. Modified: head/sys/dev/vt/hw/fb/vt_fb.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_buf.c head/sys/dev/vt/vt_core.c head/sys/dev/vt/vt_cpulogos.c Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Wed Sep 25 13:21:07 2019 (r352680) +++ head/sys/dev/vt/hw/fb/vt_fb.c Wed Sep 25 13:24:31 2019 (r352681) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -453,7 +454,8 @@ vt_fb_init(struct vt_device *vd) { struct fb_info *info; u_int margin; - int err; + int bg, err; + term_color_t c; info = vd->vd_softc; vd->vd_height = MIN(VT_FB_MAX_HEIGHT, info->fb_height); @@ -477,8 +479,15 @@ vt_fb_init(struct vt_device *vd) info->fb_cmsize = 16; } + c = TC_BLACK; + TUNABLE_INT_FETCH("teken.bg_color", &bg); + if (bg != -1) { + if (bg == TC_WHITE) + bg |= TC_LIGHT; + c = bg; + } /* Clear the screen. */ - vd->vd_driver->vd_blank(vd, TC_BLACK); + vd->vd_driver->vd_blank(vd, c); /* Wakeup screen. KMS need this. */ vt_fb_postswitch(vd); Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Wed Sep 25 13:21:07 2019 (r352680) +++ head/sys/dev/vt/vt.h Wed Sep 25 13:24:31 2019 (r352681) @@ -192,6 +192,7 @@ void vt_suspend(struct vt_device *vd); struct vt_buf { struct mtx vb_lock; /* Buffer lock. */ + struct terminal *vb_terminal; term_pos_t vb_scr_size; /* (b) Screen dimensions. */ int vb_flags; /* (b) Flags. */ #define VBF_CURSOR 0x1 /* Cursor visible. */ Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Wed Sep 25 13:21:07 2019 (r352680) +++ head/sys/dev/vt/vt_buf.c Wed Sep 25 13:24:31 2019 (r352681) @@ -420,6 +420,8 @@ void vtbuf_init_early(struct vt_buf *vb) { term_rect_t rect; + const teken_attr_t *a; + term_char_t c; vb->vb_flags |= VBF_CURSOR; vb->vb_roffset = 0; @@ -433,7 +435,11 @@ vtbuf_init_early(struct vt_buf *vb) rect.tr_begin.tp_row = rect.tr_begin.tp_col = 0; rect.tr_end.tp_col = vb->vb_scr_size.tp_col; rect.tr_end.tp_row = vb->vb_history_size; - vtbuf_do_fill(vb, &rect, VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR)); + + a = teken_get_curattr(&vb->vb_terminal->tm_emulator); + c = TCOLOR_FG((term_char_t)a->ta_fgcolor) | + TCOLOR_BG((term_char_t)a->ta_bgcolor); + vtbuf_do_fill(vb, &rect, VTBUF_SPACE_CHAR(c)); vtbuf_make_undirty(vb); if ((vb->vb_flags & VBF_MTX_INIT) == 0) { mtx_init(&vb->vb_lock, "vtbuf", NULL, MTX_SPIN); @@ -478,7 +484,12 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, uns unsigned int w, h, c, r, old_history_size; size_t bufsize, rowssize; int history_full; + const teken_attr_t *a; + term_char_t ch; + a = teken_get_curattr(&vb->vb_terminal->tm_emulator); + ch = TCOLOR_FG(a->ta_fgcolor) | TCOLOR_BG(a->ta_bgcolor); + history_size = MAX(history_size, p->tp_row); /* Allocate new buffer. */ @@ -544,7 +555,7 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, uns * background color. */ for (c = MIN(p->tp_col, w); c < p->tp_col; c++) { - row[c] = VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR); + row[c] = VTBUF_SPACE_CHAR(ch); } } @@ -552,7 +563,7 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, uns for (r = old_history_size; r < history_size; r++) { row = rows[r]; for (c = MIN(p->tp_col, w); c < p->tp_col; c++) { - row[c] = VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR); + row[c] = VTBUF_SPACE_CHAR(ch); } } @@ -601,7 +612,7 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, uns * background color. */ for (c = MIN(p->tp_col, w); c < p->tp_col; c++) { - row[c] = VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR); + row[c] = VTBUF_SPACE_CHAR(ch); } } Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Sep 25 13:21:07 2019 (r352680) +++ head/sys/dev/vt/vt_core.c Wed Sep 25 13:24:31 2019 (r352681) @@ -1241,7 +1241,7 @@ vt_mark_mouse_position_as_dirty(struct vt_device *vd, static void vt_set_border(struct vt_device *vd, const term_rect_t *area, - const term_color_t c) + term_color_t c) { vd_drawrect_t *drawrect = vd->vd_driver->vd_drawrect; @@ -1334,9 +1334,12 @@ vt_flush(struct vt_device *vd) /* Force a full redraw when the screen contents might be invalid. */ if (vd->vd_flags & (VDF_INVALID | VDF_SUSPENDED)) { + const teken_attr_t *a; + vd->vd_flags &= ~VDF_INVALID; - vt_set_border(vd, &vw->vw_draw_area, TC_BLACK); + a = teken_get_curattr(&vw->vw_terminal->tm_emulator); + vt_set_border(vd, &vw->vw_draw_area, a->ta_bgcolor); vt_termrect(vd, vf, &tarea); if (vd->vd_driver->vd_invalidate_text) vd->vd_driver->vd_invalidate_text(vd, &tarea); @@ -1440,8 +1443,7 @@ vtterm_cnprobe(struct terminal *tm, struct consdev *cp struct vt_window *vw = tm->tm_softc; struct vt_device *vd = vw->vw_device; struct winsize wsz; - term_attr_t attr; - term_char_t c; + const term_attr_t *a; if (!vty_enabled(VTY_VT)) return; @@ -1494,14 +1496,12 @@ vtterm_cnprobe(struct terminal *tm, struct consdev *cp if (vd->vd_width != 0 && vd->vd_height != 0) vt_termsize(vd, vw->vw_font, &vw->vw_buf.vb_scr_size); + /* We need to access terminal attributes from vtbuf */ + vw->vw_buf.vb_terminal = tm; vtbuf_init_early(&vw->vw_buf); vt_winsize(vd, vw->vw_font, &wsz); - c = (boothowto & RB_MUTE) == 0 ? TERMINAL_KERN_ATTR : - TERMINAL_NORM_ATTR; - attr.ta_format = TCHAR_FORMAT(c); - attr.ta_fgcolor = TCHAR_FGCOLOR(c); - attr.ta_bgcolor = TCHAR_BGCOLOR(c); - terminal_set_winsize_blank(tm, &wsz, 1, &attr); + a = teken_get_curattr(&tm->tm_emulator); + terminal_set_winsize_blank(tm, &wsz, 1, a); if (vtdbest != NULL) { #ifdef DEV_SPLASH @@ -2691,9 +2691,10 @@ vt_allocate_window(struct vt_device *vd, unsigned int vt_termsize(vd, vw->vw_font, &size); vt_winsize(vd, vw->vw_font, &wsz); + tm = vw->vw_terminal = terminal_alloc(&vt_termclass, vw); + vw->vw_buf.vb_terminal = tm; /* must be set before vtbuf_init() */ vtbuf_init(&vw->vw_buf, &size); - tm = vw->vw_terminal = terminal_alloc(&vt_termclass, vw); terminal_set_winsize(tm, &wsz); vd->vd_windows[window] = vw; callout_init(&vw->vw_proc_dead_timer, 0); Modified: head/sys/dev/vt/vt_cpulogos.c ============================================================================== --- head/sys/dev/vt/vt_cpulogos.c Wed Sep 25 13:21:07 2019 (r352680) +++ head/sys/dev/vt/vt_cpulogos.c Wed Sep 25 13:24:31 2019 (r352681) @@ -121,6 +121,8 @@ vtterm_draw_cpu_logos(struct vt_device *vd) { unsigned int ncpu, i; vt_axis_t left; + struct terminal *tm = vd->vd_curwindow->vw_terminal; + const teken_attr_t *a; if (vt_splash_ncpu) ncpu = vt_splash_ncpu; @@ -130,15 +132,16 @@ vtterm_draw_cpu_logos(struct vt_device *vd) ncpu = 1; } + a = teken_get_curattr(&tm->tm_emulator); if (vd->vd_driver->vd_drawrect) vd->vd_driver->vd_drawrect(vd, 0, 0, vd->vd_width, - vt_logo_sprite_height, 1, TC_BLACK); + vt_logo_sprite_height, 1, a->ta_bgcolor); /* * Blank is okay because we only ever draw beasties on full screen * refreshes. */ else if (vd->vd_driver->vd_blank) - vd->vd_driver->vd_blank(vd, TC_BLACK); + vd->vd_driver->vd_blank(vd, a->ta_bgcolor); ncpu = MIN(ncpu, vd->vd_width / vt_logo_sprite_width); for (i = 0, left = 0; i < ncpu; left += vt_logo_sprite_width, i++) From owner-svn-src-head@freebsd.org Wed Sep 25 13:36: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 62EAE1275D8; Wed, 25 Sep 2019 13:36:17 +0000 (UTC) (envelope-from carpeddiem@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 46dfGR5qcVz3Pqs; Wed, 25 Sep 2019 13:36:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f49.google.com with SMTP id a1so13878496ioc.6; Wed, 25 Sep 2019 06:36: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:cc; bh=42ndp1cuAOEK0Atia4pci3McWYQM70GRV2TlnPZKxtQ=; b=VD6wQwyq78cwmUB+NvKi0DsWgyE5uSt+7D0bxf7OHFV1roWyW1svbYqF2lEtIDgjaw H1CGtXyemSWvmlDdcVVtbncZLxalV/449gSI/uH2wJcU44e62Zj6WX1BsPz2sD6dH38X BtDrNs9Prcn1wPFWqL/Ej5N09pbIfaF7WyCwx9Y6pW+z3HJHN81VMSNQBSxnTBpcSZNN ZLA4CjusYIVgMsuqIYlPB/MuBFrJR+bGE+nzBTSuNWnvrUfEqYvpke6NocH1dKurXJWc oyOrplIAgCBsqbq98DzGqAqHORin4bjnBbRLRU4RudlBwFuMRbzn4Xe/KKOK1gTOGdyq HZog== X-Gm-Message-State: APjAAAVN6fBXY1Ko6pwr3Uc6Cc6AR9dp9qUVWI4hAjSR+3Y02Qy22/7h LcYziz8Sf8aP3ZOw/38D/5uZsOVKp99GkAZvBMaNCg== X-Google-Smtp-Source: APXvYqyuoF4jo0n6DX8LekRm5gCbJniUrPvE7jUjQlpsoVnTGwjMKJsOzM1Jw3HY9WJcLJKDCWtis5i7w/ov5FmwsiI= X-Received: by 2002:a92:995a:: with SMTP id p87mr635248ili.115.1569418574569; Wed, 25 Sep 2019 06:36:14 -0700 (PDT) MIME-Version: 1.0 References: <201909242036.x8OKahnv021758@repo.freebsd.org> <20190925070207.Y3271@besplex.bde.org> In-Reply-To: <20190925070207.Y3271@besplex.bde.org> From: Ed Maste Date: Wed, 25 Sep 2019 09:36:02 -0400 Message-ID: Subject: Re: svn commit: r352661 - head/sys/netinet/tcp_stacks To: Bruce Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46dfGR5qcVz3Pqs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.49 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.46 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[49.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.46)[ip: (-6.77), ipnet: 209.85.128.0/17(-3.30), asn: 15169(-2.18), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RWL_MAILSPIKE_POSSIBLE(0.00)[49.166.85.209.rep.mailspike.net : 127.0.0.17]; 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)[emaste@freebsd.org,carpeddiem@gmail.com]; 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: Wed, 25 Sep 2019 13:36:17 -0000 On Tue, 24 Sep 2019 at 17:39, Bruce Evans wrote: > > On i386, these types have different sizes, so > gcc detects the type mismatch. clang is too broken to report this type > mismatch. Interesting, it seems Clang doesn't even warn in the case of casting a uint64_t to a 32-bit pointer. Looks like there are some useful warnings that ought to be implemented. From owner-svn-src-head@freebsd.org Wed Sep 25 13:36: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 4C0BF12766E; Wed, 25 Sep 2019 13:36:57 +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 46dfHF1NpVz3Q0m; Wed, 25 Sep 2019 13:36:57 +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 1315818744; Wed, 25 Sep 2019 13:36:57 +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 x8PDaueT022463; Wed, 25 Sep 2019 13:36:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PDauVJ022462; Wed, 25 Sep 2019 13:36:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909251336.x8PDauVJ022462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 25 Sep 2019 13:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352684 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 352684 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: Wed, 25 Sep 2019 13:36:57 -0000 Author: kib Date: Wed Sep 25 13:36:56 2019 New Revision: 352684 URL: https://svnweb.freebsd.org/changeset/base/352684 Log: x86: Fall back to leaf 0x16 if TSC frequency is obtained by CPUID and leaf 0x15 is not functional. This should improve automatic TSC frequency determination on Skylake/Kabylake/... families, where 0x15 exists but does not provide all necessary information. SDM contains relatively strong wording against such uses of 0x16, but Intel does not give us any other way to obtain the frequency. Linux did the same in the commit 604dc9170f2435d27da5039a3efd757dceadc684. Based on submission by: Neel Chauhan PR: 240475 Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21777 Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Wed Sep 25 13:29:56 2019 (r352683) +++ head/sys/x86/x86/tsc.c Wed Sep 25 13:36:56 2019 (r352684) @@ -134,7 +134,11 @@ tsc_freq_vmware(void) /* * Calculate TSC frequency using information from the CPUID leaf 0x15 - * 'Time Stamp Counter and Nominal Core Crystal Clock'. It should be + * 'Time Stamp Counter and Nominal Core Crystal Clock'. If leaf 0x15 + * is not functional, as it is on Skylake/Kabylake, try 0x16 'Processor + * Frequency Information'. Leaf 0x16 is described in the SDM as + * informational only, but if 0x15 did not work, and TSC calibration + * is disabled, it is the best we can get at all. It should still be * an improvement over the parsing of the CPU model name in * tsc_freq_intel(), when available. */ @@ -146,10 +150,20 @@ tsc_freq_cpuid(void) if (cpu_high < 0x15) return (false); do_cpuid(0x15, regs); - if (regs[0] == 0 || regs[1] == 0 || regs[2] == 0) + if (regs[0] != 0 && regs[1] != 0 && regs[2] != 0) { + tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0]; + return (true); + } + + if (cpu_high < 0x16) return (false); - tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0]; - return (true); + do_cpuid(0x16, regs); + if (regs[0] != 0) { + tsc_freq = (uint64_t)regs[0] * 1000000; + return (true); + } + + return (false); } static void From owner-svn-src-head@freebsd.org Wed Sep 25 14:11: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 3AD3E1284DB; Wed, 25 Sep 2019 14:11:53 +0000 (UTC) (envelope-from carpeddiem@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 46dg3X1Xxhz3x1k; Wed, 25 Sep 2019 14:11:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f50.google.com with SMTP id b19so14213541iob.4; Wed, 25 Sep 2019 07:11:51 -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=YjVRbfd3bHIoWXaHMb7EUzhIPJwaEynUhBTN4KNXRW0=; b=psB6uDVv1OwVzzSL72cmPU8Z9xDx16r8BzeFb9tiX8ENsdcxQTa4sy9Jryppf+wQpl SIy/liPdwKf2V6q+hNnilZmPcLX9z1qDC1QxRERD1qxtyRsOfLzsKw/3zSnLEi/7+2PX +mJ4ONWj1D+VAkYUp50iS4gIjGVi7qLDfaDmQqFnCm9B22PeGHIpaQuQQDRWZ9OIAHwB LASYSHsrqRHMPIqx+b19rFAcF5xiE5G48ghFmqm5EQJnZnbqF9uNIRa78h+2pDs/S8FF gBxND93IG2gDAd+2zPqQG6aUn3r8tXYAOEMAVYR3xV8y+06GB7T1t5aegAh8TQQeswb7 0IYw== X-Gm-Message-State: APjAAAV0NJRp+sGG29ql5S8Tb0T1IFxwXWK/dpaprqTsLsRgOlSyjRc+ Gv0ej/6NdpqiofdgGj9LlYHwp3tWRlABTAAL7oZGUQ== X-Google-Smtp-Source: APXvYqwkc2jEyXOWTL70k0KXYjWAsBuTw0XEj/brXiD3d6EEA7duxHlYZoLteAOVIUu18NAm+w3L9oAfNb01tnPfnqo= X-Received: by 2002:a6b:3806:: with SMTP id f6mr10341684ioa.120.1569420711187; Wed, 25 Sep 2019 07:11:51 -0700 (PDT) MIME-Version: 1.0 References: <201909021356.x82Dui6v077765@repo.freebsd.org> <20190920212702.N1017@besplex.bde.org> In-Reply-To: <20190920212702.N1017@besplex.bde.org> From: Ed Maste Date: Wed, 25 Sep 2019 10:11:37 -0400 Message-ID: Subject: Re: svn commit: r351700 - head/lib/libc/string To: Bruce Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46dg3X1Xxhz3x1k X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.50 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.40 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[50.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.40)[ip: (-6.46), ipnet: 209.85.128.0/17(-3.30), asn: 15169(-2.18), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RWL_MAILSPIKE_POSSIBLE(0.00)[50.166.85.209.rep.mailspike.net : 127.0.0.17]; 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)[emaste@freebsd.org,carpeddiem@gmail.com]; 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: Wed, 25 Sep 2019 14:11:53 -0000 On Fri, 20 Sep 2019 at 08:14, Bruce Evans wrote: > > Optimizing this function [memchr] is especially unimportant, Why? Really, we should provide optimized assembly implementations of string functions deemed important, but it will take time for that to happen on all architectures. > and this version has mounds of style bugs. Yes, I've wondered about applying style(9) to the handful of imported string routines. In general we don't really expect ongoing updates, so it's probably no concern from a maintenance perspective. > > - do { > > - if (*p++ == (unsigned char)c) > > - return ((void *)(p - 1)); > > - } while (--n != 0); > > Old KNF code. In the !__GNUC__ #else clause , this is replaced by > equivalent code with a style that is very far from KNF. Functionally equivalent, although I compared the compiled output of both cases and what's currently there is somewhat smaller. Note that it's not an #else case, the equivalent loop is used in both cases - handling the non-word-size residue in the __GNUC__ case. > > +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; > > This seems to have no dependencies on __GNUC__ except the use of anti-aliasing, Yes, that is the reason. > I checked that this optimization actually works. For long strings, it is > almost sizeof(size_t) times faster, by accessing memory with a size > sizeof(size_t). size_t is a not very good way of hard-coding the word size. Indeed - I wouldn't have imported this change if I didn't observe a reasonable benefit when trying it out. As for word size it could be replaced using LONG_BIT I suppose (as strspn.c, strlen.c), if it's getting reworked anyway. > Related silly optimizations: > - i386 has memchr() in asm. This uses scasb, which was last optimal on the > 8088, or perhaps the original i386. On freefall, it is several times slower > than the naive translation of the naive C code. I posted a review (https://reviews.freebsd.org/D21785) to remove the scasb implementation. I haven't investigated wmemchr. > - i386 pessimizes several old string functions using scasb. The only other one I see is in strcat.S, which should probably be retired as well. Are there others? > - i386 also does dubious alignment optimizations I don't think there's much value in putting a lot of time into i386, but am happy to address straightforward issues (such as removing pessimal MD implementations). I haven't looked at these alignment optimizations. > - amd64 pessimizes strcpy() by implementing it as a C wrapper for stpcpy(). > The wrapper code is MI, but is only used for amd64. And it appears the MD one is selected by Makefile .PATH ordering, which seems fragile. From owner-svn-src-head@freebsd.org Wed Sep 25 14:21: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 EF42D1289A3; Wed, 25 Sep 2019 14:21:44 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (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 46dgGw0TwJz3xly; Wed, 25 Sep 2019 14:21:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f52.google.com with SMTP id v2so14248170iob.10; Wed, 25 Sep 2019 07:21:43 -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=6bHY8wug/LM51O/AfxJ0gYra9CLIwgLUNCHhgn96Qwg=; b=gF2snQg1uVMkQetRZ8Co4UTQiEPrKTrI+qC+ZFKGUHh+b/1MGd7uwxMZmSNX06MVVU 0BpUgj1pDW1wPZGsF9GBAhBkekN6+zW8N37ROr5M871Hhqc0gMn7wMLyjGDJ7mbCFqGZ jKmqveQdobk3zvpFMQN+mNIkbNzVe3ZrxpkejfWxD3OxKC84EPXoDJYoUEvpNJLcdtcq OTF82yIrZpysBKJuHb0qR12UKbQhLUbBpb2bpHJFxjBk6Zfm6zFVuQSgbkjk5tN4OsDl XhaqAiBRcjZSwgFaeF4vTHR+U1LEn2knNBoqSHiMSwTf2+FAshasPmK82dQzNROssSZa UpEA== X-Gm-Message-State: APjAAAUJTz8jEip5yC8kvRA/I/v4DLAtkHDj7zaosYnB5YL788UGFYg+ ocncNrBbYmRZIv3G3AlqnDn561Zkk5xT5yDxK6ZYGQ== X-Google-Smtp-Source: APXvYqxCRt42BeNQQgGOmRtGs2q74S7cmjVi1uzxOF891qCUmj6CkpcUaC7L8yMInh6wKocbFqAvgA5PcaMgidqC/R8= X-Received: by 2002:a02:1c02:: with SMTP id c2mr5528313jac.118.1569421302694; Wed, 25 Sep 2019 07:21:42 -0700 (PDT) MIME-Version: 1.0 References: <201909011612.x81GC5DW097846@repo.freebsd.org> <201909011932.x81JWYts004074@slippy.cwsent.com> <20190913214846.P1215@besplex.bde.org> In-Reply-To: <20190913214846.P1215@besplex.bde.org> From: Ed Maste Date: Wed, 25 Sep 2019 10:21:30 -0400 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: Bruce Evans Cc: Cy Schubert , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46dgGw0TwJz3xly X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.52 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.12 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[52.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.12)[ip: (-5.06), ipnet: 209.85.128.0/17(-3.30), asn: 15169(-2.18), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RWL_MAILSPIKE_POSSIBLE(0.00)[52.166.85.209.rep.mailspike.net : 127.0.0.17]; 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)[emaste@freebsd.org,carpeddiem@gmail.com]; 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: Wed, 25 Sep 2019 14:21:45 -0000 On Fri, 13 Sep 2019 at 08:00, Bruce Evans wrote: > > C11 removed gets(), but POSIX.1-2017 (Issue 7) still has it (marked as > obsolescent). Thus this change breaks support for all versions of POSIX. Yes, and intentionally so. If there is a compelling reason to restore it I'll add the #ifdef-ery to make it available only in pre-C11. From owner-svn-src-head@freebsd.org Wed Sep 25 15:30: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 406C412A806; Wed, 25 Sep 2019 15:30:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (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 46dhpD1QjHz43H8; Wed, 25 Sep 2019 15:30:28 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f47.google.com with SMTP id z19so14966817ior.0; Wed, 25 Sep 2019 08:30:28 -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=/Z4kl+yLTofTxgnzPZ5+Wr3roqZZUrVuxTgMi1w2KbY=; b=RDuTeUMe9kfvXciy8yTmhMEBEyXBcyyTmrdmZF3znLjTqt9Sf/BGq/JLKaR8ZnW8xR W/qiaoTCdryHC7PlulBtq5t7syMXcNNlIwSdWka1HQfhj5QaUoZw0hHayc2WEAwBscG+ KI31Eh9jH8TbjyUad9tvKWJpsDR8+d5qcM7/eKuCG5zTsD3rsB3PBpO+zFTBgqMFoGxe 7lUn/+Xe4tpMlCXkVRIjhATfDknpy/CVaVgk3TZIdzRaH4xYXEkKtincdsGxHEQKXmLc 31PFLaW0Mhx1+YJs57ivX6hr8W92i7IiTgOCjLcVUUkhipKNBSQnGNq+ws4bO30080uA 7rdg== X-Gm-Message-State: APjAAAVndV6OEw2U8uJYxgAfupModLc/U9NsC1Bdh8JP62hlNkfyLlJd +o1bZ8JcrAs0YmrN0IPG0PS6TO8wfBYdx9RP1n0= X-Google-Smtp-Source: APXvYqxlnh4f37EQt2/x1teyFkdP18eqJwPrpVmO6NoRdpGp/cuATJWW7YHgVzVpJHPuQkzkmygn/XPQ2gG1sMQwLjI= X-Received: by 2002:a92:c691:: with SMTP id o17mr951203ilg.185.1569425427194; Wed, 25 Sep 2019 08:30:27 -0700 (PDT) MIME-Version: 1.0 References: <201909021356.x82Dui6v077765@repo.freebsd.org> <20190920212702.N1017@besplex.bde.org> In-Reply-To: From: Ed Maste Date: Wed, 25 Sep 2019 11:30:14 -0400 Message-ID: Subject: Re: svn commit: r351700 - head/lib/libc/string To: Bruce Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46dhpD1QjHz43H8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.47 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.18 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[47.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.18)[ip: (-5.35), ipnet: 209.85.128.0/17(-3.29), asn: 15169(-2.18), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RWL_MAILSPIKE_POSSIBLE(0.00)[47.166.85.209.rep.mailspike.net : 127.0.0.17]; 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)[emaste@freebsd.org,carpeddiem@gmail.com]; 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: Wed, 25 Sep 2019 15:30:29 -0000 On Wed, 25 Sep 2019 at 10:11, Ed Maste wrote: > > Functionally equivalent, although I compared the compiled output of > both cases and what's currently there is somewhat smaller. Note that > it's not an #else case, the equivalent loop is used in both cases - > handling the non-word-size residue in the __GNUC__ case. Ah, actually I think I'm mistaken here - what's in the tree does indeed compile to a slightly smaller object, but just due to arbitrary nop alignment. From owner-svn-src-head@freebsd.org Wed Sep 25 15:46:20 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 1803412B03B; Wed, 25 Sep 2019 15:46:20 +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 46dj8W4YH3z44K9; Wed, 25 Sep 2019 15:46:19 +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 3AA2D43E407; Thu, 26 Sep 2019 01:46:15 +1000 (AEST) Date: Thu, 26 Sep 2019 01:46:14 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: Bruce Evans , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r351700 - head/lib/libc/string In-Reply-To: Message-ID: <20190926002410.M1471@besplex.bde.org> References: <201909021356.x82Dui6v077765@repo.freebsd.org> <20190920212702.N1017@besplex.bde.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=D+Q3ErZj c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=6I5d2MoRAAAA:8 a=gQa_KXwDG70taBorNMIA:9 a=c5cFJP9Q6aieznk9:21 a=UTvLPHCjRxtbRH-0:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 46dj8W4YH3z44K9 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,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: Wed, 25 Sep 2019 15:46:20 -0000 On Wed, 25 Sep 2019, Ed Maste wrote: > On Fri, 20 Sep 2019 at 08:14, Bruce Evans wrote: >> >> Optimizing this function [memchr] is especially unimportant, > > Why? Because it is almost never used, and most of its uses are unimportant. It is used a whole 26 times in all of /usr/src/*bin: - sh/exec.c: 1 especially^N unimportant use after execve() fails - dmesg/dmesg.c: 2 uses; speed unimportant in utilitities like dmesg that parse small data - sort/sort.c: 2 uses for reading lines; speed possibly important - sed/process.c: 2 uses in options parsing; speed unimportant - grep/file.c: 3 uses for reading lines; speed possibly important, but if you want speed in utility that parses large data then you should use a special lexer and not general functions even to find newlines - gcore/elfcore.c: 1 use; speed unimportant - diff/diffreg.c: 1 use for detecting binaries; speed probably unimportant - mkimg/mkimg.c: 2 uses for writes; speed unimportant since i/o-bound - truss/syscalls.c: 1 use; speed unimportant - indent/pr_comment.c: 1 use; speed unimportant - ppp/*.c: 4 uses; speed unimportant - timed/readmsg.c: 1 use; speed unimportant - inetd/inetd.c: 1 use; speed unimportant - jail/config.c: 1 use; speed unimportant - daemon/daemon.c: 1 use; speed unimportant - bhyve/gdb.c: 2 uses; speed unimportant > Really, we should provide optimized assembly implementations of string > functions deemed important, but it will take time for that to happen > on all architectures. Really, we should provide optimized (usually non-assembly) implementations of no more than copying memory, and not deem any other string function as important (since none are). Even optimizing copying memory gives speed improvements of less than 1% in most programs. Assembly implementations are usually pessimal, and become more so with time. E.g., if you write memcpy() as something like *dst++ = *src++, then if the size is known at compile time, then clang will optimize to use AVXn in some cases. Handling the same number of cases in assembly is impractical. My experiments to optimize copying memory only handle about 30 cases, but I only tried to optimized for large copies and stopped adding cases 15 years ago when it became clear that too many cases would be needed. clang knows that it doesn't understand memory, so it doesn't do optimizations like this if the size is not known at compile time. It calls the library, which in FreeBSD doesn't even know that it doesn't understand memory. > >> and this version has mounds of style bugs. > > Yes, I've wondered about applying style(9) to the handful of imported > string routines. In general we don't really expect ongoing updates, so > it's probably no concern from a maintenance perspective. > >>> - do { >>> - if (*p++ == (unsigned char)c) >>> - return ((void *)(p - 1)); >>> - } while (--n != 0); >> >> Old KNF code. In the !__GNUC__ #else clause , this is replaced by >> equivalent code with a style that is very far from KNF. > > Functionally equivalent, although I compared the compiled output of > both cases and what's currently there is somewhat smaller. Note that > it's not an #else case, the equivalent loop is used in both cases - > handling the non-word-size residue in the __GNUC__ case. > >>> +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; >> >> This seems to have no dependencies on __GNUC__ except the use of anti-aliasing, > > Yes, that is the reason. > >> I checked that this optimization actually works. For long strings, it is >> almost sizeof(size_t) times faster, by accessing memory with a size >> sizeof(size_t). size_t is a not very good way of hard-coding the word size. > > Indeed - I wouldn't have imported this change if I didn't observe a > reasonable benefit when trying it out. As for word size it could be > replaced using LONG_BIT I suppose (as strspn.c, strlen.c), if it's > getting reworked anyway. But how do you know that long strings are most common? For short strings, it is better to have low overhead. LONG_BIT is another bad way of encoding the word size. On arches with correctly sized longs, long is twice as wide as either a machine register or the maximum memory access width. So it is usually twice the word size if correct. register_t is closer to being correct. >> Related silly optimizations: >> - i386 has memchr() in asm. This uses scasb, which was last optimal on the >> 8088, or perhaps the original i386. On freefall, it is several times slower >> than the naive translation of the naive C code. > > I posted a review (https://reviews.freebsd.org/D21785) to remove the > scasb implementation. I haven't investigated wmemchr. > >> - i386 pessimizes several old string functions using scasb. > > The only other one I see is in strcat.S, which should probably be > retired as well. Are there others? No others. It also uses cmps[lb] in bcmp.S and memcmp.S. cmpsl is at least word-sized, so it is not very slow. But all string functions are slow. Even with ERMS, movs[ql] is too slow to use for memcpy() for sizes less than about 1K, since it has typically has a startup overhead of about 25 (or is it 15?) cycles and 858 bytes can be copied if the memory bandwidth is 128 GB/sec and the CPU speed is 4 GHz. 128 GB/sec is a typical L1 cache speed for a not very new x86. If the memcpy() size is much larger than 1K, then copying busts L1 and everything is slower and speeds are more limited by memory than by the implementation. *dst++ = *src++ is best if it can keep up with memory, which is not so easy if (main) memory is fast and memcpy() uses 32-bit integer accesses. >> - i386 also does dubious alignment optimizations > > I don't think there's much value in putting a lot of time into i386, > but am happy to address straightforward issues (such as removing > pessimal MD implementations). I haven't looked at these alignment > optimizations. > >> - amd64 pessimizes strcpy() by implementing it as a C wrapper for stpcpy(). >> The wrapper code is MI, but is only used for amd64. > > And it appears the MD one is selected by Makefile .PATH ordering, > which seems fragile. I thought that it was by include ordering, but .PATH has to give order too. Bruce From owner-svn-src-head@freebsd.org Wed Sep 25 16:11: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 61ACE12BAAF; Wed, 25 Sep 2019 16:11:37 +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 46djjj2k4Hz46N2; Wed, 25 Sep 2019 16:11:37 +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 406B41A391; Wed, 25 Sep 2019 16:11:37 +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 x8PGBbS6013706; Wed, 25 Sep 2019 16:11:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PGBZUc013697; Wed, 25 Sep 2019 16:11:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909251611.x8PGBZUc013697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 25 Sep 2019 16:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352688 - in head/sys: amd64/amd64 arm/arm arm64/arm64 dev/agp i386/i386 mips/mips powerpc/booke riscv/riscv vm x86/iommu X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 dev/agp i386/i386 mips/mips powerpc/booke riscv/riscv vm x86/iommu X-SVN-Commit-Revision: 352688 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: Wed, 25 Sep 2019 16:11:37 -0000 Author: markj Date: Wed Sep 25 16:11:35 2019 New Revision: 352688 URL: https://svnweb.freebsd.org/changeset/base/352688 Log: Complete the removal of the "wire_count" field from struct vm_page. Convert all remaining references to that field to "ref_count" and update comments accordingly. No functional change intended. Reviewed by: alc, kib Sponsored by: Intel, Netflix Differential Revision: https://reviews.freebsd.org/D21768 Modified: head/sys/amd64/amd64/efirt_machdep.c head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm64/arm64/efirt_machdep.c head/sys/arm64/arm64/pmap.c head/sys/dev/agp/agp_i810.c head/sys/i386/i386/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/booke/pmap.c head/sys/riscv/riscv/pmap.c head/sys/vm/vm_page.h head/sys/x86/iommu/intel_idpgtbl.c Modified: head/sys/amd64/amd64/efirt_machdep.c ============================================================================== --- head/sys/amd64/amd64/efirt_machdep.c Wed Sep 25 15:51:07 2019 (r352687) +++ head/sys/amd64/amd64/efirt_machdep.c Wed Sep 25 16:11:35 2019 (r352688) @@ -74,7 +74,7 @@ efi_destroy_1t1_map(void) if (obj_1t1_pt != NULL) { VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) - m->wire_count = VPRC_OBJREF; + m->ref_count = VPRC_OBJREF; vm_wire_sub(obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Sep 25 15:51:07 2019 (r352687) +++ head/sys/amd64/amd64/pmap.c Wed Sep 25 16:11:35 2019 (r352688) @@ -1856,7 +1856,7 @@ pmap_init(void) ("pmap_init: page table page is out of range")); mpte->pindex = pmap_pde_pindex(KERNBASE) + i; mpte->phys_addr = KPTphys + (i << PAGE_SHIFT); - mpte->wire_count = 1; + mpte->ref_count = 1; /* * Collect the page table pages that were replaced by a 2MB @@ -3285,8 +3285,8 @@ pmap_remove_pt_page(pmap_t pmap, vm_offset_t va) } /* - * Decrements a page table page's wire count, which is used to record the - * number of valid page table entries within the page. If the wire count + * Decrements a page table page's reference count, which is used to record the + * number of valid page table entries within the page. If the reference count * drops to zero, then the page table page is unmapped. Returns TRUE if the * page table page was unmapped and FALSE otherwise. */ @@ -3294,8 +3294,8 @@ static inline boolean_t pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) { - --m->wire_count; - if (m->wire_count == 0) { + --m->ref_count; + if (m->ref_count == 0) { _pmap_unwire_ptp(pmap, va, m, free); return (TRUE); } else @@ -3355,7 +3355,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_ /* * After removing a page table entry, this routine is used to - * conditionally free the page, and manage the hold/wire counts. + * conditionally free the page, and manage the reference count. */ static int pmap_unuse_pt(pmap_t pmap, vm_offset_t va, pd_entry_t ptepde, @@ -3615,7 +3615,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str } else { /* Add reference to pdp page */ pdppg = PHYS_TO_VM_PAGE(*pml4 & PG_FRAME); - pdppg->wire_count++; + pdppg->ref_count++; } pdp = (pdp_entry_t *)PHYS_TO_DMAP(*pml4 & PG_FRAME); @@ -3660,7 +3660,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str } else { /* Add reference to the pd page */ pdpg = PHYS_TO_VM_PAGE(*pdp & PG_FRAME); - pdpg->wire_count++; + pdpg->ref_count++; } } pd = (pd_entry_t *)PHYS_TO_DMAP(*pdp & PG_FRAME); @@ -3689,7 +3689,7 @@ retry: if (pdpe != NULL && (*pdpe & PG_V) != 0) { /* Add a reference to the pd page. */ pdpg = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME); - pdpg->wire_count++; + pdpg->ref_count++; } else { /* Allocate a pd page. */ ptepindex = pmap_pde_pindex(va); @@ -3740,7 +3740,7 @@ retry: */ if (pd != NULL && (*pd & PG_V) != 0) { m = PHYS_TO_VM_PAGE(*pd & PG_FRAME); - m->wire_count++; + m->ref_count++; } else { /* * Here if the pte page isn't mapped, or if it has been @@ -4205,7 +4205,7 @@ next_chunk: m_pc = SLIST_FIRST(&free); SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ - m_pc->wire_count = 1; + m_pc->ref_count = 1; } vm_page_free_pages_toq(&free, true); return (m_pc); @@ -4785,7 +4785,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v } if (!in_kernel) { - mpte->wire_count = NPTEPG; + mpte->ref_count = NPTEPG; pmap_resident_count_inc(pmap, 1); } } @@ -4946,9 +4946,9 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse KASSERT(mpte->valid == VM_PAGE_BITS_ALL, ("pmap_remove_pde: pte page not promoted")); pmap_resident_count_dec(pmap, 1); - KASSERT(mpte->wire_count == NPTEPG, - ("pmap_remove_pde: pte page wire count error")); - mpte->wire_count = 0; + KASSERT(mpte->ref_count == NPTEPG, + ("pmap_remove_pde: pte page ref count error")); + mpte->ref_count = 0; pmap_add_delayed_free_list(mpte, free, FALSE); } } @@ -5709,7 +5709,7 @@ retry: pte = pmap_pde_to_pte(pde, va); if (va < VM_MAXUSER_ADDRESS && mpte == NULL) { mpte = PHYS_TO_VM_PAGE(*pde & PG_FRAME); - mpte->wire_count++; + mpte->ref_count++; } } else if (va < VM_MAXUSER_ADDRESS) { /* @@ -5751,8 +5751,8 @@ retry: * Remove the extra PT page reference. */ if (mpte != NULL) { - mpte->wire_count--; - KASSERT(mpte->wire_count > 0, + mpte->ref_count--; + KASSERT(mpte->ref_count > 0, ("pmap_enter: missing reference to page table page," " va: 0x%lx", va)); } @@ -5873,7 +5873,7 @@ unchanged: * If both the page table page and the reservation are fully * populated, then attempt promotion. */ - if ((mpte == NULL || mpte->wire_count == NPTEPG) && + if ((mpte == NULL || mpte->ref_count == NPTEPG) && pmap_ps_enabled(pmap) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) @@ -5975,10 +5975,10 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t pde = &pde[pmap_pde_index(va)]; oldpde = *pde; if ((oldpde & PG_V) != 0) { - KASSERT(pdpg->wire_count > 1, - ("pmap_enter_pde: pdpg's wire count is too low")); + KASSERT(pdpg->ref_count > 1, + ("pmap_enter_pde: pdpg's reference count is too low")); if ((flags & PMAP_ENTER_NOREPLACE) != 0) { - pdpg->wire_count--; + pdpg->ref_count--; CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); return (KERN_FAILURE); @@ -6152,7 +6152,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ ptepindex = pmap_pde_pindex(va); if (mpte && (mpte->pindex == ptepindex)) { - mpte->wire_count++; + mpte->ref_count++; } else { /* * Get the page directory entry @@ -6169,7 +6169,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (*ptepa & PG_PS) return (NULL); mpte = PHYS_TO_VM_PAGE(*ptepa & PG_FRAME); - mpte->wire_count++; + mpte->ref_count++; } else { /* * Pass NULL instead of the PV list lock @@ -6188,7 +6188,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v } if (*pte) { if (mpte != NULL) { - mpte->wire_count--; + mpte->ref_count--; mpte = NULL; } return (mpte); @@ -6334,8 +6334,8 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_ atomic_add_long(&pmap_pde_mappings, 1); } else { /* Continue on if the PDE is already valid. */ - pdpg->wire_count--; - KASSERT(pdpg->wire_count > 0, + pdpg->ref_count--; + KASSERT(pdpg->ref_count > 0, ("pmap_object_init_pt: missing reference " "to page directory page, va: 0x%lx", addr)); } @@ -6525,13 +6525,13 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ PAGE_SIZE); atomic_add_long(&pmap_pde_mappings, 1); } else - dst_pdpg->wire_count--; + dst_pdpg->ref_count--; continue; } srcptepaddr &= PG_FRAME; srcmpte = PHYS_TO_VM_PAGE(srcptepaddr); - KASSERT(srcmpte->wire_count > 0, + KASSERT(srcmpte->ref_count > 0, ("pmap_copy: source page table page is unused")); if (va_next > end_addr) @@ -6553,7 +6553,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ KASSERT(dstmpte->pindex == pmap_pde_pindex(addr), ("dstmpte pindex/addr mismatch")); - dstmpte->wire_count++; + dstmpte->ref_count++; } else if ((dstmpte = pmap_allocpte(dst_pmap, addr, NULL)) == NULL) goto out; @@ -6586,7 +6586,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ goto out; } /* Have we copied all of the valid mappings? */ - if (dstmpte->wire_count >= srcmpte->wire_count) + if (dstmpte->ref_count >= srcmpte->ref_count) break; } } @@ -6996,9 +6996,9 @@ pmap_remove_pages(pmap_t pmap) KASSERT(mpte->valid == VM_PAGE_BITS_ALL, ("pmap_remove_pages: pte page not promoted")); pmap_resident_count_dec(pmap, 1); - KASSERT(mpte->wire_count == NPTEPG, - ("pmap_remove_pages: pte page wire count error")); - mpte->wire_count = 0; + KASSERT(mpte->ref_count == NPTEPG, + ("pmap_remove_pages: pte page reference count error")); + mpte->ref_count = 0; pmap_add_delayed_free_list(mpte, &free, FALSE); } } else { @@ -8728,7 +8728,7 @@ pmap_emulate_accessed_dirty(pmap_t pmap, vm_offset_t v m = PHYS_TO_VM_PAGE(*pte & PG_FRAME); - if ((mpte == NULL || mpte->wire_count == NPTEPG) && + if ((mpte == NULL || mpte->ref_count == NPTEPG) && pmap_ps_enabled(pmap) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { @@ -8919,12 +8919,12 @@ pmap_quick_remove_page(vm_offset_t addr) /* * Pdp pages from the large map are managed differently from either * kernel or user page table pages. They are permanently allocated at - * initialization time, and their wire count is permanently set to + * initialization time, and their reference count is permanently set to * zero. The pml4 entries pointing to those pages are copied into * each allocated pmap. * * In contrast, pd and pt pages are managed like user page table - * pages. They are dynamically allocated, and their wire count + * pages. They are dynamically allocated, and their reference count * represents the number of valid entries within the page. */ static vm_page_t @@ -9011,7 +9011,7 @@ retry: goto retry; mphys = VM_PAGE_TO_PHYS(m); *pde = mphys | X86_PG_A | X86_PG_RW | X86_PG_V | pg_nx; - PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde))->wire_count++; + PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde))->ref_count++; } else { MPASS((*pde & X86_PG_PS) == 0); mphys = *pde & PG_FRAME; @@ -9131,7 +9131,7 @@ pmap_large_map(vm_paddr_t spa, vm_size_t len, void **a X86_PG_V | X86_PG_A | pg_nx | pmap_cache_bits(kernel_pmap, mattr, TRUE); PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde))-> - wire_count++; + ref_count++; inc = NBPDR; } else { pte = pmap_large_map_pte(va); @@ -9140,7 +9140,7 @@ pmap_large_map(vm_paddr_t spa, vm_size_t len, void **a X86_PG_A | pg_nx | pmap_cache_bits(kernel_pmap, mattr, FALSE); PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pte))-> - wire_count++; + ref_count++; inc = PAGE_SIZE; } } @@ -9209,8 +9209,8 @@ pmap_large_unmap(void *svaa, vm_size_t len) pde_store(pde, 0); inc = NBPDR; m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pde)); - m->wire_count--; - if (m->wire_count == 0) { + m->ref_count--; + if (m->ref_count == 0) { *pdpe = 0; SLIST_INSERT_HEAD(&spgf, m, plinks.s.ss); } @@ -9223,13 +9223,13 @@ pmap_large_unmap(void *svaa, vm_size_t len) pte_clear(pte); inc = PAGE_SIZE; m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pte)); - m->wire_count--; - if (m->wire_count == 0) { + m->ref_count--; + if (m->ref_count == 0) { *pde = 0; SLIST_INSERT_HEAD(&spgf, m, plinks.s.ss); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pde)); - m->wire_count--; - if (m->wire_count == 0) { + m->ref_count--; + if (m->ref_count == 0) { *pdpe = 0; SLIST_INSERT_HEAD(&spgf, m, plinks.s.ss); } @@ -9436,7 +9436,7 @@ static bool pmap_pti_free_page(vm_page_t m) { - KASSERT(m->wire_count > 0, ("page %p not wired", m)); + KASSERT(m->ref_count > 0, ("page %p not referenced", m)); if (!vm_page_unwire_noq(m)) return (false); vm_page_free_zero(m); @@ -9530,7 +9530,7 @@ pmap_pti_wire_pte(void *pte) VM_OBJECT_ASSERT_WLOCKED(pti_obj); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pte)); - m->wire_count++; + m->ref_count++; } static void @@ -9540,8 +9540,8 @@ pmap_pti_unwire_pde(void *pde, bool only_ref) VM_OBJECT_ASSERT_WLOCKED(pti_obj); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pde)); - MPASS(m->wire_count > 0); - MPASS(only_ref || m->wire_count > 1); + MPASS(m->ref_count > 0); + MPASS(only_ref || m->ref_count > 1); pmap_pti_free_page(m); } @@ -9553,7 +9553,7 @@ pmap_pti_unwire_pte(void *pte, vm_offset_t va) VM_OBJECT_ASSERT_WLOCKED(pti_obj); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((uintptr_t)pte)); - MPASS(m->wire_count > 0); + MPASS(m->ref_count > 0); if (pmap_pti_free_page(m)) { pde = pmap_pti_pde(va); MPASS((*pde & (X86_PG_PS | X86_PG_V)) == X86_PG_V); Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed Sep 25 15:51:07 2019 (r352687) +++ head/sys/arm/arm/pmap-v6.c Wed Sep 25 16:11:35 2019 (r352688) @@ -2365,7 +2365,7 @@ pmap_release(pmap_t pmap) * untouched, so the table (strictly speaking a page which holds it) * is never freed if promoted. * - * If a page m->wire_count == 1 then no valid mappings exist in any L2 page + * If a page m->ref_count == 1 then no valid mappings exist in any L2 page * table in the page and the page itself is only mapped in PT2TAB. */ @@ -2376,7 +2376,7 @@ pt2_wirecount_init(vm_page_t m) /* * Note: A page m is allocated with VM_ALLOC_WIRED flag and - * m->wire_count should be already set correctly. + * m->ref_count should be already set correctly. * So, there is no need to set it again herein. */ for (i = 0; i < NPT2_IN_PG; i++) @@ -2396,10 +2396,10 @@ pt2_wirecount_inc(vm_page_t m, uint32_t pte1_idx) */ KASSERT(m->md.pt2_wirecount[pte1_idx & PT2PG_MASK] < (NPTE2_IN_PT2 + 1), ("%s: PT2 is overflowing ...", __func__)); - KASSERT(m->wire_count <= (NPTE2_IN_PG + 1), + KASSERT(m->ref_count <= (NPTE2_IN_PG + 1), ("%s: PT2PG is overflowing ...", __func__)); - m->wire_count++; + m->ref_count++; m->md.pt2_wirecount[pte1_idx & PT2PG_MASK]++; } @@ -2409,10 +2409,10 @@ pt2_wirecount_dec(vm_page_t m, uint32_t pte1_idx) KASSERT(m->md.pt2_wirecount[pte1_idx & PT2PG_MASK] != 0, ("%s: PT2 is underflowing ...", __func__)); - KASSERT(m->wire_count > 1, + KASSERT(m->ref_count > 1, ("%s: PT2PG is underflowing ...", __func__)); - m->wire_count--; + m->ref_count--; m->md.pt2_wirecount[pte1_idx & PT2PG_MASK]--; } @@ -2422,16 +2422,16 @@ pt2_wirecount_set(vm_page_t m, uint32_t pte1_idx, uint KASSERT(count <= NPTE2_IN_PT2, ("%s: invalid count %u", __func__, count)); - KASSERT(m->wire_count > m->md.pt2_wirecount[pte1_idx & PT2PG_MASK], - ("%s: PT2PG corrupting (%u, %u) ...", __func__, m->wire_count, + KASSERT(m->ref_count > m->md.pt2_wirecount[pte1_idx & PT2PG_MASK], + ("%s: PT2PG corrupting (%u, %u) ...", __func__, m->ref_count, m->md.pt2_wirecount[pte1_idx & PT2PG_MASK])); - m->wire_count -= m->md.pt2_wirecount[pte1_idx & PT2PG_MASK]; - m->wire_count += count; + m->ref_count -= m->md.pt2_wirecount[pte1_idx & PT2PG_MASK]; + m->ref_count += count; m->md.pt2_wirecount[pte1_idx & PT2PG_MASK] = count; - KASSERT(m->wire_count <= (NPTE2_IN_PG + 1), - ("%s: PT2PG is overflowed (%u) ...", __func__, m->wire_count)); + KASSERT(m->ref_count <= (NPTE2_IN_PG + 1), + ("%s: PT2PG is overflowed (%u) ...", __func__, m->ref_count)); } static __inline uint32_t @@ -2460,7 +2460,7 @@ static __inline boolean_t pt2pg_is_empty(vm_page_t m) { - return (m->wire_count == 1); + return (m->ref_count == 1); } /* @@ -2634,7 +2634,7 @@ pmap_unwire_pt2pg(pmap_t pmap, vm_offset_t va, vm_page (void)pt2tab_load_clear(pte2p); pmap_tlb_flush(pmap, pt2map_pt2pg(va)); - m->wire_count = 0; + m->ref_count = 0; pmap->pm_stats.resident_count--; /* @@ -2683,8 +2683,8 @@ pmap_unwire_pt2_all(pmap_t pmap, vm_offset_t va, vm_pa KASSERT(m->pindex == (pte1_idx & ~PT2PG_MASK), ("%s: PT2 page's pindex is wrong", __func__)); - KASSERT(m->wire_count > pt2_wirecount_get(m, pte1_idx), - ("%s: bad pt2 wire count %u > %u", __func__, m->wire_count, + KASSERT(m->ref_count > pt2_wirecount_get(m, pte1_idx), + ("%s: bad pt2 wire count %u > %u", __func__, m->ref_count, pt2_wirecount_get(m, pte1_idx))); /* @@ -2949,7 +2949,7 @@ out: m_pc = SLIST_FIRST(&free); SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ - m_pc->wire_count = 1; + m_pc->ref_count = 1; vm_wire_add(1); } vm_page_free_pages_toq(&free, false); @@ -6707,7 +6707,7 @@ pmap_pid_dump(int pid) m = PHYS_TO_VM_PAGE(pa); printf("va: 0x%x, pa: 0x%x, w: %d, " "f: 0x%x", va, pa, - m->wire_count, m->flags); + m->ref_count, m->flags); npte2++; index++; if (index >= 2) { @@ -6818,7 +6818,7 @@ dump_link(pmap_t pmap, uint32_t pte1_idx, boolean_t in pte2_class(pte2), !!(pte2 & PTE2_S), !(pte2 & PTE2_NG), m); if (m != NULL) { printf(" v:%d w:%d f:0x%04X\n", m->valid, - m->wire_count, m->flags); + m->ref_count, m->flags); } else { printf("\n"); } @@ -6892,7 +6892,7 @@ DB_SHOW_COMMAND(pmap, pmap_pmap_print) dump_link_ok = FALSE; } else if (m != NULL) - printf(" w:%d w2:%u", m->wire_count, + printf(" w:%d w2:%u", m->ref_count, pt2_wirecount_get(m, pte1_index(va))); if (pte2 == 0) printf(" !!! pt2tab entry is ZERO"); @@ -6928,7 +6928,7 @@ dump_pt2tab(pmap_t pmap) pte2_class(pte2), !!(pte2 & PTE2_S), m); if (m != NULL) printf(" , w: %d, f: 0x%04X pidx: %lld", - m->wire_count, m->flags, m->pindex); + m->ref_count, m->flags, m->pindex); printf("\n"); } } Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Wed Sep 25 15:51:07 2019 (r352687) +++ head/sys/arm64/arm64/efirt_machdep.c Wed Sep 25 16:11:35 2019 (r352688) @@ -74,7 +74,7 @@ efi_destroy_1t1_map(void) if (obj_1t1_pt != NULL) { VM_OBJECT_RLOCK(obj_1t1_pt); TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) - m->wire_count = VPRC_OBJREF; + m->ref_count = VPRC_OBJREF; vm_wire_sub(obj_1t1_pt->resident_page_count); VM_OBJECT_RUNLOCK(obj_1t1_pt); vm_object_deallocate(obj_1t1_pt); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Sep 25 15:51:07 2019 (r352687) +++ head/sys/arm64/arm64/pmap.c Wed Sep 25 16:11:35 2019 (r352688) @@ -1348,8 +1348,8 @@ pmap_add_delayed_free_list(vm_page_t m, struct spglist } /* - * Decrements a page table page's wire count, which is used to record the - * number of valid page table entries within the page. If the wire count + * Decrements a page table page's reference count, which is used to record the + * number of valid page table entries within the page. If the reference count * drops to zero, then the page table page is unmapped. Returns TRUE if the * page table page was unmapped and FALSE otherwise. */ @@ -1357,8 +1357,8 @@ static inline boolean_t pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) { - --m->wire_count; - if (m->wire_count == 0) { + --m->ref_count; + if (m->ref_count == 0) { _pmap_unwire_l3(pmap, va, m, free); return (TRUE); } else @@ -1423,7 +1423,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t /* * After removing a page table entry, this routine is used to - * conditionally free the page, and manage the hold/wire counts. + * conditionally free the page, and manage the reference count. */ static int pmap_unuse_pt(pmap_t pmap, vm_offset_t va, pd_entry_t ptepde, @@ -1554,7 +1554,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str } } else { l1pg = PHYS_TO_VM_PAGE(tl0 & ~ATTR_MASK); - l1pg->wire_count++; + l1pg->ref_count++; } l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); @@ -1595,7 +1595,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str } } else { l2pg = PHYS_TO_VM_PAGE(tl1 & ~ATTR_MASK); - l2pg->wire_count++; + l2pg->ref_count++; } } @@ -1621,7 +1621,7 @@ retry: if (l1 != NULL && (pmap_load(l1) & ATTR_DESCR_MASK) == L1_TABLE) { /* Add a reference to the L2 page. */ l2pg = PHYS_TO_VM_PAGE(pmap_load(l1) & ~ATTR_MASK); - l2pg->wire_count++; + l2pg->ref_count++; } else { /* Allocate a L2 page. */ l2pindex = pmap_l2_pindex(va) >> Ln_ENTRIES_SHIFT; @@ -1679,7 +1679,7 @@ retry: tpde = pmap_load(pde); if (tpde != 0) { m = PHYS_TO_VM_PAGE(tpde & ~ATTR_MASK); - m->wire_count++; + m->ref_count++; return (m); } break; @@ -2044,7 +2044,7 @@ next_chunk: m_pc = SLIST_FIRST(&free); SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ - m_pc->wire_count = 1; + m_pc->ref_count = 1; } vm_page_free_pages_toq(&free, true); return (m_pc); @@ -2482,9 +2482,9 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ KASSERT(ml3->valid == VM_PAGE_BITS_ALL, ("pmap_remove_l2: l3 page not promoted")); pmap_resident_count_dec(pmap, 1); - KASSERT(ml3->wire_count == NL3PG, - ("pmap_remove_l2: l3 page wire count error")); - ml3->wire_count = 0; + KASSERT(ml3->ref_count == NL3PG, + ("pmap_remove_l2: l3 page ref count error")); + ml3->ref_count = 0; pmap_add_delayed_free_list(ml3, free, FALSE); } } @@ -3229,7 +3229,7 @@ retry: l3 = pmap_l2_to_l3(pde, va); if (va < VM_MAXUSER_ADDRESS && mpte == NULL) { mpte = PHYS_TO_VM_PAGE(pmap_load(pde) & ~ATTR_MASK); - mpte->wire_count++; + mpte->ref_count++; } goto havel3; } else if (pde != NULL && lvl == 1) { @@ -3240,7 +3240,7 @@ retry: if (va < VM_MAXUSER_ADDRESS) { mpte = PHYS_TO_VM_PAGE( pmap_load(l2) & ~ATTR_MASK); - mpte->wire_count++; + mpte->ref_count++; } goto havel3; } @@ -3291,8 +3291,8 @@ havel3: * Remove the extra PT page reference. */ if (mpte != NULL) { - mpte->wire_count--; - KASSERT(mpte->wire_count > 0, + mpte->ref_count--; + KASSERT(mpte->ref_count > 0, ("pmap_enter: missing reference to page table page," " va: 0x%lx", va)); } @@ -3417,7 +3417,7 @@ validate: } #if VM_NRESERVLEVEL > 0 - if ((mpte == NULL || mpte->wire_count == NL3PG) && + if ((mpte == NULL || mpte->ref_count == NL3PG) && pmap_ps_enabled(pmap) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { @@ -3494,10 +3494,10 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t l2 = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(l2pg)); l2 = &l2[pmap_l2_index(va)]; if ((old_l2 = pmap_load(l2)) != 0) { - KASSERT(l2pg->wire_count > 1, - ("pmap_enter_l2: l2pg's wire count is too low")); + KASSERT(l2pg->ref_count > 1, + ("pmap_enter_l2: l2pg's ref count is too low")); if ((flags & PMAP_ENTER_NOREPLACE) != 0) { - l2pg->wire_count--; + l2pg->ref_count--; CTR2(KTR_PMAP, "pmap_enter_l2: failure for va %#lx in pmap %p", va, pmap); @@ -3671,7 +3671,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ l2pindex = pmap_l2_pindex(va); if (mpte && (mpte->pindex == l2pindex)) { - mpte->wire_count++; + mpte->ref_count++; } else { /* * Get the l2 entry @@ -3693,7 +3693,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (lvl == 2 && pmap_load(pde) != 0) { mpte = PHYS_TO_VM_PAGE(pmap_load(pde) & ~ATTR_MASK); - mpte->wire_count++; + mpte->ref_count++; } else { /* * Pass NULL instead of the PV list lock @@ -3722,7 +3722,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ if (pmap_load(l3) != 0) { if (mpte != NULL) { - mpte->wire_count--; + mpte->ref_count--; mpte = NULL; } return (mpte); @@ -3952,14 +3952,14 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ PAGE_SIZE); atomic_add_long(&pmap_l2_mappings, 1); } else - dst_l2pg->wire_count--; + dst_l2pg->ref_count--; continue; } KASSERT((srcptepaddr & ATTR_DESCR_MASK) == L2_TABLE, ("pmap_copy: invalid L2 entry")); srcptepaddr &= ~ATTR_MASK; srcmpte = PHYS_TO_VM_PAGE(srcptepaddr); - KASSERT(srcmpte->wire_count > 0, + KASSERT(srcmpte->ref_count > 0, ("pmap_copy: source page table page is unused")); if (va_next > end_addr) va_next = end_addr; @@ -3978,7 +3978,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ if (dstmpte != NULL) { KASSERT(dstmpte->pindex == pmap_l2_pindex(addr), ("dstmpte pindex/addr mismatch")); - dstmpte->wire_count++; + dstmpte->ref_count++; } else if ((dstmpte = pmap_alloc_l3(dst_pmap, addr, NULL)) == NULL) goto out; @@ -4017,7 +4017,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ goto out; } /* Have we copied all of the valid mappings? */ - if (dstmpte->wire_count >= srcmpte->wire_count) + if (dstmpte->ref_count >= srcmpte->ref_count) break; } } @@ -4382,9 +4382,9 @@ pmap_remove_pages(pmap_t pmap) KASSERT(ml3->valid == VM_PAGE_BITS_ALL, ("pmap_remove_pages: l3 page not promoted")); pmap_resident_count_dec(pmap,1); - KASSERT(ml3->wire_count == NL3PG, - ("pmap_remove_pages: l3 page wire count error")); - ml3->wire_count = 0; + KASSERT(ml3->ref_count == NL3PG, + ("pmap_remove_pages: l3 page ref count error")); + ml3->ref_count = 0; pmap_add_delayed_free_list(ml3, &free, FALSE); } @@ -5521,7 +5521,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_ } if (va < VM_MAXUSER_ADDRESS) { - ml3->wire_count = NL3PG; + ml3->ref_count = NL3PG; pmap_resident_count_inc(pmap, 1); } } Modified: head/sys/dev/agp/agp_i810.c ============================================================================== --- head/sys/dev/agp/agp_i810.c Wed Sep 25 15:51:07 2019 (r352687) +++ head/sys/dev/agp/agp_i810.c Wed Sep 25 16:11:35 2019 (r352688) @@ -1954,7 +1954,7 @@ agp_intel_gtt_insert_pages(device_t dev, u_int first_e sc = device_get_softc(dev); for (i = 0; i < num_entries; i++) { MPASS(pages[i]->valid == VM_PAGE_BITS_ALL); - MPASS(pages[i]->wire_count > 0); + MPASS(pages[i]->ref_count > 0); sc->match->driver->install_gtt_pte(dev, first_entry + i, VM_PAGE_TO_PHYS(pages[i]), flags); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Sep 25 15:51:07 2019 (r352687) +++ head/sys/i386/i386/pmap.c Wed Sep 25 16:11:35 2019 (r352688) @@ -992,7 +992,7 @@ __CONCAT(PMTYPE, init)(void) ("pmap_init: page table page is out of range")); mpte->pindex = i + KPTDI; mpte->phys_addr = KPTphys + ptoa(i); - mpte->wire_count = 1; + mpte->ref_count = 1; /* * Collect the page table pages that were replaced by a 2/4MB @@ -1952,8 +1952,8 @@ pmap_remove_pt_page(pmap_t pmap, vm_offset_t va) } /* - * Decrements a page table page's wire count, which is used to record the - * number of valid page table entries within the page. If the wire count + * Decrements a page table page's reference count, which is used to record the + * number of valid page table entries within the page. If the reference count * drops to zero, then the page table page is unmapped. Returns TRUE if the * page table page was unmapped and FALSE otherwise. */ @@ -1961,8 +1961,8 @@ static inline boolean_t pmap_unwire_ptp(pmap_t pmap, vm_page_t m, struct spglist *free) { - --m->wire_count; - if (m->wire_count == 0) { + --m->ref_count; + if (m->ref_count == 0) { _pmap_unwire_ptp(pmap, m, free); return (TRUE); } else @@ -1992,7 +1992,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, struct spgl /* * After removing a page table entry, this routine is used to - * conditionally free the page, and manage the hold/wire counts. + * conditionally free the page, and manage the reference count. */ static int pmap_unuse_pt(pmap_t pmap, vm_offset_t va, struct spglist *free) @@ -2171,7 +2171,7 @@ retry: */ if (ptepa) { m = PHYS_TO_VM_PAGE(ptepa & PG_FRAME); - m->wire_count++; + m->ref_count++; } else { /* * Here if the pte page isn't mapped, or if it has @@ -2438,7 +2438,7 @@ out: m_pc = SLIST_FIRST(&free); SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ - m_pc->wire_count = 1; + m_pc->ref_count = 1; } vm_page_free_pages_toq(&free, true); return (m_pc); @@ -2797,7 +2797,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offse return (FALSE); } if (pmap != kernel_pmap) { - mpte->wire_count = NPTEPG; + mpte->ref_count = NPTEPG; pmap->pm_stats.resident_count++; } } @@ -2993,9 +2993,9 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse KASSERT(mpte->valid == VM_PAGE_BITS_ALL, ("pmap_remove_pde: pte page not promoted")); pmap->pm_stats.resident_count--; - KASSERT(mpte->wire_count == NPTEPG, - ("pmap_remove_pde: pte page wire count error")); - mpte->wire_count = 0; + KASSERT(mpte->ref_count == NPTEPG, + ("pmap_remove_pde: pte page ref count error")); + mpte->ref_count = 0; pmap_add_delayed_free_list(mpte, free, FALSE); } } @@ -3731,8 +3731,8 @@ __CONCAT(PMTYPE, enter)(pmap_t pmap, vm_offset_t va, v * Remove the extra PT page reference. */ if (mpte != NULL) { - mpte->wire_count--; - KASSERT(mpte->wire_count > 0, + mpte->ref_count--; + KASSERT(mpte->ref_count > 0, ("pmap_enter: missing reference to page table page," " va: 0x%x", va)); } @@ -3853,7 +3853,7 @@ unchanged: * If both the page table page and the reservation are fully * populated, then attempt promotion. */ - if ((mpte == NULL || mpte->wire_count == NPTEPG) && + if ((mpte == NULL || mpte->ref_count == NPTEPG) && pg_ps_enabled && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) pmap_promote_pde(pmap, pde, va); @@ -4076,7 +4076,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ ptepindex = va >> PDRSHIFT; if (mpte && (mpte->pindex == ptepindex)) { - mpte->wire_count++; + mpte->ref_count++; } else { /* * Get the page directory entry @@ -4091,7 +4091,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (ptepa & PG_PS) return (NULL); mpte = PHYS_TO_VM_PAGE(ptepa & PG_FRAME); - mpte->wire_count++; + mpte->ref_count++; } else { mpte = _pmap_allocpte(pmap, ptepindex, PMAP_ENTER_NOSLEEP); @@ -4107,7 +4107,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v pte = pmap_pte_quick(pmap, va); if (*pte) { if (mpte != NULL) { - mpte->wire_count--; + mpte->ref_count--; mpte = NULL; } sched_unpin(); @@ -4402,7 +4402,7 @@ __CONCAT(PMTYPE, copy)(pmap_t dst_pmap, pmap_t src_pma } srcmpte = PHYS_TO_VM_PAGE(srcptepaddr & PG_FRAME); - KASSERT(srcmpte->wire_count > 0, + KASSERT(srcmpte->ref_count > 0, ("pmap_copy: source page table page is unused")); if (pdnxt > end_addr) @@ -4442,7 +4442,7 @@ __CONCAT(PMTYPE, copy)(pmap_t dst_pmap, pmap_t src_pma } goto out; } - if (dstmpte->wire_count >= srcmpte->wire_count) + if (dstmpte->ref_count >= srcmpte->ref_count) break; } addr += PAGE_SIZE; @@ -4829,9 +4829,9 @@ __CONCAT(PMTYPE, remove_pages)(pmap_t pmap) KASSERT(mpte->valid == VM_PAGE_BITS_ALL, ("pmap_remove_pages: pte page not promoted")); pmap->pm_stats.resident_count--; - KASSERT(mpte->wire_count == NPTEPG, - ("pmap_remove_pages: pte page wire count error")); - mpte->wire_count = 0; + KASSERT(mpte->ref_count == NPTEPG, + ("pmap_remove_pages: pte page ref count error")); + mpte->ref_count = 0; pmap_add_delayed_free_list(mpte, &free, FALSE); } } else { Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Sep 25 15:51:07 2019 (r352687) +++ head/sys/mips/mips/pmap.c Wed Sep 25 16:11:35 2019 (r352688) @@ -983,8 +983,8 @@ pmap_qremove(vm_offset_t va, int count) ***************************************************/ /* - * Decrements a page table page's wire count, which is used to record the - * number of valid page table entries within the page. If the wire count + * Decrements a page table page's reference count, which is used to record the + * number of valid page table entries within the page. If the reference count * drops to zero, then the page table page is unmapped. Returns TRUE if the * page table page was unmapped and FALSE otherwise. */ @@ -992,8 +992,8 @@ static PMAP_INLINE boolean_t pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m) { - --m->wire_count; - if (m->wire_count == 0) { + --m->ref_count; + if (m->ref_count == 0) { _pmap_unwire_ptp(pmap, va, m); return (TRUE); } else @@ -1043,7 +1043,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_ /* * After removing a page table entry, this routine is used to - * conditionally free the page, and manage the hold/wire counts. + * conditionally free the page, and manage the reference count. */ static int pmap_unuse_pt(pmap_t pmap, vm_offset_t va, pd_entry_t pde) @@ -1194,7 +1194,7 @@ _pmap_allocpte(pmap_t pmap, unsigned ptepindex, u_int } } else { pg = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(*pdep)); - pg->wire_count++; + pg->ref_count++; } /* Next level entry */ pde = (pd_entry_t *)*pdep; @@ -1230,7 +1230,7 @@ retry: */ if (pde != NULL && *pde != NULL) { m = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(*pde)); - m->wire_count++; + m->ref_count++; } else { /* * Here if the pte page isn't mapped, or if it has been @@ -2124,7 +2124,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v * Remove extra pte reference */ if (mpte) - mpte->wire_count--; + mpte->ref_count--; if (pte_test(&origpte, PTE_MANAGED)) { m->md.pv_flags |= PV_TABLE_REF; @@ -2165,8 +2165,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v pmap_invalidate_page(pmap, va); origpte = 0; if (mpte != NULL) { - mpte->wire_count--; - KASSERT(mpte->wire_count > 0, + mpte->ref_count--; + KASSERT(mpte->ref_count > 0, ("pmap_enter: missing reference to page table page," " va: %p", (void *)va)); } @@ -2276,7 +2276,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ ptepindex = pmap_pde_pindex(va); if (mpte && (mpte->pindex == ptepindex)) { - mpte->wire_count++; + mpte->ref_count++; } else { /* * Get the page directory entry @@ -2290,7 +2290,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (pde && *pde != 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Sep 25 16:45: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 006A212C84B; Wed, 25 Sep 2019 16:45:45 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) (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 46dkT35rsgz488F; Wed, 25 Sep 2019 16:45:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f68.google.com with SMTP id u8so511343iom.5; Wed, 25 Sep 2019 09:45:43 -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=koProXzroGRAcLZolTphazxSx4KXyOZaojrB5uUU0JY=; b=WrwF90V5IJ8gjlOdH5SjfCqkzd3bNZOrgIjH2r6Ho4awJyAFCGMGI/7khlmEmQTkxt gXujBzvYm0M8dgcQQPVviqrrwXZwl/lKkrvl5RDbCd81VTRkOJx0v6MPQF9xG8moCof2 DjpgedS4QNj/XtugBy6m13AGt2h2CrPrVc5Ey5x5P2lwpj+BpkV/n6c9uq7D7Ub96WpU 6dxnHXhlcFxY8nhwL+VgTJZyGywL+A70/B1dgon9t5ReFu7Ioy2ErlN/728IAz/8qXxg shcEB+IMPxvmkssX2g+0Lfgb6EKBnuoAYP5sgRNhoxdZyNYEJ40Te7m+6rGpD4rdhIgz tAXg== X-Gm-Message-State: APjAAAVrM9hD8r1o0tYnHgZzKz/cLHIEEU95K/1YHXPh+hs9pnbyPzz+ RwP9VEC6pocsG9KU24tosSP5a8Cj+3G6xS5tVSo= X-Google-Smtp-Source: APXvYqwn+T+vIC4lSADYByF2056kNki3sCOj9rslngx6O2qM7wv234lU4FQDBoncFj1y4zu6cdadIvK1rDH0FylJK70= X-Received: by 2002:a6b:254:: with SMTP id 81mr282303ioc.17.1569429942144; Wed, 25 Sep 2019 09:45:42 -0700 (PDT) MIME-Version: 1.0 References: <201909021356.x82Dui6v077765@repo.freebsd.org> <20190920212702.N1017@besplex.bde.org> <20190926002410.M1471@besplex.bde.org> In-Reply-To: <20190926002410.M1471@besplex.bde.org> From: Ed Maste Date: Wed, 25 Sep 2019 12:45:29 -0400 Message-ID: Subject: Re: svn commit: r351700 - head/lib/libc/string To: Bruce Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46dkT35rsgz488F X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.68 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-3.60 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[68.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.60)[ip: (-2.46), ipnet: 209.85.128.0/17(-3.29), asn: 15169(-2.18), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RWL_MAILSPIKE_POSSIBLE(0.00)[68.166.85.209.rep.mailspike.net : 127.0.0.17]; 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)[emaste@freebsd.org,carpeddiem@gmail.com]; 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: Wed, 25 Sep 2019 16:45:45 -0000 On Wed, 25 Sep 2019 at 11:46, Bruce Evans wrote: > > On Wed, 25 Sep 2019, Ed Maste wrote: > > > On Fri, 20 Sep 2019 at 08:14, Bruce Evans wrote: > >> > >> Optimizing this function [memchr] is especially unimportant, > > > > Why? > > Because it is almost never used, and most of its uses are unimportant. > > It is used a whole 26 times in all of /usr/src/*bin: Sure, but libc exists for the benefit of more than just the FreeBSD base system. Open source software and proprietary products built on FreeBSD make use of memchr and other string routines and have performance concerns. > But how do you know that long strings are most common? For short strings, > it is better to have low overhead. Indeed, there is a trade-off. Some ad-hoc testing confirms the original implementation is faster for byte strings of less than 8 bytes (as one would expect), and showed it slower above that. > LONG_BIT is another bad way of encoding the word size. On arches with > correctly sized longs, long is twice as wide as either a machine register > or the maximum memory access width. So it is usually twice the word size > if correct. One can argue that all of our 64-bit archs have incorrectly sized longs then, but I don't find that useful. The compilers and machines FreeBSD runs on have 64-bit longs on 64-bit processors. > register_t is closer to being correct. That makes sense, although not currently used for that purpose anywhere in libc (or other libs) that I can see. From owner-svn-src-head@freebsd.org Wed Sep 25 16:49: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 1CEE712C90E; Wed, 25 Sep 2019 16:49:23 +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 46dkYG713Bz48Jk; Wed, 25 Sep 2019 16:49:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3E7B1A96C; Wed, 25 Sep 2019 16:49:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8PGnMwQ034511; Wed, 25 Sep 2019 16:49:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PGnMBT034510; Wed, 25 Sep 2019 16:49:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909251649.x8PGnMBT034510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 25 Sep 2019 16:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352689 - head/lib/libc/i386/string X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc/i386/string X-SVN-Commit-Revision: 352689 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: Wed, 25 Sep 2019 16:49:23 -0000 Author: emaste Date: Wed Sep 25 16:49:22 2019 New Revision: 352689 URL: https://svnweb.freebsd.org/changeset/base/352689 Log: remove obsolete i386 MD memchr implementation bde reports (in a reply to r351700 commit mail): This uses scasb, which was last optimal on the 8086, or perhaps the original i386. On freefall, it is several times slower than the naive translation of the naive C code. Reported by: bde Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21785 Deleted: head/lib/libc/i386/string/memchr.S Modified: head/lib/libc/i386/string/Makefile.inc Modified: head/lib/libc/i386/string/Makefile.inc ============================================================================== --- head/lib/libc/i386/string/Makefile.inc Wed Sep 25 16:11:35 2019 (r352688) +++ head/lib/libc/i386/string/Makefile.inc Wed Sep 25 16:49:22 2019 (r352689) @@ -5,7 +5,6 @@ MDSRCS+= \ bcopy.S \ bzero.S \ ffs.S \ - memchr.S \ memcmp.S \ memcpy.S \ memmove.S \ From owner-svn-src-head@freebsd.org Wed Sep 25 17:08: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 6EFF012D499; Wed, 25 Sep 2019 17:08:36 +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 46dkzS2Gkqz4B3x; Wed, 25 Sep 2019 17:08:36 +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 2C7021AD02; Wed, 25 Sep 2019 17:08:36 +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 x8PH8aNu046764; Wed, 25 Sep 2019 17:08:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PH8a3s046763; Wed, 25 Sep 2019 17:08:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909251708.x8PH8a3s046763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 25 Sep 2019 17:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352690 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 352690 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: Wed, 25 Sep 2019 17:08:36 -0000 Author: markj Date: Wed Sep 25 17:08:35 2019 New Revision: 352690 URL: https://svnweb.freebsd.org/changeset/base/352690 Log: Add some counters for per-VM page events. For now, just count batched page queue state operations. vm.stats.page.queue_ops counts the number of batch entries that successfully completed, while queue_nops counts entries that had no effect, which occurs when the queue operation had been completed before the batch entry was processed. Reviewed by: alc, kib MFC after: 1 week Sponsored by: Intel, Netflix Differential Revision: https://reviews.freebsd.org/D21782 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Sep 25 16:49:22 2019 (r352689) +++ head/sys/vm/vm_page.c Wed Sep 25 17:08:35 2019 (r352690) @@ -73,11 +73,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include #include +#include #include #include #include @@ -130,6 +131,28 @@ static int vm_min_waiters; static int vm_severe_waiters; static int vm_pageproc_waiters; +static SYSCTL_NODE(_vm_stats, OID_AUTO, page, CTLFLAG_RD, 0, + "VM page statistics"); + +static counter_u64_t queue_ops = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, queue_ops, + CTLFLAG_RD, &queue_ops, + "Number of batched queue operations"); + +static counter_u64_t queue_nops = EARLY_COUNTER; +SYSCTL_COUNTER_U64(_vm_stats_page, OID_AUTO, queue_nops, + CTLFLAG_RD, &queue_nops, + "Number of batched queue operations with no effects"); + +static void +counter_startup(void) +{ + + queue_ops = counter_u64_alloc(M_WAITOK); + queue_nops = counter_u64_alloc(M_WAITOK); +} +SYSINIT(page_counters, SI_SUB_CPU, SI_ORDER_ANY, counter_startup, NULL); + /* * bogus page -- for I/O to/from partially complete buffers, * or for paging into sparsely invalid regions. @@ -3117,6 +3140,7 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_pa if (__predict_true((qflags & PGA_ENQUEUED) != 0)) vm_pagequeue_remove(pq, m); vm_page_dequeue_complete(m); + counter_u64_add(queue_ops, 1); } else if ((qflags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) { if ((qflags & PGA_ENQUEUED) != 0) TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); @@ -3141,6 +3165,9 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_pa vm_page_aflag_clear(m, qflags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)); + counter_u64_add(queue_ops, 1); + } else { + counter_u64_add(queue_nops, 1); } } From owner-svn-src-head@freebsd.org Wed Sep 25 17:14: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 D952612D69A; Wed, 25 Sep 2019 17:14:44 +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 46dl6X5NfQz4BTW; Wed, 25 Sep 2019 17:14:44 +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 991861AED2; Wed, 25 Sep 2019 17:14:44 +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 x8PHEi6j052620; Wed, 25 Sep 2019 17:14:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHEi0h052617; Wed, 25 Sep 2019 17:14:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251714.x8PHEi0h052617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 17:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352691 - in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Commit-Revision: 352691 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: Wed, 25 Sep 2019 17:14:44 -0000 Author: kevans Date: Wed Sep 25 17:14:43 2019 New Revision: 352691 URL: https://svnweb.freebsd.org/changeset/base/352691 Log: bsdgrep(1): various fixes of empty pattern/exit code/-c behavior When an empty pattern is encountered in the pattern list, I had previously broken bsdgrep to count that as a "match all" and ignore any other patterns in the list. This commit rectifies that mistake, among others: - The -v flag semantics were not quite right; lines matched should have been counted differently based on whether the -v flag was set or not. procline now definitively returns whether it's matched or not, and interpreting that result has been kicked up a level. - Empty patterns with the -x flag was broken similarly to empty patterns with the -w flag. The former is a whole-line match and should be more strict, only matching blank lines. No -x and no -w will will match the empty string at the beginning of each line. - The exit code with -L was broken, w.r.t. modern grep. Modern grap will exit(0) if any file that didn't match was output, so our interpretation was simply backwards. The new interpretation makes sense to me. Tests updated and added to try and catch some of this. This misbehavior was found by autoconf while fixing ports found in PR 229925 expecting either a more sane or a more GNU-like sed. MFC after: 1 week Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh head/usr.bin/grep/grep.c head/usr.bin/grep/util.c Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Wed Sep 25 17:08:35 2019 (r352690) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Wed Sep 25 17:14:43 2019 (r352691) @@ -413,6 +413,60 @@ wflag_emptypat_body() atf_check -o file:test4 grep -w -e "" test4 } +atf_test_case xflag_emptypat +xflag_emptypat_body() +{ + printf "" > test1 + printf "\n" > test2 + printf "qaz" > test3 + printf " qaz\n" > test4 + + # -x is whole-line, more strict than -w. + atf_check -s exit:1 -o empty grep -x -e "" test1 + + atf_check -o file:test2 grep -x -e "" test2 + + atf_check -s exit:1 -o empty grep -x -e "" test3 + + atf_check -s exit:1 -o empty grep -x -e "" test4 + + total=$(wc -l /COPYRIGHT | sed 's/[^0-9]//g') + + # Simple checks that grep -x with an empty pattern isn't matching every + # line. The exact counts aren't important, as long as they don't + # match the total line count and as long as they don't match each other. + atf_check -o save:xpositive.count grep -Fxc '' /COPYRIGHT + atf_check -o save:xnegative.count grep -Fvxc '' /COPYRIGHT + + atf_check -o not-inline:"${total}" cat xpositive.count + atf_check -o not-inline:"${total}" cat xnegative.count + + atf_check -o not-file:xnegative.count cat xpositive.count +} + +atf_test_case xflag_emptypat_plus +xflag_emptypat_plus_body() +{ + printf "foo\n\nbar\n\nbaz\n" > target + printf "foo\n \nbar\n \nbaz\n" > target_spacelines + printf "foo\nbar\nbaz\n" > matches + printf " \n \n" > spacelines + + printf "foo\n\nbar\n\nbaz\n" > patlist1 + printf "foo\n\nba\n\nbaz\n" > patlist2 + + sed -e '/bar/d' target > matches_not2 + + # Normal handling first + atf_check -o file:target grep -Fxf patlist1 target + atf_check -o file:matches grep -Fxf patlist1 target_spacelines + atf_check -o file:matches_not2 grep -Fxf patlist2 target + + # -v handling + atf_check -s exit:1 -o empty grep -Fvxf patlist1 target + atf_check -o file:spacelines grep -Fxvf patlist1 target_spacelines +} + atf_test_case excessive_matches excessive_matches_head() { @@ -551,6 +605,12 @@ grep_nomatch_flags_head() grep_nomatch_flags_body() { + grep_type + + if [ $? -eq $GREP_TYPE_GNU_FREEBSD ]; then + atf_expect_fail "this test does not pass with GNU grep in base" + fi + printf "A\nB\nC\n" > test1 atf_check -o inline:"1\n" grep -c -C 1 -e "B" test1 @@ -563,7 +623,7 @@ grep_nomatch_flags_body() atf_check -o inline:"test1\n" grep -l -A 1 -e "B" test1 atf_check -o inline:"test1\n" grep -l -C 1 -e "B" test1 - atf_check -s exit:1 -o inline:"test1\n" grep -L -e "D" test1 + atf_check -o inline:"test1\n" grep -L -e "D" test1 atf_check -o empty grep -q -e "B" test1 atf_check -o empty grep -q -B 1 -e "B" test1 @@ -777,6 +837,8 @@ atf_init_test_cases() atf_add_test_case egrep_empty_invalid atf_add_test_case zerolen atf_add_test_case wflag_emptypat + atf_add_test_case xflag_emptypat + atf_add_test_case xflag_emptypat_plus atf_add_test_case excessive_matches atf_add_test_case wv_combo_break atf_add_test_case fgrep_sanity Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Wed Sep 25 17:08:35 2019 (r352690) +++ head/usr.bin/grep/grep.c Wed Sep 25 17:14:43 2019 (r352691) @@ -218,20 +218,9 @@ static void add_pattern(char *pat, size_t len) { - /* Do not add further pattern is we already match everything */ - if (matchall) - return; - /* Check if we can do a shortcut */ if (len == 0) { matchall = true; - for (unsigned int i = 0; i < patterns; i++) { - free(pattern[i].pat); - } - pattern = grep_realloc(pattern, sizeof(struct pat)); - pattern[0].pat = NULL; - pattern[0].len = 0; - patterns = 1; return; } /* Increase size if necessary */ @@ -654,7 +643,7 @@ main(int argc, char *argv[]) aargv += optind; /* Empty pattern file matches nothing */ - if (!needpattern && (patterns == 0)) + if (!needpattern && (patterns == 0) && !matchall) exit(1); /* Fail if we don't have any pattern */ @@ -701,11 +690,10 @@ main(int argc, char *argv[]) r_pattern = grep_calloc(patterns, sizeof(*r_pattern)); - /* Don't process any patterns if we have a blank one */ #ifdef WITH_INTERNAL_NOSPEC - if (!matchall && grepbehave != GREP_FIXED) { + if (grepbehave != GREP_FIXED) { #else - if (!matchall) { + { #endif /* Check if cheating is allowed (always is for fgrep). */ for (i = 0; i < patterns; ++i) { @@ -737,7 +725,12 @@ main(int argc, char *argv[]) matched = true; } - /* Find out the correct return value according to the - results and the command line option. */ + if (Lflag) + matched = !matched; + + /* + * Calculate the correct return value according to the + * results and the command line option. + */ exit(matched ? (file_err ? (qflag ? 0 : 2) : 0) : (file_err ? 2 : 1)); } Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Wed Sep 25 17:08:35 2019 (r352690) +++ head/usr.bin/grep/util.c Wed Sep 25 17:14:43 2019 (r352691) @@ -210,7 +210,7 @@ procmatch_match(struct mprintc *mc, struct parsec *pc) while (pc->matchidx >= MAX_MATCHES) { /* Reset matchidx and try again */ pc->matchidx = 0; - if (procline(pc)) + if (procline(pc) == !vflag) printline(pc, ':'); else break; @@ -355,7 +355,7 @@ procfile(const char *fn) return (0); } - line_matched = procline(&pc); + line_matched = procline(&pc) == !vflag; if (line_matched) ++lines; @@ -469,18 +469,33 @@ procline(struct parsec *pc) matchidx = pc->matchidx; - /* Special case: empty pattern with -w flag, check first character */ - if (matchall && wflag) { + /* + * With matchall (empty pattern), we can try to take some shortcuts. + * Emtpy patterns trivially match every line except in the -w and -x + * cases. For -w (whole-word) cases, we only match if the first + * character isn't a word-character. For -x (whole-line) cases, we only + * match if the line is empty. + */ + if (matchall) { if (pc->ln.len == 0) return (true); - wend = L' '; - if (sscanf(&pc->ln.dat[0], "%lc", &wend) != 1 || iswword(wend)) - return (false); - else + if (wflag) { + wend = L' '; + if (sscanf(&pc->ln.dat[0], "%lc", &wend) == 1 && + !iswword(wend)) + return (true); + } else if (!xflag) return (true); - } else if (matchall) - return (true); + /* + * If we don't have any other patterns, we really don't match. + * If we do have other patterns, we must fall through and check + * them. + */ + if (patterns == 0) + return (false); + } + matched = false; st = pc->lnstart; nst = 0; @@ -609,8 +624,6 @@ procline(struct parsec *pc) /* Reflect the new matchidx in the context */ pc->matchidx = matchidx; - if (vflag) - matched = !matched; return matched; } From owner-svn-src-head@freebsd.org Wed Sep 25 17:29: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 8C51612DCB4; Wed, 25 Sep 2019 17:29:46 +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 46dlRt3BM3z4CVg; Wed, 25 Sep 2019 17:29: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 506001B0B1; Wed, 25 Sep 2019 17:29: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 x8PHTkjk058786; Wed, 25 Sep 2019 17:29:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHTj8J058784; Wed, 25 Sep 2019 17:29:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251729.x8PHTj8J058784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 17:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352693 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 352693 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: Wed, 25 Sep 2019 17:29:46 -0000 Author: kevans Date: Wed Sep 25 17:29:45 2019 New Revision: 352693 URL: https://svnweb.freebsd.org/changeset/base/352693 Log: Add COMPAT12 support to makesyscalls.sh Reviewed by: kib, imp, brooks (all without syscalls.master edits) Differential Revision: https://reviews.freebsd.org/D21366 Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/makesyscalls.sh head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Sep 25 17:16:21 2019 (r352692) +++ head/sys/compat/freebsd32/syscalls.master Wed Sep 25 17:29:45 2019 (r352693) @@ -13,7 +13,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, -; COMPAT7, COMPAT11, NODEF, NOARGS, NOPROTO, NOSTD +; COMPAT7, COMPAT11, COMPAT12, NODEF, NOARGS, NOPROTO, NOSTD ; The COMPAT* options may be combined with one or more NO* ; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) ; name pseudo-prototype of syscall routine @@ -31,6 +31,7 @@ ; COMPAT7 included on COMPAT_FREEBSD7 #ifdef (FreeBSD 7 compat) ; COMPAT10 included on COMPAT_FREEBSD10 #ifdef (FreeBSD 10 compat) ; COMPAT11 included on COMPAT_FREEBSD11 #ifdef (FreeBSD 11 compat) +; COMPAT12 included on COMPAT_FREEBSD12 #ifdef (FreeBSD 12 compat) ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Wed Sep 25 17:16:21 2019 (r352692) +++ head/sys/kern/makesyscalls.sh Wed Sep 25 17:29:45 2019 (r352693) @@ -11,6 +11,7 @@ compat6=COMPAT_FREEBSD6 compat7=COMPAT_FREEBSD7 compat10=COMPAT_FREEBSD10 compat11=COMPAT_FREEBSD11 +compat12=COMPAT_FREEBSD12 # output files: sysnames="syscalls.c" @@ -39,6 +40,8 @@ syscompat10="sysent.compat10.$$" syscompat10dcl="sysent.compat10dcl.$$" syscompat11="sysent.compat11.$$" syscompat11dcl="sysent.compat11dcl.$$" +syscompat12="sysent.compat12.$$" +syscompat12dcl="sysent.compat12dcl.$$" sysent="sysent.switch.$$" sysinc="sysinc.switch.$$" sysarg="sysarg.switch.$$" @@ -47,9 +50,9 @@ systracetmp="systrace.$$" systraceret="systraceret.$$" capabilities_conf="capabilities.conf" -trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $syscompat11 $syscompat11dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0 +trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $syscompat11 $syscompat11dcl $syscompat12 $syscompat12dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0 -touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $syscompat11 $syscompat11dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret +touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $syscompat11 $syscompat11dcl $syscompat12 $syscompat12dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret case $# in 0) echo "usage: $0 input-file " 1>&2 @@ -118,6 +121,8 @@ sed -e ' syscompat10dcl = \"$syscompat10dcl\" syscompat11 = \"$syscompat11\" syscompat11dcl = \"$syscompat11dcl\" + syscompat12 = \"$syscompat12\" + syscompat12dcl = \"$syscompat12dcl\" sysent = \"$sysent\" syssw = \"$syssw\" sysinc = \"$sysinc\" @@ -134,6 +139,7 @@ sed -e ' compat7 = \"$compat7\" compat10 = \"$compat10\" compat11 = \"$compat11\" + compat12 = \"$compat12\" syscallprefix = \"$syscallprefix\" switchname = \"$switchname\" namesname = \"$namesname\" @@ -188,6 +194,7 @@ sed -e ' printf "\n#ifdef %s\n\n", compat7 > syscompat7 printf "\n#ifdef %s\n\n", compat10 > syscompat10 printf "\n#ifdef %s\n\n", compat11 > syscompat11 + printf "\n#ifdef %s\n\n", compat12 > syscompat12 printf "/*\n * System call names.\n *\n" > sysnames printf " * DO NOT EDIT-- this file is automatically " generated ".\n" > sysnames @@ -239,6 +246,7 @@ sed -e ' print > syscompat7 print > syscompat10 print > syscompat11 + print > syscompat12 print > sysnames print > systrace print > systracetmp @@ -256,6 +264,7 @@ sed -e ' print > syscompat7 print > syscompat10 print > syscompat11 + print > syscompat12 print > sysnames print > systrace print > systracetmp @@ -273,6 +282,7 @@ sed -e ' print > syscompat7 print > syscompat10 print > syscompat11 + print > syscompat12 print > sysnames print > systrace print > systracetmp @@ -409,6 +419,8 @@ sed -e ' argalias = "freebsd10_" argalias if (flag("COMPAT11")) argalias = "freebsd11_" argalias + if (flag("COMPAT12")) + argalias = "freebsd12_" argalias } f++ @@ -569,7 +581,8 @@ sed -e ' next } type("COMPAT") || type("COMPAT4") || type("COMPAT6") || \ - type("COMPAT7") || type("COMPAT10") || type("COMPAT11") { + type("COMPAT7") || type("COMPAT10") || type("COMPAT11") || \ + type("COMPAT12") { if (flag("COMPAT")) { ncompat++ out = syscompat @@ -612,6 +625,13 @@ sed -e ' wrap = "compat11" prefix = "freebsd11_" descr = "freebsd11" + } else if (flag("COMPAT12")) { + ncompat12++ + out = syscompat12 + outdcl = syscompat12dcl + wrap = "compat12" + prefix = "freebsd12_" + descr = "freebsd12" } parseline() if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \ @@ -734,6 +754,13 @@ sed -e ' printf "#define compat11(n, name) 0, (sy_call_t *)nosys\n" > sysinc printf "#endif\n" > sysinc } + if (ncompat12 != 0) { + printf "\n#ifdef %s\n", compat12 > sysinc + printf "#define compat12(n, name) n, (sy_call_t *)__CONCAT(freebsd12_,name)\n" > sysinc + printf "#else\n" > sysinc + printf "#define compat12(n, name) 0, (sy_call_t *)nosys\n" > sysinc + printf "#endif\n" > sysinc + } printf("\n#endif /* %s */\n\n", compat) > syscompatdcl printf("\n#endif /* %s */\n\n", compat4) > syscompat4dcl @@ -741,6 +768,7 @@ sed -e ' printf("\n#endif /* %s */\n\n", compat7) > syscompat7dcl printf("\n#endif /* %s */\n\n", compat10) > syscompat10dcl printf("\n#endif /* %s */\n\n", compat11) > syscompat11dcl + printf("\n#endif /* %s */\n\n", compat12) > syscompat12dcl printf("\n#undef PAD_\n") > sysprotoend printf("#undef PADL_\n") > sysprotoend @@ -765,6 +793,7 @@ cat $sysarg $sysdcl \ $syscompat7 $syscompat7dcl \ $syscompat10 $syscompat10dcl \ $syscompat11 $syscompat11dcl \ + $syscompat12 $syscompat12dcl \ $sysaue $sysprotoend > $sysproto cat $systracetmp >> $systrace cat $systraceret >> $systrace Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Sep 25 17:16:21 2019 (r352692) +++ head/sys/kern/syscalls.master Wed Sep 25 17:29:45 2019 (r352693) @@ -12,7 +12,7 @@ ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. ; type one of STD, OBSOL, UNIMPL, COMPAT, COMPAT4, COMPAT6, -; COMPAT7, COMPAT11, NODEF, NOARGS, NOPROTO, NOSTD +; COMPAT7, COMPAT11, COMPAT12, NODEF, NOARGS, NOPROTO, NOSTD ; The COMPAT* options may be combined with one or more NO* ; options separated by '|' with no spaces (e.g. COMPAT|NOARGS) ; name pseudo-prototype of syscall routine @@ -30,6 +30,7 @@ ; COMPAT7 included on COMPAT_FREEBSD7 #ifdef (FreeBSD 7 compat) ; COMPAT10 included on COMPAT_FREEBSD10 #ifdef (FreeBSD 10 compat) ; COMPAT11 included on COMPAT_FREEBSD11 #ifdef (FreeBSD 11 compat) +; COMPAT12 included on COMPAT_FREEBSD12 #ifdef (FreeBSD 12 compat) ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically From owner-svn-src-head@freebsd.org Wed Sep 25 17:30:30 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 1EE0D12DD30; Wed, 25 Sep 2019 17:30:30 +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 46dlSj72Nyz4Cdw; Wed, 25 Sep 2019 17:30:29 +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 D567B1B0BE; Wed, 25 Sep 2019 17:30:29 +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 x8PHUT5r058906; Wed, 25 Sep 2019 17:30:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHUSeC058899; Wed, 25 Sep 2019 17:30:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251730.x8PHUSeC058899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 17:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352694 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 i386/linux sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/freebsd32 i386/linux sys X-SVN-Commit-Revision: 352694 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: Wed, 25 Sep 2019 17:30:30 -0000 Author: kevans Date: Wed Sep 25 17:30:28 2019 New Revision: 352694 URL: https://svnweb.freebsd.org/changeset/base/352694 Log: sysent: regenerate after r352693 Modified: head/sys/amd64/linux/linux_proto.h head/sys/amd64/linux32/linux32_proto.h head/sys/arm64/linux/linux_proto.h head/sys/compat/freebsd32/freebsd32_proto.h head/sys/i386/linux/linux_proto.h head/sys/sys/sysproto.h Modified: head/sys/amd64/linux/linux_proto.h ============================================================================== --- head/sys/amd64/linux/linux_proto.h Wed Sep 25 17:29:45 2019 (r352693) +++ head/sys/amd64/linux/linux_proto.h Wed Sep 25 17:30:28 2019 (r352694) @@ -1556,6 +1556,13 @@ int linux_io_uring_register(struct thread *, struct li #endif /* COMPAT_FREEBSD11 */ + +#ifdef COMPAT_FREEBSD12 + +#define nosys linux_nosys + +#endif /* COMPAT_FREEBSD12 */ + #define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC #define LINUX_SYS_AUE_linux_newstat AUE_STAT #define LINUX_SYS_AUE_linux_newfstat AUE_FSTAT Modified: head/sys/amd64/linux32/linux32_proto.h ============================================================================== --- head/sys/amd64/linux32/linux32_proto.h Wed Sep 25 17:29:45 2019 (r352693) +++ head/sys/amd64/linux32/linux32_proto.h Wed Sep 25 17:30:28 2019 (r352694) @@ -1896,6 +1896,13 @@ int linux_io_uring_register(struct thread *, struct li #endif /* COMPAT_FREEBSD11 */ + +#ifdef COMPAT_FREEBSD12 + +#define nosys linux_nosys + +#endif /* COMPAT_FREEBSD12 */ + #define LINUX32_SYS_AUE_linux_exit AUE_EXIT #define LINUX32_SYS_AUE_linux_fork AUE_FORK #define LINUX32_SYS_AUE_linux_open AUE_OPEN_RWTC Modified: head/sys/arm64/linux/linux_proto.h ============================================================================== --- head/sys/arm64/linux/linux_proto.h Wed Sep 25 17:29:45 2019 (r352693) +++ head/sys/arm64/linux/linux_proto.h Wed Sep 25 17:30:28 2019 (r352694) @@ -1320,6 +1320,13 @@ int linux_pkey_free(struct thread *, struct linux_pkey #endif /* COMPAT_FREEBSD11 */ + +#ifdef COMPAT_FREEBSD12 + +#define nosys linux_nosys + +#endif /* COMPAT_FREEBSD12 */ + #define LINUX_SYS_AUE_linux_setxattr AUE_NULL #define LINUX_SYS_AUE_linux_lsetxattr AUE_NULL #define LINUX_SYS_AUE_linux_fsetxattr AUE_NULL Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Sep 25 17:29:45 2019 (r352693) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Sep 25 17:30:28 2019 (r352694) @@ -1266,6 +1266,30 @@ int freebsd11_freebsd32_fstatat(struct thread *, struc #endif /* COMPAT_FREEBSD11 */ + +#ifdef COMPAT_FREEBSD12 + +#if !defined(PAD64_REQUIRED) && !defined(__amd64__) +#define PAD64_REQUIRED +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif + +#endif /* COMPAT_FREEBSD12 */ + #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT #define FREEBSD32_SYS_AUE_ofreebsd32_lseek AUE_LSEEK Modified: head/sys/i386/linux/linux_proto.h ============================================================================== --- head/sys/i386/linux/linux_proto.h Wed Sep 25 17:29:45 2019 (r352693) +++ head/sys/i386/linux/linux_proto.h Wed Sep 25 17:30:28 2019 (r352694) @@ -1916,6 +1916,13 @@ int linux_io_uring_register(struct thread *, struct li #endif /* COMPAT_FREEBSD11 */ + +#ifdef COMPAT_FREEBSD12 + +#define nosys linux_nosys + +#endif /* COMPAT_FREEBSD12 */ + #define LINUX_SYS_AUE_linux_exit AUE_EXIT #define LINUX_SYS_AUE_linux_fork AUE_FORK #define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Sep 25 17:29:45 2019 (r352693) +++ head/sys/sys/sysproto.h Wed Sep 25 17:30:28 2019 (r352694) @@ -2643,6 +2643,12 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #endif /* COMPAT_FREEBSD11 */ + +#ifdef COMPAT_FREEBSD12 + + +#endif /* COMPAT_FREEBSD12 */ + #define SYS_AUE_syscall AUE_NULL #define SYS_AUE_exit AUE_EXIT #define SYS_AUE_fork AUE_FORK From owner-svn-src-head@freebsd.org Wed Sep 25 17:32: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 3199112DEF4; Wed, 25 Sep 2019 17:32:45 +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 46dlWK0SVkz4D1M; Wed, 25 Sep 2019 17:32:45 +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 E78501B271; Wed, 25 Sep 2019 17:32:44 +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 x8PHWiQU064450; Wed, 25 Sep 2019 17:32:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHWhdx064446; Wed, 25 Sep 2019 17:32:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251732.x8PHWhdx064446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 17:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352695 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 352695 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: Wed, 25 Sep 2019 17:32:45 -0000 Author: kevans Date: Wed Sep 25 17:32:43 2019 New Revision: 352695 URL: https://svnweb.freebsd.org/changeset/base/352695 Log: [1/3] Add mostly Linux-compatible file sealing support File sealing applies protections against certain actions (currently: write, growth, shrink) at the inode level. New fileops are added to accommodate seals - EINVAL is returned by fcntl(2) if they are not implemented. Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D21391 Modified: head/sys/kern/kern_descrip.c head/sys/kern/uipc_shm.c head/sys/sys/fcntl.h head/sys/sys/file.h head/sys/sys/mman.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Sep 25 17:30:28 2019 (r352694) +++ head/sys/kern/kern_descrip.c Wed Sep 25 17:32:43 2019 (r352695) @@ -489,7 +489,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ struct filedescent *fde; struct proc *p; struct vnode *vp; - int error, flg, tmp; + int error, flg, seals, tmp; uint64_t bsize; off_t foffset; @@ -753,6 +753,25 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ vp = fp->f_vnode; error = VOP_ADVLOCK(vp, (caddr_t)p->p_leader, F_GETLK, flp, F_POSIX); + fdrop(fp, td); + break; + + case F_ADD_SEALS: + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, NULL); + if (error != 0) + break; + error = fo_add_seals(fp, arg); + fdrop(fp, td); + break; + + case F_GET_SEALS: + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, NULL); + if (error != 0) + break; + if (fo_get_seals(fp, &seals) == 0) + td->td_retval[0] = seals; + else + error = EINVAL; fdrop(fp, td); break; Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Sep 25 17:30:28 2019 (r352694) +++ head/sys/kern/uipc_shm.c Wed Sep 25 17:32:43 2019 (r352695) @@ -119,6 +119,8 @@ static void shm_init(void *arg); static void shm_insert(char *path, Fnv32_t fnv, struct shmfd *shmfd); static struct shmfd *shm_lookup(char *path, Fnv32_t fnv); static int shm_remove(char *path, Fnv32_t fnv, struct ucred *ucred); +static int shm_dotruncate_locked(struct shmfd *shmfd, off_t length, + void *rl_cookie); static fo_rdwr_t shm_read; static fo_rdwr_t shm_write; @@ -131,6 +133,8 @@ static fo_chown_t shm_chown; static fo_seek_t shm_seek; static fo_fill_kinfo_t shm_fill_kinfo; static fo_mmap_t shm_mmap; +static fo_get_seals_t shm_get_seals; +static fo_add_seals_t shm_add_seals; /* File descriptor operations. */ struct fileops shm_ops = { @@ -148,6 +152,8 @@ struct fileops shm_ops = { .fo_seek = shm_seek, .fo_fill_kinfo = shm_fill_kinfo, .fo_mmap = shm_mmap, + .fo_get_seals = shm_get_seals, + .fo_add_seals = shm_add_seals, .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE }; @@ -316,8 +322,10 @@ shm_write(struct file *fp, struct uio *uio, struct ucr rl_cookie = rangelock_wlock(&shmfd->shm_rl, uio->uio_offset, uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx); } - - error = uiomove_object(shmfd->shm_object, shmfd->shm_size, uio); + if ((shmfd->shm_seals & F_SEAL_WRITE) != 0) + error = EPERM; + else + error = uiomove_object(shmfd->shm_object, shmfd->shm_size, uio); rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); foffset_unlock_uio(fp, uio, flags); return (error); @@ -412,8 +420,8 @@ shm_close(struct file *fp, struct thread *td) return (0); } -int -shm_dotruncate(struct shmfd *shmfd, off_t length) +static int +shm_dotruncate_locked(struct shmfd *shmfd, off_t length, void *rl_cookie) { vm_object_t object; vm_page_t m; @@ -423,23 +431,23 @@ shm_dotruncate(struct shmfd *shmfd, off_t length) KASSERT(length >= 0, ("shm_dotruncate: length < 0")); object = shmfd->shm_object; - VM_OBJECT_WLOCK(object); - if (length == shmfd->shm_size) { - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_ASSERT_WLOCKED(object); + rangelock_cookie_assert(rl_cookie, RA_WLOCKED); + if (length == shmfd->shm_size) return (0); - } nobjsize = OFF_TO_IDX(length + PAGE_MASK); /* Are we shrinking? If so, trim the end. */ if (length < shmfd->shm_size) { + if ((shmfd->shm_seals & F_SEAL_SHRINK) != 0) + return (EPERM); + /* * Disallow any requests to shrink the size if this * object is mapped into the kernel. */ - if (shmfd->shm_kmappings > 0) { - VM_OBJECT_WUNLOCK(object); + if (shmfd->shm_kmappings > 0) return (EBUSY); - } /* * Zero the truncated part of the last page. @@ -499,12 +507,13 @@ retry: swap_release_by_cred(delta, object->cred); object->charge -= delta; } else { + if ((shmfd->shm_seals & F_SEAL_GROW) != 0) + return (EPERM); + /* Try to reserve additional swap space. */ delta = IDX_TO_OFF(nobjsize - object->size); - if (!swap_reserve_by_cred(delta, object->cred)) { - VM_OBJECT_WUNLOCK(object); + if (!swap_reserve_by_cred(delta, object->cred)) return (ENOMEM); - } object->charge += delta; } shmfd->shm_size = length; @@ -513,10 +522,24 @@ retry: shmfd->shm_mtime = shmfd->shm_ctime; mtx_unlock(&shm_timestamp_lock); object->size = nobjsize; - VM_OBJECT_WUNLOCK(object); return (0); } +int +shm_dotruncate(struct shmfd *shmfd, off_t length) +{ + void *rl_cookie; + int error; + + rl_cookie = rangelock_wlock(&shmfd->shm_rl, 0, OFF_MAX, + &shmfd->shm_mtx); + VM_OBJECT_WLOCK(shmfd->shm_object); + error = shm_dotruncate_locked(shmfd, length, rl_cookie); + VM_OBJECT_WUNLOCK(shmfd->shm_object); + rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); + return (error); +} + /* * shmfd object management including creation and reference counting * routines. @@ -878,10 +901,13 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *a vm_prot_t maxprot; int error; bool writecnt; + void *rl_cookie; shmfd = fp->f_data; maxprot = VM_PROT_NONE; + rl_cookie = rangelock_rlock(&shmfd->shm_rl, 0, objsize, + &shmfd->shm_mtx); /* FREAD should always be set. */ if ((fp->f_flag & FREAD) != 0) maxprot |= VM_PROT_EXECUTE | VM_PROT_READ; @@ -890,9 +916,16 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *a writecnt = (flags & MAP_SHARED) != 0 && (prot & VM_PROT_WRITE) != 0; + if (writecnt && (shmfd->shm_seals & F_SEAL_WRITE) != 0) { + error = EPERM; + goto out; + } + /* Don't permit shared writable mappings on read-only descriptors. */ - if (writecnt && (maxprot & VM_PROT_WRITE) == 0) - return (EACCES); + if (writecnt && (maxprot & VM_PROT_WRITE) == 0) { + error = EACCES; + goto out; + } maxprot &= cap_maxprot; /* See comment in vn_mmap(). */ @@ -900,13 +933,15 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *a #ifdef _LP64 objsize > OFF_MAX || #endif - foff < 0 || foff > OFF_MAX - objsize) - return (EINVAL); + foff < 0 || foff > OFF_MAX - objsize) { + error = EINVAL; + goto out; + } #ifdef MAC error = mac_posixshm_check_mmap(td->td_ucred, shmfd, prot, flags); if (error != 0) - return (error); + goto out; #endif mtx_lock(&shm_timestamp_lock); @@ -924,6 +959,8 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *a objsize); vm_object_deallocate(shmfd->shm_object); } +out: + rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); return (error); } @@ -1129,6 +1166,57 @@ shm_fill_kinfo(struct file *fp, struct kinfo_file *kif res = shm_fill_kinfo_locked(fp->f_data, kif, false); sx_sunlock(&shm_dict_lock); return (res); +} + +static int +shm_add_seals(struct file *fp, int seals) +{ + struct shmfd *shmfd; + void *rl_cookie; + vm_ooffset_t writemappings; + int error, nseals; + + error = 0; + shmfd = fp->f_data; + rl_cookie = rangelock_wlock(&shmfd->shm_rl, 0, OFF_MAX, + &shmfd->shm_mtx); + + /* Even already-set seals should result in EPERM. */ + if ((shmfd->shm_seals & F_SEAL_SEAL) != 0) { + error = EPERM; + goto out; + } + nseals = seals & ~shmfd->shm_seals; + if ((nseals & F_SEAL_WRITE) != 0) { + /* + * The rangelock above prevents writable mappings from being + * added after we've started applying seals. The RLOCK here + * is to avoid torn reads on ILP32 arches as unmapping/reducing + * writemappings will be done without a rangelock. + */ + VM_OBJECT_RLOCK(shmfd->shm_object); + writemappings = shmfd->shm_object->un_pager.swp.writemappings; + VM_OBJECT_RUNLOCK(shmfd->shm_object); + /* kmappings are also writable */ + if (writemappings > 0) { + error = EBUSY; + goto out; + } + } + shmfd->shm_seals |= nseals; +out: + rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); + return (error); +} + +static int +shm_get_seals(struct file *fp, int *seals) +{ + struct shmfd *shmfd; + + shmfd = fp->f_data; + *seals = shmfd->shm_seals; + return (0); } static int Modified: head/sys/sys/fcntl.h ============================================================================== --- head/sys/sys/fcntl.h Wed Sep 25 17:30:28 2019 (r352694) +++ head/sys/sys/fcntl.h Wed Sep 25 17:32:43 2019 (r352695) @@ -248,7 +248,15 @@ typedef __pid_t pid_t; #endif #if __BSD_VISIBLE #define F_DUP2FD_CLOEXEC 18 /* Like F_DUP2FD, but FD_CLOEXEC is set */ -#endif +#define F_ADD_SEALS 19 +#define F_GET_SEALS 20 + +/* Seals (F_ADD_SEALS, F_GET_SEALS). */ +#define F_SEAL_SEAL 0x0001 /* Prevent adding sealings */ +#define F_SEAL_SHRINK 0x0002 /* May not shrink */ +#define F_SEAL_GROW 0x0004 /* May not grow */ +#define F_SEAL_WRITE 0x0008 /* May not write */ +#endif /* __BSD_VISIBLE */ /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Wed Sep 25 17:30:28 2019 (r352694) +++ head/sys/sys/file.h Wed Sep 25 17:32:43 2019 (r352695) @@ -123,6 +123,8 @@ typedef int fo_mmap_t(struct file *fp, vm_map_t map, v vm_size_t size, vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, struct thread *td); typedef int fo_aio_queue_t(struct file *fp, struct kaiocb *job); +typedef int fo_add_seals_t(struct file *fp, int flags); +typedef int fo_get_seals_t(struct file *fp, int *flags); typedef int fo_flags_t; struct fileops { @@ -141,6 +143,8 @@ struct fileops { fo_fill_kinfo_t *fo_fill_kinfo; fo_mmap_t *fo_mmap; fo_aio_queue_t *fo_aio_queue; + fo_add_seals_t *fo_add_seals; + fo_get_seals_t *fo_get_seals; fo_flags_t fo_flags; /* DFLAG_* below */ }; @@ -424,6 +428,24 @@ fo_aio_queue(struct file *fp, struct kaiocb *job) { return ((*fp->f_ops->fo_aio_queue)(fp, job)); +} + +static __inline int +fo_add_seals(struct file *fp, int seals) +{ + + if (fp->f_ops->fo_add_seals == NULL) + return (EINVAL); + return ((*fp->f_ops->fo_add_seals)(fp, seals)); +} + +static __inline int +fo_get_seals(struct file *fp, int *seals) +{ + + if (fp->f_ops->fo_get_seals == NULL) + return (EINVAL); + return ((*fp->f_ops->fo_get_seals)(fp, seals)); } #endif /* _KERNEL */ Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Wed Sep 25 17:30:28 2019 (r352694) +++ head/sys/sys/mman.h Wed Sep 25 17:32:43 2019 (r352695) @@ -238,6 +238,8 @@ struct shmfd { struct rangelock shm_rl; struct mtx shm_mtx; + + int shm_seals; }; #endif From owner-svn-src-head@freebsd.org Wed Sep 25 17:33: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 4BA2712DF7A; Wed, 25 Sep 2019 17:33:13 +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 46dlWs1BWnz4D8p; Wed, 25 Sep 2019 17:33:13 +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 E62761B286; Wed, 25 Sep 2019 17:33:12 +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 x8PHXCfe064548; Wed, 25 Sep 2019 17:33:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHXCo4064547; Wed, 25 Sep 2019 17:33:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251733.x8PHXCo4064547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 17:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352696 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 352696 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: Wed, 25 Sep 2019 17:33:13 -0000 Author: kevans Date: Wed Sep 25 17:33:12 2019 New Revision: 352696 URL: https://svnweb.freebsd.org/changeset/base/352696 Log: Update fcntl(2) after r352695 Modified: head/lib/libc/sys/fcntl.2 Modified: head/lib/libc/sys/fcntl.2 ============================================================================== --- head/lib/libc/sys/fcntl.2 Wed Sep 25 17:32:43 2019 (r352695) +++ head/lib/libc/sys/fcntl.2 Wed Sep 25 17:33:12 2019 (r352696) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd Nov 15, 2018 +.Dd September 4, 2019 .Dt FCNTL 2 .Os .Sh NAME @@ -180,6 +180,11 @@ is non-zero. A zero value in .Fa arg turns off read ahead. +.It Dv F_ADD_SEALS +Add seals to the file as described below, if the underlying filesystem supports +seals. +.It Dv F_GET_SEALS +Get seals associated with the file, if the underlying filesystem supports seals. .El .Pp The flags for the @@ -217,6 +222,37 @@ when I/O is possible, e.g., upon availability of data to be read. .El .Pp +The seals that may be applied with +.Dv F_ADD_SEALS +are as follows: +.Bl -tag -width F_SEAL_SHRINK +.It Dv F_SEAL_SEAL +Prevent any further seals from being applied to the file. +.It Dv F_SEAL_SHRINK +Prevent the file from being shrunk with +.Xr ftruncate 2 . +.It Dv F_SEAL_GROW +Prevent the file from being enlarged with +.Xr ftruncate 2 . +.It Dv F_SEAL_WRITE +Prevent any further +.Xr write 2 +calls to the file. +Any writes in progress will finish before +.Fn fcntl +returns. +If any writeable mappings exist, F_ADD_SEALS will fail and return +.Dv EBUSY . +.El +.Pp +Seals are on a per-inode basis and require support by the underlying filesystem. +If the underlying filesystem does not support seals, +.Dv F_ADD_SEALS +and +.Dv F_GET_SEALS +will fail and return +.Dv EINVAL . +.Pp Several commands are available for doing advisory file locking; they all operate on the following structure: .Bd -literal @@ -528,6 +564,14 @@ is an exclusive lock and .Fa fd is not a valid file descriptor open for writing. +.It Bq Er EBUSY +The argument +.Fa cmd +is +.Dv F_ADD_SEALS , +attempting to set +.Dv F_SEAL_WRITE , +and writeable mappings of the file exist. .It Bq Er EDEADLK The argument .Fa cmd @@ -565,6 +609,14 @@ points is not valid. .Pp The argument .Fa cmd +is +.Dv F_ADD_SEALS +or +.Dv F_GET_SEALS , +and the underlying filesystem does not support sealing. +.Pp +The argument +.Fa cmd is invalid. .It Bq Er EMFILE The argument @@ -624,6 +676,15 @@ is and the process ID or process group given as an argument is in a different session than the caller. +.Pp +The +.Fa cmd +argument +is +.Dv F_ADD_SEALS +and the +.Dv F_SEAL_SEAL +seal has already been set. .It Bq Er ESRCH The .Fa cmd From owner-svn-src-head@freebsd.org Wed Sep 25 17:35: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 407B912E120; Wed, 25 Sep 2019 17:35:04 +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 46dlZ00zplz4DR2; Wed, 25 Sep 2019 17:35:04 +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 DBDA91B287; Wed, 25 Sep 2019 17:35:03 +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 x8PHZ3A7064709; Wed, 25 Sep 2019 17:35:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHZ34q064707; Wed, 25 Sep 2019 17:35:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251735.x8PHZ34q064707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 17:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352697 - in head/sys: compat/cloudabi kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/cloudabi kern sys X-SVN-Commit-Revision: 352697 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: Wed, 25 Sep 2019 17:35:04 -0000 Author: kevans Date: Wed Sep 25 17:35:03 2019 New Revision: 352697 URL: https://svnweb.freebsd.org/changeset/base/352697 Log: [2/3] Add an initial seal argument to kern_shm_open() Now that flags may be set on posixshm, add an argument to kern_shm_open() for the initial seals. To maintain past behavior where callers of shm_open(2) are guaranteed to not have any seals applied to the fd they're given, apply F_SEAL_SEAL for existing callers of kern_shm_open. A special flag could be opened later for shm_open(2) to indicate that sealing should be allowed. We currently restrict initial seals to F_SEAL_SEAL. We cannot error out if F_SEAL_SEAL is re-applied, as this would easily break shm_open() twice to a shmfd that already existed. A note's been added about the assumptions we've made here as a hint towards anyone wanting to allow other seals to be applied at creation. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D21392 Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/kern/uipc_shm.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Wed Sep 25 17:33:12 2019 (r352696) +++ head/sys/compat/cloudabi/cloudabi_fd.c Wed Sep 25 17:35:03 2019 (r352697) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -95,7 +96,7 @@ cloudabi_sys_fd_create1(struct thread *td, cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_MMAP_RWX); return (kern_shm_open(td, SHM_ANON, O_RDWR | O_CLOEXEC, 0, - &fcaps)); + &fcaps, F_SEAL_SEAL)); default: return (EINVAL); } Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Sep 25 17:33:12 2019 (r352696) +++ head/sys/kern/uipc_shm.c Wed Sep 25 17:35:03 2019 (r352697) @@ -701,13 +701,14 @@ shm_remove(char *path, Fnv32_t fnv, struct ucred *ucre int kern_shm_open(struct thread *td, const char *userpath, int flags, mode_t mode, - struct filecaps *fcaps) + struct filecaps *fcaps, int initial_seals) { struct filedesc *fdp; struct shmfd *shmfd; struct file *fp; char *path; const char *pr_path; + void *rl_cookie; size_t pr_pathlen; Fnv32_t fnv; mode_t cmode; @@ -730,6 +731,17 @@ kern_shm_open(struct thread *td, const char *userpath, if ((flags & ~(O_ACCMODE | O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC)) != 0) return (EINVAL); + /* + * Currently only F_SEAL_SEAL may be set when creating or opening shmfd. + * If the decision is made later to allow additional seals, care must be + * taken below to ensure that the seals are properly set if the shmfd + * already existed -- this currently assumes that only F_SEAL_SEAL can + * be set and doesn't take further precautions to ensure the validity of + * the seals being added with respect to current mappings. + */ + if ((initial_seals & ~F_SEAL_SEAL) != 0) + return (EINVAL); + fdp = td->td_proc->p_fd; cmode = (mode & ~fdp->fd_cmask) & ACCESSPERMS; @@ -753,6 +765,7 @@ kern_shm_open(struct thread *td, const char *userpath, return (EINVAL); } shmfd = shm_alloc(td->td_ucred, cmode); + shmfd->shm_seals = initial_seals; } else { path = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); pr_path = td->td_ucred->cr_prison->pr_path; @@ -789,6 +802,7 @@ kern_shm_open(struct thread *td, const char *userpath, if (error == 0) { #endif shmfd = shm_alloc(td->td_ucred, cmode); + shmfd->shm_seals = initial_seals; shm_insert(path, fnv, shmfd); #ifdef MAC } @@ -798,12 +812,39 @@ kern_shm_open(struct thread *td, const char *userpath, error = ENOENT; } } else { + rl_cookie = rangelock_wlock(&shmfd->shm_rl, 0, OFF_MAX, + &shmfd->shm_mtx); + /* + * kern_shm_open() likely shouldn't ever error out on + * trying to set a seal that already exists, unlike + * F_ADD_SEALS. This would break terribly as + * shm_open(2) actually sets F_SEAL_SEAL to maintain + * historical behavior where the underlying file could + * not be sealed. + */ + initial_seals &= ~shmfd->shm_seals; + + /* * Object already exists, obtain a new * reference if requested and permitted. */ free(path, M_SHMFD); - if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) + + /* + * initial_seals can't set additional seals if we've + * already been set F_SEAL_SEAL. If F_SEAL_SEAL is set, + * then we've already removed that one from + * initial_seals. This is currently redundant as we + * only allow setting F_SEAL_SEAL at creation time, but + * it's cheap to check and decreases the effort required + * to allow additional seals. + */ + if ((shmfd->shm_seals & F_SEAL_SEAL) != 0 && + initial_seals != 0) + error = EPERM; + else if ((flags & (O_CREAT | O_EXCL)) == + (O_CREAT | O_EXCL)) error = EEXIST; else { #ifdef MAC @@ -823,15 +864,27 @@ kern_shm_open(struct thread *td, const char *userpath, if (error == 0 && (flags & (O_ACCMODE | O_TRUNC)) == (O_RDWR | O_TRUNC)) { + VM_OBJECT_WLOCK(shmfd->shm_object); #ifdef MAC error = mac_posixshm_check_truncate( td->td_ucred, fp->f_cred, shmfd); if (error == 0) #endif - shm_dotruncate(shmfd, 0); + error = shm_dotruncate_locked(shmfd, 0, + rl_cookie); + VM_OBJECT_WUNLOCK(shmfd->shm_object); } - if (error == 0) + if (error == 0) { + /* + * Currently we only allow F_SEAL_SEAL to be + * set initially. As noted above, this would + * need to be reworked should that change. + */ + shmfd->shm_seals |= initial_seals; shm_hold(shmfd); + } + rangelock_unlock(&shmfd->shm_rl, rl_cookie, + &shmfd->shm_mtx); } sx_xunlock(&shm_dict_lock); @@ -856,7 +909,7 @@ sys_shm_open(struct thread *td, struct shm_open_args * { return (kern_shm_open(td, uap->path, uap->flags | O_CLOEXEC, uap->mode, - NULL)); + NULL, F_SEAL_SEAL)); } int Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Wed Sep 25 17:33:12 2019 (r352696) +++ head/sys/sys/syscallsubr.h Wed Sep 25 17:35:03 2019 (r352697) @@ -250,7 +250,7 @@ int kern_setsockopt(struct thread *td, int s, int leve int kern_settimeofday(struct thread *td, struct timeval *tv, struct timezone *tzp); int kern_shm_open(struct thread *td, const char *userpath, int flags, - mode_t mode, struct filecaps *fcaps); + mode_t mode, struct filecaps *fcaps, int initial_seals); int kern_shmat(struct thread *td, int shmid, const void *shmaddr, int shmflg); int kern_shmctl(struct thread *td, int shmid, int cmd, void *buf, From owner-svn-src-head@freebsd.org Wed Sep 25 17:35: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 D55CE12E190; Wed, 25 Sep 2019 17:35:34 +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 46dlZZ5GRNz4DZh; Wed, 25 Sep 2019 17:35:34 +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 96A3F1B29F; Wed, 25 Sep 2019 17:35:34 +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 x8PHZYE8064774; Wed, 25 Sep 2019 17:35:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHZYOq064773; Wed, 25 Sep 2019 17:35:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909251735.x8PHZYOq064773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 25 Sep 2019 17:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352698 - head X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352698 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: Wed, 25 Sep 2019 17:35:34 -0000 Author: dim Date: Wed Sep 25 17:35:34 2019 New Revision: 352698 URL: https://svnweb.freebsd.org/changeset/base/352698 Log: In r340411, libufs.so's major number was bumped to 7, but an entry in ObsoleteFiles.inc was not added. Retroactively fix that. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Sep 25 17:35:03 2019 (r352697) +++ head/ObsoleteFiles.inc Wed Sep 25 17:35:34 2019 (r352698) @@ -668,6 +668,9 @@ OLD_DIRS+=usr/lib/clang/6.0.1/lib OLD_DIRS+=usr/lib/clang/6.0.1 # 20181116: Rename test file. OLD_FILES+=usr/tests/sys/netinet/reuseport_lb +# 20181113: libufs version bumped to 7. +OLD_LIBS+=lib/libufs.so.6 +OLD_LIBS+=usr/lib32/libufs.so.6 # 20181112: Cleanup old libcap_dns. OLD_LIBS+=lib/casper/libcap_dns.so.1 OLD_LIBS+=usr/lib32/libcap_dns.so.1 From owner-svn-src-head@freebsd.org Wed Sep 25 17:53: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 0BCB112E7B7; Wed, 25 Sep 2019 17:53:00 +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 46dlyg6C2Lz4Fbc; Wed, 25 Sep 2019 17:52:59 +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 B867D1B64E; Wed, 25 Sep 2019 17:52:59 +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 x8PHqxeJ076584; Wed, 25 Sep 2019 17:52:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHqxD9076583; Wed, 25 Sep 2019 17:52:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909251752.x8PHqxD9076583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 25 Sep 2019 17:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352699 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 352699 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: Wed, 25 Sep 2019 17:53:00 -0000 Author: dim Date: Wed Sep 25 17:52:59 2019 New Revision: 352699 URL: https://svnweb.freebsd.org/changeset/base/352699 Log: In suite.test.mk, test if ${DESTDIR} exists before attempting to run chflags -R on it, otherwise the command will error out. (Note that adding -f to the chflags invocation does not help, unlike with rm.) MFC after: 3 days Modified: head/share/mk/suite.test.mk Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Wed Sep 25 17:35:34 2019 (r352698) +++ head/share/mk/suite.test.mk Wed Sep 25 17:52:59 2019 (r352699) @@ -120,7 +120,7 @@ beforecheck: # etc. aftercheck: @cd ${.CURDIR} && ${MAKE} clean - @chflags -R 0 "${DESTDIR}" + @test ! -e ${DESTDIR} || chflags -R 0 "${DESTDIR}" @rm -Rf "${DESTDIR}" .endif From owner-svn-src-head@freebsd.org Wed Sep 25 17:59: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 C428512E89F; Wed, 25 Sep 2019 17:59: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 46dm5x4sJtz4FqM; Wed, 25 Sep 2019 17:59: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 869541B656; Wed, 25 Sep 2019 17:59: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 x8PHxH5p076998; Wed, 25 Sep 2019 17:59:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHxGCW076991; Wed, 25 Sep 2019 17:59:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251759.x8PHxGCW076991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 17:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352700 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 352700 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: Wed, 25 Sep 2019 17:59:17 -0000 Author: kevans Date: Wed Sep 25 17:59:15 2019 New Revision: 352700 URL: https://svnweb.freebsd.org/changeset/base/352700 Log: Add a shm_open2 syscall to support upcoming memfd_create shm_open2 allows a little more flexibility than the original shm_open. shm_open2 doesn't enforce CLOEXEC on its callers, and it has a separate shmflag argument that can be expanded later. Currently the only shmflag is to allow file sealing on the returned fd. shm_open and memfd_create will both be implemented in libc to use this new syscall. __FreeBSD_version is bumped to indicate the presence. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D21393 Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/syscalls.master head/sys/kern/uipc_shm.c head/sys/sys/mman.h head/sys/sys/param.h head/sys/sys/syscallsubr.h Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Sep 25 17:52:59 2019 (r352699) +++ head/sys/compat/freebsd32/syscalls.master Wed Sep 25 17:59:15 2019 (r352700) @@ -1154,5 +1154,8 @@ 570 AUE_SYSCTL STD { int freebsd32___sysctlbyname(const char *name, \ size_t namelen, void *old, uint32_t *oldlenp, \ void *new, size_t newlen); } +571 AUE_SHMOPEN NOPROTO { int shm_open2( \ + const char *path, int flags, mode_t mode, \ + int shmflags, const char *name); } ; vim: syntax=off Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Wed Sep 25 17:52:59 2019 (r352699) +++ head/sys/kern/capabilities.conf Wed Sep 25 17:59:15 2019 (r352700) @@ -655,6 +655,7 @@ setuid ## shm_open(2) is scoped so as to allow only access to new anonymous objects. ## shm_open +shm_open2 ## ## Allow I/O-related file descriptors, subject to capability rights. Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Sep 25 17:52:59 2019 (r352699) +++ head/sys/kern/syscalls.master Wed Sep 25 17:59:15 2019 (r352700) @@ -3195,6 +3195,15 @@ _In_reads_bytes_opt_(newlen) void *new, size_t newlen); } +571 AUE_SHMOPEN STD { + int shm_open2( + _In_z_ const char *path, + int flags, + mode_t mode, + int shmflags, + _In_z_ const char *name + ); + } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Sep 25 17:52:59 2019 (r352699) +++ head/sys/kern/uipc_shm.c Wed Sep 25 17:59:15 2019 (r352700) @@ -1316,3 +1316,36 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, posix_shm_list, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLTYPE_OPAQUE, NULL, 0, sysctl_posix_shm_list, "", "POSIX SHM list"); + +int +kern_shm_open2(struct thread *td, const char *path, int flags, mode_t mode, + int shmflags, const char *name __unused) +{ + int initial_seals; + + if ((shmflags & ~SHM_ALLOW_SEALING) != 0) + return (EINVAL); + + initial_seals = F_SEAL_SEAL; + if ((shmflags & SHM_ALLOW_SEALING) != 0) + initial_seals &= ~F_SEAL_SEAL; + return (kern_shm_open(td, path, flags, 0, NULL, initial_seals)); +} + +/* + * This version of the shm_open() interface leaves CLOEXEC behavior up to the + * caller, and libc will enforce it for the traditional shm_open() call. This + * allows other consumers, like memfd_create(), to opt-in for CLOEXEC. This + * interface also includes a 'name' argument that is currently unused, but could + * potentially be exported later via some interface for debugging purposes. + * From the kernel's perspective, it is optional. Individual consumers like + * memfd_create() may require it in order to be compatible with other systems + * implementing the same function. + */ +int +sys_shm_open2(struct thread *td, struct shm_open2_args *uap) +{ + + return (kern_shm_open2(td, uap->path, uap->flags, uap->mode, + uap->shmflags, uap->name)); +} Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Wed Sep 25 17:52:59 2019 (r352699) +++ head/sys/sys/mman.h Wed Sep 25 17:59:15 2019 (r352700) @@ -176,6 +176,12 @@ * Anonymous object constant for shm_open(). */ #define SHM_ANON ((char *)1) + +/* + * shmflags for shm_open2() + */ +#define SHM_ALLOW_SEALING 0x00000001 + #endif /* __BSD_VISIBLE */ /* Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Sep 25 17:52:59 2019 (r352699) +++ head/sys/sys/param.h Wed Sep 25 17:59:15 2019 (r352700) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300047 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300048 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Wed Sep 25 17:52:59 2019 (r352699) +++ head/sys/sys/syscallsubr.h Wed Sep 25 17:59:15 2019 (r352700) @@ -251,6 +251,8 @@ int kern_settimeofday(struct thread *td, struct timeva struct timezone *tzp); int kern_shm_open(struct thread *td, const char *userpath, int flags, mode_t mode, struct filecaps *fcaps, int initial_seals); +int kern_shm_open2(struct thread *td, const char *path, int flags, + mode_t mode, int shmflags, const char *name); int kern_shmat(struct thread *td, int shmid, const void *shmaddr, int shmflg); int kern_shmctl(struct thread *td, int shmid, int cmd, void *buf, From owner-svn-src-head@freebsd.org Wed Sep 25 18:00: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 E5C4F12E91E; Wed, 25 Sep 2019 18:00:00 +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 46dm6m5nhJz4G05; Wed, 25 Sep 2019 18:00:00 +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 A9EE01B66E; Wed, 25 Sep 2019 18:00:00 +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 x8PI00ex077178; Wed, 25 Sep 2019 18:00:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PHxwid077093; Wed, 25 Sep 2019 17:59:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251759.x8PHxwid077093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 17:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352701 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 352701 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: Wed, 25 Sep 2019 18:00:01 -0000 Author: kevans Date: Wed Sep 25 17:59:58 2019 New Revision: 352701 URL: https://svnweb.freebsd.org/changeset/base/352701 Log: sysent: regenerate after r352700 Modified: 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/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed Sep 25 17:59:58 2019 (r352701) @@ -497,4 +497,5 @@ #define FREEBSD32_SYS_funlinkat 568 #define FREEBSD32_SYS_copy_file_range 569 #define FREEBSD32_SYS_freebsd32___sysctlbyname 570 -#define FREEBSD32_SYS_MAXSYSCALL 571 +#define FREEBSD32_SYS_shm_open2 571 +#define FREEBSD32_SYS_MAXSYSCALL 572 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Sep 25 17:59:58 2019 (r352701) @@ -607,4 +607,5 @@ const char *freebsd32_syscallnames[] = { "funlinkat", /* 568 = funlinkat */ "copy_file_range", /* 569 = copy_file_range */ "freebsd32___sysctlbyname", /* 570 = freebsd32___sysctlbyname */ + "shm_open2", /* 571 = shm_open2 */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed Sep 25 17:59:58 2019 (r352701) @@ -654,4 +654,5 @@ struct sysent freebsd32_sysent[] = { { 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 */ + { AS(shm_open2_args), (sy_call_t *)sys_shm_open2, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 571 = shm_open2 */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Sep 25 17:59:58 2019 (r352701) @@ -3344,6 +3344,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 6; break; } + /* shm_open2 */ + case 571: { + struct shm_open2_args *p = params; + uarg[0] = (intptr_t) p->path; /* const char * */ + iarg[1] = p->flags; /* int */ + iarg[2] = p->mode; /* mode_t */ + iarg[3] = p->shmflags; /* int */ + uarg[4] = (intptr_t) p->name; /* const char * */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -9008,6 +9019,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* shm_open2 */ + case 571: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "int"; + break; + case 2: + p = "mode_t"; + break; + case 3: + p = "int"; + break; + case 4: + p = "userland const char *"; + break; + default: + break; + }; + break; default: break; }; @@ -10889,6 +10922,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* freebsd32___sysctlbyname */ case 570: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* shm_open2 */ + case 571: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/kern/init_sysent.c Wed Sep 25 17:59:58 2019 (r352701) @@ -620,4 +620,5 @@ struct sysent sysent[] = { { 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 */ + { AS(shm_open2_args), (sy_call_t *)sys_shm_open2, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 571 = shm_open2 */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/kern/syscalls.c Wed Sep 25 17:59:58 2019 (r352701) @@ -577,4 +577,5 @@ const char *syscallnames[] = { "funlinkat", /* 568 = funlinkat */ "copy_file_range", /* 569 = copy_file_range */ "__sysctlbyname", /* 570 = __sysctlbyname */ + "shm_open2", /* 571 = shm_open2 */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/kern/systrace_args.c Wed Sep 25 17:59:58 2019 (r352701) @@ -3336,6 +3336,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 6; break; } + /* shm_open2 */ + case 571: { + struct shm_open2_args *p = params; + uarg[0] = (intptr_t) p->path; /* const char * */ + iarg[1] = p->flags; /* int */ + iarg[2] = p->mode; /* mode_t */ + iarg[3] = p->shmflags; /* int */ + uarg[4] = (intptr_t) p->name; /* const char * */ + *n_args = 5; + break; + } default: *n_args = 0; break; @@ -8913,6 +8924,28 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* shm_open2 */ + case 571: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "int"; + break; + case 2: + p = "mode_t"; + break; + case 3: + p = "int"; + break; + case 4: + p = "userland const char *"; + break; + default: + break; + }; + break; default: break; }; @@ -10821,6 +10854,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* __sysctlbyname */ case 570: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* shm_open2 */ + case 571: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/sys/syscall.h Wed Sep 25 17:59:58 2019 (r352701) @@ -506,4 +506,5 @@ #define SYS_funlinkat 568 #define SYS_copy_file_range 569 #define SYS___sysctlbyname 570 -#define SYS_MAXSYSCALL 571 +#define SYS_shm_open2 571 +#define SYS_MAXSYSCALL 572 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/sys/syscall.mk Wed Sep 25 17:59:58 2019 (r352701) @@ -411,4 +411,5 @@ MIASM = \ fhreadlink.o \ funlinkat.o \ copy_file_range.o \ - __sysctlbyname.o + __sysctlbyname.o \ + shm_open2.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Sep 25 17:59:15 2019 (r352700) +++ head/sys/sys/sysproto.h Wed Sep 25 17:59:58 2019 (r352701) @@ -1812,6 +1812,13 @@ struct __sysctlbyname_args { 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)]; }; +struct shm_open2_args { + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; + char shmflags_l_[PADL_(int)]; int shmflags; char shmflags_r_[PADR_(int)]; + char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; +}; 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 *); @@ -2199,6 +2206,7 @@ int sys_fhreadlink(struct thread *, struct fhreadlink_ 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 *); +int sys_shm_open2(struct thread *, struct shm_open2_args *); #ifdef COMPAT_43 @@ -3114,6 +3122,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_funlinkat AUE_UNLINKAT #define SYS_AUE_copy_file_range AUE_NULL #define SYS_AUE___sysctlbyname AUE_SYSCTL +#define SYS_AUE_shm_open2 AUE_SHMOPEN #undef PAD_ #undef PADL_ From owner-svn-src-head@freebsd.org Wed Sep 25 18:03:16 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 37ED312EBA1; Wed, 25 Sep 2019 18:03:16 +0000 (UTC) (envelope-from glebius@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 46dmBX0g2qz4GTF; Wed, 25 Sep 2019 18:03:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE6701B82E; Wed, 25 Sep 2019 18:03:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8PI3FRi082613; Wed, 25 Sep 2019 18:03:15 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PI3Fjw082612; Wed, 25 Sep 2019 18:03:15 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201909251803.x8PI3Fjw082612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 25 Sep 2019 18:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352702 - head/tools/debugscripts X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/tools/debugscripts X-SVN-Commit-Revision: 352702 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: Wed, 25 Sep 2019 18:03:16 -0000 Author: glebius Date: Wed Sep 25 18:03:15 2019 New Revision: 352702 URL: https://svnweb.freebsd.org/changeset/base/352702 Log: Enhance the 'ps' command so that it prints a line per proc and a line per thread, so that instead of repeating the same info for all threads in proc, it would print thread specific info. Also includes thread number that would match 'info threads' info and can be used as argument for thread swithcing with 'thread' command. Modified: head/tools/debugscripts/gdbinit.kernel Modified: head/tools/debugscripts/gdbinit.kernel ============================================================================== --- head/tools/debugscripts/gdbinit.kernel Wed Sep 25 17:59:58 2019 (r352701) +++ head/tools/debugscripts/gdbinit.kernel Wed Sep 25 18:03:15 2019 (r352702) @@ -199,28 +199,29 @@ define ps set $nproc = nprocs set $aproc = allproc.lh_first set $proc = allproc.lh_first - printf " pid proc uid ppid pgrp flag stat comm wchan\n" + set $tid = 1 + printf "pid/ID ppid/tid uid pgrp flag st comm/name proc/thread\n" while (--$nproc >= 0) set $pptr = $proc.p_pptr if ($pptr == 0) set $pptr = $proc end if ($proc.p_state) + printf " %5d %6d %4d %5d %8x %2d %-10s %p\n", \ + $proc.p_pid, $pptr->p_pid, \ + $proc.p_ucred->cr_ruid, \ + $proc.p_pgrp->pg_id, $proc.p_flag, $proc.p_state, \ + &$proc.p_comm[0], $aproc set $thread = $proc->p_threads.tqh_first while ($thread) - printf "%5d %08x %4d %5d %5d %06x %d %-10s ", \ - $proc.p_pid, $aproc, \ - $proc.p_ucred->cr_ruid, $pptr->p_pid, \ - $proc.p_pgrp->pg_id, $proc.p_flag, $proc.p_state, \ - &$proc.p_comm[0] - if ($thread.td_wchan) - if ($thread.td_wmesg) - printf "%s ", $thread.td_wmesg - end - printf "%x", $thread.td_wchan + printf "(%5d) %6d %-10s %p", \ + $tid, $thread->td_tid, $thread->td_name, $thread + if ($thread.td_wmesg) + printf " %s", $thread.td_wmesg end - printf "\n" + printf "\n" set $thread = $thread->td_plist.tqe_next + set $tid = $tid + 1 end end set $aproc = $proc.p_list.le_next From owner-svn-src-head@freebsd.org Wed Sep 25 18:03:20 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 BD20912EBC1; Wed, 25 Sep 2019 18:03:20 +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 46dmBc4bbpz4GWs; Wed, 25 Sep 2019 18:03:20 +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 7B0261B82F; Wed, 25 Sep 2019 18:03:20 +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 x8PI3KHA082671; Wed, 25 Sep 2019 18:03:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PI3IsX082662; Wed, 25 Sep 2019 18:03:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251803.x8PI3IsX082662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 18:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352703 - in head: . lib/libc/include lib/libc/sys sys/sys tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . lib/libc/include lib/libc/sys sys/sys tests/sys/kern X-SVN-Commit-Revision: 352703 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: Wed, 25 Sep 2019 18:03:20 -0000 Author: kevans Date: Wed Sep 25 18:03:18 2019 New Revision: 352703 URL: https://svnweb.freebsd.org/changeset/base/352703 Log: Add linux-compatible memfd_create memfd_create is effectively a SHM_ANON shm_open(2) mapping with optional CLOEXEC and file sealing support. This is used by some mesa parts, some linux libs, and qemu can also take advantage of it and uses the sealing to prevent resizing the region. This reimplements shm_open in terms of shm_open2(2) at the same time. shm_open(2) will be moved to COMPAT12 shortly. Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D21393 Added: head/lib/libc/sys/shm_open.c (contents, props changed) head/tests/sys/kern/memfd_test.c (contents, props changed) Modified: head/Makefile.inc1 head/lib/libc/include/libc_private.h head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/lib/libc/sys/shm_open.2 head/sys/sys/mman.h head/tests/sys/kern/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Sep 25 18:03:15 2019 (r352702) +++ head/Makefile.inc1 Wed Sep 25 18:03:18 2019 (r352703) @@ -947,7 +947,8 @@ _cleanobj_fast_depend_hack: .PHONY # Syscall stubs rewritten in C and obsolete MD assembly implementations # Date SVN Rev Syscalls # 20180604 r334626 brk sbrk -.for f in brk sbrk +# 20190916 r35XXXX shm_open +.for f in brk sbrk shm_open @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ egrep -qw '${f}\.[sS]' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ echo "Removing stale dependencies for ${f} syscall wrappers"; \ Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Wed Sep 25 18:03:15 2019 (r352702) +++ head/lib/libc/include/libc_private.h Wed Sep 25 18:03:18 2019 (r352703) @@ -391,6 +391,7 @@ __pid_t __sys_wait6(enum idtype, __id_t, int *, int, struct __wrusage *, struct __siginfo *); __ssize_t __sys_write(int, const void *, __size_t); __ssize_t __sys_writev(int, const struct iovec *, int); +int __sys_shm_open2(const char *, int, __mode_t, int, const char *); int __libc_sigaction(int, const struct sigaction *, struct sigaction *) __hidden; Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed Sep 25 18:03:15 2019 (r352702) +++ head/lib/libc/sys/Makefile.inc Wed Sep 25 18:03:18 2019 (r352703) @@ -46,6 +46,7 @@ PSEUDO+= _getdirentries.o SRCS+= brk.c SRCS+= pipe.c +SRCS+= shm_open.c SRCS+= vadvise.c SRCS+= compat-stub.c @@ -475,7 +476,8 @@ MLINKS+=setuid.2 setegid.2 \ setuid.2 seteuid.2 \ setuid.2 setgid.2 MLINKS+=shmat.2 shmdt.2 -MLINKS+=shm_open.2 shm_unlink.2 +MLINKS+=shm_open.2 memfd_create.3 \ + shm_open.2 shm_unlink.2 MLINKS+=sigwaitinfo.2 sigtimedwait.2 MLINKS+=stat.2 fstat.2 \ stat.2 fstatat.2 \ Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed Sep 25 18:03:15 2019 (r352702) +++ head/lib/libc/sys/Symbol.map Wed Sep 25 18:03:18 2019 (r352703) @@ -409,6 +409,7 @@ FBSD_1.6 { fhreadlink; getfhat; funlinkat; + memfd_create; }; FBSDprivate_1.0 { Modified: head/lib/libc/sys/shm_open.2 ============================================================================== --- head/lib/libc/sys/shm_open.2 Wed Sep 25 18:03:15 2019 (r352702) +++ head/lib/libc/sys/shm_open.2 Wed Sep 25 18:03:18 2019 (r352703) @@ -28,11 +28,11 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2017 +.Dd September 24, 2019 .Dt SHM_OPEN 2 .Os .Sh NAME -.Nm shm_open , shm_unlink +.Nm memfd_create , shm_open , shm_unlink .Nd "shared memory object operations" .Sh LIBRARY .Lb libc @@ -41,6 +41,8 @@ .In sys/mman.h .In fcntl.h .Ft int +.Fn memfd_create "const char *name" "unsigned int flags" +.Ft int .Fn shm_open "const char *path" "int flags" "mode_t mode" .Ft int .Fn shm_unlink "const char *path" @@ -139,14 +141,64 @@ The .Fn shm_unlink system call removes a shared memory object named .Fa path . +.Pp +The +.Fn memfd_create +function creates an anonymous shared memory object, identical to that created +by +.Fn shm_open +when +.Dv SHM_ANON +is specified. +Newly created objects start off with a size of zero. +The size of the new object must be adjusted via +.Xr ftruncate 2 . +.Pp +The +.Fa name +argument must not be +.Dv NULL , +but it may be an empty string. +The length of the +.Fa name +argument may not exceed +.Dv NAME_MAX +minus six characters for the prefix +.Dq memfd: , +which will be prepended. +The +.Fa name +argument is intended solely for debugging purposes and will never be used by the +kernel to identify a memfd. +Names are therefore not required to be unique. +.Pp +The following +.Fa flags +may be specified to +.Fn memfd_create : +.Bl -tag -width MFD_ALLOW_SEALING +.It Dv MFD_CLOEXEC +Set +.Dv FD_CLOEXEC +on the resulting file descriptor. +.It Dv MFD_ALLOW_SEALING +Allow adding seals to the resulting file descriptor using the +.Dv F_ADD_SEALS +.Xr fcntl 2 +command. +.It Dv MFD_HUGETLB +This flag is currently unsupported. +.El .Sh RETURN VALUES If successful, +.Fn memfd_create +and .Fn shm_open -returns a non-negative integer, +both return a non-negative integer, and .Fn shm_unlink returns zero. -Both functions return -1 on failure, and set +All three functions return -1 on failure, and set .Va errno to indicate the error. .Sh COMPATIBILITY @@ -220,6 +272,33 @@ This example fails without the call to errx(EX_IOERR, "%s: pwrite length mismatch", __func__); .Ed .Sh ERRORS +.Fn memfd_create +fails with these error codes for these conditions: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa name +argument was NULL. +.It Bq Er EINVAL +The +.Fa name +argument was too long. +.Pp +An invalid or unsupported flag was included in +.Fa flags . +.It Bq Er EMFILE +The process has already reached its limit for open file descriptors. +.It Bq Er ENFILE +The system file table is full. +.It Bq Er ENOSYS +In +.Fa memfd_create , +.Dv MFD_HUGETLB +was specified in +.Fa flags , +and this system does not support forced hugetlb mappings. +.El +.Pp .Fn shm_open fails with these error codes for these conditions: .Bl -tag -width Er @@ -290,12 +369,22 @@ requires write permission to the shared memory object. .Xr sendfile 2 .Sh STANDARDS The +.Fn memfd_create +function is expected to be compatible with the Linux system call of the same +name. +.Pp +The .Fn shm_open and .Fn shm_unlink functions are believed to conform to .St -p1003.1b-93 . .Sh HISTORY +The +.Fn memfd_create +function appeared in +.Fx 13.0 . +.Pp The .Fn shm_open and Added: head/lib/libc/sys/shm_open.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/shm_open.c Wed Sep 25 18:03:18 2019 (r352703) @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2019 Kyle Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), 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 COPYRIGHT HOLDER(S) ``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 HOLDER(S) 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 "libc_private.h" + +__weak_reference(shm_open, _shm_open); +__weak_reference(shm_open, __sys_shm_open); + +#ifndef SYS_freebsd12_shm_open +#define SYS_freebsd12_shm_open SYS_shm_open +#endif + +#define SHM_OPEN2_OSREL 1300048 + +#define MEMFD_NAME_PREFIX "memfd:" + +int +shm_open(const char *path, int flags, mode_t mode) +{ + + if (__getosreldate() >= SHM_OPEN2_OSREL) + return (__sys_shm_open2(path, flags | O_CLOEXEC, mode, 0, + NULL)); + + /* + * Fallback to shm_open(2) on older kernels. The kernel will enforce + * O_CLOEXEC in this interface, unlike the newer shm_open2 which does + * not enforce it. The newer interface allows memfd_create(), for + * instance, to not have CLOEXEC on the returned fd. + */ + return (syscall(SYS_freebsd12_shm_open, path, flags, mode)); +} + +/* + * The path argument is passed to the kernel, but the kernel doesn't currently + * do anything with it. Linux exposes it in linprocfs for debugging purposes + * only, but our kernel currently will not do the same. + */ +int +memfd_create(const char *name, unsigned int flags) +{ + char memfd_name[NAME_MAX + 1]; + size_t namelen; + int oflags, shmflags; + + if (name == NULL) + return (EBADF); + namelen = strlen(name); + if (namelen + sizeof(MEMFD_NAME_PREFIX) - 1 > NAME_MAX) + return (EINVAL); + if ((flags & ~(MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_HUGETLB | + MFD_HUGE_MASK)) != 0) + return (EINVAL); + /* HUGETLB set with no size specified. */ + if ((flags & MFD_HUGETLB) != 0 && (flags & MFD_HUGE_MASK) == 0) + return (EINVAL); + /* Size specified but no HUGETLB. */ + if ((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0) + return (EINVAL); + /* We don't actually support HUGETLB. */ + if ((flags & MFD_HUGETLB) != 0) + return (ENOSYS); + + /* We've already validated that we're sufficiently sized. */ + snprintf(memfd_name, NAME_MAX + 1, "%s%s", MEMFD_NAME_PREFIX, name); + oflags = O_RDWR; + shmflags = 0; + if ((flags & MFD_CLOEXEC) != 0) + oflags |= O_CLOEXEC; + if ((flags & MFD_ALLOW_SEALING) != 0) + shmflags |= SHM_ALLOW_SEALING; + return (__sys_shm_open2(SHM_ANON, oflags, 0, shmflags, memfd_name)); +} Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Wed Sep 25 18:03:15 2019 (r352702) +++ head/sys/sys/mman.h Wed Sep 25 18:03:18 2019 (r352703) @@ -182,6 +182,30 @@ */ #define SHM_ALLOW_SEALING 0x00000001 +/* + * Flags for memfd_create(). + */ +#define MFD_ALLOW_SEALING 0x00000001 +#define MFD_CLOEXEC 0x00000002 + +/* UNSUPPORTED */ +#define MFD_HUGETLB 0x00000004 + +#define MFD_HUGE_MASK 0xFC000000 +#define MFD_HUGE_SHIFT 26 +#define MFD_HUGE_64KB (16 << MFD_HUGE_SHIFT) +#define MFD_HUGE_512KB (19 << MFD_HUGE_SHIFT) +#define MFD_HUGE_1MB (20 << MFD_HUGE_SHIFT) +#define MFD_HUGE_2MB (21 << MFD_HUGE_SHIFT) +#define MFD_HUGE_8MB (23 << MFD_HUGE_SHIFT) +#define MFD_HUGE_16MB (24 << MFD_HUGE_SHIFT) +#define MFD_HUGE_32MB (25 << MFD_HUGE_SHIFT) +#define MFD_HUGE_256MB (28 << MFD_HUGE_SHIFT) +#define MFD_HUGE_512MB (29 << MFD_HUGE_SHIFT) +#define MFD_HUGE_1GB (30 << MFD_HUGE_SHIFT) +#define MFD_HUGE_2GB (31 << MFD_HUGE_SHIFT) +#define MFD_HUGE_16GB (34 << MFD_HUGE_SHIFT) + #endif /* __BSD_VISIBLE */ /* @@ -290,6 +314,9 @@ int mlockall(int); int munlockall(void); int shm_open(const char *, int, mode_t); int shm_unlink(const char *); +#endif +#if __BSD_VISIBLE +int memfd_create(const char *, unsigned int); #endif __END_DECLS Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Wed Sep 25 18:03:15 2019 (r352702) +++ head/tests/sys/kern/Makefile Wed Sep 25 18:03:18 2019 (r352703) @@ -9,6 +9,7 @@ TESTSDIR= ${TESTSBASE}/sys/kern ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= kill_zombie +ATF_TESTS_C+= memfd_test ATF_TESTS_C+= ptrace_test TEST_METADATA.ptrace_test+= timeout="15" ATF_TESTS_C+= reaper Added: head/tests/sys/kern/memfd_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/memfd_test.c Wed Sep 25 18:03:18 2019 (r352703) @@ -0,0 +1,276 @@ +/*- + * Copyright (c) 2019 Kyle Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include + +ATF_TC_WITHOUT_HEAD(basic); +ATF_TC_BODY(basic, tc) +{ + int fd; + char buf[8]; + + ATF_REQUIRE((fd = memfd_create("...", 0)) != -1); + + /* File size should be initially 0 */ + ATF_REQUIRE(write(fd, buf, sizeof(buf)) == 0); + + /* ftruncate(2) must succeed without seals */ + ATF_REQUIRE(ftruncate(fd, sizeof(buf) - 1) == 0); + + ATF_REQUIRE(write(fd, buf, sizeof(buf)) == sizeof(buf) - 1); + + close(fd); +} + +ATF_TC_WITHOUT_HEAD(cloexec); +ATF_TC_BODY(cloexec, tc) +{ + int fd_nocl, fd_cl; + + ATF_REQUIRE((fd_nocl = memfd_create("...", 0)) != -1); + ATF_REQUIRE((fd_cl = memfd_create("...", MFD_CLOEXEC)) != -1); + + ATF_REQUIRE((fcntl(fd_nocl, F_GETFD) & FD_CLOEXEC) == 0); + ATF_REQUIRE((fcntl(fd_cl, F_GETFD) & FD_CLOEXEC) != 0); + + close(fd_nocl); + close(fd_cl); +} + +ATF_TC_WITHOUT_HEAD(disallowed_sealing); +ATF_TC_BODY(disallowed_sealing, tc) +{ + int fd; + + ATF_REQUIRE((fd = memfd_create("...", 0)) != -1); + ATF_REQUIRE(fcntl(fd, F_GET_SEALS) == F_SEAL_SEAL); + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == -1); + ATF_REQUIRE(errno == EPERM); + + close(fd); +} + +#define BUF_SIZE 1024 + +ATF_TC_WITHOUT_HEAD(write_seal); +ATF_TC_BODY(write_seal, tc) +{ + int fd; + char *addr, buf[BUF_SIZE]; + + ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); + ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0); + + /* Write once, then we'll seal it and try again */ + ATF_REQUIRE(write(fd, buf, BUF_SIZE) == BUF_SIZE); + ATF_REQUIRE(lseek(fd, 0, SEEK_SET) == 0); + + addr = mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_PRIVATE, fd, 0); + ATF_REQUIRE(addr != MAP_FAILED); + ATF_REQUIRE(munmap(addr, BUF_SIZE) == 0); + + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == 0); + + ATF_REQUIRE(write(fd, buf, BUF_SIZE) == -1); + ATF_REQUIRE(errno == EPERM); + + ATF_REQUIRE(mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_SHARED, + fd, 0) == MAP_FAILED); + ATF_REQUIRE(errno == EPERM); + + close(fd); +} + +ATF_TC_WITHOUT_HEAD(mmap_write_seal); +ATF_TC_BODY(mmap_write_seal, tc) +{ + int fd; + char *addr, *paddr, *raddr; + + ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); + ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0); + + /* Map it, both shared and privately */ + addr = mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0); + ATF_REQUIRE(addr != MAP_FAILED); + paddr = mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_PRIVATE, fd, 0); + ATF_REQUIRE(paddr != MAP_FAILED); + raddr = mmap(0, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0); + ATF_REQUIRE(raddr != MAP_FAILED); + + /* Now try to seal it before unmapping */ + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == -1); + ATF_REQUIRE(errno == EBUSY); + + ATF_REQUIRE(munmap(addr, BUF_SIZE) == 0); + + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE) == 0); + + ATF_REQUIRE(munmap(paddr, BUF_SIZE) == 0); + ATF_REQUIRE(munmap(raddr, BUF_SIZE) == 0); + ATF_REQUIRE(mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_SHARED, + fd, 0) == MAP_FAILED); + ATF_REQUIRE(errno == EPERM); + paddr = mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_PRIVATE, fd, 0); + ATF_REQUIRE(paddr != MAP_FAILED); + raddr = mmap(0, BUF_SIZE, PROT_READ, MAP_SHARED, fd, 0); + ATF_REQUIRE(raddr != MAP_FAILED); + ATF_REQUIRE(munmap(raddr, BUF_SIZE) == 0); + ATF_REQUIRE(munmap(paddr, BUF_SIZE) == 0); + + close(fd); +} + +static int +memfd_truncate_test(int initial_size, int dest_size, int seals) +{ + int err, fd; + + ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); + ATF_REQUIRE(ftruncate(fd, initial_size) == 0); + + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, seals) == 0); + + err = ftruncate(fd, dest_size); + if (err != 0) + err = errno; + close(fd); + return (err); +} + +ATF_TC_WITHOUT_HEAD(truncate_seals); +ATF_TC_BODY(truncate_seals, tc) +{ + + ATF_REQUIRE(memfd_truncate_test(4, 8, F_SEAL_GROW) == EPERM); + ATF_REQUIRE(memfd_truncate_test(8, 4, F_SEAL_SHRINK) == EPERM); + ATF_REQUIRE(memfd_truncate_test(8, 4, F_SEAL_GROW) == 0); + ATF_REQUIRE(memfd_truncate_test(4, 8, F_SEAL_SHRINK) == 0); + + ATF_REQUIRE(memfd_truncate_test(4, 8, F_SEAL_GROW | F_SEAL_SHRINK) == + EPERM); + ATF_REQUIRE(memfd_truncate_test(8, 4, F_SEAL_GROW | F_SEAL_SHRINK) == + EPERM); + ATF_REQUIRE(memfd_truncate_test(4, 4, F_SEAL_GROW | F_SEAL_SHRINK) == + 0); +} + +ATF_TC_WITHOUT_HEAD(get_seals); +ATF_TC_BODY(get_seals, tc) +{ + int fd; + int seals; + + ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); + ATF_REQUIRE(fcntl(fd, F_GET_SEALS) == 0); + + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE | F_SEAL_GROW) == 0); + seals = fcntl(fd, F_GET_SEALS); + ATF_REQUIRE(seals == (F_SEAL_WRITE | F_SEAL_GROW)); + + close(fd); +} + +ATF_TC_WITHOUT_HEAD(dup_seals); +ATF_TC_BODY(dup_seals, tc) +{ + char buf[8]; + int fd, fdx; + int seals; + + ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); + ATF_REQUIRE((fdx = dup(fd)) != -1); + ATF_REQUIRE(fcntl(fd, F_GET_SEALS) == 0); + + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_WRITE | F_SEAL_GROW) == 0); + seals = fcntl(fd, F_GET_SEALS); + ATF_REQUIRE(seals == (F_SEAL_WRITE | F_SEAL_GROW)); + + seals = fcntl(fdx, F_GET_SEALS); + ATF_REQUIRE(seals == (F_SEAL_WRITE | F_SEAL_GROW)); + + /* Make sure the seal's actually being applied at the inode level */ + ATF_REQUIRE(write(fdx, buf, sizeof(buf)) == -1); + ATF_REQUIRE(errno == EPERM); + + ATF_REQUIRE(mmap(0, BUF_SIZE, (PROT_READ | PROT_WRITE), MAP_SHARED, + fdx, 0) == MAP_FAILED); + ATF_REQUIRE(errno == EPERM); + + close(fd); + close(fdx); +} + +ATF_TC_WITHOUT_HEAD(immutable_seals); +ATF_TC_BODY(immutable_seals, tc) +{ + int fd; + + ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); + + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_SEAL) == 0); + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_GROW) == -1); + ATF_REQUIRE_MSG(errno == EPERM, + "Added unique grow seal after restricting seals"); + + close(fd); + + /* + * Also check that adding a seal that already exists really doesn't + * do anything once we're sealed. + */ + ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); + + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_GROW | F_SEAL_SEAL) == 0); + ATF_REQUIRE(fcntl(fd, F_ADD_SEALS, F_SEAL_GROW) == -1); + ATF_REQUIRE_MSG(errno == EPERM, + "Added duplicate grow seal after restricting seals"); + close(fd); +} + + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, basic); + ATF_TP_ADD_TC(tp, cloexec); + ATF_TP_ADD_TC(tp, disallowed_sealing); + ATF_TP_ADD_TC(tp, write_seal); + ATF_TP_ADD_TC(tp, mmap_write_seal); + ATF_TP_ADD_TC(tp, truncate_seals); + ATF_TP_ADD_TC(tp, get_seals); + ATF_TP_ADD_TC(tp, dup_seals); + ATF_TP_ADD_TC(tp, immutable_seals); + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Wed Sep 25 18:04: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 E5CE912EC94; Wed, 25 Sep 2019 18:04:09 +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 46dmCY5ZdJz4Gl1; Wed, 25 Sep 2019 18:04:09 +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 A2B481B831; Wed, 25 Sep 2019 18:04:09 +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 x8PI49fd082767; Wed, 25 Sep 2019 18:04:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PI49vR082766; Wed, 25 Sep 2019 18:04:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251804.x8PI49vR082766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 18:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352704 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352704 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: Wed, 25 Sep 2019 18:04:10 -0000 Author: kevans Date: Wed Sep 25 18:04:09 2019 New Revision: 352704 URL: https://svnweb.freebsd.org/changeset/base/352704 Log: Adjust Makefile.inc1 syscall sub commit Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Sep 25 18:03:18 2019 (r352703) +++ head/Makefile.inc1 Wed Sep 25 18:04:09 2019 (r352704) @@ -947,7 +947,7 @@ _cleanobj_fast_depend_hack: .PHONY # Syscall stubs rewritten in C and obsolete MD assembly implementations # Date SVN Rev Syscalls # 20180604 r334626 brk sbrk -# 20190916 r35XXXX shm_open +# 20190916 r352703 shm_open .for f in brk sbrk shm_open @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ egrep -qw '${f}\.[sS]' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ From owner-svn-src-head@freebsd.org Wed Sep 25 18:06: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 3BCD612ED8A; Wed, 25 Sep 2019 18:06:49 +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 46dmGd0rl0z4Gws; Wed, 25 Sep 2019 18:06:49 +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 F0DCD1B832; Wed, 25 Sep 2019 18:06:48 +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 x8PI6mF2082946; Wed, 25 Sep 2019 18:06:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PI6mpF082944; Wed, 25 Sep 2019 18:06:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251806.x8PI6mpF082944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 18:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352705 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 352705 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: Wed, 25 Sep 2019 18:06:49 -0000 Author: kevans Date: Wed Sep 25 18:06:48 2019 New Revision: 352705 URL: https://svnweb.freebsd.org/changeset/base/352705 Log: Mark shm_open(2) as COMPAT12, succeeded by shm_open2 Implementation and regenerated files will follow. Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Sep 25 18:04:09 2019 (r352704) +++ head/sys/compat/freebsd32/syscalls.master Wed Sep 25 18:06:48 2019 (r352705) @@ -910,8 +910,8 @@ uint32_t length1, uint32_t length2); } #endif 481 AUE_THR_KILL2 NOPROTO { int thr_kill2(pid_t pid, long id, int sig); } -482 AUE_SHMOPEN NOPROTO { int shm_open(const char *path, int flags, \ - mode_t mode); } +482 AUE_SHMOPEN COMPAT12|NOPROTO { int shm_open(const char *path, + int flags, mode_t mode); } 483 AUE_SHMUNLINK NOPROTO { int shm_unlink(const char *path); } 484 AUE_NULL NOPROTO { int cpuset(cpusetid_t *setid); } #ifdef PAD64_REQUIRED Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Sep 25 18:04:09 2019 (r352704) +++ head/sys/kern/syscalls.master Wed Sep 25 18:06:48 2019 (r352705) @@ -2579,7 +2579,7 @@ int sig ); } -482 AUE_SHMOPEN STD { +482 AUE_SHMOPEN COMPAT12 { int shm_open( _In_z_ const char *path, int flags, From owner-svn-src-head@freebsd.org Wed Sep 25 18:09: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 3F2AA12EE4A; Wed, 25 Sep 2019 18:09:23 +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 46dmKb10pfz4H5p; Wed, 25 Sep 2019 18:09:23 +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 DB8D51B833; Wed, 25 Sep 2019 18:09:22 +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 x8PI9MDh083138; Wed, 25 Sep 2019 18:09:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PI9JL5083124; Wed, 25 Sep 2019 18:09:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251809.x8PI9JL5083124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 18:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352706 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump X-SVN-Commit-Revision: 352706 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: Wed, 25 Sep 2019 18:09:23 -0000 Author: kevans Date: Wed Sep 25 18:09:19 2019 New Revision: 352706 URL: https://svnweb.freebsd.org/changeset/base/352706 Log: sysent: regenerate after r352705 This also implements it, fixes kdump, and removes no longer needed bits from lib/libc/sys/shm_open.c for the interim. Modified: head/lib/libc/sys/shm_open.c 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/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/kern/uipc_shm.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h head/usr.bin/kdump/kdump.c Modified: head/lib/libc/sys/shm_open.c ============================================================================== --- head/lib/libc/sys/shm_open.c Wed Sep 25 18:06:48 2019 (r352705) +++ head/lib/libc/sys/shm_open.c Wed Sep 25 18:09:19 2019 (r352706) @@ -46,10 +46,6 @@ __FBSDID("$FreeBSD$"); __weak_reference(shm_open, _shm_open); __weak_reference(shm_open, __sys_shm_open); -#ifndef SYS_freebsd12_shm_open -#define SYS_freebsd12_shm_open SYS_shm_open -#endif - #define SHM_OPEN2_OSREL 1300048 #define MEMFD_NAME_PREFIX "memfd:" Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed Sep 25 18:09:19 2019 (r352706) @@ -404,7 +404,7 @@ #define FREEBSD32_SYS_freebsd32_truncate 479 #define FREEBSD32_SYS_freebsd32_ftruncate 480 #define FREEBSD32_SYS_thr_kill2 481 -#define FREEBSD32_SYS_shm_open 482 +#define FREEBSD32_SYS_freebsd12_shm_open 482 #define FREEBSD32_SYS_shm_unlink 483 #define FREEBSD32_SYS_cpuset 484 #define FREEBSD32_SYS_freebsd32_cpuset_setid 485 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Sep 25 18:09:19 2019 (r352706) @@ -500,7 +500,7 @@ const char *freebsd32_syscallnames[] = { "freebsd32_ftruncate", /* 480 = freebsd32_ftruncate */ #endif "thr_kill2", /* 481 = thr_kill2 */ - "shm_open", /* 482 = shm_open */ + "compat12.shm_open", /* 482 = freebsd12 shm_open */ "shm_unlink", /* 483 = shm_unlink */ "cpuset", /* 484 = cpuset */ #ifdef PAD64_REQUIRED Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed Sep 25 18:09:19 2019 (r352706) @@ -51,6 +51,12 @@ #define compat11(n, name) 0, (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD12 +#define compat12(n, name) n, (sy_call_t *)__CONCAT(freebsd12_,name) +#else +#define compat12(n, name) 0, (sy_call_t *)nosys +#endif + /* The casts are bogus but will do for now. */ struct sysent freebsd32_sysent[] = { #if !defined(PAD64_REQUIRED) && !defined(__amd64__) @@ -547,7 +553,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_ftruncate_args), (sy_call_t *)freebsd32_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 480 = freebsd32_ftruncate */ #endif { AS(thr_kill2_args), (sy_call_t *)sys_thr_kill2, AUE_THR_KILL2, NULL, 0, 0, 0, SY_THR_STATIC }, /* 481 = thr_kill2 */ - { AS(shm_open_args), (sy_call_t *)sys_shm_open, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 482 = shm_open */ + { compat12(AS(freebsd12_shm_open_args),shm_open), AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 482 = freebsd12 shm_open */ { AS(shm_unlink_args), (sy_call_t *)sys_shm_unlink, AUE_SHMUNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 483 = shm_unlink */ { AS(cpuset_args), (sy_call_t *)sys_cpuset, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 484 = cpuset */ #ifdef PAD64_REQUIRED Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Sep 25 18:09:19 2019 (r352706) @@ -2491,15 +2491,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* shm_open */ - case 482: { - struct shm_open_args *p = params; - uarg[0] = (intptr_t) p->path; /* const char * */ - iarg[1] = p->flags; /* int */ - iarg[2] = p->mode; /* mode_t */ - *n_args = 3; - break; - } /* shm_unlink */ case 483: { struct shm_unlink_args *p = params; @@ -7453,22 +7444,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* shm_open */ - case 482: - switch(ndx) { - case 0: - p = "userland const char *"; - break; - case 1: - p = "int"; - break; - case 2: - p = "mode_t"; - break; - default: - break; - }; - break; /* shm_unlink */ case 483: switch(ndx) { @@ -10473,11 +10448,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char * #endif /* thr_kill2 */ case 481: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* shm_open */ - case 482: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/kern/init_sysent.c Wed Sep 25 18:09:19 2019 (r352706) @@ -47,6 +47,12 @@ #define compat11(n, name) 0, (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD12 +#define compat12(n, name) n, (sy_call_t *)__CONCAT(freebsd12_,name) +#else +#define compat12(n, name) 0, (sy_call_t *)nosys +#endif + /* The casts are bogus but will do for now. */ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 0 = syscall */ @@ -531,7 +537,7 @@ struct sysent sysent[] = { { AS(truncate_args), (sy_call_t *)sys_truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 479 = truncate */ { AS(ftruncate_args), (sy_call_t *)sys_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 480 = ftruncate */ { AS(thr_kill2_args), (sy_call_t *)sys_thr_kill2, AUE_THR_KILL2, NULL, 0, 0, 0, SY_THR_STATIC }, /* 481 = thr_kill2 */ - { AS(shm_open_args), (sy_call_t *)sys_shm_open, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 482 = shm_open */ + { compat12(AS(freebsd12_shm_open_args),shm_open), AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 482 = freebsd12 shm_open */ { AS(shm_unlink_args), (sy_call_t *)sys_shm_unlink, AUE_SHMUNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 483 = shm_unlink */ { AS(cpuset_args), (sy_call_t *)sys_cpuset, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 484 = cpuset */ { AS(cpuset_setid_args), (sy_call_t *)sys_cpuset_setid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 485 = cpuset_setid */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/kern/syscalls.c Wed Sep 25 18:09:19 2019 (r352706) @@ -488,7 +488,7 @@ const char *syscallnames[] = { "truncate", /* 479 = truncate */ "ftruncate", /* 480 = ftruncate */ "thr_kill2", /* 481 = thr_kill2 */ - "shm_open", /* 482 = shm_open */ + "compat12.shm_open", /* 482 = freebsd12 shm_open */ "shm_unlink", /* 483 = shm_unlink */ "cpuset", /* 484 = cpuset */ "cpuset_setid", /* 485 = cpuset_setid */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/kern/systrace_args.c Wed Sep 25 18:09:19 2019 (r352706) @@ -2575,15 +2575,6 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* shm_open */ - case 482: { - struct shm_open_args *p = params; - uarg[0] = (intptr_t) p->path; /* const char * */ - iarg[1] = p->flags; /* int */ - iarg[2] = p->mode; /* mode_t */ - *n_args = 3; - break; - } /* shm_unlink */ case 483: { struct shm_unlink_args *p = params; @@ -7555,22 +7546,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* shm_open */ - case 482: - switch(ndx) { - case 0: - p = "userland const char *"; - break; - case 1: - p = "int"; - break; - case 2: - p = "mode_t"; - break; - default: - break; - }; - break; /* shm_unlink */ case 483: switch(ndx) { @@ -10442,11 +10417,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* thr_kill2 */ case 481: - if (ndx == 0 || ndx == 1) - p = "int"; - break; - /* shm_open */ - case 482: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/kern/uipc_shm.c Wed Sep 25 18:09:19 2019 (r352706) @@ -904,13 +904,15 @@ kern_shm_open(struct thread *td, const char *userpath, } /* System calls. */ +#ifdef COMPAT_FREEBSD12 int -sys_shm_open(struct thread *td, struct shm_open_args *uap) +freebsd12_shm_open(struct thread *td, struct freebsd12_shm_open_args *uap) { return (kern_shm_open(td, uap->path, uap->flags | O_CLOEXEC, uap->mode, NULL, F_SEAL_SEAL)); } +#endif int sys_shm_unlink(struct thread *td, struct shm_unlink_args *uap) Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/sys/syscall.h Wed Sep 25 18:09:19 2019 (r352706) @@ -418,7 +418,7 @@ #define SYS_truncate 479 #define SYS_ftruncate 480 #define SYS_thr_kill2 481 -#define SYS_shm_open 482 +#define SYS_freebsd12_shm_open 482 #define SYS_shm_unlink 483 #define SYS_cpuset 484 #define SYS_cpuset_setid 485 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/sys/syscall.mk Wed Sep 25 18:09:19 2019 (r352706) @@ -327,7 +327,7 @@ MIASM = \ truncate.o \ ftruncate.o \ thr_kill2.o \ - shm_open.o \ + freebsd12_shm_open.o \ shm_unlink.o \ cpuset.o \ cpuset_setid.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Sep 25 18:06:48 2019 (r352705) +++ head/sys/sys/sysproto.h Wed Sep 25 18:09:19 2019 (r352706) @@ -1381,11 +1381,6 @@ struct thr_kill2_args { char id_l_[PADL_(long)]; long id; char id_r_[PADR_(long)]; char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; }; -struct shm_open_args { - char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; -}; struct shm_unlink_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; }; @@ -2123,7 +2118,6 @@ int sys_lseek(struct thread *, struct lseek_args *); int sys_truncate(struct thread *, struct truncate_args *); int sys_ftruncate(struct thread *, struct ftruncate_args *); int sys_thr_kill2(struct thread *, struct thr_kill2_args *); -int sys_shm_open(struct thread *, struct shm_open_args *); int sys_shm_unlink(struct thread *, struct shm_unlink_args *); int sys_cpuset(struct thread *, struct cpuset_args *); int sys_cpuset_setid(struct thread *, struct cpuset_setid_args *); @@ -2654,6 +2648,12 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #ifdef COMPAT_FREEBSD12 +struct freebsd12_shm_open_args { + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; +}; +int freebsd12_shm_open(struct thread *, struct freebsd12_shm_open_args *); #endif /* COMPAT_FREEBSD12 */ @@ -3037,7 +3037,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_truncate AUE_TRUNCATE #define SYS_AUE_ftruncate AUE_FTRUNCATE #define SYS_AUE_thr_kill2 AUE_THR_KILL2 -#define SYS_AUE_shm_open AUE_SHMOPEN +#define SYS_AUE_freebsd12_shm_open AUE_SHMOPEN #define SYS_AUE_shm_unlink AUE_SHMUNLINK #define SYS_AUE_cpuset AUE_NULL #define SYS_AUE_cpuset_setid AUE_NULL Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Wed Sep 25 18:06:48 2019 (r352705) +++ head/usr.bin/kdump/kdump.c Wed Sep 25 18:09:19 2019 (r352706) @@ -1246,7 +1246,8 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) ip++; narg--; break; - case SYS_shm_open: +#ifdef SYS_freebsd12_shm_open + case SYS_freebsd12_shm_open: print_number(ip, narg, c); putchar(','); print_mask_arg(sysdecode_open_flags, ip[0]); @@ -1255,6 +1256,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_int sv_flags) ip += 2; narg -= 2; break; +#endif case SYS_minherit: print_number(ip, narg, c); print_number(ip, narg, c); From owner-svn-src-head@freebsd.org Wed Sep 25 18:26: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 0C69212F28E; Wed, 25 Sep 2019 18:26:34 +0000 (UTC) (envelope-from glebius@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 46dmjP6YcBz4J3R; Wed, 25 Sep 2019 18:26:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA5D81BBF4; Wed, 25 Sep 2019 18:26:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8PIQXls095265; Wed, 25 Sep 2019 18:26:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PIQVUN095257; Wed, 25 Sep 2019 18:26:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201909251826.x8PIQVUN095257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 25 Sep 2019 18:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352707 - in head/sys: conf kern net sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: conf kern net sys X-SVN-Commit-Revision: 352707 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: Wed, 25 Sep 2019 18:26:34 -0000 Author: glebius Date: Wed Sep 25 18:26:31 2019 New Revision: 352707 URL: https://svnweb.freebsd.org/changeset/base/352707 Log: Add debugging facility EPOCH_TRACE that checks that epochs entered are properly nested and warns about recursive entrances. Unlike with locks, there is nothing fundamentally wrong with such use, the intent of tracer is to help to review complex epoch-protected code paths, and we mean the network stack here. Reviewed by: hselasky Sponsored by: Netflix Pull Request: https://reviews.freebsd.org/D21610 Modified: head/sys/conf/options head/sys/kern/kern_thread.c head/sys/kern/subr_epoch.c head/sys/kern/subr_stack.c head/sys/net/if.c head/sys/sys/epoch.h head/sys/sys/proc.h head/sys/sys/stack.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Sep 25 18:09:19 2019 (r352706) +++ head/sys/conf/options Wed Sep 25 18:26:31 2019 (r352707) @@ -712,6 +712,8 @@ WITNESS_SKIPSPIN opt_witness.h WITNESS_COUNT opt_witness.h OPENSOLARIS_WITNESS opt_global.h +EPOCH_TRACE opt_epoch.h + # options for ACPI support ACPI_DEBUG opt_acpi.h ACPI_MAX_TASKS opt_acpi.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed Sep 25 18:09:19 2019 (r352706) +++ head/sys/kern/kern_thread.c Wed Sep 25 18:26:31 2019 (r352707) @@ -668,6 +668,7 @@ thread_link(struct thread *td, struct proc *p) LIST_INIT(&td->td_contested); LIST_INIT(&td->td_lprof[0]); LIST_INIT(&td->td_lprof[1]); + SLIST_INIT(&td->td_epochs); sigqueue_init(&td->td_sigqueue, p); callout_init(&td->td_slpcallout, 1); TAILQ_INSERT_TAIL(&p->p_threads, td, td_plist); @@ -684,6 +685,8 @@ thread_unlink(struct thread *td) struct proc *p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); + MPASS(SLIST_EMPTY(&td->td_epochs)); + TAILQ_REMOVE(&p->p_threads, td, td_plist); p->p_numthreads--; /* could clear a few other things here */ Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Wed Sep 25 18:09:19 2019 (r352706) +++ head/sys/kern/subr_epoch.c Wed Sep 25 18:26:31 2019 (r352707) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -47,6 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef EPOCH_TRACE +#include +#include +#include +#endif #include #include #include @@ -80,6 +84,7 @@ struct epoch { struct sx e_drain_sx; struct mtx e_drain_mtx; volatile int e_drain_count; + const char *e_name; }; /* arbitrary --- needs benchmarking */ @@ -134,6 +139,103 @@ __read_mostly epoch_t global_epoch_preempt; static void epoch_call_task(void *context __unused); static uma_zone_t pcpu_zone_record; +#ifdef EPOCH_TRACE +struct stackentry { + RB_ENTRY(stackentry) se_node; + struct stack se_stack; +}; + +static int +stackentry_compare(struct stackentry *a, struct stackentry *b) +{ + + if (a->se_stack.depth > b->se_stack.depth) + return (1); + if (a->se_stack.depth < b->se_stack.depth) + return (-1); + for (int i = 0; i < a->se_stack.depth; i++) { + if (a->se_stack.pcs[i] > b->se_stack.pcs[i]) + return (1); + if (a->se_stack.pcs[i] < b->se_stack.pcs[i]) + return (-1); + } + + return (0); +} + +RB_HEAD(stacktree, stackentry) epoch_stacks = RB_INITIALIZER(&epoch_stacks); +RB_GENERATE_STATIC(stacktree, stackentry, se_node, stackentry_compare); + +static struct mtx epoch_stacks_lock; +MTX_SYSINIT(epochstacks, &epoch_stacks_lock, "epoch_stacks", MTX_DEF); + +static void epoch_trace_report(const char *fmt, ...) __printflike(1, 2); +static inline void +epoch_trace_report(const char *fmt, ...) +{ + va_list ap; + struct stackentry se, *new; + + stack_zero(&se.se_stack); /* XXX: is it really needed? */ + stack_save(&se.se_stack); + + /* Tree is never reduced - go lockless. */ + if (RB_FIND(stacktree, &epoch_stacks, &se) != NULL) + return; + + new = malloc(sizeof(*new), M_STACK, M_NOWAIT); + if (new != NULL) { + bcopy(&se.se_stack, &new->se_stack, sizeof(struct stack)); + + mtx_lock(&epoch_stacks_lock); + new = RB_INSERT(stacktree, &epoch_stacks, new); + mtx_unlock(&epoch_stacks_lock); + if (new != NULL) + free(new, M_STACK); + } + + va_start(ap, fmt); + (void)vprintf(fmt, ap); + va_end(ap); + stack_print_ddb(&se.se_stack); +} + +static inline void +epoch_trace_enter(struct thread *td, epoch_t epoch, epoch_tracker_t et, + const char *file, int line) +{ + epoch_tracker_t iet; + + SLIST_FOREACH(iet, &td->td_epochs, et_tlink) + if (iet->et_epoch == epoch) + epoch_trace_report("Recursively entering epoch %s " + "previously entered at %s:%d\n", + epoch->e_name, iet->et_file, iet->et_line); + et->et_epoch = epoch; + et->et_file = file; + et->et_line = line; + SLIST_INSERT_HEAD(&td->td_epochs, et, et_tlink); +} + +static inline void +epoch_trace_exit(struct thread *td, epoch_t epoch, epoch_tracker_t et, + const char *file, int line) +{ + + if (SLIST_FIRST(&td->td_epochs) != et) { + epoch_trace_report("Exiting epoch %s in a not nested order. " + "Most recently entered %s at %s:%d\n", + epoch->e_name, + SLIST_FIRST(&td->td_epochs)->et_epoch->e_name, + SLIST_FIRST(&td->td_epochs)->et_file, + SLIST_FIRST(&td->td_epochs)->et_line); + /* This will panic if et is not anywhere on td_epochs. */ + SLIST_REMOVE(&td->td_epochs, et, epoch_tracker, et_tlink); + } else + SLIST_REMOVE_HEAD(&td->td_epochs, et_tlink); +} +#endif /* EPOCH_TRACE */ + static void epoch_init(void *arg __unused) { @@ -156,9 +258,10 @@ epoch_init(void *arg __unused) DPCPU_ID_PTR(cpu, epoch_cb_task), NULL, cpu, NULL, NULL, "epoch call task"); } + SLIST_INIT(&thread0.td_epochs); inited = 1; - global_epoch = epoch_alloc(0); - global_epoch_preempt = epoch_alloc(EPOCH_PREEMPT); + global_epoch = epoch_alloc("Global", 0); + global_epoch_preempt = epoch_alloc("Global preemptible", EPOCH_PREEMPT); } SYSINIT(epoch, SI_SUB_TASKQ + 1, SI_ORDER_FIRST, epoch_init, NULL); @@ -198,7 +301,7 @@ epoch_adjust_prio(struct thread *td, u_char prio) } epoch_t -epoch_alloc(int flags) +epoch_alloc(const char *name, int flags) { epoch_t epoch; @@ -210,6 +313,7 @@ epoch_alloc(int flags) MPASS(epoch_count < MAX_EPOCHS - 2); epoch->e_flags = flags; epoch->e_idx = epoch_count; + epoch->e_name = name; sx_init(&epoch->e_drain_sx, "epoch-drain-sx"); mtx_init(&epoch->e_drain_mtx, "epoch-drain-mtx", NULL, MTX_DEF); allepochs[epoch_count++] = epoch; @@ -243,7 +347,7 @@ epoch_currecord(epoch_t epoch) } while (0) void -epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) +_epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et EPOCH_FILE_LINE) { struct epoch_record *er; struct thread *td; @@ -251,16 +355,14 @@ epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) MPASS(cold || epoch != NULL); INIT_CHECK(epoch); MPASS(epoch->e_flags & EPOCH_PREEMPT); -#ifdef EPOCH_TRACKER_DEBUG - et->et_magic_pre = EPOCH_MAGIC0; - et->et_magic_post = EPOCH_MAGIC1; -#endif td = curthread; +#ifdef EPOCH_TRACE + epoch_trace_enter(td, epoch, et, file, line); +#endif et->et_td = td; td->td_epochnest++; critical_enter(); sched_pin(); - td->td_pre_epoch_prio = td->td_priority; er = epoch_currecord(epoch); TAILQ_INSERT_TAIL(&er->er_tdlist, et, et_link); @@ -277,7 +379,6 @@ epoch_enter(epoch_t epoch) MPASS(cold || epoch != NULL); INIT_CHECK(epoch); td = curthread; - td->td_epochnest++; critical_enter(); er = epoch_currecord(epoch); @@ -285,7 +386,7 @@ epoch_enter(epoch_t epoch) } void -epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) +_epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et EPOCH_FILE_LINE) { struct epoch_record *er; struct thread *td; @@ -300,12 +401,6 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) MPASS(epoch->e_flags & EPOCH_PREEMPT); MPASS(et != NULL); MPASS(et->et_td == td); -#ifdef EPOCH_TRACKER_DEBUG - MPASS(et->et_magic_pre == EPOCH_MAGIC0); - MPASS(et->et_magic_post == EPOCH_MAGIC1); - et->et_magic_pre = 0; - et->et_magic_post = 0; -#endif #ifdef INVARIANTS et->et_td = (void*)0xDEADBEEF; #endif @@ -315,6 +410,9 @@ epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) if (__predict_false(td->td_pre_epoch_prio != td->td_priority)) epoch_adjust_prio(td, td->td_pre_epoch_prio); critical_exit(); +#ifdef EPOCH_TRACE + epoch_trace_exit(td, epoch, et, file, line); +#endif } void Modified: head/sys/kern/subr_stack.c ============================================================================== --- head/sys/kern/subr_stack.c Wed Sep 25 18:09:19 2019 (r352706) +++ head/sys/kern/subr_stack.c Wed Sep 25 18:26:31 2019 (r352707) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); FEATURE(stack, "Support for capturing kernel stack"); -static MALLOC_DEFINE(M_STACK, "stack", "Stack Traces"); +MALLOC_DEFINE(M_STACK, "stack", "Stack Traces"); static int stack_symbol(vm_offset_t pc, char *namebuf, u_int buflen, long *offset, int flags); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Sep 25 18:09:19 2019 (r352706) +++ head/sys/net/if.c Wed Sep 25 18:26:31 2019 (r352707) @@ -940,8 +940,8 @@ static void if_epochalloc(void *dummy __unused) { - net_epoch_preempt = epoch_alloc(EPOCH_PREEMPT); - net_epoch = epoch_alloc(0); + net_epoch_preempt = epoch_alloc("Net preemptible", EPOCH_PREEMPT); + net_epoch = epoch_alloc("Net", 0); } SYSINIT(ifepochalloc, SI_SUB_TASKQ + 1, SI_ORDER_ANY, if_epochalloc, NULL); Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Wed Sep 25 18:09:19 2019 (r352706) +++ head/sys/sys/epoch.h Wed Sep 25 18:26:31 2019 (r352707) @@ -41,6 +41,8 @@ typedef struct epoch_context *epoch_context_t; #include #include +#include "opt_epoch.h" + struct epoch; typedef struct epoch *epoch_t; @@ -51,21 +53,19 @@ extern epoch_t global_epoch; extern epoch_t global_epoch_preempt; struct epoch_tracker { -#ifdef EPOCH_TRACKER_DEBUG -#define EPOCH_MAGIC0 0xFADECAFEF00DD00D -#define EPOCH_MAGIC1 0xBADDBABEDEEDFEED - uint64_t et_magic_pre; -#endif TAILQ_ENTRY(epoch_tracker) et_link; struct thread *et_td; ck_epoch_section_t et_section; -#ifdef EPOCH_TRACKER_DEBUG - uint64_t et_magic_post; +#ifdef EPOCH_TRACE + struct epoch *et_epoch; + SLIST_ENTRY(epoch_tracker) et_tlink; + const char *et_file; + int et_line; #endif } __aligned(sizeof(void *)); typedef struct epoch_tracker *epoch_tracker_t; -epoch_t epoch_alloc(int flags); +epoch_t epoch_alloc(const char *name, int flags); void epoch_free(epoch_t epoch); void epoch_wait(epoch_t epoch); void epoch_wait_preempt(epoch_t epoch); @@ -75,11 +75,22 @@ int in_epoch(epoch_t epoch); int in_epoch_verbose(epoch_t epoch, int dump_onfail); DPCPU_DECLARE(int, epoch_cb_count); DPCPU_DECLARE(struct grouptask, epoch_cb_task); -#define EPOCH_MAGIC0 0xFADECAFEF00DD00D -#define EPOCH_MAGIC1 0xBADDBABEDEEDFEED -void epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et); -void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et); +#ifdef EPOCH_TRACE +#define EPOCH_FILE_LINE , const char *file, int line +#else +#define EPOCH_FILE_LINE +#endif + +void _epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et EPOCH_FILE_LINE); +void _epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et EPOCH_FILE_LINE); +#ifdef EPOCH_TRACE +#define epoch_enter_preempt(epoch, et) _epoch_enter_preempt(epoch, et, __FILE__, __LINE__) +#define epoch_exit_preempt(epoch, et) _epoch_exit_preempt(epoch, et, __FILE__, __LINE__) +#else +#define epoch_enter_preempt(epoch, et) _epoch_enter_preempt(epoch, et) +#define epoch_exit_preempt(epoch, et) _epoch_exit_preempt(epoch, et) +#endif void epoch_enter(epoch_t epoch); void epoch_exit(epoch_t epoch); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Sep 25 18:09:19 2019 (r352706) +++ head/sys/sys/proc.h Wed Sep 25 18:26:31 2019 (r352707) @@ -367,6 +367,7 @@ struct thread { void *td_lkpi_task; /* LinuxKPI task struct pointer */ struct epoch_tracker *td_et; /* (k) compat KPI spare tracker */ int td_pmcpend; + SLIST_HEAD(, epoch_tracker) td_epochs; }; struct thread0_storage { Modified: head/sys/sys/stack.h ============================================================================== --- head/sys/sys/stack.h Wed Sep 25 18:09:19 2019 (r352706) +++ head/sys/sys/stack.h Wed Sep 25 18:26:31 2019 (r352707) @@ -33,6 +33,10 @@ #include +#ifdef _SYS_MALLOC_H_ +MALLOC_DECLARE(M_STACK); +#endif + struct sbuf; /* MI Routines. */ From owner-svn-src-head@freebsd.org Wed Sep 25 18:48: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 BF43512F851; Wed, 25 Sep 2019 18:48:05 +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 46dnBF40ncz4K3G; Wed, 25 Sep 2019 18:48:05 +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 6D4751BF8C; Wed, 25 Sep 2019 18:48:05 +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 x8PIm5d4007379; Wed, 25 Sep 2019 18:48:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PIm5k6007378; Wed, 25 Sep 2019 18:48:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251848.x8PIm5k6007378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 18:48:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352709 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 352709 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: Wed, 25 Sep 2019 18:48:05 -0000 Author: kevans Date: Wed Sep 25 18:48:05 2019 New Revision: 352709 URL: https://svnweb.freebsd.org/changeset/base/352709 Log: compat/freebsd32: restore style after r352705 (no functional change) The escaped newlines haven't been necessary since r339624, but this file has not been reformatted. Restore the style. Modified: head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Sep 25 18:47:05 2019 (r352708) +++ head/sys/compat/freebsd32/syscalls.master Wed Sep 25 18:48:05 2019 (r352709) @@ -910,8 +910,8 @@ uint32_t length1, uint32_t length2); } #endif 481 AUE_THR_KILL2 NOPROTO { int thr_kill2(pid_t pid, long id, int sig); } -482 AUE_SHMOPEN COMPAT12|NOPROTO { int shm_open(const char *path, - int flags, mode_t mode); } +482 AUE_SHMOPEN COMPAT12|NOPROTO { int shm_open( \ + const char *path, int flags, mode_t mode); } 483 AUE_SHMUNLINK NOPROTO { int shm_unlink(const char *path); } 484 AUE_NULL NOPROTO { int cpuset(cpusetid_t *setid); } #ifdef PAD64_REQUIRED From owner-svn-src-head@freebsd.org Wed Sep 25 18:50: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 AD7C412FA74; Wed, 25 Sep 2019 18:50:58 +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 46dnFZ4Bvhz4KMT; Wed, 25 Sep 2019 18:50:58 +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 74C771BFD4; Wed, 25 Sep 2019 18:50:58 +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 x8PIowGd008295; Wed, 25 Sep 2019 18:50:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PIovMr008289; Wed, 25 Sep 2019 18:50:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909251850.x8PIovMr008289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 25 Sep 2019 18:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352710 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 352710 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: Wed, 25 Sep 2019 18:50:58 -0000 Author: dim Date: Wed Sep 25 18:50:57 2019 New Revision: 352710 URL: https://svnweb.freebsd.org/changeset/base/352710 Log: Do not left-shift a negative number (inducing undefined behavior in C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate computations that compute the IEEE-754 bit pattern for |2**k| for integer |k|. The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to compute IEEE-754 bit patterns for 2**k in certain places. (k is an integer and 2**k is exactly representable in IEEE-754.) Currently they do things like 0x3FF0'0000+(k<<20), which is to say they take the bit pattern representing 1 and then add directly to the exponent field to get the desired power of two. This is fine when k is non-negative. But when k<0 (and certain classes of input trigger this), this left-shifts a negative number -- an operation with undefined behavior in C and C++. The desired semantics can be achieved by instead adding the possibly-negative k to the IEEE-754 exponent bias to get the desired exponent field, _then_ shifting that into its proper overall position. (Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD and SET_FLOAT_WORD uses further down in each of these files that perform shift operations involving k, but by these points k's range has been restricted to 2 < k <= 56, and the shift operations under those circumstances can't do anything that would be UB.) Submitted by: Jeff Walden, https://github.com/jswalden Obtained from: https://github.com/freebsd/freebsd/pull/411 Obtained from: https://github.com/freebsd/freebsd/pull/412 MFC after: 3 days Modified: head/lib/msun/src/e_exp.c head/lib/msun/src/e_expf.c head/lib/msun/src/s_expm1.c head/lib/msun/src/s_expm1f.c Modified: head/lib/msun/src/e_exp.c ============================================================================== --- head/lib/msun/src/e_exp.c Wed Sep 25 18:48:05 2019 (r352709) +++ head/lib/msun/src/e_exp.c Wed Sep 25 18:50:57 2019 (r352710) @@ -145,9 +145,9 @@ __ieee754_exp(double x) /* default IEEE double exp */ /* x is now in primary range */ t = x*x; if(k >= -1021) - INSERT_WORDS(twopk,0x3ff00000+(k<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0); else - INSERT_WORDS(twopk,0x3ff00000+((k+1000)<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+(k+1000)))<<20, 0); c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); if(k==0) return one-((x*c)/(c-2.0)-x); else y = one-((lo-(x*c)/(2.0-c))-hi); Modified: head/lib/msun/src/e_expf.c ============================================================================== --- head/lib/msun/src/e_expf.c Wed Sep 25 18:48:05 2019 (r352709) +++ head/lib/msun/src/e_expf.c Wed Sep 25 18:50:57 2019 (r352710) @@ -83,9 +83,9 @@ __ieee754_expf(float x) /* x is now in primary range */ t = x*x; if(k >= -125) - SET_FLOAT_WORD(twopk,0x3f800000+(k<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); else - SET_FLOAT_WORD(twopk,0x3f800000+((k+100)<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+(k+100)))<<23); c = x - t*(P1+t*P2); if(k==0) return one-((x*c)/(c-(float)2.0)-x); else y = one-((lo-(x*c)/((float)2.0-c))-hi); Modified: head/lib/msun/src/s_expm1.c ============================================================================== --- head/lib/msun/src/s_expm1.c Wed Sep 25 18:48:05 2019 (r352709) +++ head/lib/msun/src/s_expm1.c Wed Sep 25 18:50:57 2019 (r352710) @@ -188,7 +188,7 @@ expm1(double x) e = hxs*((r1-t)/(6.0 - x*t)); if(k==0) return x - (x*e-hxs); /* c is 0 */ else { - INSERT_WORDS(twopk,0x3ff00000+(k<<20),0); /* 2^k */ + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20,0); /* 2^k */ e = (x*(e-c)-c); e -= hxs; if(k== -1) return 0.5*(x-e)-0.5; Modified: head/lib/msun/src/s_expm1f.c ============================================================================== --- head/lib/msun/src/s_expm1f.c Wed Sep 25 18:48:05 2019 (r352709) +++ head/lib/msun/src/s_expm1f.c Wed Sep 25 18:50:57 2019 (r352710) @@ -94,7 +94,7 @@ expm1f(float x) e = hxs*((r1-t)/((float)6.0 - x*t)); if(k==0) return x - (x*e-hxs); /* c is 0 */ else { - SET_FLOAT_WORD(twopk,0x3f800000+(k<<23)); /* 2^k */ + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); /* 2^k */ e = (x*(e-c)-c); e -= hxs; if(k== -1) return (float)0.5*(x-e)-(float)0.5; From owner-svn-src-head@freebsd.org Wed Sep 25 19:13:24 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 789C91301E5; Wed, 25 Sep 2019 19:13:24 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) (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 46dnlR27dMz4LbB; Wed, 25 Sep 2019 19:13:23 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f67.google.com with SMTP id a1so1690892ioc.6; Wed, 25 Sep 2019 12:13:23 -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=8F9smyiez7GI1Ibot53O7iWeEYfbykqcc7leatNFeJc=; b=SuBEhedfX6e02ND70chsdtR43Q9kgZCdImya/nwlJXWW2qljABlLn8Ija8gcd1n52q ZWL0tHtHRExJZ+mPOKb4HmfZqK5wRbPK1sZUsJnc0DT+tsgBM+y1w6YnDaouF6Q1t4ST hIpsQ+lkVzh8XYBJrAhWDSyEJCPx6JwVTBE32kpUpSIuhaTzbvKXL/UM7Mu5dh4Kt8ik uJE0zKC0agZH1bCZ07kYMEl/2TsRU1iH9U12WxkTW5sJk+/XP+stDTXAfxlHjmn6ArV5 h0hwavWvyMoLLCgKBnczq5u+uhw/sO4HF4865CSoxhEfZL+nlEq6xShyHYA73oUnh/5K 9MOA== X-Gm-Message-State: APjAAAVsSt5A9iWnjma9B1loZs86xssgHpuODe2F9de4SJ3lwcut85Va ALlKRCams2/jCGD7Rn4Dpp7RwkMOGLv30DUb2+r+4Q== X-Google-Smtp-Source: APXvYqyhuEgsYV3wfL4hjDUs9aNUt/wKVRr7sovMuZj+uAG8QgP+3Zi4OwjLqWYEdIjZKX4OGgU4mWAG7TYLMYTG+oA= X-Received: by 2002:a6b:bb86:: with SMTP id l128mr1016804iof.18.1569438802186; Wed, 25 Sep 2019 12:13:22 -0700 (PDT) MIME-Version: 1.0 References: <201908210145.x7L1jU3x072180@repo.freebsd.org> <20190830140337.D1405@besplex.bde.org> In-Reply-To: <20190830140337.D1405@besplex.bde.org> From: Ed Maste Date: Wed, 25 Sep 2019 15:13:09 -0400 Message-ID: Subject: Re: svn commit: r351319 - in head/usr.sbin/makefs: ffs msdos To: Bruce Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46dnlR27dMz4LbB X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.67 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-3.42 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[67.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.42)[ip: (-1.59), ipnet: 209.85.128.0/17(-3.29), asn: 15169(-2.18), country: US(-0.05)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_TO(0.00)[optusnet.com.au]; RWL_MAILSPIKE_POSSIBLE(0.00)[67.166.85.209.rep.mailspike.net : 127.0.0.17]; 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)[emaste@freebsd.org,carpeddiem@gmail.com]; 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: Wed, 25 Sep 2019 19:13:24 -0000 On Fri, 30 Aug 2019 at 00:29, Bruce Evans wrote: > > On Wed, 21 Aug 2019, Ed Maste wrote: > > > Author: emaste > > Date: Wed Aug 21 01:45:29 2019 > > New Revision: 351319 > > URL: https://svnweb.freebsd.org/changeset/base/351319 > > > > Log: > > makefs: use `char *` not `void *` for buf b_data, drop casts in msdos > > > > (The kernel uses caddr_t.) > > This is much better than churning the copy of the working code. My eventual goal is to converge on a shared copy of these files, generally moving to what is already done in the kernel's implementation. If there's reasonable clean up or improvements to be made in the kernel code I'm interested in doing so, but I'm not really sure what to do with the caddr_ts there yet. I see that NetBSD removed all uses of caddr_t. From owner-svn-src-head@freebsd.org Wed Sep 25 19:20: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 EA3641302D8; Wed, 25 Sep 2019 19:20:42 +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 46dnvt5zTLz4LmD; Wed, 25 Sep 2019 19:20:42 +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 B08EE1C511; Wed, 25 Sep 2019 19:20:42 +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 x8PJKgra025181; Wed, 25 Sep 2019 19:20:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PJKf6E025174; Wed, 25 Sep 2019 19:20:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251920.x8PJKf6E025174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 19:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352711 - in head: lib/libc/sys sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern sys/sys X-SVN-Commit-Revision: 352711 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: Wed, 25 Sep 2019 19:20:43 -0000 Author: kevans Date: Wed Sep 25 19:20:41 2019 New Revision: 352711 URL: https://svnweb.freebsd.org/changeset/base/352711 Log: rfork(2): add RFSPAWN flag When RFSPAWN is passed, rfork exhibits vfork(2) semantics but also resets signal handlers in the child during creation to avoid a point of corruption of parent state from the child. This flag will be used by posix_spawn(3) to handle potential signal issues. Reviewed by: jilles, kib Differential Revision: https://reviews.freebsd.org/D19058 Modified: head/lib/libc/sys/rfork.2 head/sys/kern/kern_fork.c head/sys/kern/kern_sig.c head/sys/sys/proc.h head/sys/sys/signalvar.h head/sys/sys/unistd.h Modified: head/lib/libc/sys/rfork.2 ============================================================================== --- head/lib/libc/sys/rfork.2 Wed Sep 25 18:50:57 2019 (r352710) +++ head/lib/libc/sys/rfork.2 Wed Sep 25 19:20:41 2019 (r352711) @@ -5,7 +5,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 12, 2011 +.Dd September 25, 2019 .Dt RFORK 2 .Os .Sh NAME @@ -34,7 +34,9 @@ and open files. The .Fa flags argument -is the logical OR of some subset of: +is either +.Dv RFSPAWN +or the logical OR of some subset of: .Bl -tag -width ".Dv RFLINUXTHPN" .It Dv RFPROC If set a new process is created; otherwise changes affect the @@ -103,6 +105,14 @@ This is intended to mimic certain Linux clone behaviou File descriptors in a shared file descriptor table are kept open until either they are explicitly closed or all processes sharing the table exit. +.Pp +If +.Dv RFSPAWN +is passed, +.Nm +will use +.Xr vfork 2 +semantics but reset all signal actions in the child to default. .Pp If .Dv RFPROC Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Wed Sep 25 18:50:57 2019 (r352710) +++ head/sys/kern/kern_fork.c Wed Sep 25 19:20:41 2019 (r352711) @@ -170,10 +170,18 @@ sys_rfork(struct thread *td, struct rfork_args *uap) /* Don't allow kernel-only flags. */ if ((uap->flags & RFKERNELONLY) != 0) return (EINVAL); + /* RFSPAWN must not appear with others */ + if ((uap->flags & RFSPAWN) != 0 && uap->flags != RFSPAWN) + return (EINVAL); AUDIT_ARG_FFLAGS(uap->flags); bzero(&fr, sizeof(fr)); - fr.fr_flags = uap->flags; + if ((uap->flags & RFSPAWN) != 0) { + fr.fr_flags = RFFDG | RFPROC | RFPPWAIT | RFMEM; + fr.fr_flags2 = FR2_DROPSIG_CAUGHT; + } else { + fr.fr_flags = uap->flags; + } fr.fr_pidp = &pid; error = fork1(td, &fr); if (error == 0) { @@ -471,6 +479,11 @@ do_fork(struct thread *td, struct fork_req *fr, struct } else { sigacts_copy(newsigacts, p1->p_sigacts); p2->p_sigacts = newsigacts; + if ((fr->fr_flags2 & FR2_DROPSIG_CAUGHT) != 0) { + mtx_lock(&p2->p_sigacts->ps_mtx); + sig_drop_caught(p2); + mtx_unlock(&p2->p_sigacts->ps_mtx); + } } if (fr->fr_flags & RFTSIGZMB) Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Wed Sep 25 18:50:57 2019 (r352710) +++ head/sys/kern/kern_sig.c Wed Sep 25 19:20:41 2019 (r352711) @@ -986,12 +986,7 @@ execsigs(struct proc *p) PROC_LOCK_ASSERT(p, MA_OWNED); ps = p->p_sigacts; mtx_lock(&ps->ps_mtx); - while (SIGNOTEMPTY(ps->ps_sigcatch)) { - sig = sig_ffs(&ps->ps_sigcatch); - sigdflt(ps, sig); - if ((sigprop(sig) & SIGPROP_IGNORE) != 0) - sigqueue_delete_proc(p, sig); - } + sig_drop_caught(p); /* * As CloudABI processes cannot modify signal handlers, fully @@ -3856,4 +3851,21 @@ sigacts_shared(struct sigacts *ps) { return (ps->ps_refcnt > 1); +} + +void +sig_drop_caught(struct proc *p) +{ + int sig; + struct sigacts *ps; + + ps = p->p_sigacts; + PROC_LOCK_ASSERT(p, MA_OWNED); + mtx_assert(&ps->ps_mtx, MA_OWNED); + while (SIGNOTEMPTY(ps->ps_sigcatch)) { + sig = sig_ffs(&ps->ps_sigcatch); + sigdflt(ps, sig); + if ((sigprop(sig) & SIGPROP_IGNORE) != 0) + sigqueue_delete_proc(p, sig); + } } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Sep 25 18:50:57 2019 (r352710) +++ head/sys/sys/proc.h Wed Sep 25 19:20:41 2019 (r352711) @@ -1006,6 +1006,8 @@ struct fork_req { int *fr_pd_fd; int fr_pd_flags; struct filecaps *fr_pd_fcaps; + int fr_flags2; +#define FR2_DROPSIG_CAUGHT 0x00001 /* Drop caught non-DFL signals */ }; /* Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Wed Sep 25 18:50:57 2019 (r352710) +++ head/sys/sys/signalvar.h Wed Sep 25 19:20:41 2019 (r352711) @@ -381,6 +381,7 @@ void sigacts_copy(struct sigacts *dest, struct sigacts void sigacts_free(struct sigacts *ps); struct sigacts *sigacts_hold(struct sigacts *ps); int sigacts_shared(struct sigacts *ps); +void sig_drop_caught(struct proc *p); void sigexit(struct thread *td, int sig) __dead2; int sigev_findtd(struct proc *p, struct sigevent *sigev, struct thread **); int sig_ffs(sigset_t *set); Modified: head/sys/sys/unistd.h ============================================================================== --- head/sys/sys/unistd.h Wed Sep 25 18:50:57 2019 (r352710) +++ head/sys/sys/unistd.h Wed Sep 25 19:20:41 2019 (r352711) @@ -188,11 +188,14 @@ #define RFTSIGNUM(flags) (((flags) >> RFTSIGSHIFT) & RFTSIGMASK) #define RFTSIGFLAGS(signum) ((signum) << RFTSIGSHIFT) #define RFPROCDESC (1<<28) /* return a process descriptor */ -#define RFPPWAIT (1<<31) /* parent sleeps until child exits (vfork) */ +/* kernel: parent sleeps until child exits (vfork) */ +#define RFPPWAIT (1<<31) +/* user: vfork(2) semantics, clear signals */ +#define RFSPAWN (1U<<31) #define RFFLAGS (RFFDG | RFPROC | RFMEM | RFNOWAIT | RFCFDG | \ RFTHREAD | RFSIGSHARE | RFLINUXTHPN | RFSTOPPED | RFHIGHPID | RFTSIGZMB | \ - RFPROCDESC | RFPPWAIT) -#define RFKERNELONLY (RFSTOPPED | RFHIGHPID | RFPPWAIT | RFPROCDESC) + RFPROCDESC | RFSPAWN | RFPPWAIT) +#define RFKERNELONLY (RFSTOPPED | RFHIGHPID | RFPROCDESC) #endif /* __BSD_VISIBLE */ From owner-svn-src-head@freebsd.org Wed Sep 25 19:22: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 B3967130469; Wed, 25 Sep 2019 19:22:04 +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 46dnxS47mmz4M66; Wed, 25 Sep 2019 19:22:04 +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 7116D1C694; Wed, 25 Sep 2019 19:22:04 +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 x8PJM4eK030791; Wed, 25 Sep 2019 19:22:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PJM4vO030790; Wed, 25 Sep 2019 19:22:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909251922.x8PJM4vO030790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 19:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352712 - in head/lib/libc: gen sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/lib/libc: gen sys X-SVN-Commit-Revision: 352712 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: Wed, 25 Sep 2019 19:22:04 -0000 Author: kevans Date: Wed Sep 25 19:22:03 2019 New Revision: 352712 URL: https://svnweb.freebsd.org/changeset/base/352712 Log: posix_spawn(3): handle potential signal issues with vfork Described in [1], signal handlers running in a vfork child have opportunities to corrupt the parent's state. Address this by adding a new rfork(2) flag, RFSPAWN, that has vfork(2) semantics but also resets signal handlers in the child during creation. x86 uses rfork_thread(3) instead of a direct rfork(2) because rfork with RFMEM/RFSPAWN cannot work when the return address is stored on the stack -- further information about this problem is described under RFMEM in the rfork(2) man page. Addressing this has been identified as a prerequisite to using posix_spawn in subprocess on FreeBSD [2]. [1] https://ewontfix.com/7/ [2] https://bugs.python.org/issue35823 Reviewed by: jilles, kib Differential Revision: https://reviews.freebsd.org/D19058 Modified: head/lib/libc/gen/posix_spawn.c head/lib/libc/sys/rfork.2 Modified: head/lib/libc/gen/posix_spawn.c ============================================================================== --- head/lib/libc/gen/posix_spawn.c Wed Sep 25 19:20:41 2019 (r352711) +++ head/lib/libc/gen/posix_spawn.c Wed Sep 25 19:22:03 2019 (r352712) @@ -194,43 +194,115 @@ process_file_actions(const posix_spawn_file_actions_t return (0); } +struct posix_spawn_args { + const char *path; + const posix_spawn_file_actions_t *fa; + const posix_spawnattr_t *sa; + char * const * argv; + char * const * envp; + int use_env_path; + int error; +}; + +#if defined(__i386__) || defined(__amd64__) +#define _RFORK_THREAD_STACK_SIZE 4096 +#endif + static int +_posix_spawn_thr(void *data) +{ + struct posix_spawn_args *psa; + char * const *envp; + + psa = data; + if (psa->sa != NULL) { + psa->error = process_spawnattr(*psa->sa); + if (psa->error) + _exit(127); + } + if (psa->fa != NULL) { + psa->error = process_file_actions(*psa->fa); + if (psa->error) + _exit(127); + } + envp = psa->envp != NULL ? psa->envp : environ; + if (psa->use_env_path) + _execvpe(psa->path, psa->argv, envp); + else + _execve(psa->path, psa->argv, envp); + psa->error = errno; + + /* This is called in such a way that it must not exit. */ + _exit(127); +} + +static int do_posix_spawn(pid_t *pid, const char *path, const posix_spawn_file_actions_t *fa, const posix_spawnattr_t *sa, char * const argv[], char * const envp[], int use_env_path) { + struct posix_spawn_args psa; pid_t p; - volatile int error = 0; +#ifdef _RFORK_THREAD_STACK_SIZE + char *stack; - p = vfork(); - switch (p) { - case -1: - return (errno); - case 0: - if (sa != NULL) { - error = process_spawnattr(*sa); - if (error) - _exit(127); - } - if (fa != NULL) { - error = process_file_actions(*fa); - if (error) - _exit(127); - } - if (use_env_path) - _execvpe(path, argv, envp != NULL ? envp : environ); - else - _execve(path, argv, envp != NULL ? envp : environ); - error = errno; - _exit(127); - default: - if (error != 0) - _waitpid(p, NULL, WNOHANG); - else if (pid != NULL) - *pid = p; - return (error); + stack = malloc(_RFORK_THREAD_STACK_SIZE); + if (stack == NULL) + return (ENOMEM); +#endif + psa.path = path; + psa.fa = fa; + psa.sa = sa; + psa.argv = argv; + psa.envp = envp; + psa.use_env_path = use_env_path; + psa.error = 0; + + /* + * Passing RFSPAWN to rfork(2) gives us effectively a vfork that drops + * non-ignored signal handlers. We'll fall back to the slightly less + * ideal vfork(2) if we get an EINVAL from rfork -- this should only + * happen with newer libc on older kernel that doesn't accept + * RFSPAWN. + */ +#ifdef _RFORK_THREAD_STACK_SIZE + /* + * x86 stores the return address on the stack, so rfork(2) cannot work + * as-is because the child would clobber the return address om the + * parent. Because of this, we must use rfork_thread instead while + * almost every other arch stores the return address in a register. + */ + p = rfork_thread(RFSPAWN, stack + _RFORK_THREAD_STACK_SIZE, + _posix_spawn_thr, &psa); + free(stack); +#else + p = rfork(RFSPAWN); + if (p == 0) + /* _posix_spawn_thr does not return */ + _posix_spawn_thr(&psa); +#endif + /* + * The above block should leave us in a state where we've either + * succeeded and we're ready to process the results, or we need to + * fallback to vfork() if the kernel didn't like RFSPAWN. + */ + + if (p == -1 && errno == EINVAL) { + p = vfork(); + if (p == 0) + /* _posix_spawn_thr does not return */ + _posix_spawn_thr(&psa); } + if (p == -1) + return (errno); + if (psa.error != 0) + /* Failed; ready to reap */ + _waitpid(p, NULL, WNOHANG); + else if (pid != NULL) + /* exec succeeded */ + *pid = p; + return (psa.error); } int Modified: head/lib/libc/sys/rfork.2 ============================================================================== --- head/lib/libc/sys/rfork.2 Wed Sep 25 19:20:41 2019 (r352711) +++ head/lib/libc/sys/rfork.2 Wed Sep 25 19:22:03 2019 (r352712) @@ -113,6 +113,9 @@ is passed, will use .Xr vfork 2 semantics but reset all signal actions in the child to default. +This flag is used by the +.Xr posix_spawn 3 +implementation in libc. .Pp If .Dv RFPROC From owner-svn-src-head@freebsd.org Wed Sep 25 19:29: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 8B639130513; Wed, 25 Sep 2019 19:29:10 +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 46dp5f33v8z4MLw; Wed, 25 Sep 2019 19:29:10 +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 4D25B1C6F1; Wed, 25 Sep 2019 19:29:10 +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 x8PJTAjK031249; Wed, 25 Sep 2019 19:29:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PJTA2T031248; Wed, 25 Sep 2019 19:29:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909251929.x8PJTA2T031248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 25 Sep 2019 19:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352713 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352713 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: Wed, 25 Sep 2019 19:29:10 -0000 Author: mav Date: Wed Sep 25 19:29:09 2019 New Revision: 352713 URL: https://svnweb.freebsd.org/changeset/base/352713 Log: Microoptimize sched_pickcpu() after r352658. I've noticed that I missed intr check at one more SCHED_AFFINITY(), so instead of adding one more branching I prefer to remove few. Profiler shows the function CPU time reduction from 0.24% to 0.16%. MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Sep 25 19:22:03 2019 (r352712) +++ head/sys/kern/sched_ule.c Wed Sep 25 19:29:09 2019 (r352713) @@ -1270,20 +1270,28 @@ sched_pickcpu(struct thread *td, int flags) */ if (td->td_priority <= PRI_MAX_ITHD && THREAD_CAN_SCHED(td, self) && curthread->td_intr_nesting_level) { + tdq = TDQ_SELF(); + if (tdq->tdq_lowpri >= PRI_MIN_IDLE) { + SCHED_STAT_INC(pickcpu_idle_affinity); + return (self); + } ts->ts_cpu = self; intr = 1; - } else + cg = tdq->tdq_cg; + goto llc; + } else { intr = 0; + tdq = TDQ_CPU(ts->ts_cpu); + cg = tdq->tdq_cg; + } /* * If the thread can run on the last cpu and the affinity has not * expired and it is idle, run it there. */ - tdq = TDQ_CPU(ts->ts_cpu); - cg = tdq->tdq_cg; if (THREAD_CAN_SCHED(td, ts->ts_cpu) && tdq->tdq_lowpri >= PRI_MIN_IDLE && SCHED_AFFINITY(ts, CG_SHARE_L2)) { - if (!intr && cg->cg_flags & CG_FLAG_THREAD) { + if (cg->cg_flags & CG_FLAG_THREAD) { CPUSET_FOREACH(cpu, cg->cg_mask) { if (TDQ_CPU(cpu)->tdq_lowpri < PRI_MIN_IDLE) break; @@ -1295,6 +1303,7 @@ sched_pickcpu(struct thread *td, int flags) return (ts->ts_cpu); } } +llc: /* * Search for the last level cache CPU group in the tree. * Skip SMT, identical groups and caches with expired affinity. From owner-svn-src-head@freebsd.org Wed Sep 25 20:46: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 79F0E132C9A; Wed, 25 Sep 2019 20:46:10 +0000 (UTC) (envelope-from glebius@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 46dqpV2gCvz4XNV; Wed, 25 Sep 2019 20:46:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 397381D5F2; Wed, 25 Sep 2019 20:46:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8PKkAvP084903; Wed, 25 Sep 2019 20:46:10 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PKk9OF084900; Wed, 25 Sep 2019 20:46:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201909252046.x8PKk9OF084900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 25 Sep 2019 20:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352725 - in head/sys: dev/firewire net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: dev/firewire net X-SVN-Commit-Revision: 352725 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: Wed, 25 Sep 2019 20:46:10 -0000 Author: glebius Date: Wed Sep 25 20:46:09 2019 New Revision: 352725 URL: https://svnweb.freebsd.org/changeset/base/352725 Log: style(9): remove extraneous empty lines Modified: head/sys/dev/firewire/if_fwip.c head/sys/net/if_ethersubr.c head/sys/net/if_vlan.c Modified: head/sys/dev/firewire/if_fwip.c ============================================================================== --- head/sys/dev/firewire/if_fwip.c Wed Sep 25 20:01:49 2019 (r352724) +++ head/sys/dev/firewire/if_fwip.c Wed Sep 25 20:46:09 2019 (r352725) @@ -717,7 +717,6 @@ fwip_stream_input(struct fw_xferq *xferq) uint16_t src; uint32_t *p; - fwip = (struct fwip_softc *)xferq->sc; ifp = fwip->fw_softc.fwip_ifp; Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Wed Sep 25 20:01:49 2019 (r352724) +++ head/sys/net/if_ethersubr.c Wed Sep 25 20:46:09 2019 (r352725) @@ -800,7 +800,6 @@ VNET_SYSUNINIT(vnet_ether_uninit, SI_SUB_PROTO_IF, SI_ static void ether_input(struct ifnet *ifp, struct mbuf *m) { - struct mbuf *mn; /* Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Wed Sep 25 20:01:49 2019 (r352724) +++ head/sys/net/if_vlan.c Wed Sep 25 20:46:09 2019 (r352725) @@ -247,7 +247,6 @@ static struct sx _VLAN_SX_ID; #define VLAN_XLOCK_ASSERT() sx_assert(&_VLAN_SX_ID, SA_XLOCKED) #define VLAN_SXLOCK_ASSERT() sx_assert(&_VLAN_SX_ID, SA_LOCKED) - /* * We also have a per-trunk mutex that should be acquired when changing * its state. From owner-svn-src-head@freebsd.org Wed Sep 25 21:13: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 5243F13347A; Wed, 25 Sep 2019 21:13:06 +0000 (UTC) (envelope-from dim@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 46drPZ1RlBz4Yxv; Wed, 25 Sep 2019 21:13:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id F3D0FD5DF; Wed, 25 Sep 2019 21:13:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::fdb1:1a26:679b:6133] (unknown [IPv6:2001:470:7a58:0:fdb1:1a26:679b:6133]) (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 E5D275EE59; Wed, 25 Sep 2019 23:13:03 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_B7BDB3A6-35C6-49F6-90B5-165671961A09"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r352661 - head/sys/netinet/tcp_stacks Date: Wed, 25 Sep 2019 23:12:55 +0200 In-Reply-To: Cc: Bruce Evans , src-committers , svn-src-all , svn-src-head To: Ed Maste References: <201909242036.x8OKahnv021758@repo.freebsd.org> <20190925070207.Y3271@besplex.bde.org> X-Mailer: Apple Mail (2.3445.104.11) 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: Wed, 25 Sep 2019 21:13:06 -0000 --Apple-Mail=_B7BDB3A6-35C6-49F6-90B5-165671961A09 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 25 Sep 2019, at 15:36, Ed Maste wrote: >=20 > On Tue, 24 Sep 2019 at 17:39, Bruce Evans = wrote: >>=20 >> On i386, these types have different sizes, so >> gcc detects the type mismatch. clang is too broken to report this = type >> mismatch. >=20 > Interesting, it seems Clang doesn't even warn in the case of casting a > uint64_t to a 32-bit pointer. Looks like there are some useful > warnings that ought to be implemented. There is -Wconversion for this, or the more specific -Wshorten-64-to-32: $ cat shorten.c int foo(long l) { return l; } $ clang -Wconversion -c shorten.c shorten.c:3:10: warning: implicit conversion loses integer precision: = 'long' to 'int' [-Wshorten-64-to-32] return l; ~~~~~~ ^ 1 warning generated. But for some reason this warning isn't enabled by default, even with = -Wall. I guess you would get a zillion warnings on our tree, if you enabled = this. :) -Dimitry --Apple-Mail=_B7BDB3A6-35C6-49F6-90B5-165671961A09 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 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCXYvYVwAKCRCwXqMKLiCW o4otAKDfngl9Y+ZW0gOHPShvGyEvjJ8bMACeIOyQoNfj431asRs+JO7tD2LTrKU= =EjjJ -----END PGP SIGNATURE----- --Apple-Mail=_B7BDB3A6-35C6-49F6-90B5-165671961A09-- From owner-svn-src-head@freebsd.org Wed Sep 25 21:23:30 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 AB7DA1339DA; Wed, 25 Sep 2019 21:23:30 +0000 (UTC) (envelope-from yuripv@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 46drdZ43Q7z4Zd2; Wed, 25 Sep 2019 21:23:30 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6E6E31DD4D; Wed, 25 Sep 2019 21:23:30 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8PLNUkj008938; Wed, 25 Sep 2019 21:23:30 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PLNUZj008937; Wed, 25 Sep 2019 21:23:30 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201909252123.x8PLNUZj008937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 25 Sep 2019 21:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352726 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 352726 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: Wed, 25 Sep 2019 21:23:30 -0000 Author: yuripv Date: Wed Sep 25 21:23:30 2019 New Revision: 352726 URL: https://svnweb.freebsd.org/changeset/base/352726 Log: efibootmgr(8): fix markup and style issues - split synopsis into separate options that can't be used together - sort options - fix (style) issues reported by mandoc lint Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D21710 Modified: head/usr.sbin/efibootmgr/efibootmgr.8 Modified: head/usr.sbin/efibootmgr/efibootmgr.8 ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.8 Wed Sep 25 20:46:09 2019 (r352725) +++ head/usr.sbin/efibootmgr/efibootmgr.8 Wed Sep 25 21:23:30 2019 (r352726) @@ -24,20 +24,42 @@ .\" .\" $FreeBSD$ .\" -.Dd December 28, 2018 +.Dd September 24, 2019 .Dt EFIBOOTMGR 8 .Os .Sh NAME -.Nm efibootmgr +.Nm efibootmgr .Nd manipulate the EFI Boot Manager .Sh SYNOPSIS -.Op Fl aAnNB -.Op Fl b Ar bootnum -.Op Fl t Ar timeout -.Op Fl T -.Op Fl o Ar bootorder +.Nm .Op Fl v -.Op Fl c l Ar loader [ Fl k Ar kernel ] [ Fl L Ar label ] [ Fl -dry-run ] +.Nm +.Fl a +.Fl b Ar bootnum +.Nm +.Fl A +.Fl b Ar bootnum +.Nm +.Fl B +.Fl b Ar bootnum +.Nm +.Fl c +.Fl l Ar loader +.Op Fl aD +.Op Fl b Ar bootnum +.Op Fl k Ar kernel +.Op Fl L Ar label +.Nm +.Fl n +.Fl b Ar bootnum +.Nm +.Fl N +.Nm +.Fl o Ar bootorder +.Nm +.Fl t Ar timeout +.Nm +.Fl T .Sh "DESCRIPTION" .Nm manipulates how UEFI Boot Managers boot the system. @@ -50,13 +72,13 @@ The UEFI standard defines how hosts may control what i bootstrap the system. Each method is encapsulated within a persistent UEFI variable, stored by the UEFI BIOS of the form -.Va BootXXXX . +.Cm Boot Ns Em XXXX . These variables are numbered, describe where to load the bootstrap program from, and whether or not the method is active. The boot order of these methods is controlled by another variable -.Va BootOrder . -The currently booting method is communicated using -.Va BootCurrent . +.Cm BootOrder . +The currently booting method is communicated using +.Cm BootCurrent . A global timeout can also be set. .Pp .Nm @@ -64,91 +86,133 @@ requires that the kernel efirt module be loaded to get non-volatile variables. .Pp The following options are available: -.Bl -tag -width 28m -.It Fl c Fl -create -Create a new Boot Variable -.It Fl l -loader Ar loader -The path to and name of the loader. -.It Fl k -kernel Ar kernel -The path to and name of the kernel. +.Bl -tag -width Ds +.It Fl a -activate +Activate the given +.Ar bootnum +boot entry, or the new entry when used with +.Fl c . +.It Fl A -deactivate +Deactivate the given +.Ar bootnum +boot entry. .It Fl b -bootnum Ar bootnum -When creating or modifying an entry, use bootnum as the index. +When creating or modifying an entry, use +.Ar bootnum +as the index. When creating a new entry, fail if it already exists. -.It Fl L -label Ar label -An optional description for the entry. +.It Fl B -delete +Delete the given +.Ar bootnum +boot entry. +.It Fl c -create +Create a new +.Cm Boot +variable. .It Fl D -dry-run Process but do not change any variables. -.It Fl B -delete -Delete the given bootnum boot entry. -.It Fl a -activate -Activate the given bootnum boot entry, or the new entry when used with -c. -.It Fl A -deactivate -Deactivate the given bootnum boot entry. +.It Fl k -kernel Ar kernel +The path to and name of the kernel. +.It Fl l -loader Ar loader +The path to and name of the loader. +.It Fl L -label Ar label +An optional description for the entry. .It Fl n -bootnext -Set bootnum boot entry as the BootNext variable. -.It Fl N -delete-bootnext -Delete the BootNext optional variable. +Set +.Ar bootnum +boot entry as the +.Cm BootNext +variable. +.It Fl N -delete-bootnext +Delete the +.Cm BootNext +optional variable. .It Fl o -bootorder Ar bootorder -Set BootOrder variable to the given comma delimited set of bootnums. -The numbers are in hex to match BootXXXX, but may omit leading zeros. +Set +.Cm BootOrder +variable to the given comma delimited set of +.Ar bootnum Ns s . +The numbers are in hex to match +.Cm Boot Ns Em XXXX , +but may omit leading zeros. .It Fl t -set-timeout Ar timeout Set the bootmenu timeout value. .It Fl T -del-timeout -Delete the BootTimeout variable. +Delete the +.Cm BootTimeout +variable. .It Fl v -verbose Display the device path of boot entries in the output. .El -.Pp .Sh Examples +To display the current +.Cm Boot +related variables in the system: .Pp -To display the current Boot related variables in the system: -.Pp .Dl efibootmgr [-v] .Pp -This will display the optional BootNext bootnum, BootCurrent, -or currently booted bootnum, followed by the optional Timeout value, any -BootOrder that may be set, followed finally by all currently defined Boot -variables, active or not. The verbose flag will augment this output with -the disk partition uuids, size/offset and device-path of the -variable. +This will display the optional +.Cm BootNext +bootnum, +.Cm BootCurrent , +or currently booted bootnum, followed by the optional +.Cm Timeout +value, any +.Cm BootOrder +that may be set, followed finally by all currently defined +.Cm Boot +variables, active or not. +The verbose flag will augment this output with the disk partition uuids, +size/offset and device-path of the variable. .Pp The .Nm -program can be used to create new EFI boot variables. To create a new -boot var pointing to an installation with its EFI partition mounted -under /mnt, the given loader and a label "FreeBSD-11": +program can be used to create new EFI boot variables. +To create a new boot var pointing to an installation with its EFI partition +mounted under +.Pa /mnt , +the given loader and a label +.Qq FreeBSD-11 : .Pp .Dl efibootmgr -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD-11 .Pp This will result in the next available bootnum being assigned to a -new UEFI boot variable, and given the label "FreeBSD-11" such as: +new UEFI boot variable, and given the label +.Qq FreeBSD-11 +such as: .Pp .Dl Boot0009 FreeBSD-11 .Pp -Note newly created boot entries are created inactive. The active state is denoted -by an '*' following the BootXXXX name in the output. They are also inserted -into the first position of current BootOrder variable if it exists. They -must first be set to active before being considered available to attempt booting from, else they -are ignored. +Note newly created boot entries are created inactive. +The active state is denoted by an '*' following the +.Cm Boot Ns Em XXXX +name in the output. +They are also inserted into the first position of current +.Cm BootOrder +variable if it exists. +They must first be set to active before being considered available to attempt +booting from, else they are ignored. .Pp .Dl efibootmgr -B -b 0009 .Pp -Will delete the given boot entry Boot0009 +Will delete the given boot entry Boot0009. .Pp To set a given newly created boot entry active use: .Pp .Dl efibootmgr -a -b 0009 .Pp -To set a given boot entry to be used as the BootNext variable, irrespective -of its active state, use: +To set a given boot entry to be used as the +.Cm BootNext +variable, irrespective of its active state, use: .Pp .Dl efibootmgr -n -b 0009 .Pp -To set the BootOrder for the next reboot use: +To set the +.Cm BootOrder +for the next reboot use: .Pp .Dl efibootmgr -o 0009,0003,... -.Pp .Sh SEE ALSO .Xr efivar 8 , -.Xr uefi 8 , -.Xr gpart 8 +.Xr gpart 8 , +.Xr uefi 8 From owner-svn-src-head@freebsd.org Wed Sep 25 22:53: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 A371B13594A; Wed, 25 Sep 2019 22:53:31 +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 46dtdR3vCgz4fwl; Wed, 25 Sep 2019 22:53:31 +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 692101ED85; Wed, 25 Sep 2019 22:53:31 +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 x8PMrVtO061490; Wed, 25 Sep 2019 22:53:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8PMrVSU061489; Wed, 25 Sep 2019 22:53:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909252253.x8PMrVSU061489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Sep 2019 22:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352727 - in head: lib/libc/sys tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libc/sys tests/sys/kern X-SVN-Commit-Revision: 352727 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: Wed, 25 Sep 2019 22:53:31 -0000 Author: kevans Date: Wed Sep 25 22:53:30 2019 New Revision: 352727 URL: https://svnweb.freebsd.org/changeset/base/352727 Log: Add SPDX tags to recently added files Reported by: Pawel Biernacki Modified: head/lib/libc/sys/shm_open.c head/tests/sys/kern/memfd_test.c Modified: head/lib/libc/sys/shm_open.c ============================================================================== --- head/lib/libc/sys/shm_open.c Wed Sep 25 21:23:30 2019 (r352726) +++ head/lib/libc/sys/shm_open.c Wed Sep 25 22:53:30 2019 (r352727) @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2019 Kyle Evans * All rights reserved. * Modified: head/tests/sys/kern/memfd_test.c ============================================================================== --- head/tests/sys/kern/memfd_test.c Wed Sep 25 21:23:30 2019 (r352726) +++ head/tests/sys/kern/memfd_test.c Wed Sep 25 22:53:30 2019 (r352727) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2019 Kyle Evans * All rights reserved. * From owner-svn-src-head@freebsd.org Wed Sep 25 23:01: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 0B0F9135D12; Wed, 25 Sep 2019 23:01:37 +0000 (UTC) (envelope-from carpeddiem@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 46dtpm5Flvz4gQf; Wed, 25 Sep 2019 23:01:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f53.google.com with SMTP id b136so1380900iof.3; Wed, 25 Sep 2019 16:01:36 -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=UwEmUTJdH8AT5fyYLnltqm3e05I3SYIBg6sa6x1BowU=; b=WK2tepFqt8A+RtRrMA9KaSQEUjT52qf1vC202fIk+bOkXCJaGPbfVLF6gnMGh1bny8 T69H1IpuF16/cP89aZSvp5ZosMCwwbEKWRGPZhj+HcO+8Yxc/nmGrqLe0aVKrq9EZAAz CXTzVeYZP6xbS9Wh26Tjwpe97hHsF7krlNu8q/oYjuAWOad515k2a25IbbCo6kF2d1iG kAWoAlPWyhWwW6P4WSDmyPumsyMzHK+OlpXvB183/E9yBZUsM2E2vGvEoYAQs+97y6BM Asu5Aj8YSps1jVZiS4OO/DE0EDQwCXQn4+KEI8GgN0RO7jR7+miNUO8OocB0lUw9akZJ 09lQ== X-Gm-Message-State: APjAAAXWZL9d6rjKLw8P/nJgk65HSEVX4AFabkFroeqpuChJZk+fAf8f Wn5+WiwAzJDyGvzrfZyLoNyiw8GiANmZYurbLDJh7w== X-Google-Smtp-Source: APXvYqxLLbmRMJ8d/2j0TJLP9iA0kOr6Ff3pEy6Iz3d9EDEc45dxkyD0U1lswjw4e9x7/GvdSYtOgSLu6z2/6OWwhmA= X-Received: by 2002:a92:8cd9:: with SMTP id s86mr123299ill.120.1569452494371; Wed, 25 Sep 2019 16:01:34 -0700 (PDT) MIME-Version: 1.0 References: <201909242036.x8OKahnv021758@repo.freebsd.org> <20190925070207.Y3271@besplex.bde.org> In-Reply-To: From: Ed Maste Date: Wed, 25 Sep 2019 19:01:21 -0400 Message-ID: Subject: Re: svn commit: r352661 - head/sys/netinet/tcp_stacks To: Dimitry Andric Cc: Bruce Evans , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46dtpm5Flvz4gQf X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,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: Wed, 25 Sep 2019 23:01:37 -0000 On Wed, 25 Sep 2019 at 17:13, Dimitry Andric wrote: > > > Interesting, it seems Clang doesn't even warn in the case of casting a > > uint64_t to a 32-bit pointer. Looks like there are some useful > > warnings that ought to be implemented. > > There is -Wconversion for this, or the more specific -Wshorten-64-to-32: But it's not all of -Wconversion I think we want or even 64- to 32-bit warnings, but particularly conversions between pointers and integers of different sizes. From owner-svn-src-head@freebsd.org Thu Sep 26 00:35: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 6F2EB137260; Thu, 26 Sep 2019 00:35:07 +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 46dwtg25P9z4lLW; Thu, 26 Sep 2019 00:35:07 +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 256081FF76; Thu, 26 Sep 2019 00:35:07 +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 x8Q0Z6m3021658; Thu, 26 Sep 2019 00:35:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q0Z6t5021657; Thu, 26 Sep 2019 00:35:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909260035.x8Q0Z6t5021657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Sep 2019 00:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352728 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352728 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: Thu, 26 Sep 2019 00:35:07 -0000 Author: mav Date: Thu Sep 26 00:35:06 2019 New Revision: 352728 URL: https://svnweb.freebsd.org/changeset/base/352728 Log: Microoptimize sched_pickcpu() CPU affinity on SMT. Use of CPU_FFS() to implement CPUSET_FOREACH() allows to save up to ~0.5% of CPU time on 72-thread SMT system doing 80K IOPS to NVMe from one thread. MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Sep 25 22:53:30 2019 (r352727) +++ head/sys/kern/sched_ule.c Thu Sep 26 00:35:06 2019 (r352728) @@ -643,10 +643,6 @@ struct cpu_search { #define CPU_SEARCH_HIGHEST 0x2 #define CPU_SEARCH_BOTH (CPU_SEARCH_LOWEST|CPU_SEARCH_HIGHEST) -#define CPUSET_FOREACH(cpu, mask) \ - for ((cpu) = 0; (cpu) <= mp_maxid; (cpu)++) \ - if (CPU_ISSET(cpu, &mask)) - static __always_inline int cpu_search(const struct cpu_group *cg, struct cpu_search *low, struct cpu_search *high, const int match); int __noinline cpu_search_lowest(const struct cpu_group *cg, @@ -1292,13 +1288,17 @@ sched_pickcpu(struct thread *td, int flags) tdq->tdq_lowpri >= PRI_MIN_IDLE && SCHED_AFFINITY(ts, CG_SHARE_L2)) { if (cg->cg_flags & CG_FLAG_THREAD) { - CPUSET_FOREACH(cpu, cg->cg_mask) { - if (TDQ_CPU(cpu)->tdq_lowpri < PRI_MIN_IDLE) + /* Check all SMT threads for being idle. */ + for (cpu = CPU_FFS(&cg->cg_mask) - 1; ; cpu++) { + if (CPU_ISSET(cpu, &cg->cg_mask) && + TDQ_CPU(cpu)->tdq_lowpri < PRI_MIN_IDLE) break; + if (cpu >= mp_maxid) { + SCHED_STAT_INC(pickcpu_idle_affinity); + return (ts->ts_cpu); + } } - } else - cpu = INT_MAX; - if (cpu > mp_maxid) { + } else { SCHED_STAT_INC(pickcpu_idle_affinity); return (ts->ts_cpu); } From owner-svn-src-head@freebsd.org Thu Sep 26 00:54: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 E6AC5137814; Thu, 26 Sep 2019 00:54:07 +0000 (UTC) (envelope-from mhorne@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 46dxJb5vSxz4mLg; Thu, 26 Sep 2019 00:54:07 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AD9EA202F8; Thu, 26 Sep 2019 00:54:07 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8Q0s7h8033500; Thu, 26 Sep 2019 00:54:07 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q0s7s2033499; Thu, 26 Sep 2019 00:54:07 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201909260054.x8Q0s7s2033499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 26 Sep 2019 00:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352729 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 352729 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: Thu, 26 Sep 2019 00:54:08 -0000 Author: mhorne Date: Thu Sep 26 00:54:07 2019 New Revision: 352729 URL: https://svnweb.freebsd.org/changeset/base/352729 Log: Cleanup of elf_machdep.c Fix some style(9) violations. This also changes the name of the machine-dependent sysctl kern.debug_kld to debug.kld_reloc, and changes its type from int to bool. This is acceptable since we are not currently concerned with preserving the RISC-V ABI. Reviewed by: markj, kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21772 Modified: head/sys/riscv/riscv/elf_machdep.c Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Thu Sep 26 00:35:06 2019 (r352728) +++ head/sys/riscv/riscv/elf_machdep.c Thu Sep 26 00:54:07 2019 (r352729) @@ -109,13 +109,11 @@ static Elf64_Brandinfo freebsd_brand_info = { }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, - (sysinit_cfunc_t) elf64_insert_brand_entry, - &freebsd_brand_info); + (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); -static int debug_kld; -SYSCTL_INT(_kern, OID_AUTO, debug_kld, - CTLFLAG_RW, &debug_kld, 0, - "Activate debug prints in elf_reloc_internal()"); +static bool debug_kld; +SYSCTL_BOOL(_debug, OID_AUTO, kld_reloc, CTLFLAG_RW, &debug_kld, 0, + "Activate debug prints in elf_reloc_internal()"); struct type2str_ent { int type; @@ -274,7 +272,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas uint32_t before32_1; uint32_t before32; uint64_t before64; - uint32_t* insn32p; + uint32_t *insn32p; uint32_t imm20; int error; @@ -282,15 +280,15 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case ELF_RELOC_RELA: rela = (const Elf_Rela *)data; where = (Elf_Addr *)(relocbase + rela->r_offset); - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; addend = rela->r_addend; rtype = ELF_R_TYPE(rela->r_info); symidx = ELF_R_SYM(rela->r_info); break; default: printf("%s:%d unknown reloc type %d\n", - __FUNCTION__, __LINE__, type); - return -1; + __FUNCTION__, __LINE__, type); + return (-1); } switch (rtype) { @@ -301,43 +299,36 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_RISCV_JUMP_SLOT: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr; before64 = *where; if (*where != val) *where = val; - if (debug_kld) - printf("%p %c %-24s %016lx -> %016lx\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before64, *where); + printf("%p %c %-24s %016lx -> %016lx\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before64, *where); break; case R_RISCV_RELATIVE: before64 = *where; - *where = elf_relocaddr(lf, relocbase + addend); - if (debug_kld) - printf("%p %c %-24s %016lx -> %016lx\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before64, *where); + printf("%p %c %-24s %016lx -> %016lx\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before64, *where); break; case R_RISCV_JAL: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr - (Elf_Addr)where; - if ((val <= -(1UL << 20) || (1UL << 20) <= val)) { + if (val <= -(1UL << 20) || (1UL << 20) <= val) { printf("kldload: huge offset against R_RISCV_JAL\n"); - return -1; + return (-1); } before32 = *insn32p; @@ -345,13 +336,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas *insn32p = insert_imm(*insn32p, val, 10, 1, 21); *insn32p = insert_imm(*insn32p, val, 11, 11, 20); *insn32p = insert_imm(*insn32p, val, 19, 12, 12); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_CALL: @@ -359,14 +347,15 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas * R_RISCV_CALL relocates 8-byte region that consists * of the sequence of AUIPC and JALR. */ - /* calculate and check the pc relative offset. */ + /* Calculate and check the pc relative offset. */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); + val = addr - (Elf_Addr)where; - if ((val <= -(1UL << 32) || (1UL << 32) <= val)) { + if (val <= -(1UL << 32) || (1UL << 32) <= val) { printf("kldload: huge offset against R_RISCV_CALL\n"); - return -1; + return (-1); } /* Relocate AUIPC. */ @@ -377,112 +366,91 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas /* Relocate JALR. */ before32_1 = insn32p[1]; insn32p[1] = insert_imm(insn32p[1], val, 11, 0, 20); - if (debug_kld) - printf("%p %c %-24s %08x %08x -> %08x %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, insn32p[0], - before32_1, insn32p[1]); + printf("%p %c %-24s %08x %08x -> %08x %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, insn32p[0], before32_1, insn32p[1]); break; case R_RISCV_PCREL_HI20: val = addr - (Elf_Addr)where; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; imm20 = calc_hi20_imm(val); *insn32p = insert_imm(*insn32p, imm20, 31, 12, 12); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_PCREL_LO12_I: val = addr - (Elf_Addr)where; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 0, 20); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_PCREL_LO12_S: val = addr - (Elf_Addr)where; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 5, 25); *insn32p = insert_imm(*insn32p, addr, 4, 0, 7); if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_HI20: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; imm20 = calc_hi20_imm(val); *insn32p = insert_imm(*insn32p, imm20, 31, 12, 12); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_LO12_I: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 0, 20); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; case R_RISCV_LO12_S: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); val = addr; - insn32p = (uint32_t*)where; + insn32p = (uint32_t *)where; before32 = *insn32p; *insn32p = insert_imm(*insn32p, addr, 11, 5, 25); *insn32p = insert_imm(*insn32p, addr, 4, 0, 7); - if (debug_kld) - printf("%p %c %-24s %08x -> %08x\n", - where, - (local? 'l': 'g'), - reloctype_to_str(rtype), - before32, *insn32p); + printf("%p %c %-24s %08x -> %08x\n", where, + (local ? 'l' : 'g'), reloctype_to_str(rtype), + before32, *insn32p); break; default: From owner-svn-src-head@freebsd.org Thu Sep 26 00:58: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 C61D413792B; Thu, 26 Sep 2019 00:58:47 +0000 (UTC) (envelope-from mhorne@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 46dxPz4rJRz4mcb; Thu, 26 Sep 2019 00:58:47 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8999720301; Thu, 26 Sep 2019 00:58:47 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8Q0wl7j033915; Thu, 26 Sep 2019 00:58:47 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q0wlYf033914; Thu, 26 Sep 2019 00:58:47 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201909260058.x8Q0wlYf033914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 26 Sep 2019 00:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352730 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 352730 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: Thu, 26 Sep 2019 00:58:47 -0000 Author: mhorne Date: Thu Sep 26 00:58:47 2019 New Revision: 352730 URL: https://svnweb.freebsd.org/changeset/base/352730 Log: Fix some broken relocation handling In a few cases, the symbol lookup is missing before attempting to perform the relocation. While the relocation types affected are currently unused, this results in an uninitialized variable warning, that is escalated to an error when building with clang. Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21773 Modified: head/sys/riscv/riscv/elf_machdep.c Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Thu Sep 26 00:54:07 2019 (r352729) +++ head/sys/riscv/riscv/elf_machdep.c Thu Sep 26 00:58:47 2019 (r352730) @@ -373,6 +373,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_RISCV_PCREL_HI20: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + val = addr - (Elf_Addr)where; insn32p = (uint32_t *)where; before32 = *insn32p; @@ -385,6 +389,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_RISCV_PCREL_LO12_I: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + val = addr - (Elf_Addr)where; insn32p = (uint32_t *)where; before32 = *insn32p; @@ -396,6 +404,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; case R_RISCV_PCREL_LO12_S: + error = lookup(lf, symidx, 1, &addr); + if (error != 0) + return (-1); + val = addr - (Elf_Addr)where; insn32p = (uint32_t *)where; before32 = *insn32p; @@ -412,6 +424,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas if (error != 0) return (-1); + val = addr; insn32p = (uint32_t *)where; before32 = *insn32p; imm20 = calc_hi20_imm(val); From owner-svn-src-head@freebsd.org Thu Sep 26 01:50:27 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 38B26F170D; Thu, 26 Sep 2019 01:50:27 +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 46dyYZ6z90z4qLN; Thu, 26 Sep 2019 01:50:26 +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 CE95F20C7B; Thu, 26 Sep 2019 01:50:26 +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 x8Q1oQvw064311; Thu, 26 Sep 2019 01:50:26 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q1oQIM064310; Thu, 26 Sep 2019 01:50:26 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909260150.x8Q1oQIM064310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 26 Sep 2019 01:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352733 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 352733 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: Thu, 26 Sep 2019 01:50:27 -0000 Author: cem Date: Thu Sep 26 01:50:26 2019 New Revision: 352733 URL: https://svnweb.freebsd.org/changeset/base/352733 Log: amd64: Expose vm.pmap.large_map_pml4_entries as a sysctl node It's nice to have sysctl nodes for tunables. Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Sep 26 01:50:20 2019 (r352732) +++ head/sys/amd64/amd64/pmap.c Thu Sep 26 01:50:26 2019 (r352733) @@ -1965,6 +1965,11 @@ pmap_init(void) } } +SYSCTL_UINT(_vm_pmap, OID_AUTO, large_map_pml4_entries, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &lm_ents, 0, + "Maximum number of PML4 entries for use by large map (tunable). " + "Each entry corresponds to 512GB of address space."); + static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, "2MB page mapping counters"); From owner-svn-src-head@freebsd.org Thu Sep 26 01:50:27 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 38B02F170B; Thu, 26 Sep 2019 01:50:27 +0000 (UTC) (envelope-from mm@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 46dyYZ6SQbz4qLM; Thu, 26 Sep 2019 01:50:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C18E920C7A; Thu, 26 Sep 2019 01:50:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8Q1oQ1a064301; Thu, 26 Sep 2019 01:50:26 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q1oKsr064234; Thu, 26 Sep 2019 01:50:20 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201909260150.x8Q1oKsr064234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 26 Sep 2019 01:50:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352732 - in head/contrib/libarchive: cat cpio libarchive libarchive/test tar tar/test test_utils X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in head/contrib/libarchive: cat cpio libarchive libarchive/test tar tar/test test_utils X-SVN-Commit-Revision: 352732 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: Thu, 26 Sep 2019 01:50:27 -0000 Author: mm Date: Thu Sep 26 01:50:20 2019 New Revision: 352732 URL: https://svnweb.freebsd.org/changeset/base/352732 Log: MFV r352731: Sync libarchive with vendor. Relevant vendor changes: Issue #1237: Fix integer overflow in archive_read_support_filter_lz4.c PR #1249: Correct some typographical and grammatical errors. PR #1250: Minor corrections to the formatting of manual pages MFC after: 1 week Modified: head/contrib/libarchive/cat/bsdcat.1 head/contrib/libarchive/cpio/bsdcpio.1 head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_entry.3 head/contrib/libarchive/libarchive/archive_entry_acl.3 head/contrib/libarchive/libarchive/archive_entry_misc.3 head/contrib/libarchive/libarchive/archive_entry_paths.3 head/contrib/libarchive/libarchive/archive_entry_perms.3 head/contrib/libarchive/libarchive/archive_entry_stat.3 head/contrib/libarchive/libarchive/archive_entry_time.3 head/contrib/libarchive/libarchive/archive_read.3 head/contrib/libarchive/libarchive/archive_read_add_passphrase.3 head/contrib/libarchive/libarchive/archive_read_data.3 head/contrib/libarchive/libarchive/archive_read_disk.3 head/contrib/libarchive/libarchive/archive_read_extract.3 head/contrib/libarchive/libarchive/archive_read_filter.3 head/contrib/libarchive/libarchive/archive_read_format.3 head/contrib/libarchive/libarchive/archive_read_free.3 head/contrib/libarchive/libarchive/archive_read_header.3 head/contrib/libarchive/libarchive/archive_read_new.3 head/contrib/libarchive/libarchive/archive_read_open.3 head/contrib/libarchive/libarchive/archive_read_set_options.3 head/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_string.c head/contrib/libarchive/libarchive/archive_util.3 head/contrib/libarchive/libarchive/archive_write.3 head/contrib/libarchive/libarchive/archive_write_blocksize.3 head/contrib/libarchive/libarchive/archive_write_data.3 head/contrib/libarchive/libarchive/archive_write_disk.3 head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_filter.3 head/contrib/libarchive/libarchive/archive_write_finish_entry.3 head/contrib/libarchive/libarchive/archive_write_format.3 head/contrib/libarchive/libarchive/archive_write_free.3 head/contrib/libarchive/libarchive/archive_write_header.3 head/contrib/libarchive/libarchive/archive_write_new.3 head/contrib/libarchive/libarchive/archive_write_open.3 head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_format_mtree.c head/contrib/libarchive/libarchive/archive_write_set_options.3 head/contrib/libarchive/libarchive/archive_write_set_passphrase.3 head/contrib/libarchive/libarchive/libarchive_changes.3 head/contrib/libarchive/libarchive/libarchive_internals.3 head/contrib/libarchive/libarchive/tar.5 head/contrib/libarchive/libarchive/test/test_archive_write_add_filter_by_name.c head/contrib/libarchive/libarchive/test/test_archive_write_set_format_filter_by_ext.c head/contrib/libarchive/libarchive/test/test_read_format_raw.c head/contrib/libarchive/libarchive/test/test_read_format_zip.c head/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c head/contrib/libarchive/libarchive/test/test_write_filter_zstd.c head/contrib/libarchive/tar/bsdtar.1 head/contrib/libarchive/tar/test/test_option_n.c head/contrib/libarchive/tar/test/test_option_xattrs.c head/contrib/libarchive/test_utils/test_main.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/cat/bsdcat.1 ============================================================================== --- head/contrib/libarchive/cat/bsdcat.1 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/cat/bsdcat.1 Thu Sep 26 01:50:20 2019 (r352732) @@ -34,16 +34,15 @@ .Nm .Op options .Op files -.Pp .Sh DESCRIPTION .Nm expands files to standard output. .Sh OPTIONS .Nm typically takes a filename as an argument or reads standard input when used in a -pipe. In both cases decompressed data it written to standard output. +pipe. +In both cases decompressed data it written to standard output. .Sh EXAMPLES -.Pp To decompress a file: .Pp .Dl bsdcat example.txt.gz > example.txt @@ -55,8 +54,8 @@ To decompress standard input in a pipe: Both examples achieve the same results - a decompressed file by redirecting output. .Sh SEE ALSO -.Xr uncompress 1 , -.Xr zcat 1 , .Xr bzcat 1 , +.Xr uncompress 1 , .Xr xzcat 1 , -.Xr libarchive-formats 5 , +.Xr zcat 1 , +.Xr libarchive-formats 5 Modified: head/contrib/libarchive/cpio/bsdcpio.1 ============================================================================== --- head/contrib/libarchive/cpio/bsdcpio.1 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/cpio/bsdcpio.1 Thu Sep 26 01:50:20 2019 (r352732) @@ -75,7 +75,6 @@ Pass-through. Read a list of filenames from standard input and copy the files to the specified directory. .El -.Pp .Sh OPTIONS Unless specifically stated otherwise, options are applicable in all operating modes. @@ -385,10 +384,10 @@ For best compatibility, scripts should limit themselve standard syntax. .Sh SEE ALSO .Xr bzip2 1 , -.Xr tar 1 , .Xr gzip 1 , .Xr mt 1 , .Xr pax 1 , +.Xr tar 1 , .Xr libarchive 3 , .Xr cpio 5 , .Xr libarchive-formats 5 , Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive.h Thu Sep 26 01:50:20 2019 (r352732) @@ -52,7 +52,7 @@ */ #if defined(__BORLANDC__) && __BORLANDC__ >= 0x560 # include -#elif !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) && !defined(__BORLANDC__) && !defined(_SCO_DS) && !defined(__osf__) +#elif !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) && !defined(__BORLANDC__) && !defined(_SCO_DS) && !defined(__osf__) && !defined(__CLANG_INTTYPES_H) # include #endif Modified: head/contrib/libarchive/libarchive/archive_entry.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_entry.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -32,7 +32,7 @@ .Nm archive_entry_clear , .Nm archive_entry_clone , .Nm archive_entry_free , -.Nm archive_entry_new , +.Nm archive_entry_new .Nd functions for managing archive entry descriptions .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) @@ -126,7 +126,6 @@ using the current locale. Similarly, if you store a wide string and then store a narrow string for the same data, the previously-set wide string will be discarded in favor of the new data. -.Pp .\" .Sh EXAMPLE .\" .Sh RETURN VALUES .\" .Sh ERRORS @@ -134,8 +133,8 @@ be discarded in favor of the new data. .Xr archive_entry_acl 3 , .Xr archive_entry_paths 3 , .Xr archive_entry_perms 3 , -.Xr archive_entry_time 3 -.Xr libarchive 3 , +.Xr archive_entry_time 3 , +.Xr libarchive 3 .Sh HISTORY The .Nm libarchive Modified: head/contrib/libarchive/libarchive/archive_entry_acl.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_acl.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_entry_acl.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -118,15 +118,16 @@ Streaming Archive Library (libarchive, -larchive) .Sh DESCRIPTION The .Dq Access Control Lists (ACLs) -extend the standard Unix perssion model. +extend the standard Unix permission model. The ACL interface of .Nm libarchive -supports both POSIX.1e and NFSv4 style ACLs. Use of ACLs is restricted by +supports both POSIX.1e and NFSv4 style ACLs. +Use of ACLs is restricted by various levels of ACL support in operating systems, file systems and archive formats. .Ss POSIX.1e Access Control Lists A POSIX.1e ACL consists of a number of independent entries. -Each entry specifies the permission set as bitmask of basic permissions. +Each entry specifies the permission set as a bitmask of basic permissions. Valid permissions in the .Fa permset are: @@ -147,13 +148,13 @@ The user specified by the name field. .It Dv ARCHIVE_ENTRY_ACL_USER_OBJ The owner of the file. .It Dv ARCHIVE_ENTRY_ACL_GROUP -The group specied by the name field. +The group specified by the name field. .It Dv ARCHIVE_ENTRY_ACL_GROUP_OBJ -The group who owns the file. +The group which owns the file. .It Dv ARCHIVE_ENTRY_ACL_MASK The maximum permissions to be obtained via group permissions. .It Dv ARCHIVE_ENTRY_ACL_OTHER -Any principal who is not file owner or a member of the owning group. +Any principal who is not the file owner or a member of the owning group. .El .Pp The principals @@ -164,12 +165,12 @@ and are equivalent to user, group and other in the classic Unix permission model and specify non-extended ACL entries. .Pp -All files with have an access ACL +All files have an access ACL .Pq Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS . This specifies the permissions required for access to the file itself. Directories have an additional ACL .Pq Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT , -which controls the initial access ACL for newly created directory entries. +which controls the initial access ACL for newly-created directory entries. .Ss NFSv4 Access Control Lists A NFSv4 ACL consists of multiple individual entries called Access Control Entries (ACEs). @@ -197,11 +198,11 @@ The user specified by the name field. .It Dv ARCHIVE_ENTRY_ACL_USER_OBJ The owner of the file. .It Dv ARCHIVE_ENTRY_ACL_GROUP -The group specied by the name field. +The group specified by the name field. .It Dv ARCHIVE_ENTRY_ACL_GROUP_OBJ -The group who owns the file. +The group which owns the file. .It Dv ARCHIVE_ENTRY_ACL_EVERYONE -Any principal who is not file owner or a member of the owning group. +Any principal who is not the file owner or a member of the owning group. .El .Pp Entries with the @@ -216,9 +217,10 @@ integer. .Pp NFSv4 ACE permissions and flags are stored in the same .Fa permset -bitfield. Some permissions share the same constant and permission character but -have different effect on directories than on files. The following ACE -permissions are supported: +bitfield. +Some permissions share the same constant and permission character +but have different effect on directories than on files. +The following ACE permissions are supported: .Bl -tag -offset indent -compact -width ARCHIV .It Dv ARCHIVE_ENTRY_ACL_READ_DATA ( Sy r ) Read data (file). @@ -265,7 +267,8 @@ Inherit parent directory ACE to subdirectories. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY ( Sy i ) Only inherit, do not apply the permission on the directory itself. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT ( Sy n ) -Do not propagate inherit flags. Only first-level entries inherit ACLs. +Do not propagate inherit flags. +Only first-level entries inherit ACLs. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS ( Sy S ) Trigger alarm or audit on successful access. .It Dv ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS ( Sy F ) @@ -279,8 +282,8 @@ and .Fn archive_entry_acl_add_entry_w add a single ACL entry. For the access ACL and non-extended principals, the classic Unix permissions -are updated. An archive entry cannot contain both POSIX.1e and NFSv4 ACL -entries. +are updated. +An archive entry cannot contain both POSIX.1e and NFSv4 ACL entries. .Pp .Fn archive_entry_acl_clear removes all ACL entries and resets the enumeration pointer. @@ -300,7 +303,8 @@ for POSIX.1e ACLs and .It Dv ARCHIVE_ENTRY_ACL_TYPE_AUDIT .It Dv ARCHIVE_ENTRY_ACL_TYPE_ALARM .El -for NFSv4 ACLs. For POSIX.1e ACLs if +for NFSv4 ACLs. +For POSIX.1e ACLs if .Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS is included and at least one extended ACL entry is found, the three non-extended ACLs are added. @@ -312,7 +316,8 @@ add new .Pq or merge with existing ACL entries from .Pq wide -text. The argument +text. +The argument .Fa type may take one of the following values: .Bl -tag -offset indent -compact -width "ARCHIVE_ENTRY_ACL_TYPE_DEFAULT" @@ -322,11 +327,13 @@ may take one of the following values: .El Supports all formats that can be created with .Fn archive_entry_acl_to_text -or respective +or respectively .Fn archive_entry_acl_to_text_w . -Existing ACL entries are preserved. To get a clean new ACL from text +Existing ACL entries are preserved. +To get a clean new ACL from text .Fn archive_entry_acl_clear -must be called first. Entries prefixed with +must be called first. +Entries prefixed with .Dq default: are treated as .Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT @@ -354,7 +361,7 @@ prepare reading the list of ACL entries with .Fn archive_entry_acl_next or .Fn archive_entry_acl_next_w . -The function returns either 0, if no non-extended ACLs are found. +The function returns 0 if no non-extended ACLs are found. In this case, the access permissions should be obtained by .Xr archive_entry_mode 3 or set using @@ -367,7 +374,8 @@ and .Fn archive_entry_acl_to_text_w convert the ACL entries for the given type into a .Pq wide -string of ACL entries separated by newline. If the pointer +string of ACL entries separated by newline. +If the pointer .Fa len_p is not NULL, then the function shall return the length of the string .Pq not including the NULL terminator @@ -415,7 +423,8 @@ are prefixed with .Dq default: . .Pp .Fn archive_entry_acl_types -get ACL entry types contained in an archive entry's ACL. As POSIX.1e and NFSv4 +get ACL entry types contained in an archive entry's ACL. +As POSIX.1e and NFSv4 ACL entries cannot be mixed, this function is a very efficient way to detect if an ACL already contains POSIX.1e or NFSv4 ACL entries. .Sh RETURN VALUES Modified: head/contrib/libarchive/libarchive/archive_entry_misc.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_misc.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_entry_misc.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -28,7 +28,7 @@ .Sh NAME .Nm archive_entry_symlink_type , .Nm archive_entry_set_symlink_type -.Nd miscellaneous functions for manipulating properties of archive_entry. +.Nd miscellaneous functions for manipulating properties of archive_entry .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) .Sh SYNOPSIS @@ -42,7 +42,8 @@ The function .Fn archive_entry_symlink_type returns and the function .Fn archive_entry_set_symlink_type -sets the type of the symbolic link stored in an archive entry. These functions +sets the type of the symbolic link stored in an archive entry. +These functions have special meaning on operating systems that support multiple symbolic link types (e.g. Microsoft Windows). .Pp Modified: head/contrib/libarchive/libarchive/archive_entry_paths.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_paths.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_entry_paths.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -133,7 +133,7 @@ The accessor functions are named .Fn XXX_w . .It UTF-8 Unicode strings encoded as UTF-8. -This are convience functions to update both the multibyte and wide +These are convenience functions to update both the multibyte and wide character strings at the same time. .El .Pp @@ -141,13 +141,13 @@ The sourcepath is a pure filesystem concept and never archive directly. .Pp For that reason, it is only available as multibyte string. -The link path is a convience function for conditionally setting +The link path is a convenience function for conditionally setting hardlink or symlink destination. It doesn't have a corresponding get accessor function. .Pp .Fn archive_entry_set_XXX -is an alias for +is an alias for .Fn archive_entry_copy_XXX . .Sh SEE ALSO -.Xr archive_entry 3 -.Xr libarchive 3 , +.Xr archive_entry 3 , +.Xr libarchive 3 Modified: head/contrib/libarchive/libarchive/archive_entry_perms.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_perms.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_entry_perms.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -126,7 +126,7 @@ The corresponding functions and .Fn archive_entry_set_perm store the given user id, group id and permission in the entry. -The permission is also set as side effect of calling +The permission is also set as a side effect of calling .Fn archive_entry_set_mode . .Pp .Fn archive_entry_strmode @@ -143,12 +143,12 @@ The accessor functions are named .Fn XXX_w . .It UTF-8 Unicode strings encoded as UTF-8. -This are convience functions to update both the multibyte and wide +These are convenience functions to update both the multibyte and wide character strings at the same time. .El .Pp .Fn archive_entry_set_XXX -is an alias for +is an alias for .Fn archive_entry_copy_XXX . .Ss File Flags File flags are transparently converted between a bitmap @@ -182,7 +182,7 @@ The .Fn archive_entry_copy_fflags_text and .Fn archive_entry_copy_fflags_text_w -functions parse the provided text and sets the internal bitmap values. +functions parse the provided text and set the internal bitmap values. This is a platform-specific operation; names that are not meaningful on the current platform will be ignored. The function returns a pointer to the start of the first name that was not @@ -197,8 +197,8 @@ which stops parsing at the first unrecognized name.) .Xr archive_entry 3 , .Xr archive_entry_acl 3 , .Xr archive_read_disk 3 , -.Xr archive_write_disk 3 -.Xr libarchive 3 , +.Xr archive_write_disk 3 , +.Xr libarchive 3 .Sh BUGS The platform types .Vt uid_t Modified: head/contrib/libarchive/libarchive/archive_entry_stat.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_stat.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_entry_stat.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -54,7 +54,7 @@ .Nm archive_entry_rdevmajor , .Nm archive_entry_set_rdevmajor , .Nm archive_entry_rdevminor , -.Nm archive_entry_set_rdevminor , +.Nm archive_entry_set_rdevminor .Nd accessor functions for manipulating archive entry descriptions .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) @@ -267,8 +267,8 @@ platforms. Some archive formats use the combined form, while other formats use the split form. .Sh SEE ALSO +.Xr stat 2 , .Xr archive_entry_acl 3 , .Xr archive_entry_perms 3 , .Xr archive_entry_time 3 , -.Xr libarchive 3 , -.Xr stat 2 +.Xr libarchive 3 Modified: head/contrib/libarchive/libarchive/archive_entry_time.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_time.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_entry_time.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -48,7 +48,7 @@ .Nm archive_entry_mtime_nsec , .Nm archive_entry_mtime_is_set , .Nm archive_entry_set_mtime , -.Nm archive_entry_unset_mtime , +.Nm archive_entry_unset_mtime .Nd functions for manipulating times in archive entry descriptions .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) @@ -113,8 +113,8 @@ The current state can be queried using .Fn XXX_is_set . Unset time fields have a second and nanosecond field of 0. .Sh SEE ALSO -.Xr archive_entry 3 -.Xr libarchive 3 , +.Xr archive_entry 3 , +.Xr libarchive 3 .Sh HISTORY The .Nm libarchive Modified: head/contrib/libarchive/libarchive/archive_read.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -155,7 +155,7 @@ to close the archive, then call .Fn archive_read_free to release all resources, including all memory allocated by the library. .\" -.Sh EXAMPLE +.Sh EXAMPLES The following illustrates basic usage of the library. In this example, the callback functions are simply wrappers around the standard @@ -217,16 +217,16 @@ myclose(struct archive *a, void *client_data) .\" .Sh ERRORS .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , -.Xr archive_read_new 3 , .Xr archive_read_data 3 , .Xr archive_read_extract 3 , .Xr archive_read_filter 3 , .Xr archive_read_format 3 , .Xr archive_read_header 3 , +.Xr archive_read_new 3 , .Xr archive_read_open 3 , .Xr archive_read_set_options 3 , .Xr archive_util 3 , +.Xr libarchive 3 , .Xr tar 5 .Sh HISTORY The Modified: head/contrib/libarchive/libarchive/archive_read_add_passphrase.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_add_passphrase.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_add_passphrase.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -59,16 +59,16 @@ or empty, this function will do nothing and will be returned. Otherwise, .Cm ARCHIVE_OK -will be returned. +will be returned. .It Fn archive_read_set_passphrase_callback -Register callback function that will be invoked to get a passphrase -for decrption after trying all passphrases registered by the +Register a callback function that will be invoked to get a passphrase +for decryption after trying all the passphrases registered by the .Fn archive_read_add_passphrase function failed. .El .\" .Sh ERRORS .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , .Xr archive_read 3 , -.Xr archive_read_set_options 3 +.Xr archive_read_set_options 3 , +.Xr libarchive 3 Modified: head/contrib/libarchive/libarchive/archive_read_data.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_data.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_data.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -28,7 +28,7 @@ .Dt ARCHIVE_READ_DATA 3 .Os .Sh NAME -.Nm archive_read_data +.Nm archive_read_data , .Nm archive_read_data_block , .Nm archive_read_data_skip , .Nm archive_read_data_into_fd @@ -118,7 +118,6 @@ functions. .\" .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , .Xr archive_read 3 , .Xr archive_read_extract 3 , .Xr archive_read_filter 3 , @@ -127,4 +126,5 @@ functions. .Xr archive_read_open 3 , .Xr archive_read_set_options 3 , .Xr archive_util 3 , +.Xr libarchive 3 , .Xr tar 5 Modified: head/contrib/libarchive/libarchive/archive_read_disk.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_disk.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -99,9 +99,10 @@ following values: .Bl -tag -compact -width "indent" .It Cm ARCHIVE_READDISK_HONOR_NODUMP Skip files and directories with the nodump file attribute (file flag) set. -By default, the nodump file atrribute is ignored. +By default, the nodump file attribute is ignored. .It Cm ARCHIVE_READDISK_MAC_COPYFILE -Mac OS X specific. Read metadata (ACLs and extended attributes) with +Mac OS X specific. +Read metadata (ACLs and extended attributes) with .Xr copyfile 3 . By default, metadata is read using .Xr copyfile 3 . @@ -120,7 +121,7 @@ or for more information on file attributes. .It Cm ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS Do not traverse mount points. -By defaut, moint points are traversed. +By default, mount points are traversed. .It Cm ARCHIVE_READDISK_NO_XATTR Do not read extended file attributes (xattrs). By default, extended file attributes are read from disk. @@ -216,7 +217,7 @@ of some other operation. (For example, directory traversal libraries often provide this information.) .Pp Where necessary, user and group ids are converted to user and group names -using the currently registered lookup functions above. +using the currently-registered lookup functions above. This affects the file ownership fields and ACL values in the .Tn struct archive_entry object. @@ -226,7 +227,7 @@ More information about the object and the overall design of the library can be found in the .Xr libarchive 3 overview. -.Sh EXAMPLE +.Sh EXAMPLES The following illustrates basic usage of the library by showing how to use it to copy an item on disk into an archive. .Bd -literal -offset indent @@ -291,11 +292,11 @@ and functions. .\" .Sh SEE ALSO +.Xr tar 1 , .Xr archive_read 3 , .Xr archive_util 3 , .Xr archive_write 3 , .Xr archive_write_disk 3 , -.Xr tar 1 , .Xr libarchive 3 .Sh HISTORY The Modified: head/contrib/libarchive/libarchive/archive_read_extract.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_extract.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_extract.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -126,7 +126,6 @@ and functions. .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , .Xr archive_read 3 , .Xr archive_read_data 3 , .Xr archive_read_filter 3 , @@ -134,4 +133,5 @@ functions. .Xr archive_read_open 3 , .Xr archive_read_set_options 3 , .Xr archive_util 3 , +.Xr libarchive 3 , .Xr tar 5 Modified: head/contrib/libarchive/libarchive/archive_read_filter.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_filter.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_filter.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -147,8 +147,8 @@ and functions. .\" .Sh SEE ALSO -.Xr libarchive 3 , .Xr archive_read 3 , .Xr archive_read_data 3 , .Xr archive_read_format 3 , -.Xr archive_read_format 3 +.Xr archive_read_format 3 , +.Xr libarchive 3 Modified: head/contrib/libarchive/libarchive/archive_read_format.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_format.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_format.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -102,7 +102,7 @@ For example, .Fn archive_read_support_format_tar enables support for a variety of standard tar formats, old-style tar, ustar, pax interchange format, and many common variants. -.It Fn archive_read_support_format_all +.It Fn archive_read_support_format_all Enables support for all available formats except the .Dq raw format (see below). @@ -125,7 +125,7 @@ it is not possible to accurately determine a format fo an empty file based purely on contents. So empty files are treated by libarchive as a distinct format. -.It Fn archive_read_support_format_raw +.It Fn archive_read_support_format_raw The .Dq raw format handler allows libarchive to be used to read arbitrary data. @@ -153,11 +153,11 @@ functions. .\" .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , .Xr archive_read_data 3 , .Xr archive_read_filter 3 , .Xr archive_read_set_options 3 , .Xr archive_util 3 , +.Xr libarchive 3 , .Xr tar 5 .Sh BUGS Many traditional archiver programs treat Modified: head/contrib/libarchive/libarchive/archive_read_free.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_free.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_free.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -83,11 +83,11 @@ and functions. .\" .Sh SEE ALSO -.Xr libarchive 3 , -.Xr archive_read_new 3 , .Xr archive_read_data 3 , .Xr archive_read_filter 3 , .Xr archive_read_format 3 , +.Xr archive_read_new 3 , .Xr archive_read_open 3 , .Xr archive_read_set_options 3 , -.Xr archive_util 3 +.Xr archive_util 3 , +.Xr libarchive 3 Modified: head/contrib/libarchive/libarchive/archive_read_header.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_header.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_header.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -79,7 +79,6 @@ functions. .\" .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , .Xr archive_read 3 , .Xr archive_read_data 3 , .Xr archive_read_extract 3 , @@ -88,4 +87,5 @@ functions. .Xr archive_read_open 3 , .Xr archive_read_set_options 3 , .Xr archive_util 3 , +.Xr libarchive 3 , .Xr tar 5 Modified: head/contrib/libarchive/libarchive/archive_read_new.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_new.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_new.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -50,10 +50,10 @@ object can be found in the overview manual page for .\" .Sh ERRORS .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , .Xr archive_read_data 3 , .Xr archive_read_filter 3 , .Xr archive_read_format 3 , .Xr archive_read_set_options 3 , .Xr archive_util 3 , +.Xr libarchive 3 , .Xr tar 5 Modified: head/contrib/libarchive/libarchive/archive_read_open.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_open.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_open.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -205,7 +205,7 @@ On failure, the callback should invoke .Fn archive_set_error to register an error code and message and return -.Cm ARCHIVE_FATAL. +.Cm ARCHIVE_FATAL . .\" .Sh EXAMPLE .\" .Sh RETURN VALUES @@ -223,11 +223,11 @@ functions. .\" .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , .Xr archive_read 3 , .Xr archive_read_data 3 , .Xr archive_read_filter 3 , .Xr archive_read_format 3 , .Xr archive_read_set_options 3 , .Xr archive_util 3 , +.Xr libarchive 3 , .Xr tar 5 Modified: head/contrib/libarchive/libarchive/archive_read_set_options.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_set_options.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_set_options.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -212,7 +212,8 @@ Use to disable. .It Cm read_concatenated_archives Ignore zeroed blocks in the archive, which occurs when multiple tar archives -have been concatenated together. Without this option, only the contents of +have been concatenated together. +Without this option, only the contents of the first concatenated archive would be read. .El .El @@ -226,6 +227,6 @@ functions. .\" .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , +.Xr archive_read 3 , .Xr archive_write_set_options 3 , -.Xr archive_read 3 +.Xr libarchive 3 Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_gzip.c Thu Sep 26 01:50:20 2019 (r352732) @@ -131,12 +131,20 @@ archive_read_support_filter_gzip(struct archive *_a) */ static ssize_t peek_at_header(struct archive_read_filter *filter, int *pbits, - struct private_data *state) +#ifdef HAVE_ZLIB_H + struct private_data *state +#else + void *state +#endif + ) { const unsigned char *p; ssize_t avail, len; int bits = 0; int header_flags; +#ifndef HAVE_ZLIB_H + (void)state; /* UNUSED */ +#endif /* Start by looking at the first ten bytes of the header, which * is all fixed layout. */ @@ -153,8 +161,10 @@ peek_at_header(struct archive_read_filter *filter, int bits += 3; header_flags = p[3]; /* Bytes 4-7 are mod time in little endian. */ +#ifdef HAVE_ZLIB_H if (state) state->mtime = archive_le32dec(p + 4); +#endif /* Byte 8 is deflate flags. */ /* XXXX TODO: return deflate flags back to consume_header for use in initializing the decompressor. */ @@ -171,7 +181,9 @@ peek_at_header(struct archive_read_filter *filter, int /* Null-terminated optional filename. */ if (header_flags & 8) { +#ifdef HAVE_ZLIB_H ssize_t file_start = len; +#endif do { ++len; if (avail < len) @@ -181,11 +193,13 @@ peek_at_header(struct archive_read_filter *filter, int return (0); } while (p[len - 1] != 0); +#ifdef HAVE_ZLIB_H if (state) { /* Reset the name in case of repeat header reads. */ free(state->name); state->name = strdup((const char *)&p[file_start]); } +#endif } /* Null-terminated optional comment. */ @@ -236,24 +250,6 @@ gzip_bidder_bid(struct archive_read_filter_bidder *sel return (0); } -static int -gzip_read_header(struct archive_read_filter *self, struct archive_entry *entry) -{ - struct private_data *state; - - state = (struct private_data *)self->data; - - /* A mtime of 0 is considered invalid/missing. */ - if (state->mtime != 0) - archive_entry_set_mtime(entry, state->mtime, 0); - - /* If the name is available, extract it. */ - if (state->name) - archive_entry_set_pathname(entry, state->name); - - return (ARCHIVE_OK); -} - #ifndef HAVE_ZLIB_H /* @@ -277,6 +273,24 @@ gzip_bidder_init(struct archive_read_filter *self) #else +static int +gzip_read_header(struct archive_read_filter *self, struct archive_entry *entry) +{ + struct private_data *state; + + state = (struct private_data *)self->data; + + /* A mtime of 0 is considered invalid/missing. */ + if (state->mtime != 0) + archive_entry_set_mtime(entry, state->mtime, 0); + + /* If the name is available, extract it. */ + if (state->name) + archive_entry_set_pathname(entry, state->name); + + return (ARCHIVE_OK); +} + /* * Initialize the filter object. */ @@ -306,7 +320,9 @@ gzip_bidder_init(struct archive_read_filter *self) self->read = gzip_filter_read; self->skip = NULL; /* not supported */ self->close = gzip_filter_close; +#ifdef HAVE_ZLIB_H self->read_header = gzip_read_header; +#endif state->in_stream = 0; /* We're not actually within a stream yet. */ Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Thu Sep 26 01:50:20 2019 (r352732) @@ -460,7 +460,7 @@ lz4_filter_read_descriptor(struct archive_read_filter __archive_read_filter_consume(self->upstream, descriptor_bytes); - /* Make sure we have an enough buffer for uncompressed data. */ + /* Make sure we have a large enough buffer for uncompressed data. */ if (lz4_allocate_out_block(self) != ARCHIVE_OK) return (ARCHIVE_FATAL); if (state->flags.stream_checksum) @@ -520,7 +520,7 @@ lz4_filter_read_data_block(struct archive_read_filter if (read_buf == NULL) goto truncated_error; - /* Optional process, checking a block sum. */ + /* Optional processing, checking a block sum. */ if (checksum_size) { unsigned int chsum = __archive_xxhash.XXH32( read_buf + 4, (int)compressed_size, 0); @@ -640,7 +640,7 @@ lz4_filter_read_default_stream(struct archive_read_fil if (ret == 0 && *p == NULL) state->stage = SELECT_STREAM; - /* Optional process, checking a stream sum. */ + /* Optional processing, checking a stream sum. */ if (state->flags.stream_checksum) { if (state->stage == SELECT_STREAM) { unsigned int checksum; @@ -660,7 +660,7 @@ lz4_filter_read_default_stream(struct archive_read_fil if (checksum != checksum_stream) { archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, - "lz4 stream cheksum error"); + "lz4 stream checksum error"); return (ARCHIVE_FATAL); } } else if (ret > 0) @@ -674,7 +674,7 @@ static ssize_t lz4_filter_read_legacy_stream(struct archive_read_filter *self, const void **p) { struct private_data *state = (struct private_data *)self->data; - int compressed; + uint32_t compressed; const char *read_buf; ssize_t ret; Modified: head/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Thu Sep 26 01:50:20 2019 (r352732) @@ -487,7 +487,7 @@ process_extra(struct archive_read *a, struct archive_e /* Some ZIP files may have trailing 0 bytes. Let's check they * are all 0 and ignore them instead of returning an error. * - * This is not techincally correct, but some ZIP files look + * This is not technically correct, but some ZIP files look * like this and other tools support those files - so let's * also support them. */ @@ -1053,7 +1053,7 @@ zip_read_local_file_header(struct archive_read *a, str /* Make sure that entries with a trailing '/' are marked as directories * even if the External File Attributes contains bogus values. If this - * is not a directory and there is no type, assume regularfile. */ + * is not a directory and there is no type, assume a regular file. */ if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) { int has_slash; @@ -1104,7 +1104,7 @@ zip_read_local_file_header(struct archive_read *a, str } if (zip_entry->flags & LA_FROM_CENTRAL_DIRECTORY) { - /* If this came from the central dir, it's size info + /* If this came from the central dir, its size info * is definitive, so ignore the length-at-end flag. */ zip_entry->zip_flags &= ~ZIP_LENGTH_AT_END; /* If local header is missing a value, use the one from Modified: head/contrib/libarchive/libarchive/archive_string.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_string.c Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_string.c Thu Sep 26 01:50:20 2019 (r352732) @@ -458,7 +458,7 @@ archive_wstring_append_from_mbs_in_codepage(struct arc if (from_cp == CP_C_LOCALE) { /* - * "C" locale special process. + * "C" locale special processing. */ wchar_t *ws; const unsigned char *mp; @@ -680,7 +680,7 @@ archive_string_append_from_wcs_in_codepage(struct arch if (to_cp == CP_C_LOCALE) { /* - * "C" locale special process. + * "C" locale special processing. */ const wchar_t *wp = ws; char *p; @@ -889,7 +889,7 @@ add_converter(struct archive_string_conv *sc, int (*co struct archive_string_conv *)) { if (sc == NULL || sc->nconverter >= 2) - __archive_errx(1, "Programing error"); + __archive_errx(1, "Programming error"); sc->converter[sc->nconverter++] = converter; } Modified: head/contrib/libarchive/libarchive/archive_util.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_util.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_util.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -92,10 +92,10 @@ Clears any error information left over from a previous Not generally used in client code. .It Fn archive_compression Synonym for -.Fn archive_filter_code(a, 0) . +.Fn archive_filter_code a 0 . .It Fn archive_compression_name Synonym for -.Fn archive_filter_name(a, 0) . +.Fn archive_filter_name a 0 . .It Fn archive_copy_error Copies error information from one archive to another. .It Fn archive_errno @@ -142,13 +142,13 @@ filter 0 is the gunzip filter, filter 1 is the uudecode filter, and filter 2 is the pseudo-filter that wraps the archive read functions. In this case, requesting -.Fn archive_position(a, -1) +.Fn archive_position a -1 would be a synonym for -.Fn archive_position(a, 2) +.Fn archive_position a 2 which would return the number of bytes currently read from the archive, while -.Fn archive_position(a, 1) +.Fn archive_position a 1 would return the number of bytes after uudecoding, and -.Fn archive_position(a, 0) +.Fn archive_position a 0 would return the number of bytes after decompression. .It Fn archive_filter_name Returns a textual name identifying the indicated filter. @@ -170,9 +170,9 @@ A textual description of the format of the current ent .It Fn archive_position Returns the number of bytes read from or written to the indicated filter. In particular, -.Fn archive_position(a, 0) +.Fn archive_position a 0 returns the number of bytes read or written by the format handler, while -.Fn archive_position(a, -1) +.Fn archive_position a -1 returns the number of bytes read or written to the archive. See .Fn archive_filter_count Modified: head/contrib/libarchive/libarchive/archive_write.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_write.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_write.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -118,7 +118,7 @@ After all entries have been written, use the .Fn archive_write_free function to release all resources. .\" -.Sh EXAMPLE +.Sh EXAMPLES The following sketch illustrates basic usage of the library. In this example, the callback functions are simply wrappers around the standard @@ -192,7 +192,7 @@ write_archive(const char *outname, const char **filena if (archive_write_set_format_filter_by_ext(a, outname) != ARCHIVE_OK) { archive_write_add_filter_gzip(a); archive_write_set_format_ustar(a); - } + } archive_write_open(a, mydata, myopen, mywrite, myclose); while (*filename) { stat(*filename, &st); @@ -225,8 +225,8 @@ int main(int argc, const char **argv) .Ed .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , .Xr archive_write_set_options 3 , +.Xr libarchive 3 , .Xr cpio 5 , .Xr mtree 5 , .Xr tar 5 Modified: head/contrib/libarchive/libarchive/archive_write_blocksize.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_blocksize.3 Thu Sep 26 01:42:09 2019 (r352731) +++ head/contrib/libarchive/libarchive/archive_write_blocksize.3 Thu Sep 26 01:50:20 2019 (r352732) @@ -107,8 +107,8 @@ functions. .\" .Sh SEE ALSO .Xr tar 1 , -.Xr libarchive 3 , *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Sep 26 01:51: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 2B872F1A5D; Thu, 26 Sep 2019 01:51:56 +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 46dybJ0GvQz4qpW; Thu, 26 Sep 2019 01:51:56 +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 E1CAA20DFD; Thu, 26 Sep 2019 01:51:55 +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 x8Q1ptRu068780; Thu, 26 Sep 2019 01:51:55 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q1ptIo068779; Thu, 26 Sep 2019 01:51:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909260151.x8Q1ptIo068779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 26 Sep 2019 01:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352734 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 352734 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: Thu, 26 Sep 2019 01:51:56 -0000 Author: cem Date: Thu Sep 26 01:51:55 2019 New Revision: 352734 URL: https://svnweb.freebsd.org/changeset/base/352734 Log: amd64 pmap: Clarify largemap bootverbose message units A PML4 covers 512 gigabytes, not gigabits. Use the typical B suffix for bytes. No functional change. Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Sep 26 01:50:26 2019 (r352733) +++ head/sys/amd64/amd64/pmap.c Thu Sep 26 01:51:55 2019 (r352734) @@ -1947,7 +1947,7 @@ pmap_init(void) if (lm_ents > LMEPML4I - LMSPML4I + 1) lm_ents = LMEPML4I - LMSPML4I + 1; if (bootverbose) - printf("pmap: large map %u PML4 slots (%lu Gb)\n", + printf("pmap: large map %u PML4 slots (%lu GB)\n", lm_ents, (u_long)lm_ents * (NBPML4 / 1024 / 1024 / 1024)); if (lm_ents != 0) { large_vmem = vmem_create("large", LARGEMAP_MIN_ADDRESS, From owner-svn-src-head@freebsd.org Thu Sep 26 02:54: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 D5C29F4782; Thu, 26 Sep 2019 02:54:46 +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 46dzzp5MjKz4txs; Thu, 26 Sep 2019 02:54:46 +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 814E42192C; Thu, 26 Sep 2019 02:54:46 +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 x8Q2skYe005161; Thu, 26 Sep 2019 02:54:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q2sjbi005158; Thu, 26 Sep 2019 02:54:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201909260254.x8Q2sjbi005158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 26 Sep 2019 02:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352736 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 352736 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: Thu, 26 Sep 2019 02:54:46 -0000 Author: rmacklem Date: Thu Sep 26 02:54:45 2019 New Revision: 352736 URL: https://svnweb.freebsd.org/changeset/base/352736 Log: Replace all mtx_assert() calls for n_mtx and ncl_iod_mutex with macros. To be consistent with replacing the mtx_lock()/mtx_unlock() calls on the NFS node mutex (n_mtx) and ncl_iod_mutex, this patch replaces all mtx_assert() calls on these mutexes with macros as well. This will simplify changing these locks to sx locks in a future commit. However, this change may be delayed indefinitely, since it appears there is a deadlock when vnode_pager_setsize() is called to shrink the size and the NFS node lock is held. There is no semantic change as a result of this commit. Suggested by: kib MFC after: 1 week Modified: head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clnfsiod.c head/sys/fs/nfsclient/nfs_clnode.c Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Thu Sep 26 01:54:24 2019 (r352735) +++ head/sys/fs/nfs/nfsport.h Thu Sep 26 02:54:45 2019 (r352736) @@ -688,10 +688,12 @@ void nfsrvd_rcv(struct socket *, void *, int); #define NFSUNLOCKV4ROOTMUTEX() mtx_unlock(&nfs_v4root_mutex) #define NFSLOCKNODE(n) mtx_lock(&((n)->n_mtx)) #define NFSUNLOCKNODE(n) mtx_unlock(&((n)->n_mtx)) +#define NFSASSERTNODE(n) mtx_assert(&((n)->n_mtx), MA_OWNED) #define NFSLOCKMNT(m) mtx_lock(&((m)->nm_mtx)) #define NFSUNLOCKMNT(m) mtx_unlock(&((m)->nm_mtx)) #define NFSLOCKIOD() mtx_lock(&ncl_iod_mutex) #define NFSUNLOCKIOD() mtx_unlock(&ncl_iod_mutex) +#define NFSASSERTIOD() mtx_assert(&ncl_iod_mutex, MA_OWNED) #define NFSLOCKREQUEST(r) mtx_lock(&((r)->r_mtx)) #define NFSUNLOCKREQUEST(r) mtx_unlock(&((r)->r_mtx)) #define NFSLOCKSOCKREQ(r) mtx_lock(&((r)->nr_mtx)) Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnfsiod.c Thu Sep 26 01:54:24 2019 (r352735) +++ head/sys/fs/nfsclient/nfs_clnfsiod.c Thu Sep 26 02:54:45 2019 (r352736) @@ -169,7 +169,7 @@ nfs_nfsiodnew_sync(void) { int error, i; - mtx_assert(&ncl_iod_mutex, MA_OWNED); + NFSASSERTIOD(); for (i = 0; i < ncl_iodmax; i++) { if (nfs_asyncdaemon[i] == 0) { nfs_asyncdaemon[i] = 1; @@ -206,7 +206,7 @@ void ncl_nfsiodnew(void) { - mtx_assert(&ncl_iod_mutex, MA_OWNED); + NFSASSERTIOD(); taskqueue_enqueue(taskqueue_thread, &ncl_nfsiodnew_task); } Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Thu Sep 26 01:54:24 2019 (r352735) +++ head/sys/fs/nfsclient/nfs_clnode.c Thu Sep 26 02:54:45 2019 (r352736) @@ -212,7 +212,7 @@ ncl_releasesillyrename(struct vnode *vp, struct thread ASSERT_VOP_ELOCKED(vp, "releasesillyrename"); np = VTONFS(vp); - mtx_assert(&np->n_mtx, MA_OWNED); + NFSASSERTNODE(np); if (vp->v_type != VDIR) { sp = np->n_sillyrename; np->n_sillyrename = NULL; From owner-svn-src-head@freebsd.org Thu Sep 26 03:09: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 2B6F9F5275; Thu, 26 Sep 2019 03:09:43 +0000 (UTC) (envelope-from cy@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 46f0K30Klwz3BnH; Thu, 26 Sep 2019 03:09:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE35621B94; Thu, 26 Sep 2019 03:09:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8Q39gJ7012498; Thu, 26 Sep 2019 03:09:42 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q39glb012497; Thu, 26 Sep 2019 03:09:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909260309.x8Q39glb012497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 26 Sep 2019 03:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352737 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 352737 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: Thu, 26 Sep 2019 03:09:43 -0000 Author: cy Date: Thu Sep 26 03:09:42 2019 New Revision: 352737 URL: https://svnweb.freebsd.org/changeset/base/352737 Log: ipf mistakenly regards UDP packets with a checksum of 0xffff as bad. Obtained from: NetBSD fil.c r1.30, NetBSD PR/54443 MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 26 02:54:45 2019 (r352736) +++ head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 26 03:09:42 2019 (r352737) @@ -6730,8 +6730,11 @@ ipf_checkl4sum(fin) /*NOTREACHED*/ } - if (csump != NULL) + if (csump != NULL) { hdrsum = *csump; + if (fin->fin_p == IPPROTO_UDP && hdrsum == 0xffff) + hdrsum = 0x0000; + } if (dosum) { sum = fr_cksum(fin, fin->fin_ip, fin->fin_p, fin->fin_dp); From owner-svn-src-head@freebsd.org Thu Sep 26 03:09: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 4F6F8F5297; Thu, 26 Sep 2019 03:09:46 +0000 (UTC) (envelope-from cy@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 46f0K60kzHz3Bnx; Thu, 26 Sep 2019 03:09:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F19B521B95; Thu, 26 Sep 2019 03:09:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8Q39jwU012546; Thu, 26 Sep 2019 03:09:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q39jLQ012545; Thu, 26 Sep 2019 03:09:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909260309.x8Q39jLQ012545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 26 Sep 2019 03:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352738 - head/contrib/ipfilter/tools X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/tools X-SVN-Commit-Revision: 352738 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: Thu, 26 Sep 2019 03:09:46 -0000 Author: cy Date: Thu Sep 26 03:09:45 2019 New Revision: 352738 URL: https://svnweb.freebsd.org/changeset/base/352738 Log: Teach the ippool parser about address families. This is a precursor to implementing IPv6 support within ippool which requires reworking radix_ipf.c. MFC after: 1 month Modified: head/contrib/ipfilter/tools/ippool_y.y Modified: head/contrib/ipfilter/tools/ippool_y.y ============================================================================== --- head/contrib/ipfilter/tools/ippool_y.y Thu Sep 26 03:09:42 2019 (r352737) +++ head/contrib/ipfilter/tools/ippool_y.y Thu Sep 26 03:09:45 2019 (r352738) @@ -309,11 +309,27 @@ range: addrmask { $$ = calloc(1, sizeof(*$$)); $$->ipn_info = 0; $$->ipn_addr = $1[0]; $$->ipn_mask = $1[1]; +#ifdef USE_INET6 + if (use_inet6) + $$->ipn_addr.adf_family = + AF_INET6; + else +#endif + $$->ipn_addr.adf_family = + AF_INET; } | '!' addrmask { $$ = calloc(1, sizeof(*$$)); $$->ipn_info = 1; $$->ipn_addr = $2[0]; $$->ipn_mask = $2[1]; +#ifdef USE_INET6 + if (use_inet6) + $$->ipn_addr.adf_family = + AF_INET6; + else +#endif + $$->ipn_addr.adf_family = + AF_INET; } | YY_STR { $$ = add_poolhosts($1); free($1); From owner-svn-src-head@freebsd.org Thu Sep 26 07:14: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 C68F9FB9F3; Thu, 26 Sep 2019 07:14:54 +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 46f5ly4dhxz3Ntw; Thu, 26 Sep 2019 07:14:54 +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 7EC9124919; Thu, 26 Sep 2019 07:14:54 +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 x8Q7EsmZ058013; Thu, 26 Sep 2019 07:14:54 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q7EsMM058012; Thu, 26 Sep 2019 07:14:54 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909260714.x8Q7EsMM058012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 26 Sep 2019 07:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352739 - head/sys/dev/vt/hw/fb X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/dev/vt/hw/fb X-SVN-Commit-Revision: 352739 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: Thu, 26 Sep 2019 07:14:54 -0000 Author: tsoome Date: Thu Sep 26 07:14:54 2019 New Revision: 352739 URL: https://svnweb.freebsd.org/changeset/base/352739 Log: vt: use proper return value check with TUNABLE_INT_FETCH The TUNABLE_INT_FETCH is macro around getenv_int() and we will get return value 0 or 1 for failure or success, we can use it to decide which background color to use. Modified: head/sys/dev/vt/hw/fb/vt_fb.c Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Thu Sep 26 03:09:45 2019 (r352738) +++ head/sys/dev/vt/hw/fb/vt_fb.c Thu Sep 26 07:14:54 2019 (r352739) @@ -480,8 +480,7 @@ vt_fb_init(struct vt_device *vd) } c = TC_BLACK; - TUNABLE_INT_FETCH("teken.bg_color", &bg); - if (bg != -1) { + if (TUNABLE_INT_FETCH("teken.bg_color", &bg) != 0) { if (bg == TC_WHITE) bg |= TC_LIGHT; c = bg; From owner-svn-src-head@freebsd.org Thu Sep 26 07:19: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 CE434FBAC1; Thu, 26 Sep 2019 07:19:26 +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 46f5sB4zhcz3P49; Thu, 26 Sep 2019 07:19:26 +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 8A2532492D; Thu, 26 Sep 2019 07:19:26 +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 x8Q7JQvw058268; Thu, 26 Sep 2019 07:19:26 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8Q7JQQo058267; Thu, 26 Sep 2019 07:19:26 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201909260719.x8Q7JQQo058267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 26 Sep 2019 07:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352740 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352740 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: Thu, 26 Sep 2019 07:19:26 -0000 Author: tsoome Date: Thu Sep 26 07:19:26 2019 New Revision: 352740 URL: https://svnweb.freebsd.org/changeset/base/352740 Log: kernel terminal should initialize fg and bg variables before calling TUNABLE_INT_FETCH We have two ways to check if kenv variable exists - either we check return value from TUNABLE_INT_FETCH, or we pre-initialize the variable and check if this value did change. In terminal_init() it is more convinient to use pre-initialized variables. Problem was revealed by older loader.efi, which did not set teken.* variables. Reported by: tuexen Modified: head/sys/kern/subr_terminal.c Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Thu Sep 26 07:14:54 2019 (r352739) +++ head/sys/kern/subr_terminal.c Thu Sep 26 07:19:26 2019 (r352740) @@ -175,6 +175,7 @@ terminal_init(struct terminal *tm) teken_init(&tm->tm_emulator, &terminal_drawmethods, tm); + fg = bg = -1; TUNABLE_INT_FETCH("teken.fg_color", &fg); TUNABLE_INT_FETCH("teken.bg_color", &bg); From owner-svn-src-head@freebsd.org Thu Sep 26 12:57:20 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 BD2661262C3 for ; Thu, 26 Sep 2019 12:57:20 +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 46fFM44fFyz4DDd for ; Thu, 26 Sep 2019 12:57:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (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 7524F140AF for ; Thu, 26 Sep 2019 12:57:20 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f179.google.com with SMTP id m15so2734371qtq.2 for ; Thu, 26 Sep 2019 05:57:20 -0700 (PDT) X-Gm-Message-State: APjAAAWdmT1qFr4vkJ7tvjvT7xZMMs8xnH9MG4iSdlI61MG5Bb1VmCgi aw2KMSczhUUBlGzWmL67QvidatfxHLaxrXN/wGY= X-Received: by 2002:a0c:cdd2:: with SMTP id a18mt2343107qvn.115.1569502639787; Thu, 26 Sep 2019 05:57:19 -0700 (PDT) MIME-Version: 1.0 References: <201909251732.x8PHWhdx064446@repo.freebsd.org> In-Reply-To: <201909251732.x8PHWhdx064446@repo.freebsd.org> From: Kyle Evans Date: Thu, 26 Sep 2019 07:57:08 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352695 - in head/sys: kern sys Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" 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: Thu, 26 Sep 2019 12:57:20 -0000 On Wed, Sep 25, 2019 at 12:32 PM Kyle Evans wrote: > > Author: kevans > Date: Wed Sep 25 17:32:43 2019 > New Revision: 352695 > URL: https://svnweb.freebsd.org/changeset/base/352695 > > Log: > [1/3] Add mostly Linux-compatible file sealing support > > File sealing applies protections against certain actions > (currently: write, growth, shrink) at the inode level. New fileops are added > to accommodate seals - EINVAL is returned by fcntl(2) if they are not > implemented. > > Reviewed by: markj, kib > Differential Revision: https://reviews.freebsd.org/D21391 > Small nit, pointed out by koobs... the above should be Linux-compatible, not just mostly Linux-compatible. The initial version of this tried to implement file sealing at the completely wrong layer, which was caught in review and promptly fixed. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Thu Sep 26 13:27: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 911521271B8; Thu, 26 Sep 2019 13:27:26 +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 46fG1p3K2Bz4Fsg; Thu, 26 Sep 2019 13:27:26 +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 5532DC87; Thu, 26 Sep 2019 13:27:26 +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 x8QDRQjJ074394; Thu, 26 Sep 2019 13:27:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QDRQqM074393; Thu, 26 Sep 2019 13:27:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909261327.x8QDRQqM074393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 26 Sep 2019 13:27:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352742 - head/usr.bin/bsdiff/bspatch X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/bsdiff/bspatch X-SVN-Commit-Revision: 352742 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: Thu, 26 Sep 2019 13:27:26 -0000 Author: emaste Date: Thu Sep 26 13:27:25 2019 New Revision: 352742 URL: https://svnweb.freebsd.org/changeset/base/352742 Log: bspatch: add integer overflow checks Introduce a new add_off_t static function that exits with an error message if there's an overflow, otherwise returns their sum. Use this when adding values obtained from the input patch. Reviewed by: delphij, allanjude (earlier) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7897 Modified: head/usr.bin/bsdiff/bspatch/bspatch.c Modified: head/usr.bin/bsdiff/bspatch/bspatch.c ============================================================================== --- head/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 26 12:54:52 2019 (r352741) +++ head/usr.bin/bsdiff/bspatch/bspatch.c Thu Sep 26 13:27:25 2019 (r352742) @@ -61,6 +61,23 @@ exit_cleanup(void) warn("unlinkat"); } +static inline off_t +add_off_t(off_t a, off_t b) +{ + off_t result; + +#if __GNUC__ >= 5 || \ + (defined(__has_builtin) && __has_builtin(__builtin_add_overflow)) + if (__builtin_add_overflow(a, b, &result)) + errx(1, "Corrupt patch"); +#else + if ((b > 0 && a > OFF_MAX - b) || (b < 0 && a < OFF_MIN - b)) + errx(1, "Corrupt patch"); + result = a + b; +#endif + return result; +} + static off_t offtin(u_char *buf) { off_t y; @@ -199,12 +216,12 @@ int main(int argc, char *argv[]) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((cpfbz2 = BZ2_bzReadOpen(&cbz2err, cpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", cbz2err); - offset += bzctrllen; + offset = add_off_t(offset, bzctrllen); if (fseeko(dpf, offset, SEEK_SET)) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((dpfbz2 = BZ2_bzReadOpen(&dbz2err, dpf, 0, 0, NULL, 0)) == NULL) errx(1, "BZ2_bzReadOpen, bz2err = %d", dbz2err); - offset += bzdatalen; + offset = add_off_t(offset, bzdatalen); if (fseeko(epf, offset, SEEK_SET)) err(1, "fseeko(%s, %jd)", argv[3], (intmax_t)offset); if ((epfbz2 = BZ2_bzReadOpen(&ebz2err, epf, 0, 0, NULL, 0)) == NULL) @@ -238,7 +255,7 @@ int main(int argc, char *argv[]) errx(1, "Corrupt patch"); /* Sanity-check */ - if (newpos + ctrl[0] > newsize) + if (add_off_t(newpos, ctrl[0]) > newsize) errx(1, "Corrupt patch"); /* Read diff string */ @@ -249,15 +266,15 @@ int main(int argc, char *argv[]) /* Add old data to diff string */ for (i = 0; i < ctrl[0]; i++) - if ((oldpos + i >= 0) && (oldpos + i < oldsize)) + if (add_off_t(oldpos, i) < oldsize) new[newpos + i] += old[oldpos + i]; /* Adjust pointers */ - newpos += ctrl[0]; - oldpos += ctrl[0]; + newpos = add_off_t(newpos, ctrl[0]); + oldpos = add_off_t(oldpos, ctrl[0]); /* Sanity-check */ - if (newpos + ctrl[1] > newsize) + if (add_off_t(newpos, ctrl[1]) > newsize) errx(1, "Corrupt patch"); /* Read extra string */ @@ -267,8 +284,8 @@ int main(int argc, char *argv[]) errx(1, "Corrupt patch"); /* Adjust pointers */ - newpos+=ctrl[1]; - oldpos+=ctrl[2]; + newpos = add_off_t(newpos, ctrl[1]); + oldpos = add_off_t(oldpos, ctrl[2]); } /* Clean up the bzip2 reads */ From owner-svn-src-head@freebsd.org Thu Sep 26 14:48: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 4E777128DC1; Thu, 26 Sep 2019 14:48:40 +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 46fHqX1Plcz4KYk; Thu, 26 Sep 2019 14:48:40 +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 1370B1B39; Thu, 26 Sep 2019 14:48:40 +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 x8QEmdBw020746; Thu, 26 Sep 2019 14:48:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QEmdtC020745; Thu, 26 Sep 2019 14:48:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909261448.x8QEmdtC020745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Sep 2019 14:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352743 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 352743 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: Thu, 26 Sep 2019 14:48:40 -0000 Author: mav Date: Thu Sep 26 14:48:39 2019 New Revision: 352743 URL: https://svnweb.freebsd.org/changeset/base/352743 Log: Add kern.cam.da.X.quirks tunable, similar existing for ada. Submitted by: Michael Lass MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20677 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Sep 26 13:27:25 2019 (r352742) +++ head/sys/cam/scsi/scsi_da.c Thu Sep 26 14:48:39 2019 (r352743) @@ -2694,6 +2694,7 @@ daregister(struct cam_periph *periph, void *arg) struct ccb_getdev *cgd; char tmpstr[80]; caddr_t match; + int quirks; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -2749,6 +2750,13 @@ daregister(struct cam_periph *periph, void *arg) xpt_path_inq(&cpi, periph->path); if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE)) softc->quirks |= DA_Q_NO_6_BYTE; + + /* Override quirks if tunable is set */ + snprintf(tmpstr, sizeof(tmpstr), "kern.cam.da.%d.quirks", + periph->unit_number); + quirks = softc->quirks; + TUNABLE_INT_FETCH(tmpstr, &quirks); + softc->quirks = quirks; if (SID_TYPE(&cgd->inq_data) == T_ZBC_HM) softc->zone_mode = DA_ZONE_HOST_MANAGED; From owner-svn-src-head@freebsd.org Thu Sep 26 14:49: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 15EE9128E25; Thu, 26 Sep 2019 14:49:10 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46fHr43xQfz4Khb; Thu, 26 Sep 2019 14:49:08 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id 2e0850b4; Thu, 26 Sep 2019 10:48:35 -0400 (EDT) Received: from [IPv6:2001:470:1f07:302:cad7:19ff:fec0:a06d] (2001:470:1f07:302:cad7:19ff:fec0:a06d [IPv6:2001:470:1f07:302:cad7:19ff:fec0:a06d]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id f3272e4c TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Thu, 26 Sep 2019 10:48:35 -0400 (EDT) Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201909251826.x8PIQVUN095257@repo.freebsd.org> Cc: freebsd-x11@freebsd.org From: Charlie Li Autocrypt: addr=ml+freebsd@vishwin.info; keydata= mQINBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABtC5DaGFybGllIExp IChGcmVlQlNEKSA8bWwrZnJlZWJzZEB2aXNod2luLmluZm8+iQJOBBMBCAA4FiEE/3/Cqr5a +41PbEb+jnB43vIDq2wFAlt7iwoCGyMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQjnB4 3vIDq2zlBQ/7Boe3K9i4pxvIlBWlFDmDuclLiju/LTsc81mO607TIwUMx5p3BfnhqTwqpcuT Gilj2JKSlIw0NioJ3HnPiPyIpMmOmdeLBwvBn8iBmjs14DdDMgKusE8gKc0KRFbTM397rB7K oXj2/R8VF3Uuo8i3vlWyah6p+Osz1dAad/7COqPeM9OBMKaYAOrdKvxMC96l5k+Wc1JKOLeA BP7BtgmQB7HydHUm+dzqUB1rgMP2djIXd5Ngc749kzNQIFvC9ZXbaABw5M4JqKRbVFm08Wgw IUyhkNEtMpkBxMPwqXsk3t1KVptYQSAfW/+8mWDP2sgUOyz9O2IBfb1acCPk04/jf8SsXRaT HzJr64NseWlZUHAMYl9EC09gdE6UDCIHR68+IzutMtgT17Djuu1HRYly+RWAGkyTOeR7Sv/V 2B89Nsq5OfHYs3F2vD57/aRj5TmZJDQWxH/rDYbj8Pk6UjXcaY6QWUtNFidvCMFlBpXuncXU ZWgTsJEyZLHP5SJ7S9sRSHU5+CVUkjsbEFNuHkkGHAkSnpP+HosnH8/q9Rykn9FTamLbiQRQ UxJ6+IlqvOUtRRrMGMBF7ZIFGHcl8tcKynsPTeaHjpqPhCrZx8PmCKKoJHwW4Ua7+cdZkBJq R20qvXuLIrInjkIpA1CbacMckS5a7el6pi/nU0NG1S1K4Zu5Ag0EW3uIdQEQANdl7YHG8JOy HbEYv+7ExSrO96qBRavg1FsDG0riDmlsOSfZ2fqL6/YJF5WsfsX99+YSdIiLQfC4QOw/cA+M I65pgY4cCu42L7YIW/AR+jB1hFg+Q/cbeOwjuKPFYtZvxeDpSsaA6iIR+p+t4DXkjWl86g6W aFLC+til/rCilFHY/1/6M918F1gm/6xCIADDFu0BXLkASc5B4LuvaFEiJIuI9ZoQDIgWxnsX 0tXXE36SwK/XrowzRzsOa+2iOHAPKu7rPGHwy28vO4T5Uq7UynMZG2sK3RTbOijaxL4IJF4W MRqpuGdBSJ4sWmr5aIpgX9au5L1TNAAILJpHXnkv+k825+9VgbhFtFYBHEkgUtXb+w34JnkH okpr9A78dpWb+T+jOEP6ZUgM+4VVy+hCCpbcCVI2PEXu8w2z3+4yZWxIFmy8UYZRoeTMKzV2 zLeisoA0XA8jj548YNPiAl20Mjyoqu42WNv0P8fD9PMTcfLFCj2PlxOhuUFaIUH3ty0/bNeS jPtVK+L9x4W37R7U1tYk+tB5MlPakQiSQtdToB+8K34rnBt/3kCoAYL7Hygw9+qyZrEKZDtP 5JKekfgsy28t1z66xWCUwq9PHuUFiij3cjbwIbskI9uy2+xITcXt4ZqVfpZcdGmjfbdTPkGf PH2pjDoCJaezYdbha/3OVhmVABEBAAGJAjYEGAEIACAWIQT/f8Kqvlr7jU9sRv6OcHje8gOr bAUCW3uIdQIbDAAKCRCOcHje8gOrbExnD/9qwSL4HiorJmUEJ+5CTh8IJql4PzeQK8Dx93gi Zs5jWVlCJTmcpQNirWIZM2eRt67C/wTJjLmEVGzySVLpGiUqhXqdROgFmDwvEnmpIbtWWyvG sgSOCmZj/tz0GEtLSsjJcV/kLffkv7XEKkt9ZjIJnFYVYSovDK1o2PoO6Rfi5AWHHB7jYhjS HJvJjDx0yClO9gEYhtw7R60YOLH+cKoDou9tu+4wR3QwRsNGO6wrzLGhptxuBrDMI+HuOx+j wBTliuzuvZrry6OdKDDdq5D4vvQCj4vFnK4p7LZXhBshCMoLkWoA0I2T+YF/V5Ob5EuvsTIC re/pO/g941ipVkehvVNAsiplSaHjasB1HS6BQ95csI8E/b6PnKm+IECp2bANbLP1jrxKeBGj UkeyRxTmOV/ADUIIj8S4a2yOxTxlysN2O5wqXCJcxaYelC/Y4TUcL6ENxn2dLBdCYKQEna0u DdxZp7fS+pXN6qyK8Qz6Q42MHAxFAZdLKf6a44d4HQt6rPcWdETVlnVKnJr0b9kg5K1Q8N4k PVoTGVrkGAZhmjFYsqWulq445VU46mX7WcqsrZx8LqNTwP6i3Bf71FJ9EBxTyA8fP8k0qosP 8U8D7jhcc5x4yVW8RBBtB+a5q3odWdFnjMLEm4wtxBH/mSN/UKRcFSBvKQ8FxTgpX4Yxcw== Organization: FreeBSD mailing lists Message-ID: <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> Date: Thu, 26 Sep 2019 10:48:28 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <201909251826.x8PIQVUN095257@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hltS3znsS6Xb3kPNlMvEKK4TfIHz0Vy6b" X-Rspamd-Queue-Id: 46fHr43xQfz4Khb X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.74 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[vishwin.info:s=fuccboi12]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.64)[ip: (-9.91), ipnet: 46.101.80.0/20(-4.96), asn: 14061(1.70), country: US(-0.05)]; DKIM_TRACE(0.00)[vishwin.info:+]; DMARC_POLICY_ALLOW(-0.50)[vishwin.info,quarantine]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:14061, ipnet:46.101.80.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[freebsd] 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: Thu, 26 Sep 2019 14:49:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hltS3znsS6Xb3kPNlMvEKK4TfIHz0Vy6b Content-Type: multipart/mixed; boundary="lxRrTeo7pDxN0g1Ka4H3Etoo9KGn7d9HJ" --lxRrTeo7pDxN0g1Ka4H3Etoo9KGn7d9HJ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Gleb Smirnoff wrote: > Modified: head/sys/conf/options > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/options Wed Sep 25 18:09:19 2019 (r352706) > +++ head/sys/conf/options Wed Sep 25 18:26:31 2019 (r352707) > @@ -712,6 +712,8 @@ WITNESS_SKIPSPIN opt_witness.h > WITNESS_COUNT opt_witness.h > OPENSOLARIS_WITNESS opt_global.h > =20 > +EPOCH_TRACE opt_epoch.h > + > # options for ACPI support > ACPI_DEBUG opt_acpi.h > ACPI_MAX_TASKS opt_acpi.h >=20 > Modified: head/sys/sys/epoch.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/epoch.h Wed Sep 25 18:09:19 2019 (r352706) > +++ head/sys/sys/epoch.h Wed Sep 25 18:26:31 2019 (r352707) > @@ -41,6 +41,8 @@ typedef struct epoch_context *epoch_context_t; > #include > #include > =20 > +#include "opt_epoch.h" > + > struct epoch; > typedef struct epoch *epoch_t; > =20 This breaks building the drm-kmod ports, as the build cannot find opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the exact same way): --- linux_anon_inodes.o --- cc -O2 -pipe -fno-strict-aliasing -include /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/g= pu/drm/drm_os_config.h '-DKBUILD_MODNAME=3D"linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include= -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/dummy/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkp= i/gplv2/include -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=3D./machine=3D/usr/src/sys/amd64/include -fdebug-prefix-map=3D./x86=3D/usr/src/sys/x86/include -MD -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith -mno-aes -mno-avx -std=3Diso9899:1999 -c /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/= gplv2/src/linux_anon_inodes.c -o linux_anon_inodes.o In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/= gplv2/src/linux_anon_inodes.c:12: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/= gplv2/include/linux/anon_inodes.h:4: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/= gplv2/include/linux/fs.h:6: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/= gplv2/include/linux/shrinker.h:5: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: In file included from /usr/src/sys/net/if_var.h:83: /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found= #include "opt_epoch.h" ^~~~~~~~~~~~~ --- linux_anon_inodefs.o --- In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/= gplv2/src/linux_anon_inodefs.c:45: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/= gplv2/include/linux/debugfs.h:18: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/= gplv2/include/linux/fs.h:6: In file included from /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/= gplv2/include/linux/shrinker.h:5: In file included from /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: In file included from /usr/src/sys/net/if_var.h:83: /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found= #include "opt_epoch.h" ^~~~~~~~~~~~~ --- linux_anon_inodes.o --- 1 error generated. *** [linux_anon_inodes.o] Error code 1 make[2]: stopped in /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi --- linux_anon_inodefs.o --- 1 error generated. *** [linux_anon_inodefs.o] Error code 1 Interestingly enough, does not happen when drm-current-kmod is built as part of buildkernel (using an existing installed package with SOURCE on).= --=20 Charlie Li =E2=80=A6nope, still don't have an exit line. (This email address is for mailing list use; replace local-part with vishwin for off-list communication if possible) --lxRrTeo7pDxN0g1Ka4H3Etoo9KGn7d9HJ-- --hltS3znsS6Xb3kPNlMvEKK4TfIHz0Vy6b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAl2Mz8IACgkQjnB43vID q2zMGhAAri5IvcBKMQPJwKVZaqWL9jLY6s94ZNOTMVqNiH0XYGyqbPAkIsEpUePp 7ehGzP7b+aqO+UUuNDpAvGySR8vm2Z4W6Xa9xMlTQmRIPTNNpQoaWtA0yBXRimFG hxysB2IjEvqkYw3fW/PRetxE2wqMjU17HnesL/fZxmCdIgYlTXKalDW0uxCokeYZ WOp5rrKybn11tNn1PD6j3lA5k/iz9vk5XCPcSNPWe07waNlkYu3nMj09zd1tdMGW 3rZh5+L7qm5Njx78g8V/+jzc+B8zwPCe+OEwHJ9FbjdYaIU8n+rl9jjoMCRFxu8p IMTTkp/zhSN/kS9eD9QpGcQRkyfmapA8HLeQ/ZCwDkxghQILrqxWeJHuHiTHynbC F7Ebx6SOQyMgkXyJMeDLI6cEyg/dfwCSU9FKq5beOwjmJ+z3FPXyaJ7Wdawfvn/O ri353qsD9eINdzM1RYFGgaRm/ZM4rvuN/kAVTPmGeeFzS+Ia723kMCPJYhP/5C9p 0N145ZXbEAJ7VBq/PGE7bc9y8dQtOktbCgMsDHXfGQlU0BilPbgz302nChIi2USQ QEVePEknC2oAwDMvSvT3/JGovkQlG+8/P0bIx4P9oiHudxAHtfduxzFQj4irKVYa cLOXMhJwH5bPY34kGYDWN0xQBYMeaCrjKTefKj3F9heJq5dHI5Y= =PPB/ -----END PGP SIGNATURE----- --hltS3znsS6Xb3kPNlMvEKK4TfIHz0Vy6b-- From owner-svn-src-head@freebsd.org Thu Sep 26 14:58: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 93A95129345; Thu, 26 Sep 2019 14:58:25 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (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 46fJ2m3btzz4LKG; Thu, 26 Sep 2019 14:58:24 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-qt1-f194.google.com with SMTP id n1so3208665qtp.8; Thu, 26 Sep 2019 07:58:24 -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=stDy7IPHDugIACAhxE12SZENtQdJF9ZiS/Dkd5wiYJg=; b=isc4ZX+8oG8tU+s041yg2kU/oeAd5ve3nRYU1b/88yVhwDWD4fJTboO/LancMHwcd0 T9AMi5FLKO+6dInp/bUOUchLNz55TZBQgpPU6JelupSy9yW0TmttKof4hTcwvyqrUp8Y lt4we+me8fE1LnCWDaLNm4nH605vVe9M55Eiw00X3NVymI6wtFCzgoCMEZ54/T9r53ND 3ddlLrOTL3eeby8qtVgyGZdLCFe9etVi5Xc/LTUAcjURAmhRiDgjGPSp7sw51Jk/HWwY FcVuum65VfBEcGtOLLfxzGSB1VLaV211w9SS7uE/5NQlhymzt9v+dFh4aN3qsIpDgkbd Jwjw== X-Gm-Message-State: APjAAAWvqyk31Xyi/j48LUn3EmYpjEUc+ub3paALkr8Shs3m8imbBk1+ q4HV/uS3+09/hz0m+eurn14zV9lkqQg= X-Google-Smtp-Source: APXvYqxAlXkQX3csWfoTc9ZkbZQCXDtMr6QyFdl/+WIxZSzPqrE82qIZ7O1mS452iZr7TSij5pTwaA== X-Received: by 2002:ac8:548c:: with SMTP id h12mr4413925qtq.226.1569509902995; Thu, 26 Sep 2019 07:58:22 -0700 (PDT) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com. [209.85.160.176]) by smtp.gmail.com with ESMTPSA id k2sm1004651qtm.42.2019.09.26.07.58.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Sep 2019 07:58:22 -0700 (PDT) Received: by mail-qt1-f176.google.com with SMTP id n7so3218940qtb.6; Thu, 26 Sep 2019 07:58:22 -0700 (PDT) X-Received: by 2002:ac8:748c:: with SMTP id v12mr4163983qtq.211.1569509902119; Thu, 26 Sep 2019 07:58:22 -0700 (PDT) MIME-Version: 1.0 References: <201909251826.x8PIQVUN095257@repo.freebsd.org> <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> In-Reply-To: <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> From: Kyle Evans Date: Thu, 26 Sep 2019 09:58:10 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Charlie Li Cc: Gleb Smirnoff , src-committers , svn-src-all , svn-src-head , freebsd-x11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46fJ2m3btzz4LKG X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of byondlenox@gmail.com designates 209.85.160.194 as permitted sender) smtp.mailfrom=byondlenox@gmail.com X-Spamd-Result: default: False [-2.97 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[freebsd]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[kyle-evans.net]; RWL_MAILSPIKE_GOOD(0.00)[194.160.85.209.rep.mailspike.net : 127.0.0.18]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[194.160.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-2.47)[ip: (-6.84), ipnet: 209.85.128.0/17(-3.29), asn: 15169(-2.18), country: US(-0.05)]; FORGED_SENDER(0.30)[self@kyle-evans.net,byondlenox@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)[self@kyle-evans.net,byondlenox@gmail.com]; TAGGED_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] 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: Thu, 26 Sep 2019 14:58:25 -0000 On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: > > Gleb Smirnoff wrote: > > Modified: head/sys/conf/options > > ============================================================================== > > --- head/sys/conf/options Wed Sep 25 18:09:19 2019 (r352706) > > +++ head/sys/conf/options Wed Sep 25 18:26:31 2019 (r352707) > > @@ -712,6 +712,8 @@ WITNESS_SKIPSPIN opt_witness.h > > WITNESS_COUNT opt_witness.h > > OPENSOLARIS_WITNESS opt_global.h > > > > +EPOCH_TRACE opt_epoch.h > > + > > # options for ACPI support > > ACPI_DEBUG opt_acpi.h > > ACPI_MAX_TASKS opt_acpi.h > > > > Modified: head/sys/sys/epoch.h > > ============================================================================== > > --- head/sys/sys/epoch.h Wed Sep 25 18:09:19 2019 (r352706) > > +++ head/sys/sys/epoch.h Wed Sep 25 18:26:31 2019 (r352707) > > @@ -41,6 +41,8 @@ typedef struct epoch_context *epoch_context_t; > > #include > > #include > > > > +#include "opt_epoch.h" > > + > > struct epoch; > > typedef struct epoch *epoch_t; > > > This breaks building the drm-kmod ports, as the build cannot find > opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the > exact same way): > > --- linux_anon_inodes.o --- > cc -O2 -pipe -fno-strict-aliasing -include > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h > '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE > -nostdinc > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include > -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys > -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer > -mno-omit-leaf-frame-pointer > -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include > -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD > -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel > -mno-red-zone -mno-mmx -mno-sse -msoft-float > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector > -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas > -Wno-error-tautological-compare -Wno-error-empty-body > -Wno-error-parentheses-equality -Wno-error-unused-function > -Wno-error-pointer-sign -Wno-error-shift-negative-value > -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith > -mno-aes -mno-avx -std=iso9899:1999 -c > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c > -o linux_anon_inodes.o > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > In file included from > /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > In file included from /usr/src/sys/net/if_var.h:83: > /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found > #include "opt_epoch.h" > ^~~~~~~~~~~~~ > --- linux_anon_inodefs.o --- > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > In file included from > /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > In file included from /usr/src/sys/net/if_var.h:83: > /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found > #include "opt_epoch.h" > ^~~~~~~~~~~~~ > --- linux_anon_inodes.o --- > 1 error generated. > *** [linux_anon_inodes.o] Error code 1 > > make[2]: stopped in > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi > --- linux_anon_inodefs.o --- > 1 error generated. > *** [linux_anon_inodefs.o] Error code 1 > > Interestingly enough, does not happen when drm-current-kmod is built as > part of buildkernel (using an existing installed package with SOURCE on). > FWIW, johalun noticed this yesterday and addressed it here: https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f0ac7fe1a660300981d From owner-svn-src-head@freebsd.org Thu Sep 26 15:02: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 753DF12959C; Thu, 26 Sep 2019 15:02:35 +0000 (UTC) (envelope-from jtl@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 46fJ7b2TFjz4Lmk; Thu, 26 Sep 2019 15:02:35 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E1AD1EE2; Thu, 26 Sep 2019 15:02:35 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QF2Y8N032122; Thu, 26 Sep 2019 15:02:34 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QF2YIk032121; Thu, 26 Sep 2019 15:02:34 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201909261502.x8QF2YIk032121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 26 Sep 2019 15:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352744 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352744 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: Thu, 26 Sep 2019 15:02:35 -0000 Author: jtl Date: Thu Sep 26 15:02:34 2019 New Revision: 352744 URL: https://svnweb.freebsd.org/changeset/base/352744 Log: Remove the unused sch parameter to the syncache_respond() function. The use of this parameter was removed in r313330. This commit now removes passing this now-unused parameter. Reviewed by: gallatin, rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21644 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Sep 26 14:48:39 2019 (r352743) +++ head/sys/netinet/tcp_syncache.c Thu Sep 26 15:02:34 2019 (r352744) @@ -130,8 +130,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, functions_inherit_ static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -static int syncache_respond(struct syncache *, struct syncache_head *, - const struct mbuf *, int); +static int syncache_respond(struct syncache *, const struct mbuf *, int); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -495,7 +494,7 @@ syncache_timer(void *xsch) free(s, M_TCPLOG); } - syncache_respond(sc, sch, NULL, TH_SYN|TH_ACK); + syncache_respond(sc, NULL, TH_SYN|TH_ACK); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } @@ -632,7 +631,7 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr "sending challenge ACK\n", s, __func__, th->th_seq, sc->sc_irs + 1, sc->sc_wnd); - syncache_respond(sc, sch, m, TH_ACK); + syncache_respond(sc, m, TH_ACK); } } else { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) @@ -1475,7 +1474,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t s, __func__); free(s, M_TCPLOG); } - if (syncache_respond(sc, sch, m, TH_SYN|TH_ACK) == 0) { + if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); @@ -1640,7 +1639,7 @@ skip_alloc: /* * Do a standard 3-way handshake. */ - if (syncache_respond(sc, sch, m, TH_SYN|TH_ACK) == 0) { + if (syncache_respond(sc, m, TH_SYN|TH_ACK) == 0) { if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) syncache_free(sc); else if (sc != &scs) @@ -1685,8 +1684,7 @@ tfo_expanded: * i.e. m0 != NULL, or upon 3WHS ACK timeout, i.e. m0 == NULL. */ static int -syncache_respond(struct syncache *sc, struct syncache_head *sch, - const struct mbuf *m0, int flags) +syncache_respond(struct syncache *sc, const struct mbuf *m0, int flags) { struct ip *ip = NULL; struct mbuf *m; From owner-svn-src-head@freebsd.org Thu Sep 26 15:03: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 4FAE212961A; Thu, 26 Sep 2019 15:03:17 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (varun.vishwin.info [46.101.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "varun.vishwin.info", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46fJ8N1131z4Lwk; Thu, 26 Sep 2019 15:03:15 +0000 (UTC) (envelope-from ml+freebsd@vishwin.info) Received: from varun.vishwin.info (fd35:9eae:7575::2 [IPv6:fd35:9eae:7575::2]) by varun.vishwin.info (OpenSMTPD) with ESMTP id e156d748; Thu, 26 Sep 2019 11:03:12 -0400 (EDT) Received: from [IPv6:2001:470:1f07:302:cad7:19ff:fec0:a06d] (2001:470:1f07:302:cad7:19ff:fec0:a06d [IPv6:2001:470:1f07:302:cad7:19ff:fec0:a06d]) by varun.vishwin.info (OpenSMTPD) with ESMTPSA id f7563f45 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Thu, 26 Sep 2019 11:03:12 -0400 (EDT) Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Kyle Evans Cc: Gleb Smirnoff , src-committers , svn-src-all , svn-src-head , freebsd-x11@freebsd.org References: <201909251826.x8PIQVUN095257@repo.freebsd.org> <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> From: Charlie Li Autocrypt: addr=ml+freebsd@vishwin.info; keydata= mQINBFt7iHUBEADCorTixbMGuHd9WYSKCELlv/TFcRtvpHUw/n9LtXzKixUUwl7iuMFMYTz3 QXePX0Twq4jCQYySfcxWbPkLsSYlPOkaGQ+XytfmIHoqG5ba4i1fp+F41is0oCtLt1+oL84j NKUd13em/JWd+PJeQbSTVnHbT2yaAi7vqWw5WKVaMExjfPGU5TArV46wSRU6Zuy1ZX66q0q5 dPzeBdeKYWJE8aGtyi3pYUpKUOX4gxiNetf6leDFZ4OsexWaRdU0n8fId5d1qwjAE3lOwV5z 0Ilt8t4iXtX3JL3DAQyLZIeXHIg9O3rrpPMXQWSp2/5g39PohNk7farbhcpIKxuDN+L5N6U9 OxNHBSCv9FGDO4R/mw3YwJCovDzsF7RSyXQDIY36yjdh2uTLZ0uD5Ci/DPmJUySFLRvpqWnQ M7V5cYhdqDfcElGpRbi8JZQVYRJjvI5Jj0byG98KeaD0YFxKqmmm+Oh+xWXE7xt/DsBoZeZJ BFP84LvFbwQqprvI+sg+1z2+JIgNbYwl8VaYzfyGnqTEXTOsQYEKTdKA9MODSAsN31MlQICe CIHZV+OwOqH1KQ/mZp59AnpXAmj4T94bnahE9yJtVW/qglX/nTeFNUdu5MyEgkeB0x7mx+t0 3hE20yp/NbyvG1T/o53NHwHiURC/8Fxd1NWPZ6n4X8npQn6iyQARAQABtC5DaGFybGllIExp IChGcmVlQlNEKSA8bWwrZnJlZWJzZEB2aXNod2luLmluZm8+iQJOBBMBCAA4FiEE/3/Cqr5a +41PbEb+jnB43vIDq2wFAlt7iwoCGyMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQjnB4 3vIDq2zlBQ/7Boe3K9i4pxvIlBWlFDmDuclLiju/LTsc81mO607TIwUMx5p3BfnhqTwqpcuT Gilj2JKSlIw0NioJ3HnPiPyIpMmOmdeLBwvBn8iBmjs14DdDMgKusE8gKc0KRFbTM397rB7K oXj2/R8VF3Uuo8i3vlWyah6p+Osz1dAad/7COqPeM9OBMKaYAOrdKvxMC96l5k+Wc1JKOLeA BP7BtgmQB7HydHUm+dzqUB1rgMP2djIXd5Ngc749kzNQIFvC9ZXbaABw5M4JqKRbVFm08Wgw IUyhkNEtMpkBxMPwqXsk3t1KVptYQSAfW/+8mWDP2sgUOyz9O2IBfb1acCPk04/jf8SsXRaT HzJr64NseWlZUHAMYl9EC09gdE6UDCIHR68+IzutMtgT17Djuu1HRYly+RWAGkyTOeR7Sv/V 2B89Nsq5OfHYs3F2vD57/aRj5TmZJDQWxH/rDYbj8Pk6UjXcaY6QWUtNFidvCMFlBpXuncXU ZWgTsJEyZLHP5SJ7S9sRSHU5+CVUkjsbEFNuHkkGHAkSnpP+HosnH8/q9Rykn9FTamLbiQRQ UxJ6+IlqvOUtRRrMGMBF7ZIFGHcl8tcKynsPTeaHjpqPhCrZx8PmCKKoJHwW4Ua7+cdZkBJq R20qvXuLIrInjkIpA1CbacMckS5a7el6pi/nU0NG1S1K4Zu5Ag0EW3uIdQEQANdl7YHG8JOy HbEYv+7ExSrO96qBRavg1FsDG0riDmlsOSfZ2fqL6/YJF5WsfsX99+YSdIiLQfC4QOw/cA+M I65pgY4cCu42L7YIW/AR+jB1hFg+Q/cbeOwjuKPFYtZvxeDpSsaA6iIR+p+t4DXkjWl86g6W aFLC+til/rCilFHY/1/6M918F1gm/6xCIADDFu0BXLkASc5B4LuvaFEiJIuI9ZoQDIgWxnsX 0tXXE36SwK/XrowzRzsOa+2iOHAPKu7rPGHwy28vO4T5Uq7UynMZG2sK3RTbOijaxL4IJF4W MRqpuGdBSJ4sWmr5aIpgX9au5L1TNAAILJpHXnkv+k825+9VgbhFtFYBHEkgUtXb+w34JnkH okpr9A78dpWb+T+jOEP6ZUgM+4VVy+hCCpbcCVI2PEXu8w2z3+4yZWxIFmy8UYZRoeTMKzV2 zLeisoA0XA8jj548YNPiAl20Mjyoqu42WNv0P8fD9PMTcfLFCj2PlxOhuUFaIUH3ty0/bNeS jPtVK+L9x4W37R7U1tYk+tB5MlPakQiSQtdToB+8K34rnBt/3kCoAYL7Hygw9+qyZrEKZDtP 5JKekfgsy28t1z66xWCUwq9PHuUFiij3cjbwIbskI9uy2+xITcXt4ZqVfpZcdGmjfbdTPkGf PH2pjDoCJaezYdbha/3OVhmVABEBAAGJAjYEGAEIACAWIQT/f8Kqvlr7jU9sRv6OcHje8gOr bAUCW3uIdQIbDAAKCRCOcHje8gOrbExnD/9qwSL4HiorJmUEJ+5CTh8IJql4PzeQK8Dx93gi Zs5jWVlCJTmcpQNirWIZM2eRt67C/wTJjLmEVGzySVLpGiUqhXqdROgFmDwvEnmpIbtWWyvG sgSOCmZj/tz0GEtLSsjJcV/kLffkv7XEKkt9ZjIJnFYVYSovDK1o2PoO6Rfi5AWHHB7jYhjS HJvJjDx0yClO9gEYhtw7R60YOLH+cKoDou9tu+4wR3QwRsNGO6wrzLGhptxuBrDMI+HuOx+j wBTliuzuvZrry6OdKDDdq5D4vvQCj4vFnK4p7LZXhBshCMoLkWoA0I2T+YF/V5Ob5EuvsTIC re/pO/g941ipVkehvVNAsiplSaHjasB1HS6BQ95csI8E/b6PnKm+IECp2bANbLP1jrxKeBGj UkeyRxTmOV/ADUIIj8S4a2yOxTxlysN2O5wqXCJcxaYelC/Y4TUcL6ENxn2dLBdCYKQEna0u DdxZp7fS+pXN6qyK8Qz6Q42MHAxFAZdLKf6a44d4HQt6rPcWdETVlnVKnJr0b9kg5K1Q8N4k PVoTGVrkGAZhmjFYsqWulq445VU46mX7WcqsrZx8LqNTwP6i3Bf71FJ9EBxTyA8fP8k0qosP 8U8D7jhcc5x4yVW8RBBtB+a5q3odWdFnjMLEm4wtxBH/mSN/UKRcFSBvKQ8FxTgpX4Yxcw== Organization: FreeBSD mailing lists Message-ID: <1681db78-6a0c-55cf-1e01-65e06f145975@vishwin.info> Date: Thu, 26 Sep 2019 11:03:06 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qvqKKzW9dx42GtESdQ8Z71FV2muK6hZmI" X-Rspamd-Queue-Id: 46fJ8N1131z4Lwk X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.74 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[vishwin.info:s=fuccboi12]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; IP_SCORE(-2.64)[ip: (-9.91), ipnet: 46.101.80.0/20(-4.96), asn: 14061(1.70), country: US(-0.05)]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[vishwin.info:+]; DMARC_POLICY_ALLOW(-0.50)[vishwin.info,quarantine]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:14061, ipnet:46.101.80.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[freebsd] 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: Thu, 26 Sep 2019 15:03:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qvqKKzW9dx42GtESdQ8Z71FV2muK6hZmI Content-Type: multipart/mixed; boundary="EoP4fktVvQEyUhGVZDlDGHACWDAAIXt33" --EoP4fktVvQEyUhGVZDlDGHACWDAAIXt33 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Kyle Evans wrote: > On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: >> This breaks building the drm-kmod ports, as the build cannot find >> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the >> exact same way): >> >> --- linux_anon_inodes.o --- >> cc -O2 -pipe -fno-strict-aliasing -include >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/driver= s/gpu/drm/drm_os_config.h >> '-DKBUILD_MODNAME=3D"linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE >> -nostdinc >> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/incl= ude -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/lin= uxkpi/dummy/include >> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linu= xkpi/gplv2/include >> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys >> -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer= >> -mno-omit-leaf-frame-pointer >> -fdebug-prefix-map=3D./machine=3D/usr/src/sys/amd64/include >> -fdebug-prefix-map=3D./x86=3D/usr/src/sys/x86/include -MD >> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=3Dkerne= l >> -mno-red-zone -mno-mmx -mno-sse -msoft-float >> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protect= or >> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes >> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef >> -Wno-pointer-sign -D__printf__=3D__freebsd_kprintf__ >> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas >> -Wno-error-tautological-compare -Wno-error-empty-body >> -Wno-error-parentheses-equality -Wno-error-unused-function >> -Wno-error-pointer-sign -Wno-error-shift-negative-value >> -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-ari= th >> -mno-aes -mno-avx -std=3Diso9899:1999 -c >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/gplv2/src/linux_anon_inodes.c >> -o linux_anon_inodes.o >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/gplv2/src/linux_anon_inodes.c:12: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/gplv2/include/linux/anon_inodes.h:4: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/gplv2/include/linux/fs.h:6: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/gplv2/include/linux/shrinker.h:5: >> In file included from >> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >> In file included from /usr/src/sys/net/if_var.h:83: >> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not fo= und >> #include "opt_epoch.h" >> ^~~~~~~~~~~~~ >> --- linux_anon_inodefs.o --- >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/gplv2/src/linux_anon_inodefs.c:45: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/gplv2/include/linux/debugfs.h:18: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/gplv2/include/linux/fs.h:6: >> In file included from >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi/gplv2/include/linux/shrinker.h:5: >> In file included from >> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >> In file included from /usr/src/sys/net/if_var.h:83: >> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not fo= und >> #include "opt_epoch.h" >> ^~~~~~~~~~~~~ >> --- linux_anon_inodes.o --- >> 1 error generated. >> *** [linux_anon_inodes.o] Error code 1 >> >> make[2]: stopped in >> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxk= pi >> --- linux_anon_inodefs.o --- >> 1 error generated. >> *** [linux_anon_inodefs.o] Error code 1 >> >> Interestingly enough, does not happen when drm-current-kmod is built a= s >> part of buildkernel (using an existing installed package with SOURCE o= n). >> >=20 > FWIW, johalun noticed this yesterday and addressed it here: > https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f= 0ac7fe1a660300981d >=20 Ah, of course I would miss these commits in the kms-drm repo, considering that I watch them roll in. Will wait for the updated snapshots in ports. --=20 Charlie Li =E2=80=A6nope, still don't have an exit line. (This email address is for mailing list use; replace local-part with vishwin for off-list communication if possible) --EoP4fktVvQEyUhGVZDlDGHACWDAAIXt33-- --qvqKKzW9dx42GtESdQ8Z71FV2muK6hZmI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE/3/Cqr5a+41PbEb+jnB43vIDq2wFAl2M0yoACgkQjnB43vID q2xa7Q/+ILdtCqW0sawoh6tFePPdtgzHA8S2YVQ1EsLcQjDJNvwuwtF1zhWrR//W xY89kESZR77DUzgO+QsqNH5d+to0a6kmiD74VdcxGwMG51dc+8oF2TDAKcQekDD/ 9r/Abql+PVXMP/sB4CqjOUg//L5U48qTJkWFU/H5du540afdzJaSj0UuAKqbsEMk ohXvgaAmctBLWb8LaypSaM/nGRvzTmlM6DMLnX7E0v4EJAXGxB8Grckhjlt/BSrz AfLTiVfqhkJEE8UfLbRKHPCCaklT8OGnYG3/7LjH0AsyzfvZP59DrwvKPwVH5yel hG62w4J+RJF+AxxIHNC5gpor3mLtyx+HGBnu3ckgPVpoBbdZ9S9U3USRG1c6sZ5l 6iO065Vw8n2rMgnSsRFc+lVTBomAmZiLLZstwnywWMvJBthyUZrpScrry0fHE+/Z Yo91NHewpOB+2GXlJe9pMMmxrnl12VYAsBibxlbP+W2HktLA3LMEkcVqc3urGU58 1+jJ291aT0SjTagaQyKKaU3tDC1341ih9HQYvRsFtdoS2f6NWvx/vPW8qgDRQEWR 9zDlk8fyAG5/onR91qAhJ9CUpKSUWIjN9+/QlAUB9ohB68sFCOih5w6uPQ7i9vBC w2ov8fpShn4QFXJlRD7A68nHRgLhj5kj/I95NDVtNmcv0hpuq78= =m4v9 -----END PGP SIGNATURE----- --qvqKKzW9dx42GtESdQ8Z71FV2muK6hZmI-- From owner-svn-src-head@freebsd.org Thu Sep 26 15:06: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 41360129794; Thu, 26 Sep 2019 15:06:47 +0000 (UTC) (envelope-from jtl@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 46fJDR0yCyz4M85; Thu, 26 Sep 2019 15:06:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0503B1EFD; Thu, 26 Sep 2019 15:06:47 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QF6kQO032362; Thu, 26 Sep 2019 15:06:46 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QF6kTG032361; Thu, 26 Sep 2019 15:06:46 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201909261506.x8QF6kTG032361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 26 Sep 2019 15:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352745 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352745 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: Thu, 26 Sep 2019 15:06:47 -0000 Author: jtl Date: Thu Sep 26 15:06:46 2019 New Revision: 352745 URL: https://svnweb.freebsd.org/changeset/base/352745 Log: Access the syncache secret directly from the V_tcp_syncache variable, rather than indirectly through the backpointer to the tcp_syncache structure stored in the hashtable bucket. This also allows us to remove the requirement in syncookie_generate() and syncookie_lookup() that the syncache hashtable bucket must be locked. Reviewed by: gallatin, rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21644 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Sep 26 15:02:34 2019 (r352744) +++ head/sys/netinet/tcp_syncache.c Thu Sep 26 15:06:46 2019 (r352745) @@ -2061,8 +2061,6 @@ syncookie_generate(struct syncache_head *sch, struct s uint8_t *secbits; union syncookie cookie; - SCH_LOCK_ASSERT(sch); - cookie.cookie = 0; /* Map our computed MSS into the 3-bit index. */ @@ -2090,10 +2088,10 @@ syncookie_generate(struct syncache_head *sch, struct s cookie.flags.sack_ok = 1; /* Which of the two secrets to use. */ - secbit = sch->sch_sc->secret.oddeven & 0x1; + secbit = V_tcp_syncache.secret.oddeven & 0x1; cookie.flags.odd_even = secbit; - secbits = sch->sch_sc->secret.key[secbit]; + secbits = V_tcp_syncache.secret.key[secbit]; hash = syncookie_mac(&sc->sc_inc, sc->sc_irs, cookie.cookie, secbits, (uintptr_t)sch); @@ -2121,8 +2119,6 @@ syncookie_lookup(struct in_conninfo *inc, struct synca int wnd, wscale = 0; union syncookie cookie; - SCH_LOCK_ASSERT(sch); - /* * Pull information out of SYN-ACK/ACK and revert sequence number * advances. @@ -2137,7 +2133,7 @@ syncookie_lookup(struct in_conninfo *inc, struct synca cookie.cookie = (ack & 0xff) ^ (ack >> 24); /* Which of the two secrets to use. */ - secbits = sch->sch_sc->secret.key[cookie.flags.odd_even]; + secbits = V_tcp_syncache.secret.key[cookie.flags.odd_even]; hash = syncookie_mac(inc, seq, cookie.cookie, secbits, (uintptr_t)sch); From owner-svn-src-head@freebsd.org Thu Sep 26 15:11:38 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 D20861298C7; Thu, 26 Sep 2019 15:11:38 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46fJL22Ys2z4MZB; Thu, 26 Sep 2019 15:11:38 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 46fJKs6dPPz3c7b; Thu, 26 Sep 2019 15:11:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id kReIqIvfIa_a; Thu, 26 Sep 2019 15:11:29 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-147-3.mobileonline.telia.com [95.192.147.3]) by mail.daemonic.se (Postfix) with ESMTPSA id 46fJKr55krz3c7Z; Thu, 26 Sep 2019 15:11:28 +0000 (UTC) Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Charlie Li , Kyle Evans Cc: svn-src-head , svn-src-all , Gleb Smirnoff , src-committers , freebsd-x11@freebsd.org References: <201909251826.x8PIQVUN095257@repo.freebsd.org> <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> <1681db78-6a0c-55cf-1e01-65e06f145975@vishwin.info> From: Niclas Zeising Message-ID: <18644033-d01e-1bc7-02eb-42999033d8fd@freebsd.org> Date: Thu, 26 Sep 2019 17:11:27 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <1681db78-6a0c-55cf-1e01-65e06f145975@vishwin.info> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46fJL22Ys2z4MZB X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.94 / 15.00]; TAGGED_RCPT(0.00)[freebsd]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.95)[-0.945,0]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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: Thu, 26 Sep 2019 15:11:38 -0000 On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote: > Kyle Evans wrote: >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: >>> This breaks building the drm-kmod ports, as the build cannot find >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the >>> exact same way): >>> >>> --- linux_anon_inodes.o --- >>> cc -O2 -pipe -fno-strict-aliasing -include >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE >>> -nostdinc >>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include >>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include >>> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys >>> -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer >>> -mno-omit-leaf-frame-pointer >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ >>> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas >>> -Wno-error-tautological-compare -Wno-error-empty-body >>> -Wno-error-parentheses-equality -Wno-error-unused-function >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value >>> -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith >>> -mno-aes -mno-avx -std=iso9899:1999 -c >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c >>> -o linux_anon_inodes.o >>> In file included from >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: >>> In file included from >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: >>> In file included from >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: >>> In file included from >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: >>> In file included from >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >>> In file included from /usr/src/sys/net/if_var.h:83: >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found >>> #include "opt_epoch.h" >>> ^~~~~~~~~~~~~ >>> --- linux_anon_inodefs.o --- >>> In file included from >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: >>> In file included from >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: >>> In file included from >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: >>> In file included from >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: >>> In file included from >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >>> In file included from /usr/src/sys/net/if_var.h:83: >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found >>> #include "opt_epoch.h" >>> ^~~~~~~~~~~~~ >>> --- linux_anon_inodes.o --- >>> 1 error generated. >>> *** [linux_anon_inodes.o] Error code 1 >>> >>> make[2]: stopped in >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi >>> --- linux_anon_inodefs.o --- >>> 1 error generated. >>> *** [linux_anon_inodefs.o] Error code 1 >>> >>> Interestingly enough, does not happen when drm-current-kmod is built as >>> part of buildkernel (using an existing installed package with SOURCE on). >>> >> >> FWIW, johalun noticed this yesterday and addressed it here: >> https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f0ac7fe1a660300981d >> > Ah, of course I would miss these commits in the kms-drm repo, > considering that I watch them roll in. Will wait for the updated > snapshots in ports. > I'll get to updating the ports as soon as I can. Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Thu Sep 26 15:18: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 EFC97129CB0; Thu, 26 Sep 2019 15:18:57 +0000 (UTC) (envelope-from jtl@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 46fJVT6rBRz4MyT; Thu, 26 Sep 2019 15:18:57 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF2CA20BC; Thu, 26 Sep 2019 15:18:57 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QFIvmw038416; Thu, 26 Sep 2019 15:18:57 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QFIvbv038415; Thu, 26 Sep 2019 15:18:57 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201909261518.x8QFIvbv038415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Thu, 26 Sep 2019 15:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352746 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352746 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: Thu, 26 Sep 2019 15:18:58 -0000 Author: jtl Date: Thu Sep 26 15:18:57 2019 New Revision: 352746 URL: https://svnweb.freebsd.org/changeset/base/352746 Log: Add new functionality to switch to using cookies exclusively when we the syn cache overflows. Whether this is due to an attack or due to the system having more legitimate connections than the syn cache can hold, this situation can quickly impact performance. To make the system perform better during these periods, the code will now switch to exclusively using cookies until the syn cache stops overflowing. In order for this to occur, the system must be configured to use the syn cache with syn cookie fallback. If syn cookies are completely disabled, this change should have no functional impact. When the system is exclusively using syn cookies (either due to configuration or the overflow detection enabled by this change), the code will now skip acquiring a lock on the syn cache bucket. Additionally, the code will now skip lookups in several places (such as when the system receives a RST in response to a SYN|ACK frame). Reviewed by: rrs, gallatin (previous version) Discussed with: tuexen Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21644 Modified: head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Sep 26 15:06:46 2019 (r352745) +++ head/sys/netinet/tcp_syncache.c Thu Sep 26 15:18:57 2019 (r352746) @@ -144,6 +144,8 @@ static struct syncache *syncookie_lookup(struct in_conninfo *, struct syncache_head *, struct syncache *, struct tcphdr *, struct tcpopt *, struct socket *); +static void syncache_pause(struct in_conninfo *); +static void syncache_unpause(void *); static void syncookie_reseed(void *); #ifdef INVARIANTS static int syncookie_cmp(struct in_conninfo *inc, struct syncache_head *sch, @@ -300,6 +302,14 @@ syncache_init(void) arc4rand(V_tcp_syncache.secret.key[1], SYNCOOKIE_SECRET_SIZE, 0); callout_reset(&V_tcp_syncache.secret.reseed, SYNCOOKIE_LIFETIME * hz, syncookie_reseed, &V_tcp_syncache); + + /* Initialize the pause machinery. */ + mtx_init(&V_tcp_syncache.pause_mtx, "tcp_sc_pause", NULL, MTX_DEF); + callout_init_mtx(&V_tcp_syncache.pause_co, &V_tcp_syncache.pause_mtx, + 0); + V_tcp_syncache.pause_until = time_uptime - TCP_SYNCACHE_PAUSE_TIME; + V_tcp_syncache.pause_backoff = 0; + V_tcp_syncache.paused = false; } #ifdef VIMAGE @@ -316,6 +326,14 @@ syncache_destroy(void) */ callout_drain(&V_tcp_syncache.secret.reseed); + /* Stop the SYN cache pause callout. */ + mtx_lock(&V_tcp_syncache.pause_mtx); + if (callout_stop(&V_tcp_syncache.pause_co) == 0) { + mtx_unlock(&V_tcp_syncache.pause_mtx); + callout_drain(&V_tcp_syncache.pause_co); + } else + mtx_unlock(&V_tcp_syncache.pause_mtx); + /* Cleanup hash buckets: stop timers, free entries, destroy locks. */ for (i = 0; i < V_tcp_syncache.hashsize; i++) { @@ -339,6 +357,7 @@ syncache_destroy(void) /* Free the allocated global resources. */ uma_zdestroy(V_tcp_syncache.zone); free(V_tcp_syncache.hashbase, M_SYNCACHE); + mtx_destroy(&V_tcp_syncache.pause_mtx); } #endif @@ -360,10 +379,10 @@ syncache_insert(struct syncache *sc, struct syncache_h if (sch->sch_length >= V_tcp_syncache.bucket_limit) { KASSERT(!TAILQ_EMPTY(&sch->sch_bucket), ("sch->sch_length incorrect")); + syncache_pause(&sc->sc_inc); sc2 = TAILQ_LAST(&sch->sch_bucket, sch_head); sch->sch_last_overflow = time_uptime; syncache_drop(sc2, sch); - TCPSTAT_INC(tcps_sc_bucketoverflow); } /* Put it into the bucket. */ @@ -450,6 +469,7 @@ syncache_timer(void *xsch) struct syncache *sc, *nsc; int tick = ticks; char *s; + bool paused; CURVNET_SET(sch->sch_sc->vnet); @@ -462,7 +482,19 @@ syncache_timer(void *xsch) */ sch->sch_nextc = tick + INT_MAX; + /* + * If we have paused processing, unconditionally remove + * all syncache entries. + */ + mtx_lock(&V_tcp_syncache.pause_mtx); + paused = V_tcp_syncache.paused; + mtx_unlock(&V_tcp_syncache.pause_mtx); + TAILQ_FOREACH_SAFE(sc, &sch->sch_bucket, sc_hash, nsc) { + if (paused) { + syncache_drop(sc, sch); + continue; + } /* * We do not check if the listen socket still exists * and accept the case where the listen socket may be @@ -505,14 +537,24 @@ syncache_timer(void *xsch) } /* - * Find an entry in the syncache. - * Returns always with locked syncache_head plus a matching entry or NULL. + * Returns true if the system is only using cookies at the moment. + * This could be due to a sysadmin decision to only use cookies, or it + * could be due to the system detecting an attack. */ -static struct syncache * -syncache_lookup(struct in_conninfo *inc, struct syncache_head **schp) +static inline bool +syncache_cookiesonly(void) { - struct syncache *sc; - struct syncache_head *sch; + + return (V_tcp_syncookies && (V_tcp_syncache.paused || + V_tcp_syncookiesonly)); +} + +/* + * Find the hash bucket for the given connection. + */ +static struct syncache_head * +syncache_hashbucket(struct in_conninfo *inc) +{ uint32_t hash; /* @@ -525,8 +567,20 @@ syncache_lookup(struct in_conninfo *inc, struct syncac hash = jenkins_hash32((uint32_t *)&inc->inc_ie, 5, V_tcp_syncache.hash_secret) & V_tcp_syncache.hashmask; - sch = &V_tcp_syncache.hashbase[hash]; - *schp = sch; + return (&V_tcp_syncache.hashbase[hash]); +} + +/* + * Find an entry in the syncache. + * Returns always with locked syncache_head plus a matching entry or NULL. + */ +static struct syncache * +syncache_lookup(struct in_conninfo *inc, struct syncache_head **schp) +{ + struct syncache *sc; + struct syncache_head *sch; + + *schp = sch = syncache_hashbucket(inc); SCH_LOCK(sch); /* Circle through bucket row to find matching entry. */ @@ -551,6 +605,8 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr struct syncache_head *sch; char *s = NULL; + if (syncache_cookiesonly()) + return; sc = syncache_lookup(inc, &sch); /* returns locked sch */ SCH_LOCK_ASSERT(sch); @@ -654,6 +710,8 @@ syncache_badack(struct in_conninfo *inc) struct syncache *sc; struct syncache_head *sch; + if (syncache_cookiesonly()) + return; sc = syncache_lookup(inc, &sch); /* returns locked sch */ SCH_LOCK_ASSERT(sch); if (sc != NULL) { @@ -669,6 +727,8 @@ syncache_unreach(struct in_conninfo *inc, tcp_seq th_s struct syncache *sc; struct syncache_head *sch; + if (syncache_cookiesonly()) + return; sc = syncache_lookup(inc, &sch); /* returns locked sch */ SCH_LOCK_ASSERT(sch); if (sc == NULL) @@ -1029,6 +1089,7 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt struct syncache_head *sch; struct syncache scs; char *s; + bool locked; /* * Global TCP locks are held because we manipulate the PCB lists @@ -1038,8 +1099,15 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt KASSERT((th->th_flags & (TH_RST|TH_ACK|TH_SYN)) == TH_ACK, ("%s: can handle only ACK", __func__)); - sc = syncache_lookup(inc, &sch); /* returns locked sch */ - SCH_LOCK_ASSERT(sch); + if (syncache_cookiesonly()) { + sc = NULL; + sch = syncache_hashbucket(inc); + locked = false; + } else { + sc = syncache_lookup(inc, &sch); /* returns locked sch */ + locked = true; + SCH_LOCK_ASSERT(sch); + } #ifdef INVARIANTS /* @@ -1063,7 +1131,7 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt * C. check that the syncookie is valid. If it is, then * cobble up a fake syncache entry, and return. */ - if (!V_tcp_syncookies) { + if (locked && !V_tcp_syncookies) { SCH_UNLOCK(sch); if ((s = tcp_log_addrs(inc, th, NULL, NULL))) log(LOG_DEBUG, "%s; %s: Spurious ACK, " @@ -1071,7 +1139,7 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt s, __func__); goto failed; } - if (!V_tcp_syncookiesonly && + if (locked && !V_tcp_syncookiesonly && sch->sch_last_overflow < time_uptime - SYNCOOKIE_LIFETIME) { SCH_UNLOCK(sch); if ((s = tcp_log_addrs(inc, th, NULL, NULL))) @@ -1082,7 +1150,8 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt } bzero(&scs, sizeof(scs)); sc = syncookie_lookup(inc, sch, &scs, th, to, *lsop); - SCH_UNLOCK(sch); + if (locked) + SCH_UNLOCK(sch); if (sc == NULL) { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) log(LOG_DEBUG, "%s; %s: Segment failed " @@ -1331,6 +1400,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t unsigned int *tfo_pending = NULL; int tfo_cookie_valid = 0; int tfo_response_cookie_valid = 0; + bool locked; INP_WLOCK_ASSERT(inp); /* listen socket */ KASSERT((th->th_flags & (TH_RST|TH_ACK|TH_SYN)) == TH_SYN, @@ -1436,8 +1506,15 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t * how to handle such a case; either ignore it as spoofed, or * drop the current entry and create a new one? */ - sc = syncache_lookup(inc, &sch); /* returns locked entry */ - SCH_LOCK_ASSERT(sch); + if (syncache_cookiesonly()) { + sc = NULL; + sch = syncache_hashbucket(inc); + locked = false; + } else { + sc = syncache_lookup(inc, &sch); /* returns locked sch */ + locked = true; + SCH_LOCK_ASSERT(sch); + } if (sc != NULL) { if (tfo_cookie_valid) INP_WUNLOCK(inp); @@ -1490,7 +1567,15 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t goto skip_alloc; } - sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); + /* + * Skip allocating a syncache entry if we are just going to discard + * it later. + */ + if (!locked) { + bzero(&scs, sizeof(scs)); + sc = &scs; + } else + sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { /* * The zone allocator couldn't provide more entries. @@ -1501,6 +1586,7 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL) { sch->sch_last_overflow = time_uptime; syncache_drop(sc, sch); + syncache_pause(inc); } sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { @@ -1508,6 +1594,9 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t bzero(&scs, sizeof(scs)); sc = &scs; } else { + KASSERT(locked, + ("%s: bucket unexpectedly unlocked", + __func__)); SCH_UNLOCK(sch); if (ipopts) (void) m_free(ipopts); @@ -1626,7 +1715,8 @@ skip_alloc: sc->sc_flowlabel = htonl(sc->sc_flowlabel) & IPV6_FLOWLABEL_MASK; } #endif - SCH_UNLOCK(sch); + if (locked) + SCH_UNLOCK(sch); if (tfo_cookie_valid) { syncache_tfo_expand(sc, lsop, m, tfo_response_cookie); @@ -2260,6 +2350,104 @@ syncookie_reseed(void *arg) /* Reschedule ourself. */ callout_schedule(&sc->secret.reseed, SYNCOOKIE_LIFETIME * hz); +} + +/* + * We have overflowed a bucket. Let's pause dealing with the syncache. + * This function will increment the bucketoverflow statistics appropriately + * (once per pause when pausing is enabled; otherwise, once per overflow). + */ +static void +syncache_pause(struct in_conninfo *inc) +{ + time_t delta; + const char *s; + + /* XXX: + * 2. Add sysctl read here so we don't get the benefit of this + * change without the new sysctl. + */ + + /* + * Try an unlocked read. If we already know that another thread + * has activated the feature, there is no need to proceed. + */ + if (V_tcp_syncache.paused) + return; + + /* Are cookied enabled? If not, we can't pause. */ + if (!V_tcp_syncookies) { + TCPSTAT_INC(tcps_sc_bucketoverflow); + return; + } + + /* + * We may be the first thread to find an overflow. Get the lock + * and evaluate if we need to take action. + */ + mtx_lock(&V_tcp_syncache.pause_mtx); + if (V_tcp_syncache.paused) { + mtx_unlock(&V_tcp_syncache.pause_mtx); + return; + } + + /* Activate protection. */ + V_tcp_syncache.paused = true; + TCPSTAT_INC(tcps_sc_bucketoverflow); + + /* + * Determine the last backoff time. If we are seeing a re-newed + * attack within that same time after last reactivating the syncache, + * consider it an extension of the same attack. + */ + delta = TCP_SYNCACHE_PAUSE_TIME << V_tcp_syncache.pause_backoff; + if (V_tcp_syncache.pause_until + delta - time_uptime > 0) { + if (V_tcp_syncache.pause_backoff < TCP_SYNCACHE_MAX_BACKOFF) { + delta <<= 1; + V_tcp_syncache.pause_backoff++; + } + } else { + delta = TCP_SYNCACHE_PAUSE_TIME; + V_tcp_syncache.pause_backoff = 0; + } + + /* Log a warning, including IP addresses, if able. */ + if (inc != NULL) + s = tcp_log_addrs(inc, NULL, NULL, NULL); + else + s = (const char *)NULL; + log(LOG_WARNING, "TCP syncache overflow detected; using syncookies for " + "the next %lld seconds%s%s%s\n", (long long)delta, + (s != NULL) ? " (last SYN: " : "", (s != NULL) ? s : "", + (s != NULL) ? ")" : ""); + free(__DECONST(void *, s), M_TCPLOG); + + /* Use the calculated delta to set a new pause time. */ + V_tcp_syncache.pause_until = time_uptime + delta; + callout_reset(&V_tcp_syncache.pause_co, delta * hz, syncache_unpause, + &V_tcp_syncache); + mtx_unlock(&V_tcp_syncache.pause_mtx); +} + +/* Evaluate whether we need to unpause. */ +static void +syncache_unpause(void *arg) +{ + struct tcp_syncache *sc; + time_t delta; + + sc = arg; + mtx_assert(&sc->pause_mtx, MA_OWNED | MA_NOTRECURSED); + callout_deactivate(&sc->pause_co); + + /* + * Check to make sure we are not running early. If the pause + * time has expired, then deactivate the protection. + */ + if ((delta = sc->pause_until - time_uptime) > 0) + callout_schedule(&sc->pause_co, delta * hz); + else + sc->paused = false; } /* Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Thu Sep 26 15:06:46 2019 (r352745) +++ head/sys/netinet/tcp_syncache.h Thu Sep 26 15:18:57 2019 (r352746) @@ -111,6 +111,9 @@ struct syncookie_secret { u_int lifetime; }; +#define TCP_SYNCACHE_PAUSE_TIME SYNCOOKIE_LIFETIME +#define TCP_SYNCACHE_MAX_BACKOFF 6 /* 16 minutes */ + struct tcp_syncache { struct syncache_head *hashbase; uma_zone_t zone; @@ -122,6 +125,11 @@ struct tcp_syncache { uint32_t hash_secret; struct vnet *vnet; struct syncookie_secret secret; + struct mtx pause_mtx; + struct callout pause_co; + time_t pause_until; + uint8_t pause_backoff; + volatile bool paused; }; /* Internal use for the syncookie functions. */ From owner-svn-src-head@freebsd.org Thu Sep 26 15:32:30 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 8709D12A208; Thu, 26 Sep 2019 15:32:30 +0000 (UTC) (envelope-from dab@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 46fJp63q22z4NmM; Thu, 26 Sep 2019 15:32:30 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 662BB243D; Thu, 26 Sep 2019 15:32:30 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QFWUef049700; Thu, 26 Sep 2019 15:32:30 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QFWSDH049691; Thu, 26 Sep 2019 15:32:28 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201909261532.x8QFWSDH049691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 26 Sep 2019 15:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352747 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/posixshm usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/posixshm usr.bin/truss X-SVN-Commit-Revision: 352747 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: Thu, 26 Sep 2019 15:32:30 -0000 Author: dab Date: Thu Sep 26 15:32:28 2019 New Revision: 352747 URL: https://svnweb.freebsd.org/changeset/base/352747 Log: Add an shm_rename syscall Add an atomic shm rename operation, similar in spirit to a file rename. Atomically unlink an shm from a source path and link it to a destination path. If an existing shm is linked at the destination path, unlink it as part of the same atomic operation. The caller needs the same permissions as shm_unlink to the shm being renamed, and the same permissions for the shm at the destination which is being unlinked, if it exists. If those fail, EACCES is returned, as with the other shm_* syscalls. truss support is included; audit support will come later. This commit includes only the implementation; the sysent-generated bits will come in a follow-on commit. Submitted by: Matthew Bryan Reviewed by: jilles (earlier revision) Reviewed by: brueffer (manpages, earlier revision) Relnotes: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21423 Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map head/lib/libc/sys/shm_open.2 head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master head/sys/kern/uipc_shm.c head/sys/sys/mman.h head/tests/sys/posixshm/posixshm_test.c head/usr.bin/truss/syscalls.c Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Thu Sep 26 15:18:57 2019 (r352746) +++ head/lib/libc/sys/Makefile.inc Thu Sep 26 15:32:28 2019 (r352747) @@ -477,7 +477,8 @@ MLINKS+=setuid.2 setegid.2 \ setuid.2 setgid.2 MLINKS+=shmat.2 shmdt.2 MLINKS+=shm_open.2 memfd_create.3 \ - shm_open.2 shm_unlink.2 + shm_open.2 shm_unlink.2 \ + shm_rename.2 MLINKS+=sigwaitinfo.2 sigtimedwait.2 MLINKS+=stat.2 fstat.2 \ stat.2 fstatat.2 \ Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Thu Sep 26 15:18:57 2019 (r352746) +++ head/lib/libc/sys/Symbol.map Thu Sep 26 15:32:28 2019 (r352747) @@ -410,6 +410,7 @@ FBSD_1.6 { getfhat; funlinkat; memfd_create; + shm_rename; }; FBSDprivate_1.0 { Modified: head/lib/libc/sys/shm_open.2 ============================================================================== --- head/lib/libc/sys/shm_open.2 Thu Sep 26 15:18:57 2019 (r352746) +++ head/lib/libc/sys/shm_open.2 Thu Sep 26 15:32:28 2019 (r352747) @@ -28,11 +28,11 @@ .\" .\" $FreeBSD$ .\" -.Dd September 24, 2019 +.Dd September 26, 2019 .Dt SHM_OPEN 2 .Os .Sh NAME -.Nm memfd_create , shm_open , shm_unlink +.Nm memfd_create , shm_open , shm_rename, shm_unlink .Nd "shared memory object operations" .Sh LIBRARY .Lb libc @@ -45,6 +45,8 @@ .Ft int .Fn shm_open "const char *path" "int flags" "mode_t mode" .Ft int +.Fn shm_rename "const char *path_from" "const char *path_to" "int flags" +.Ft int .Fn shm_unlink "const char *path" .Sh DESCRIPTION The @@ -112,8 +114,9 @@ see and .Xr fcntl 2 . .Pp -As a FreeBSD extension, -the constant +As a +.Fx +extension, the constant .Dv SHM_ANON may be used for the .Fa path @@ -122,7 +125,9 @@ argument to In this case, an anonymous, unnamed shared memory object is created. Since the object has no name, it cannot be removed via a subsequent call to -.Fn shm_unlink . +.Fn shm_unlink , +or moved with a call to +.Fn shm_rename . Instead, the shared memory object will be garbage collected when the last reference to the shared memory object is removed. @@ -138,6 +143,31 @@ will fail with All other flags are ignored. .Pp The +.Fn shm_rename +system call atomically removes a shared memory object named +.Fa path_from +and relinks it at +.Fa path_to . +If another object is already linked at +.Fa path_to , +that object will be unlinked, unless one of the following flags are provided: +.Bl -tag -offset indent -width Er +.It Er SHM_RENAME_EXCHANGE +Atomically exchange the shms at +.Fa path_from +and +.Fa path_to . +.It Er SHM_RENAME_NOREPLACE +Return an error if an shm exists at +.Fa path_to , +rather than unlinking it. +.El +.Fn shm_rename +is also a +.Fx +extension. +.Pp +The .Fn shm_unlink system call removes a shared memory object named .Fa path . @@ -196,15 +226,20 @@ and .Fn shm_open both return a non-negative integer, and +.Fn shm_rename +and .Fn shm_unlink -returns zero. -All three functions return -1 on failure, and set +return zero. +All functions return -1 on failure, and set .Va errno to indicate the error. .Sh COMPATIBILITY The -.Fa path -argument does not necessarily represent a pathname (although it does in +.Fa path , +.Fa path_from , +and +.Fa path_to +arguments do not necessarily represent a pathname (although they do in most other implementations). Two processes opening the same .Fa path @@ -325,7 +360,7 @@ The .Fa path argument points outside the process' allocated address space. .It Bq Er ENAMETOOLONG -The entire pathname exceeded 1023 characters. +The entire pathname exceeds 1023 characters. .It Bq Er EINVAL The .Fa path @@ -344,6 +379,31 @@ are specified and the named shared memory object does The required permissions (for reading or reading and writing) are denied. .El .Pp +The following errors are defined for +.Fn shm_rename : +.Bl -tag -width Er +.It Bq Er EFAULT +The +.Fa path_from +or +.Fa path_to +argument points outside the process' allocated address space. +.It Bq Er ENAMETOOLONG +The entire pathname exceeds 1023 characters. +.It Bq Er ENOENT +The shared memory object at +.Fa path_from +does not exist. +.It Bq Er EACCES +The required permissions are denied. +.It Bq Er EEXIST +An shm exists at +.Fa path_to , +and the +.Dv SHM_RENAME_NOREPLACE +flag was provided. +.El +.Pp .Fn shm_unlink fails with these error codes for these conditions: .Bl -tag -width Er @@ -352,7 +412,7 @@ The .Fa path argument points outside the process' allocated address space. .It Bq Er ENAMETOOLONG -The entire pathname exceeded 1023 characters. +The entire pathname exceeds 1023 characters. .It Bq Er ENOENT The named shared memory object does not exist. .It Bq Er EACCES @@ -394,9 +454,19 @@ functions first appeared in The functions were reimplemented as system calls using shared memory objects directly rather than files in .Fx 8.0 . +.Pp +.Fn shm_rename +first appeared in +.Fx 13.0 +as a +.Fx +extension. .Sh AUTHORS .An Garrett A. Wollman Aq Mt wollman@FreeBSD.org (C library support and this manual page) .Pp .An Matthew Dillon Aq Mt dillon@FreeBSD.org .Pq Dv MAP_NOSYNC +.Pp +.An Matthew Bryan Aq Mt matthew.bryan@isilon.com +.Pq Dv shm_rename implementation Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Sep 26 15:18:57 2019 (r352746) +++ head/sys/compat/freebsd32/syscalls.master Thu Sep 26 15:32:28 2019 (r352747) @@ -1157,5 +1157,7 @@ 571 AUE_SHMOPEN NOPROTO { int shm_open2( \ const char *path, int flags, mode_t mode, \ int shmflags, const char *name); } +572 AUE_NULL NOPROTO { int shm_rename(const char *path_from, \ + const char *path_to, int flags); } ; vim: syntax=off Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Sep 26 15:18:57 2019 (r352746) +++ head/sys/kern/syscalls.master Thu Sep 26 15:32:28 2019 (r352747) @@ -3204,6 +3204,13 @@ _In_z_ const char *name ); } +572 AUE_NULL STD { + int shm_rename( + _In_z_ const char *path_from, + _In_z_ const char *path_to, + int flags + ); + } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu Sep 26 15:18:57 2019 (r352746) +++ head/sys/kern/uipc_shm.c Thu Sep 26 15:32:28 2019 (r352747) @@ -33,8 +33,9 @@ /* * Support for shared swap-backed anonymous memory objects via - * shm_open(2) and shm_unlink(2). While most of the implementation is - * here, vm_mmap.c contains mapping logic changes. + * shm_open(2), shm_rename(2), and shm_unlink(2). + * While most of the implementation is here, vm_mmap.c contains + * mapping logic changes. * * posixshmcontrol(1) allows users to inspect the state of the memory * objects. Per-uid swap resource limit controls total amount of @@ -945,6 +946,158 @@ sys_shm_unlink(struct thread *td, struct shm_unlink_ar free(path, M_TEMP); return (error); +} + +int +sys_shm_rename(struct thread *td, struct shm_rename_args *uap) +{ + char *path_from = NULL, *path_to = NULL; + Fnv32_t fnv_from, fnv_to; + struct shmfd *fd_from; + struct shmfd *fd_to; + int error; + int flags; + + flags = uap->flags; + + /* + * Make sure the user passed only valid flags. + * If you add a new flag, please add a new term here. + */ + if ((flags & ~( + SHM_RENAME_NOREPLACE | + SHM_RENAME_EXCHANGE + )) != 0) { + error = EINVAL; + goto out; + } + + /* + * EXCHANGE and NOREPLACE don't quite make sense together. Let's + * force the user to choose one or the other. + */ + if ((flags & SHM_RENAME_NOREPLACE) != 0 && + (flags & SHM_RENAME_EXCHANGE) != 0) { + error = EINVAL; + goto out; + } + + /* + * Malloc zone M_SHMFD, since this path may end up freed later from + * M_SHMFD if we end up doing an insert. + */ + path_from = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); + error = copyinstr(uap->path_from, path_from, MAXPATHLEN, NULL); + if (error) + goto out; + + path_to = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); + error = copyinstr(uap->path_to, path_to, MAXPATHLEN, NULL); + if (error) + goto out; + + /* Rename with from/to equal is a no-op */ + if (strncmp(path_from, path_to, MAXPATHLEN) == 0) + goto out; + + fnv_from = fnv_32_str(path_from, FNV1_32_INIT); + fnv_to = fnv_32_str(path_to, FNV1_32_INIT); + + sx_xlock(&shm_dict_lock); + + fd_from = shm_lookup(path_from, fnv_from); + if (fd_from == NULL) { + sx_xunlock(&shm_dict_lock); + error = ENOENT; + goto out; + } + + fd_to = shm_lookup(path_to, fnv_to); + if ((flags & SHM_RENAME_NOREPLACE) != 0 && fd_to != NULL) { + sx_xunlock(&shm_dict_lock); + error = EEXIST; + goto out; + } + + /* + * Unconditionally prevents shm_remove from invalidating the 'from' + * shm's state. + */ + shm_hold(fd_from); + error = shm_remove(path_from, fnv_from, td->td_ucred); + + /* + * One of my assumptions failed if ENOENT (e.g. locking didn't + * protect us) + */ + KASSERT(error != ENOENT, ("Our shm disappeared during shm_rename: %s", + path_from)); + if (error) { + shm_drop(fd_from); + sx_xunlock(&shm_dict_lock); + goto out; + } + + /* + * If we are exchanging, we need to ensure the shm_remove below + * doesn't invalidate the dest shm's state. + */ + if ((flags & SHM_RENAME_EXCHANGE) != 0 && fd_to != NULL) + shm_hold(fd_to); + + /* + * NOTE: if path_to is not already in the hash, c'est la vie; + * it simply means we have nothing already at path_to to unlink. + * That is the ENOENT case. + * + * If we somehow don't have access to unlink this guy, but + * did for the shm at path_from, then relink the shm to path_from + * and abort with EACCES. + * + * All other errors: that is weird; let's relink and abort the + * operation. + */ + error = shm_remove(path_to, fnv_to, td->td_ucred); + if (error && error != ENOENT) { + shm_insert(path_from, fnv_from, fd_from); + shm_drop(fd_from); + /* Don't free path_from now, since the hash references it */ + path_from = NULL; + sx_xunlock(&shm_dict_lock); + goto out; + } + + shm_insert(path_to, fnv_to, fd_from); + + /* Don't free path_to now, since the hash references it */ + path_to = NULL; + + /* We kept a ref when we removed, and incremented again in insert */ + shm_drop(fd_from); +#ifdef DEBUG + KASSERT(fd_from->shm_refs > 0, ("Expected >0 refs; got: %d\n", + fd_from->shm_refs)); +#endif + + if ((flags & SHM_RENAME_EXCHANGE) != 0 && fd_to != NULL) { + shm_insert(path_from, fnv_from, fd_to); + path_from = NULL; + shm_drop(fd_to); +#ifdef DEBUG + KASSERT(fd_to->shm_refs > 0, ("Expected >0 refs; got: %d\n", + fd_to->shm_refs)); +#endif + } + + error = 0; + sx_xunlock(&shm_dict_lock); + +out: + if (path_from != NULL) + free(path_from, M_SHMFD); + if (path_to != NULL) + free(path_to, M_SHMFD); + return(error); } int Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Thu Sep 26 15:18:57 2019 (r352746) +++ head/sys/sys/mman.h Thu Sep 26 15:32:28 2019 (r352747) @@ -134,6 +134,14 @@ #define MAP_FAILED ((void *)-1) /* + * Flags provided to shm_rename + */ +/* Don't overwrite dest, if it exists */ +#define SHM_RENAME_NOREPLACE (1 << 0) +/* Atomically swap src and dest */ +#define SHM_RENAME_EXCHANGE (1 << 1) + +/* * msync() flags */ #define MS_SYNC 0x0000 /* msync synchronously */ @@ -313,6 +321,7 @@ int posix_madvise(void *, size_t, int); int mlockall(int); int munlockall(void); int shm_open(const char *, int, mode_t); +int shm_rename(const char *, const char *, int); int shm_unlink(const char *); #endif #if __BSD_VISIBLE Modified: head/tests/sys/posixshm/posixshm_test.c ============================================================================== --- head/tests/sys/posixshm/posixshm_test.c Thu Sep 26 15:18:57 2019 (r352746) +++ head/tests/sys/posixshm/posixshm_test.c Thu Sep 26 15:32:28 2019 (r352747) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -46,20 +47,36 @@ __FBSDID("$FreeBSD$"); #define TEST_PATH_LEN 256 static char test_path[TEST_PATH_LEN]; +static char test_path2[TEST_PATH_LEN]; +static unsigned int test_path_idx = 0; static void -gen_test_path(void) +gen_a_test_path(char *path) { + snprintf(path, TEST_PATH_LEN, "%s/tmp.XXXXXX%d", + getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR"), + test_path_idx); - snprintf(test_path, sizeof(test_path), "%s/tmp.XXXXXX", - getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR")); - test_path[sizeof(test_path) - 1] = '\0'; - ATF_REQUIRE_MSG(mkstemp(test_path) != -1, + test_path_idx++; + + ATF_REQUIRE_MSG(mkstemp(path) != -1, "mkstemp failed; errno=%d", errno); - ATF_REQUIRE_MSG(unlink(test_path) == 0, + ATF_REQUIRE_MSG(unlink(path) == 0, "unlink failed; errno=%d", errno); } +static void +gen_test_path(void) +{ + gen_a_test_path(test_path); +} + +static void +gen_test_path2(void) +{ + gen_a_test_path(test_path2); +} + /* * Attempt a shm_open() that should fail with an expected error of 'error'. */ @@ -89,20 +106,18 @@ shm_unlink_should_fail(const char *path, int error) } /* - * Open the test object and write '1' to the first byte. Returns valid fd + * Open the test object and write a value to the first byte. Returns valid fd * on success and -1 on failure. */ static int -scribble_object(void) +scribble_object(const char *path, char value) { char *page; int fd, pagesize; - gen_test_path(); - ATF_REQUIRE(0 < (pagesize = getpagesize())); - fd = shm_open(test_path, O_CREAT|O_EXCL|O_RDWR, 0777); + fd = shm_open(path, O_CREAT|O_EXCL|O_RDWR, 0777); if (fd < 0 && errno == EEXIST) { if (shm_unlink(test_path) < 0) atf_tc_fail("shm_unlink"); @@ -117,13 +132,45 @@ scribble_object(void) if (page == MAP_FAILED) atf_tc_fail("mmap failed; errno=%d", errno); - page[0] = '1'; + page[0] = value; ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", errno); return (fd); } +/* + * Fail the test case if the 'path' does not refer to an shm whose first byte + * is equal to expected_value + */ +static void +verify_object(const char *path, char expected_value) +{ + int fd; + int pagesize; + char *page; + + ATF_REQUIRE(0 < (pagesize = getpagesize())); + + fd = shm_open(path, O_RDONLY, 0777); + if (fd < 0) + atf_tc_fail("shm_open failed in verify_object; errno=%d, path=%s", + errno, path); + + page = mmap(0, pagesize, PROT_READ, MAP_SHARED, fd, 0); + if (page == MAP_FAILED) + atf_tc_fail("mmap(1)"); + if (page[0] != expected_value) + atf_tc_fail("Renamed object has incorrect value; has" + "%d (0x%x, '%c'), expected %d (0x%x, '%c')\n", + page[0], page[0], isprint(page[0]) ? page[0] : ' ', + expected_value, expected_value, + isprint(expected_value) ? expected_value : ' '); + ATF_REQUIRE_MSG(munmap(page, pagesize) == 0, "munmap failed; errno=%d", + errno); + close(fd); +} + ATF_TC_WITHOUT_HEAD(remap_object); ATF_TC_BODY(remap_object, tc) { @@ -132,7 +179,8 @@ ATF_TC_BODY(remap_object, tc) ATF_REQUIRE(0 < (pagesize = getpagesize())); - fd = scribble_object(); + gen_test_path(); + fd = scribble_object(test_path, '1'); page = mmap(0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (page == MAP_FAILED) @@ -149,6 +197,209 @@ ATF_TC_BODY(remap_object, tc) "shm_unlink failed; errno=%d", errno); } +ATF_TC_WITHOUT_HEAD(rename_from_anon); +ATF_TC_BODY(rename_from_anon, tc) +{ + int rc; + + gen_test_path(); + rc = shm_rename(SHM_ANON, test_path, 0); + if (rc != -1) + atf_tc_fail("shm_rename from SHM_ANON succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(rename_bad_path_pointer); +ATF_TC_BODY(rename_bad_path_pointer, tc) +{ + const char *bad_path; + int rc; + + bad_path = (const char *)0x1; + + gen_test_path(); + rc = shm_rename(test_path, bad_path, 0); + if (rc != -1) + atf_tc_fail("shm_rename of nonexisting shm succeeded unexpectedly"); + + rc = shm_rename(bad_path, test_path, 0); + if (rc != -1) + atf_tc_fail("shm_rename of nonexisting shm succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(rename_from_nonexisting); +ATF_TC_BODY(rename_from_nonexisting, tc) +{ + int rc; + + gen_test_path(); + rc = shm_rename(test_path, test_path2, 0); + if (rc != -1) + atf_tc_fail("shm_rename of nonexisting shm succeeded unexpectedly"); + + if (errno != ENOENT) + atf_tc_fail("Expected ENOENT to rename of nonexistent shm"); +} + +ATF_TC_WITHOUT_HEAD(rename_to_anon); +ATF_TC_BODY(rename_to_anon, tc) +{ + int rc; + + gen_test_path(); + rc = shm_rename(test_path, SHM_ANON, 0); + if (rc != -1) + atf_tc_fail("shm_rename to SHM_ANON succeeded unexpectedly"); +} + +ATF_TC_WITHOUT_HEAD(rename_to_replace); +ATF_TC_BODY(rename_to_replace, tc) +{ + char expected_value; + int fd; + int fd2; + + // Some contents we can verify later + expected_value = 'g'; + + gen_test_path(); + fd = scribble_object(test_path, expected_value); + close(fd); + + // Give the other some different value so we can detect success + gen_test_path2(); + fd2 = scribble_object(test_path2, 'h'); + close(fd2); + + ATF_REQUIRE_MSG(shm_rename(test_path, test_path2, 0) == 0, + "shm_rename failed; errno=%d", errno); + + // Read back renamed; verify contents + verify_object(test_path2, expected_value); +} + +ATF_TC_WITHOUT_HEAD(rename_to_noreplace); +ATF_TC_BODY(rename_to_noreplace, tc) +{ + char expected_value_from; + char expected_value_to; + int fd_from; + int fd_to; + int rc; + + // Some contents we can verify later + expected_value_from = 'g'; + gen_test_path(); + fd_from = scribble_object(test_path, expected_value_from); + close(fd_from); + + // Give the other some different value so we can detect success + expected_value_to = 'h'; + gen_test_path2(); + fd_to = scribble_object(test_path2, expected_value_to); + close(fd_to); + + rc = shm_rename(test_path, test_path2, SHM_RENAME_NOREPLACE); + ATF_REQUIRE_MSG((rc == -1) && (errno == EEXIST), + "shm_rename didn't fail as expected; errno: %d; return: %d", errno, + rc); + + // Read back renamed; verify contents + verify_object(test_path2, expected_value_to); +} + +ATF_TC_WITHOUT_HEAD(rename_to_exchange); +ATF_TC_BODY(rename_to_exchange, tc) +{ + char expected_value_from; + char expected_value_to; + int fd_from; + int fd_to; + + // Some contents we can verify later + expected_value_from = 'g'; + gen_test_path(); + fd_from = scribble_object(test_path, expected_value_from); + close(fd_from); + + // Give the other some different value so we can detect success + expected_value_to = 'h'; + gen_test_path2(); + fd_to = scribble_object(test_path2, expected_value_to); + close(fd_to); + + ATF_REQUIRE_MSG(shm_rename(test_path, test_path2, + SHM_RENAME_EXCHANGE) == 0, + "shm_rename failed; errno=%d", errno); + + // Read back renamed; verify contents + verify_object(test_path, expected_value_to); + verify_object(test_path2, expected_value_from); +} + +ATF_TC_WITHOUT_HEAD(rename_to_exchange_nonexisting); +ATF_TC_BODY(rename_to_exchange_nonexisting, tc) +{ + char expected_value_from; + int fd_from; + + // Some contents we can verify later + expected_value_from = 'g'; + gen_test_path(); + fd_from = scribble_object(test_path, expected_value_from); + close(fd_from); + + gen_test_path2(); + + ATF_REQUIRE_MSG(shm_rename(test_path, test_path2, + SHM_RENAME_EXCHANGE) == 0, + "shm_rename failed; errno=%d", errno); + + // Read back renamed; verify contents + verify_object(test_path2, expected_value_from); +} + +ATF_TC_WITHOUT_HEAD(rename_to_self); +ATF_TC_BODY(rename_to_self, tc) +{ + int fd; + char expected_value; + + expected_value = 't'; + + gen_test_path(); + fd = scribble_object(test_path, expected_value); + close(fd); + + ATF_REQUIRE_MSG(shm_rename(test_path, test_path, 0) == 0, + "shm_rename failed; errno=%d", errno); + + verify_object(test_path, expected_value); +} + +ATF_TC_WITHOUT_HEAD(rename_bad_flag); +ATF_TC_BODY(rename_bad_flag, tc) +{ + int fd; + int rc; + + /* Make sure we don't fail out due to ENOENT */ + gen_test_path(); + gen_test_path2(); + fd = scribble_object(test_path, 'd'); + close(fd); + fd = scribble_object(test_path2, 'd'); + close(fd); + + /* + * Note: if we end up with enough flags that we use all the bits, + * then remove this test completely. + */ + rc = shm_rename(test_path, test_path2, INT_MIN); + ATF_REQUIRE_MSG((rc == -1) && (errno == EINVAL), + "shm_rename should have failed with EINVAL; got: return=%d, " + "errno=%d", rc, errno); +} + ATF_TC_WITHOUT_HEAD(reopen_object); ATF_TC_BODY(reopen_object, tc) { @@ -157,7 +408,8 @@ ATF_TC_BODY(reopen_object, tc) ATF_REQUIRE(0 < (pagesize = getpagesize())); - fd = scribble_object(); + gen_test_path(); + fd = scribble_object(test_path, '1'); close(fd); fd = shm_open(test_path, O_RDONLY, 0777); @@ -634,6 +886,16 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, remap_object); + ATF_TP_ADD_TC(tp, rename_from_anon); + ATF_TP_ADD_TC(tp, rename_bad_path_pointer); + ATF_TP_ADD_TC(tp, rename_from_nonexisting); + ATF_TP_ADD_TC(tp, rename_to_anon); + ATF_TP_ADD_TC(tp, rename_to_replace); + ATF_TP_ADD_TC(tp, rename_to_noreplace); + ATF_TP_ADD_TC(tp, rename_to_exchange); + ATF_TP_ADD_TC(tp, rename_to_exchange_nonexisting); + ATF_TP_ADD_TC(tp, rename_to_self); + ATF_TP_ADD_TC(tp, rename_bad_flag); ATF_TP_ADD_TC(tp, reopen_object); ATF_TP_ADD_TC(tp, readonly_mmap_write); ATF_TP_ADD_TC(tp, open_after_link); Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Thu Sep 26 15:18:57 2019 (r352746) +++ head/usr.bin/truss/syscalls.c Thu Sep 26 15:32:28 2019 (r352747) @@ -471,6 +471,8 @@ static struct syscall decoded_syscalls[] = { { Ptr | IN, 3 }, { Socklent, 4 } } }, { .name = "shm_open", .ret_type = 1, .nargs = 3, .args = { { ShmName | IN, 0 }, { Open, 1 }, { Octal, 2 } } }, + { .name = "shm_rename", .ret_type = 1, .nargs = 3, + .args = { { Name | IN, 0 }, { Name | IN, 1 }, { Hex, 2 } } }, { .name = "shm_unlink", .ret_type = 1, .nargs = 1, .args = { { Name | IN, 0 } } }, { .name = "shutdown", .ret_type = 1, .nargs = 2, From owner-svn-src-head@freebsd.org Thu Sep 26 15:35: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 06D0012A2C0; Thu, 26 Sep 2019 15:35:36 +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 46fJsg6NYLz4NyK; Thu, 26 Sep 2019 15:35:35 +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 BEF33245E; Thu, 26 Sep 2019 15:35:35 +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 x8QFZZPo049915; Thu, 26 Sep 2019 15:35:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QFZZnk049914; Thu, 26 Sep 2019 15:35:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909261535.x8QFZZnk049914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 26 Sep 2019 15:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352748 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352748 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: Thu, 26 Sep 2019 15:35:36 -0000 Author: markj Date: Thu Sep 26 15:35:35 2019 New Revision: 352748 URL: https://svnweb.freebsd.org/changeset/base/352748 Log: Fix handling of invalid pages in exec_map_first_page(). exec_map_first_page() would unconditionally free an unbacked, invalid page from the executable image. However, it is possible that the page is wired, in which case it is incorrect to free the page, so check for additional wirings first. Reported by: syzkaller Tested by: pho Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21767 Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Sep 26 15:32:28 2019 (r352747) +++ head/sys/kern/kern_exec.c Thu Sep 26 15:35:35 2019 (r352748) @@ -981,8 +981,10 @@ exec_map_first_page(struct image_params *imgp) if (ma[0]->valid != VM_PAGE_BITS_ALL) { vm_page_xbusy(ma[0]); if (!vm_pager_has_page(object, 0, NULL, &after)) { - vm_page_unwire_noq(ma[0]); - vm_page_free(ma[0]); + if (vm_page_unwire_noq(ma[0])) + vm_page_free(ma[0]); + else + vm_page_xunbusy(ma[0]); VM_OBJECT_WUNLOCK(object); return (EIO); } @@ -1006,9 +1008,16 @@ exec_map_first_page(struct image_params *imgp) initial_pagein = i; rv = vm_pager_get_pages(object, ma, initial_pagein, NULL, NULL); if (rv != VM_PAGER_OK) { - vm_page_unwire_noq(ma[0]); - for (i = 0; i < initial_pagein; i++) - vm_page_free(ma[i]); + if (vm_page_unwire_noq(ma[0])) + vm_page_free(ma[0]); + else + vm_page_xunbusy(ma[0]); + for (i = 1; i < initial_pagein; i++) { + if (!vm_page_wired(ma[i])) + vm_page_free(ma[i]); + else + vm_page_xunbusy(ma[i]); + } VM_OBJECT_WUNLOCK(object); return (EIO); } From owner-svn-src-head@freebsd.org Thu Sep 26 15:41: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 9212712A943; Thu, 26 Sep 2019 15:41:13 +0000 (UTC) (envelope-from dab@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 46fK093P14z4PlC; Thu, 26 Sep 2019 15:41:13 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 590FE25AB; Thu, 26 Sep 2019 15:41:13 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QFfDc7053312; Thu, 26 Sep 2019 15:41:13 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QFfBLY053303; Thu, 26 Sep 2019 15:41:11 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201909261541.x8QFfBLY053303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 26 Sep 2019 15:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352751 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 352751 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: Thu, 26 Sep 2019 15:41:13 -0000 Author: dab Date: Thu Sep 26 15:41:10 2019 New Revision: 352751 URL: https://svnweb.freebsd.org/changeset/base/352751 Log: sysent: regenerate after r352747. Sponsored by: Dell EMC Isilon Modified: 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/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Sep 26 15:41:10 2019 (r352751) @@ -498,4 +498,5 @@ #define FREEBSD32_SYS_copy_file_range 569 #define FREEBSD32_SYS_freebsd32___sysctlbyname 570 #define FREEBSD32_SYS_shm_open2 571 -#define FREEBSD32_SYS_MAXSYSCALL 572 +#define FREEBSD32_SYS_shm_rename 572 +#define FREEBSD32_SYS_MAXSYSCALL 573 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Sep 26 15:41:10 2019 (r352751) @@ -608,4 +608,5 @@ const char *freebsd32_syscallnames[] = { "copy_file_range", /* 569 = copy_file_range */ "freebsd32___sysctlbyname", /* 570 = freebsd32___sysctlbyname */ "shm_open2", /* 571 = shm_open2 */ + "shm_rename", /* 572 = shm_rename */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Sep 26 15:41:10 2019 (r352751) @@ -661,4 +661,5 @@ struct sysent freebsd32_sysent[] = { { 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 */ { AS(shm_open2_args), (sy_call_t *)sys_shm_open2, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 571 = shm_open2 */ + { AS(shm_rename_args), (sy_call_t *)sys_shm_rename, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 572 = shm_rename */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Sep 26 15:41:10 2019 (r352751) @@ -3346,6 +3346,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 5; break; } + /* shm_rename */ + case 572: { + struct shm_rename_args *p = params; + uarg[0] = (intptr_t) p->path_from; /* const char * */ + uarg[1] = (intptr_t) p->path_to; /* const char * */ + iarg[2] = p->flags; /* int */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -9016,6 +9025,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* shm_rename */ + case 572: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "userland const char *"; + break; + case 2: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10897,6 +10922,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* shm_open2 */ case 571: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* shm_rename */ + case 572: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/kern/init_sysent.c Thu Sep 26 15:41:10 2019 (r352751) @@ -627,4 +627,5 @@ struct sysent sysent[] = { { 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 */ { AS(shm_open2_args), (sy_call_t *)sys_shm_open2, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 571 = shm_open2 */ + { AS(shm_rename_args), (sy_call_t *)sys_shm_rename, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 572 = shm_rename */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/kern/syscalls.c Thu Sep 26 15:41:10 2019 (r352751) @@ -578,4 +578,5 @@ const char *syscallnames[] = { "copy_file_range", /* 569 = copy_file_range */ "__sysctlbyname", /* 570 = __sysctlbyname */ "shm_open2", /* 571 = shm_open2 */ + "shm_rename", /* 572 = shm_rename */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/kern/systrace_args.c Thu Sep 26 15:41:10 2019 (r352751) @@ -3338,6 +3338,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 5; break; } + /* shm_rename */ + case 572: { + struct shm_rename_args *p = params; + uarg[0] = (intptr_t) p->path_from; /* const char * */ + uarg[1] = (intptr_t) p->path_to; /* const char * */ + iarg[2] = p->flags; /* int */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -8921,6 +8930,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* shm_rename */ + case 572: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "userland const char *"; + break; + case 2: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10829,6 +10854,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* shm_open2 */ case 571: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* shm_rename */ + case 572: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/sys/syscall.h Thu Sep 26 15:41:10 2019 (r352751) @@ -507,4 +507,5 @@ #define SYS_copy_file_range 569 #define SYS___sysctlbyname 570 #define SYS_shm_open2 571 -#define SYS_MAXSYSCALL 572 +#define SYS_shm_rename 572 +#define SYS_MAXSYSCALL 573 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/sys/syscall.mk Thu Sep 26 15:41:10 2019 (r352751) @@ -412,4 +412,5 @@ MIASM = \ funlinkat.o \ copy_file_range.o \ __sysctlbyname.o \ - shm_open2.o + shm_open2.o \ + shm_rename.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Sep 26 15:38:06 2019 (r352750) +++ head/sys/sys/sysproto.h Thu Sep 26 15:41:10 2019 (r352751) @@ -1814,6 +1814,11 @@ struct shm_open2_args { char shmflags_l_[PADL_(int)]; int shmflags; char shmflags_r_[PADR_(int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; }; +struct shm_rename_args { + char path_from_l_[PADL_(const char *)]; const char * path_from; char path_from_r_[PADR_(const char *)]; + char path_to_l_[PADL_(const char *)]; const char * path_to; char path_to_r_[PADR_(const char *)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2201,6 +2206,7 @@ int sys_funlinkat(struct thread *, struct funlinkat_ar int sys_copy_file_range(struct thread *, struct copy_file_range_args *); int sys___sysctlbyname(struct thread *, struct __sysctlbyname_args *); int sys_shm_open2(struct thread *, struct shm_open2_args *); +int sys_shm_rename(struct thread *, struct shm_rename_args *); #ifdef COMPAT_43 @@ -3123,6 +3129,7 @@ int freebsd12_shm_open(struct thread *, struct freebsd #define SYS_AUE_copy_file_range AUE_NULL #define SYS_AUE___sysctlbyname AUE_SYSCTL #define SYS_AUE_shm_open2 AUE_SHMOPEN +#define SYS_AUE_shm_rename AUE_NULL #undef PAD_ #undef PADL_ From owner-svn-src-head@freebsd.org Thu Sep 26 15:54: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 6D19012B18D; Thu, 26 Sep 2019 15:54:36 +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 46fKHc2r5Fz4RBB; Thu, 26 Sep 2019 15:54:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-vk1-f171.google.com (mail-vk1-f171.google.com [209.85.221.171]) (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 345AA15503; Thu, 26 Sep 2019 15:54:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-vk1-f171.google.com with SMTP id u192so543276vkb.12; Thu, 26 Sep 2019 08:54:36 -0700 (PDT) X-Gm-Message-State: APjAAAUIE9kj5+aOvM4a4elSRYk9A/7A2hwlYGn2/Sf0Q4Hyz9jczDGE oycSWSLOW70Fn3FjdFvYRZsZw7pFgk7I6jqXwXM= X-Google-Smtp-Source: APXvYqwRWytZJI3DtMCkQVlSbuEufL4Mxvuwlv/lpdAGSWm5IRK7KsCZAFX1TdwsogV9jpOWCQFC1JKfcKsz+/V2mI8= X-Received: by 2002:a1f:ec5:: with SMTP id 188mr697647vko.90.1569513275409; Thu, 26 Sep 2019 08:54:35 -0700 (PDT) MIME-Version: 1.0 References: <201909261532.x8QFWSDH049691@repo.freebsd.org> In-Reply-To: <201909261532.x8QFWSDH049691@repo.freebsd.org> From: Kyle Evans Date: Thu, 26 Sep 2019 10:54:23 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r352747 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/posixshm usr.bin/truss To: David Bright Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" 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: Thu, 26 Sep 2019 15:54:36 -0000 On Thu, Sep 26, 2019 at 10:32 AM David Bright wrote: > > Author: dab > Date: Thu Sep 26 15:32:28 2019 > New Revision: 352747 > URL: https://svnweb.freebsd.org/changeset/base/352747 > > Log: > Add an shm_rename syscall > > Add an atomic shm rename operation, similar in spirit to a file > rename. Atomically unlink an shm from a source path and link it to a > destination path. If an existing shm is linked at the destination > path, unlink it as part of the same atomic operation. The caller needs > the same permissions as shm_unlink to the shm being renamed, and the > same permissions for the shm at the destination which is being > unlinked, if it exists. If those fail, EACCES is returned, as with the > other shm_* syscalls. > > truss support is included; audit support will come later. > > This commit includes only the implementation; the sysent-generated > bits will come in a follow-on commit. > > Submitted by: Matthew Bryan > Reviewed by: jilles (earlier revision) > Reviewed by: brueffer (manpages, earlier revision) > Relnotes: yes > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D21423 > > Modified: > head/lib/libc/sys/Makefile.inc > head/lib/libc/sys/Symbol.map > head/lib/libc/sys/shm_open.2 > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/syscalls.master > head/sys/kern/uipc_shm.c > head/sys/sys/mman.h > head/tests/sys/posixshm/posixshm_test.c > head/usr.bin/truss/syscalls.c > > Modified: head/lib/libc/sys/Makefile.inc > ============================================================================== > --- head/lib/libc/sys/Makefile.inc Thu Sep 26 15:18:57 2019 (r352746) > +++ head/lib/libc/sys/Makefile.inc Thu Sep 26 15:32:28 2019 (r352747) > @@ -477,7 +477,8 @@ MLINKS+=setuid.2 setegid.2 \ > setuid.2 setgid.2 > MLINKS+=shmat.2 shmdt.2 > MLINKS+=shm_open.2 memfd_create.3 \ > - shm_open.2 shm_unlink.2 > + shm_open.2 shm_unlink.2 \ > + shm_rename.2 > MLINKS+=sigwaitinfo.2 sigtimedwait.2 > MLINKS+=stat.2 fstat.2 \ > stat.2 fstatat.2 \ > > Modified: head/lib/libc/sys/Symbol.map > ============================================================================== > --- head/lib/libc/sys/Symbol.map Thu Sep 26 15:18:57 2019 (r352746) > +++ head/lib/libc/sys/Symbol.map Thu Sep 26 15:32:28 2019 (r352747) > @@ -410,6 +410,7 @@ FBSD_1.6 { > getfhat; > funlinkat; > memfd_create; > + shm_rename; > }; > > FBSDprivate_1.0 { > > Modified: head/lib/libc/sys/shm_open.2 > ============================================================================== > --- head/lib/libc/sys/shm_open.2 Thu Sep 26 15:18:57 2019 (r352746) > +++ head/lib/libc/sys/shm_open.2 Thu Sep 26 15:32:28 2019 (r352747) > @@ -28,11 +28,11 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd September 24, 2019 > +.Dd September 26, 2019 > .Dt SHM_OPEN 2 > .Os > .Sh NAME > -.Nm memfd_create , shm_open , shm_unlink > +.Nm memfd_create , shm_open , shm_rename, shm_unlink > .Nd "shared memory object operations" > .Sh LIBRARY > .Lb libc > @@ -45,6 +45,8 @@ > .Ft int > .Fn shm_open "const char *path" "int flags" "mode_t mode" > .Ft int > +.Fn shm_rename "const char *path_from" "const char *path_to" "int flags" > +.Ft int > .Fn shm_unlink "const char *path" > .Sh DESCRIPTION > The > @@ -112,8 +114,9 @@ see > and > .Xr fcntl 2 . > .Pp > -As a FreeBSD extension, > -the constant > +As a > +.Fx > +extension, the constant > .Dv SHM_ANON > may be used for the > .Fa path > @@ -122,7 +125,9 @@ argument to > In this case, an anonymous, unnamed shared memory object is created. > Since the object has no name, > it cannot be removed via a subsequent call to > -.Fn shm_unlink . > +.Fn shm_unlink , > +or moved with a call to > +.Fn shm_rename . > Instead, > the shared memory object will be garbage collected when the last reference to > the shared memory object is removed. > @@ -138,6 +143,31 @@ will fail with > All other flags are ignored. > .Pp > The > +.Fn shm_rename > +system call atomically removes a shared memory object named > +.Fa path_from > +and relinks it at > +.Fa path_to . > +If another object is already linked at > +.Fa path_to , > +that object will be unlinked, unless one of the following flags are provided: > +.Bl -tag -offset indent -width Er > +.It Er SHM_RENAME_EXCHANGE > +Atomically exchange the shms at > +.Fa path_from > +and > +.Fa path_to . > +.It Er SHM_RENAME_NOREPLACE > +Return an error if an shm exists at > +.Fa path_to , > +rather than unlinking it. > +.El > +.Fn shm_rename > +is also a > +.Fx > +extension. > +.Pp > +The > .Fn shm_unlink > system call removes a shared memory object named > .Fa path . > @@ -196,15 +226,20 @@ and > .Fn shm_open > both return a non-negative integer, > and > +.Fn shm_rename > +and > .Fn shm_unlink > -returns zero. > -All three functions return -1 on failure, and set > +return zero. > +All functions return -1 on failure, and set > .Va errno > to indicate the error. > .Sh COMPATIBILITY > The > -.Fa path > -argument does not necessarily represent a pathname (although it does in > +.Fa path , > +.Fa path_from , > +and > +.Fa path_to > +arguments do not necessarily represent a pathname (although they do in > most other implementations). > Two processes opening the same > .Fa path > @@ -325,7 +360,7 @@ The > .Fa path > argument points outside the process' allocated address space. > .It Bq Er ENAMETOOLONG > -The entire pathname exceeded 1023 characters. > +The entire pathname exceeds 1023 characters. > .It Bq Er EINVAL > The > .Fa path > @@ -344,6 +379,31 @@ are specified and the named shared memory object does > The required permissions (for reading or reading and writing) are denied. > .El > .Pp > +The following errors are defined for > +.Fn shm_rename : > +.Bl -tag -width Er > +.It Bq Er EFAULT > +The > +.Fa path_from > +or > +.Fa path_to > +argument points outside the process' allocated address space. > +.It Bq Er ENAMETOOLONG > +The entire pathname exceeds 1023 characters. > +.It Bq Er ENOENT > +The shared memory object at > +.Fa path_from > +does not exist. > +.It Bq Er EACCES > +The required permissions are denied. > +.It Bq Er EEXIST > +An shm exists at > +.Fa path_to , > +and the > +.Dv SHM_RENAME_NOREPLACE > +flag was provided. > +.El > +.Pp > .Fn shm_unlink > fails with these error codes for these conditions: > .Bl -tag -width Er > @@ -352,7 +412,7 @@ The > .Fa path > argument points outside the process' allocated address space. > .It Bq Er ENAMETOOLONG > -The entire pathname exceeded 1023 characters. > +The entire pathname exceeds 1023 characters. > .It Bq Er ENOENT > The named shared memory object does not exist. > .It Bq Er EACCES > @@ -394,9 +454,19 @@ functions first appeared in > The functions were reimplemented as system calls using shared memory objects > directly rather than files in > .Fx 8.0 . > +.Pp > +.Fn shm_rename > +first appeared in > +.Fx 13.0 > +as a > +.Fx > +extension. > .Sh AUTHORS > .An Garrett A. Wollman Aq Mt wollman@FreeBSD.org > (C library support and this manual page) > .Pp > .An Matthew Dillon Aq Mt dillon@FreeBSD.org > .Pq Dv MAP_NOSYNC > +.Pp > +.An Matthew Bryan Aq Mt matthew.bryan@isilon.com > +.Pq Dv shm_rename implementation > > Modified: head/sys/compat/freebsd32/syscalls.master > ============================================================================== > --- head/sys/compat/freebsd32/syscalls.master Thu Sep 26 15:18:57 2019 (r352746) > +++ head/sys/compat/freebsd32/syscalls.master Thu Sep 26 15:32:28 2019 (r352747) > @@ -1157,5 +1157,7 @@ > 571 AUE_SHMOPEN NOPROTO { int shm_open2( \ > const char *path, int flags, mode_t mode, \ > int shmflags, const char *name); } > +572 AUE_NULL NOPROTO { int shm_rename(const char *path_from, \ > + const char *path_to, int flags); } > > ; vim: syntax=off > > Modified: head/sys/kern/syscalls.master > ============================================================================== > --- head/sys/kern/syscalls.master Thu Sep 26 15:18:57 2019 (r352746) > +++ head/sys/kern/syscalls.master Thu Sep 26 15:32:28 2019 (r352747) > @@ -3204,6 +3204,13 @@ > _In_z_ const char *name > ); > } > +572 AUE_NULL STD { > + int shm_rename( > + _In_z_ const char *path_from, > + _In_z_ const char *path_to, > + int flags > + ); > + } > > ; Please copy any additions and changes to the following compatability tables: > ; sys/compat/freebsd32/syscalls.master > > Modified: head/sys/kern/uipc_shm.c > ============================================================================== > --- head/sys/kern/uipc_shm.c Thu Sep 26 15:18:57 2019 (r352746) > +++ head/sys/kern/uipc_shm.c Thu Sep 26 15:32:28 2019 (r352747) > @@ -33,8 +33,9 @@ > > /* > * Support for shared swap-backed anonymous memory objects via > - * shm_open(2) and shm_unlink(2). While most of the implementation is > - * here, vm_mmap.c contains mapping logic changes. > + * shm_open(2), shm_rename(2), and shm_unlink(2). > + * While most of the implementation is here, vm_mmap.c contains > + * mapping logic changes. > * > * posixshmcontrol(1) allows users to inspect the state of the memory > * objects. Per-uid swap resource limit controls total amount of > @@ -945,6 +946,158 @@ sys_shm_unlink(struct thread *td, struct shm_unlink_ar > free(path, M_TEMP); > > return (error); > +} > + > +int > +sys_shm_rename(struct thread *td, struct shm_rename_args *uap) > +{ > + char *path_from = NULL, *path_to = NULL; > + Fnv32_t fnv_from, fnv_to; > + struct shmfd *fd_from; > + struct shmfd *fd_to; > + int error; > + int flags; > + > + flags = uap->flags; > + > + /* > + * Make sure the user passed only valid flags. > + * If you add a new flag, please add a new term here. > + */ > + if ((flags & ~( > + SHM_RENAME_NOREPLACE | > + SHM_RENAME_EXCHANGE > + )) != 0) { > + error = EINVAL; > + goto out; > + } > + > + /* > + * EXCHANGE and NOREPLACE don't quite make sense together. Let's > + * force the user to choose one or the other. > + */ > + if ((flags & SHM_RENAME_NOREPLACE) != 0 && > + (flags & SHM_RENAME_EXCHANGE) != 0) { > + error = EINVAL; > + goto out; > + } > + > + /* > + * Malloc zone M_SHMFD, since this path may end up freed later from > + * M_SHMFD if we end up doing an insert. > + */ > + path_from = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); > + error = copyinstr(uap->path_from, path_from, MAXPATHLEN, NULL); > + if (error) > + goto out; > + > + path_to = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); > + error = copyinstr(uap->path_to, path_to, MAXPATHLEN, NULL); > + if (error) > + goto out; > + > + /* Rename with from/to equal is a no-op */ > + if (strncmp(path_from, path_to, MAXPATHLEN) == 0) > + goto out; > + > + fnv_from = fnv_32_str(path_from, FNV1_32_INIT); > + fnv_to = fnv_32_str(path_to, FNV1_32_INIT); > + > + sx_xlock(&shm_dict_lock); > + > + fd_from = shm_lookup(path_from, fnv_from); > + if (fd_from == NULL) { > + sx_xunlock(&shm_dict_lock); > + error = ENOENT; > + goto out; > + } > + > + fd_to = shm_lookup(path_to, fnv_to); > + if ((flags & SHM_RENAME_NOREPLACE) != 0 && fd_to != NULL) { > + sx_xunlock(&shm_dict_lock); > + error = EEXIST; > + goto out; > + } > + > + /* > + * Unconditionally prevents shm_remove from invalidating the 'from' > + * shm's state. > + */ > + shm_hold(fd_from); > + error = shm_remove(path_from, fnv_from, td->td_ucred); > + > + /* > + * One of my assumptions failed if ENOENT (e.g. locking didn't > + * protect us) > + */ > + KASSERT(error != ENOENT, ("Our shm disappeared during shm_rename: %s", > + path_from)); > + if (error) { > + shm_drop(fd_from); > + sx_xunlock(&shm_dict_lock); > + goto out; > + } > + > + /* > + * If we are exchanging, we need to ensure the shm_remove below > + * doesn't invalidate the dest shm's state. > + */ > + if ((flags & SHM_RENAME_EXCHANGE) != 0 && fd_to != NULL) > + shm_hold(fd_to); > + > + /* > + * NOTE: if path_to is not already in the hash, c'est la vie; > + * it simply means we have nothing already at path_to to unlink. > + * That is the ENOENT case. > + * > + * If we somehow don't have access to unlink this guy, but > + * did for the shm at path_from, then relink the shm to path_from > + * and abort with EACCES. > + * > + * All other errors: that is weird; let's relink and abort the > + * operation. > + */ > + error = shm_remove(path_to, fnv_to, td->td_ucred); > + if (error && error != ENOENT) { > + shm_insert(path_from, fnv_from, fd_from); > + shm_drop(fd_from); > + /* Don't free path_from now, since the hash references it */ > + path_from = NULL; > + sx_xunlock(&shm_dict_lock); > + goto out; > + } > + > + shm_insert(path_to, fnv_to, fd_from); > + > + /* Don't free path_to now, since the hash references it */ > + path_to = NULL; > + > + /* We kept a ref when we removed, and incremented again in insert */ > + shm_drop(fd_from); > +#ifdef DEBUG > + KASSERT(fd_from->shm_refs > 0, ("Expected >0 refs; got: %d\n", > + fd_from->shm_refs)); > +#endif > + > + if ((flags & SHM_RENAME_EXCHANGE) != 0 && fd_to != NULL) { > + shm_insert(path_from, fnv_from, fd_to); > + path_from = NULL; > + shm_drop(fd_to); > +#ifdef DEBUG > + KASSERT(fd_to->shm_refs > 0, ("Expected >0 refs; got: %d\n", > + fd_to->shm_refs)); > +#endif > + } > + > + error = 0; > + sx_xunlock(&shm_dict_lock); > + > +out: > + if (path_from != NULL) > + free(path_from, M_SHMFD); > + if (path_to != NULL) > + free(path_to, M_SHMFD); > + return(error); > } > > int > > Modified: head/sys/sys/mman.h > ============================================================================== > --- head/sys/sys/mman.h Thu Sep 26 15:18:57 2019 (r352746) > +++ head/sys/sys/mman.h Thu Sep 26 15:32:28 2019 (r352747) > @@ -134,6 +134,14 @@ > #define MAP_FAILED ((void *)-1) > > /* > + * Flags provided to shm_rename > + */ > +/* Don't overwrite dest, if it exists */ > +#define SHM_RENAME_NOREPLACE (1 << 0) > +/* Atomically swap src and dest */ > +#define SHM_RENAME_EXCHANGE (1 << 1) > + > +/* > * msync() flags > */ > #define MS_SYNC 0x0000 /* msync synchronously */ > @@ -313,6 +321,7 @@ int posix_madvise(void *, size_t, int); > int mlockall(int); > int munlockall(void); > int shm_open(const char *, int, mode_t); > +int shm_rename(const char *, const char *, int); > int shm_unlink(const char *); > #endif > #if __BSD_VISIBLE > I think this should also be under __BSD_VISIBLE rather than __POSIX_VISIBLE since it's not specified in any POSIX publication (that I've found). From owner-svn-src-head@freebsd.org Thu Sep 26 16:13: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 66DCB12BE00; Thu, 26 Sep 2019 16:13:18 +0000 (UTC) (envelope-from dab@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 46fKjB26Nxz4Svq; Thu, 26 Sep 2019 16:13:18 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2BAE82BBD; Thu, 26 Sep 2019 16:13:18 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QGDIT1074285; Thu, 26 Sep 2019 16:13:18 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QGDIoD074284; Thu, 26 Sep 2019 16:13:18 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201909261613.x8QGDIoD074284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 26 Sep 2019 16:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352756 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 352756 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: Thu, 26 Sep 2019 16:13:18 -0000 Author: dab Date: Thu Sep 26 16:13:17 2019 New Revision: 352756 URL: https://svnweb.freebsd.org/changeset/base/352756 Log: Correct mistake in MLINKS introduced in r352747 Messed up a merge conflict resolution and didn't catch that before commit. Sponsored by: Dell EMC Isilon Modified: head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Thu Sep 26 16:09:28 2019 (r352755) +++ head/lib/libc/sys/Makefile.inc Thu Sep 26 16:13:17 2019 (r352756) @@ -478,7 +478,7 @@ MLINKS+=setuid.2 setegid.2 \ MLINKS+=shmat.2 shmdt.2 MLINKS+=shm_open.2 memfd_create.3 \ shm_open.2 shm_unlink.2 \ - shm_rename.2 + shm_open.2 shm_rename.2 MLINKS+=sigwaitinfo.2 sigtimedwait.2 MLINKS+=stat.2 fstat.2 \ stat.2 fstatat.2 \ From owner-svn-src-head@freebsd.org Thu Sep 26 16:19:24 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 79D9E12C16B; Thu, 26 Sep 2019 16:19:24 +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 46fKrD2dgZz4TMw; Thu, 26 Sep 2019 16:19:24 +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 2D8682BCB; Thu, 26 Sep 2019 16:19:24 +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 x8QGJOgp074772; Thu, 26 Sep 2019 16:19:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QGJNAt074767; Thu, 26 Sep 2019 16:19:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201909261619.x8QGJNAt074767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 26 Sep 2019 16:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352757 - in head: lib/libc/sys lib/libregex/tests stand/lua tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libc/sys lib/libregex/tests stand/lua tests/sys/kern X-SVN-Commit-Revision: 352757 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: Thu, 26 Sep 2019 16:19:24 -0000 Author: kevans Date: Thu Sep 26 16:19:22 2019 New Revision: 352757 URL: https://svnweb.freebsd.org/changeset/base/352757 Log: Further normalize copyright notices - s/C/c/ where I've been inconsistent about it - +SPDX tags - Remove "All rights reserved" where possible Requested by: rgrimes (all rights reserved) Modified: head/lib/libc/sys/shm_open.c head/lib/libregex/tests/libregex_test.sh head/stand/lua/config.lua head/stand/lua/menu.lua head/stand/lua/password.lua head/tests/sys/kern/memfd_test.c Modified: head/lib/libc/sys/shm_open.c ============================================================================== --- head/lib/libc/sys/shm_open.c Thu Sep 26 16:13:17 2019 (r352756) +++ head/lib/libc/sys/shm_open.c Thu Sep 26 16:19:22 2019 (r352757) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2019 Kyle Evans - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: head/lib/libregex/tests/libregex_test.sh ============================================================================== --- head/lib/libregex/tests/libregex_test.sh Thu Sep 26 16:13:17 2019 (r352756) +++ head/lib/libregex/tests/libregex_test.sh Thu Sep 26 16:19:22 2019 (r352757) @@ -1,6 +1,7 @@ # +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# # Copyright (c) 2017 Kyle Evans -# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Thu Sep 26 16:13:17 2019 (r352756) +++ head/stand/lua/config.lua Thu Sep 26 16:19:22 2019 (r352757) @@ -2,7 +2,7 @@ -- SPDX-License-Identifier: BSD-2-Clause-FreeBSD -- -- Copyright (c) 2015 Pedro Souza --- Copyright (C) 2018 Kyle Evans +-- Copyright (c) 2018 Kyle Evans -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Thu Sep 26 16:13:17 2019 (r352756) +++ head/stand/lua/menu.lua Thu Sep 26 16:19:22 2019 (r352757) @@ -2,7 +2,7 @@ -- SPDX-License-Identifier: BSD-2-Clause-FreeBSD -- -- Copyright (c) 2015 Pedro Souza --- Copyright (C) 2018 Kyle Evans +-- Copyright (c) 2018 Kyle Evans -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Thu Sep 26 16:13:17 2019 (r352756) +++ head/stand/lua/password.lua Thu Sep 26 16:19:22 2019 (r352757) @@ -2,7 +2,7 @@ -- SPDX-License-Identifier: BSD-2-Clause-FreeBSD -- -- Copyright (c) 2015 Pedro Souza --- Copyright (C) 2018 Kyle Evans +-- Copyright (c) 2018 Kyle Evans -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without Modified: head/tests/sys/kern/memfd_test.c ============================================================================== --- head/tests/sys/kern/memfd_test.c Thu Sep 26 16:13:17 2019 (r352756) +++ head/tests/sys/kern/memfd_test.c Thu Sep 26 16:19:22 2019 (r352757) @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2019 Kyle Evans - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-head@freebsd.org Thu Sep 26 16:46: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 B1CE912CDA2 for ; Thu, 26 Sep 2019 16:46:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (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 46fLRB6Vg1z4WZ9 for ; Thu, 26 Sep 2019 16:46:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x743.google.com with SMTP id y189so2359021qkc.3 for ; Thu, 26 Sep 2019 09:46: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=64Rkc3FVX3biU3eesUyNZUXZMGebRjEw8U/Uo/6t0OE=; b=0iAvRwnbC33wGGObsWGSFwtO42MPg2foYfGmMjvPrDq3yaqV5+jT9KxntZg7kiCkdk UnEjiuzYxlfQU5wi0mus+/guhM+9cOquWDYdRxNmZd05enTBKPm7AauACHG8d73BhcDU C/sHoVcCIFUUhfFivT1+YexOWeGt+IiZmc0LFWA3uDtGDUM/xIH7jILTFz51K6bqdv9Q 016LBHtINQfUbPWZ745n0IuggsjBtQnKMcrpBG8cKAp83pCN5QogSMYADk5+T01Onl8p 4fhhG/UuQc5CZWCVk+i49A4RhQ12FZV6o3oMoFN49tTiy7u0UJiRYuDOdTY0E34yGJ/L SDmQ== 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=64Rkc3FVX3biU3eesUyNZUXZMGebRjEw8U/Uo/6t0OE=; b=V51b2wxRqyKPyCEMNR9pFMq6896/xmKM6faLB02Wf9N2h/97qnZaiWies0HPsbbmP1 mAKKPE0ta5fHA1pSOUhfIwbRIrRzN2MNwjExT5jaCirHVmzevPBaDVSXAfA3CZEu3uz9 FOt3KonCOKsYDa7MumEy7cwUPm8InpTBQeo38o0ZjJ5xiM07DFND9moeZieqFspauPDN UUIDye/THblNc6TwutNeriv7WKLCHhW31tSG5U4YLSms5vGXKHquz42oG6UVcl/Kw3Of Qgqimhl6GLLq2ZoxDczZqmtDuCJC/OUHRT0pfQYhywICH6890RF9r3OlKSbkSdf3Syvn W3SA== X-Gm-Message-State: APjAAAXEH5MaIPyOeTliKv6Btb4IwKFiUQlg9qviImvsiPjtfNsg06LS 9SRXeeH2ISaIEjuAIbwJPC8Qa0qSElheGtUh5RpKAA== X-Google-Smtp-Source: APXvYqy+AXHHlMJ4z5no4CuiFjhXEujDB4GdRcMbwxeqptWOGlSOBCpatUmR+RAc50U6Xgc08STFKvkAsTVgFAl47vM= X-Received: by 2002:a05:620a:6af:: with SMTP id i15mr4223336qkh.380.1569516373951; Thu, 26 Sep 2019 09:46:13 -0700 (PDT) MIME-Version: 1.0 References: <201909251826.x8PIQVUN095257@repo.freebsd.org> <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> <1681db78-6a0c-55cf-1e01-65e06f145975@vishwin.info> <18644033-d01e-1bc7-02eb-42999033d8fd@freebsd.org> In-Reply-To: <18644033-d01e-1bc7-02eb-42999033d8fd@freebsd.org> From: Warner Losh Date: Thu, 26 Sep 2019 10:46:02 -0600 Message-ID: Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Niclas Zeising Cc: Charlie Li , Kyle Evans , svn-src-head , svn-src-all , Gleb Smirnoff , src-committers , FreeBSD X11 mailing list X-Rspamd-Queue-Id: 46fLRB6Vg1z4WZ9 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=0iAvRwnb; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::743) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-0.93 / 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]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[freebsd]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.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]; RCPT_COUNT_SEVEN(0.00)[8]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.43)[ip: (2.67), ipnet: 2607:f8b0::/32(-2.60), asn: 15169(-2.18), 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]; SUSPICIOUS_RECIPS(1.50)[]; 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: Thu, 26 Sep 2019 16:46:15 -0000 But we shouldn't be including opt_foo.h files in sys/*.h files. That's the root cause of trouble here. Warner On Thu, Sep 26, 2019 at 9:11 AM Niclas Zeising wrote: > On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote: > > Kyle Evans wrote: > >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: > >>> This breaks building the drm-kmod ports, as the build cannot find > >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the > >>> exact same way): > >>> > >>> --- linux_anon_inodes.o --- > >>> cc -O2 -pipe -fno-strict-aliasing -include > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h > >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE > >>> -nostdinc > >>> > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include > >>> > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include > >>> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys > >>> -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer > >>> -mno-omit-leaf-frame-pointer > >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include > >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD > >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel > >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float > >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv > -fstack-protector > >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > >>> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas > >>> -Wno-error-tautological-compare -Wno-error-empty-body > >>> -Wno-error-parentheses-equality -Wno-error-unused-function > >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value > >>> -Wno-address-of-packed-member -Wno-format-zero-length > -Wno-pointer-arith > >>> -mno-aes -mno-avx -std=iso9899:1999 -c > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c > >>> -o linux_anon_inodes.o > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > >>> In file included from > >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > >>> In file included from /usr/src/sys/net/if_var.h:83: > >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not > found > >>> #include "opt_epoch.h" > >>> ^~~~~~~~~~~~~ > >>> --- linux_anon_inodefs.o --- > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > >>> In file included from > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > >>> In file included from > >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > >>> In file included from /usr/src/sys/net/if_var.h:83: > >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not > found > >>> #include "opt_epoch.h" > >>> ^~~~~~~~~~~~~ > >>> --- linux_anon_inodes.o --- > >>> 1 error generated. > >>> *** [linux_anon_inodes.o] Error code 1 > >>> > >>> make[2]: stopped in > >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi > >>> --- linux_anon_inodefs.o --- > >>> 1 error generated. > >>> *** [linux_anon_inodefs.o] Error code 1 > >>> > >>> Interestingly enough, does not happen when drm-current-kmod is built as > >>> part of buildkernel (using an existing installed package with SOURCE > on). > >>> > >> > >> FWIW, johalun noticed this yesterday and addressed it here: > >> > https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f0ac7fe1a660300981d > >> > > Ah, of course I would miss these commits in the kms-drm repo, > > considering that I watch them roll in. Will wait for the updated > > snapshots in ports. > > > > I'll get to updating the ports as soon as I can. > Regards > -- > Niclas Zeising > _______________________________________________ > freebsd-x11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-x11 > To unsubscribe, send any mail to "freebsd-x11-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Thu Sep 26 17:11: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 39CC412D9D5; Thu, 26 Sep 2019 17:11:53 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (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 46fM0m14GYz4YQd; Thu, 26 Sep 2019 17:11:51 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt1-x830.google.com with SMTP id j31so3785121qta.5; Thu, 26 Sep 2019 10:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VvvPDuI1RhYe6BcHSWGbqyk340BwPtfJZorO1xLDUF8=; b=Y7xe5IYjq36m4wmERzzIS8oN+iHk/FC/5YDBFVxqNSc6RgNRFtDPWFnxvb6YMg8qOV 79eNG5FEdBIWFR/BOOFflpSUV0uPphcVNTvh3WUw5GPMnporMeJP6ilGYpUamaC+TxJk uS0cct2BNGIxXo1N+u+Fn50T+tS/Espbtc8mprQ+1jdXNsvXS6bCDEByCkvixAFPMCP0 u5WKAxw1vKjIbg/eWBn1yYIxQwyLFdHXyljA22rerMqg2wDSAc1QFjMK7mXx59SrXPOe YjxrpGmMXLwYY/EHRIJCpD6WpH1k8aitnqXZ6nma3aBK9PtUo87uESrqaH+phb57uKaR XIlA== 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:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=VvvPDuI1RhYe6BcHSWGbqyk340BwPtfJZorO1xLDUF8=; b=ggwcfXLLK3XzZuBZIceJa+4jqvcqeMiuvPPg/Mm4KAM1KRefpki2RirYtQRwqyF4sU eOi3FfUWhX+bdkICwqLKRUDE6oJmvrqBc2QyalYlqO0kFFtFHusV3x1XeHBQ2GRns6k1 hlbGvmlj1ygJ6jLytiUOsCe5yLFJUvmNBFEVs0hxahBuFsJQ4YY5k3+fwklKKgW8k7WR HSd53M+00T8W9I8h0CGH1B3DoSkr/eendXh3W9u3C3SCA0WFw5u3JsUN0CFNbcjfSVB7 O6J+j5TNtcRtfD2437gMR4lJIPaOadWQAVZFfYfO/WXRkzJCHttcza2UyHSgMkQkJoQK RrYA== X-Gm-Message-State: APjAAAXkxQdzsUAda3sg7wXPSSyRmA4ZyeUKA4+zRR2mIj4xFPcRpJHJ qjdePoyZJHg+kHM8ZEwB/fsC0/yz X-Google-Smtp-Source: APXvYqySSA6TX55THJztEnRO47cxE+yjRgVXEVZV6PYskvxpMEovK89vp9HpvQ2loRmcv+8IyBWLBg== X-Received: by 2002:a0c:f84d:: with SMTP id g13mr3618688qvo.217.1569517910636; Thu, 26 Sep 2019 10:11:50 -0700 (PDT) Received: from mbp.home ([2804:f1c:800:fc00:64a4:9a05:9f73:b793]) by smtp.gmail.com with ESMTPSA id w73sm1434610qkb.111.2019.09.26.10.11.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Sep 2019 10:11:49 -0700 (PDT) Sender: Renato Botelho Subject: Re: svn commit: r338888 - head/sbin/devd To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201809221532.w8MFWsPk073665@repo.freebsd.org> From: Renato Botelho 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: Date: Thu, 26 Sep 2019 14:11:47 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <201809221532.w8MFWsPk073665@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46fM0m14GYz4YQd X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Y7xe5IYj; dmarc=none; spf=pass (mx1.freebsd.org: domain of gargabsd@gmail.com designates 2607:f8b0:4864:20::830 as permitted sender) smtp.mailfrom=gargabsd@gmail.com X-Spamd-Result: default: False [-5.03 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; 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(-2.83)[ip: (-9.34), ipnet: 2607:f8b0::/32(-2.60), asn: 15169(-2.18), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[0.3.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]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; 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: Thu, 26 Sep 2019 17:11:53 -0000 On 22/09/18 12:32, Warner Losh wrote: > Author: imp > Date: Sat Sep 22 15:32:53 2018 > New Revision: 338888 > URL: https://svnweb.freebsd.org/changeset/base/338888 > > Log: > We don't need shell protection for when we're expanding matches. > Don't add it. This should fix when we do regepx matches against > variables we've set and fix wifi bring up. > > PR: 231441 > Approved by: re@ (kib) > Differential Revision: https://reviews.freebsd.org/D17267 Warner, We are seeing unexpected $ on /var/log/messages when matches are replaced inside shell commands between single quotes. With action set as follow: action "logger -t kern.notice 'device-name=$device-name start'"; We see a log entry like this: Sep 26 13:56:06 x230 kern.notice[27604]: device-name=$rtwn0 start Reverting this change made it to log properly: Sep 26 13:56:06 x230 kern.notice[27604]: device-name=rtwn0 start There is an open bug already: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240411 -- Renato Botelho From owner-svn-src-head@freebsd.org Thu Sep 26 17:25:30 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 9FEED12E266; Thu, 26 Sep 2019 17:25:30 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (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 46fMJT5sbkz4ZY3; Thu, 26 Sep 2019 17:25:29 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qk1-x743.google.com with SMTP id y189so2468315qkc.3; Thu, 26 Sep 2019 10:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WhUe5D2pfE2ajEnESfL25WnCgdud6+4cqdvzv+o6PVc=; b=AZU8qPTG//aDoSjjjoMzbkobTipXZ8W0YX+WNKm2EafnMg5FfMkZk9kmAaPOqCd7bI 7/qGLk3wEmQxdrtCsnpkUPPNg+oJNH61WEK7t1MdthDSnEtqd1f/WpL0yZ9MKyYE4dOr teixw/L3V3yvyL27gE59L0RvQX+xDLpMNiZtwYZLd6kLb4YScVftJYlrn0upLruE4pL8 ln4JT82S5z9criwgBz6AB86+loqUZy+DELa0velvJ1IePptwhLmggKaza5nP8JX6Cg1A rZfYy2qVMxaLLUdo9ez4ZAiPnqkxTNGDlcNUYV7z0tSiIP4km0CQF8Xav5UwU7kEiH9L J0aQ== 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=WhUe5D2pfE2ajEnESfL25WnCgdud6+4cqdvzv+o6PVc=; b=TAbZ6mlLDw0kPzyanxlI+Kmv5QZ24fcB7Dt8J3ru10Mlby0QNu4UqEnu/6b/IfPqpU +/sMvppDWJO+dMb10r46qGpPUflGeHREHnhoFgu2mUZdGEWxuLPYu9NWGYqG/mJ9XP20 HJehOoHnGj9N4IsWZza9tIc2bky9JAqxH1gv+jHDyNLBQSlkvldqI4IF4zIPgFF/rJEq t+TanzLFOoPXiGZmdYBsXCSvz1e06OLIy2TjsMaUH6YqEzcSoRvrSOi4XF6l5d6ANOZG 8Q2yKM2byIhWjJxPrpF9Q8ISjksDJfbIFzllEjBQevRsO1jdgtYgY0USibScPMmAeRh9 XHxw== X-Gm-Message-State: APjAAAUTk4kZnGYLCWj5KVGjOpSQJVTYAapl+e8QjPhJNA9mlZU72grc 9+Hbwxi5sy9L+wMq6XI0QgdeA1dl7BhMc3OmYJM= X-Google-Smtp-Source: APXvYqxXGyNXt7GRQGhDWayvQW+N6RlaCMRNicK2RrwQMv/n8jsWRxFYk+EernGy+Cf46cIp5wE41A6pooR6Dccsmno= X-Received: by 2002:a37:a843:: with SMTP id r64mr4125570qke.363.1569518728714; Thu, 26 Sep 2019 10:25:28 -0700 (PDT) MIME-Version: 1.0 References: <201909251826.x8PIQVUN095257@repo.freebsd.org> <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> <1681db78-6a0c-55cf-1e01-65e06f145975@vishwin.info> <18644033-d01e-1bc7-02eb-42999033d8fd@freebsd.org> In-Reply-To: From: Ryan Stone Date: Thu, 26 Sep 2019 13:25:17 -0400 Message-ID: Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Warner Losh Cc: Niclas Zeising , Charlie Li , Kyle Evans , svn-src-head , svn-src-all , Gleb Smirnoff , src-committers , FreeBSD X11 mailing list Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46fMJT5sbkz4ZY3 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=AZU8qPTG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rysto32@gmail.com designates 2607:f8b0:4864:20::743 as permitted sender) smtp.mailfrom=rysto32@gmail.com X-Spamd-Result: default: False [-1.50 / 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)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TAGGED_RCPT(0.00)[freebsd]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCPT_COUNT_SEVEN(0.00)[9]; RCVD_IN_DNSWL_NONE(0.00)[3.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]; IP_SCORE(0.00)[ip: (2.67), ipnet: 2607:f8b0::/32(-2.60), asn: 15169(-2.18), country: US(-0.05)]; 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)[]; SUSPICIOUS_RECIPS(1.50)[] 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: Thu, 26 Sep 2019 17:25:30 -0000 We also shouldn't have ifdef's that change the size of a kernel structure that's part of the KBI. Isn't struct epoch_tracker part of the KBI? On Thu, Sep 26, 2019 at 12:46 PM Warner Losh wrote: > > But we shouldn't be including opt_foo.h files in sys/*.h files. That's the root cause of trouble here. > > Warner > > On Thu, Sep 26, 2019 at 9:11 AM Niclas Zeising wrote: >> >> On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote: >> > Kyle Evans wrote: >> >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: >> >>> This breaks building the drm-kmod ports, as the build cannot find >> >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the >> >>> exact same way): >> >>> >> >>> --- linux_anon_inodes.o --- >> >>> cc -O2 -pipe -fno-strict-aliasing -include >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h >> >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE >> >>> -nostdinc >> >>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include >> >>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include >> >>> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys >> >>> -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer >> >>> -mno-omit-leaf-frame-pointer >> >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include >> >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD >> >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel >> >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float >> >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector >> >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes >> >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef >> >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ >> >>> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas >> >>> -Wno-error-tautological-compare -Wno-error-empty-body >> >>> -Wno-error-parentheses-equality -Wno-error-unused-function >> >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value >> >>> -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith >> >>> -mno-aes -mno-avx -std=iso9899:1999 -c >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c >> >>> -o linux_anon_inodes.o >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: >> >>> In file included from >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >> >>> In file included from /usr/src/sys/net/if_var.h:83: >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found >> >>> #include "opt_epoch.h" >> >>> ^~~~~~~~~~~~~ >> >>> --- linux_anon_inodefs.o --- >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: >> >>> In file included from >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: >> >>> In file included from >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: >> >>> In file included from /usr/src/sys/net/if_var.h:83: >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found >> >>> #include "opt_epoch.h" >> >>> ^~~~~~~~~~~~~ >> >>> --- linux_anon_inodes.o --- >> >>> 1 error generated. >> >>> *** [linux_anon_inodes.o] Error code 1 >> >>> >> >>> make[2]: stopped in >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi >> >>> --- linux_anon_inodefs.o --- >> >>> 1 error generated. >> >>> *** [linux_anon_inodefs.o] Error code 1 >> >>> >> >>> Interestingly enough, does not happen when drm-current-kmod is built as >> >>> part of buildkernel (using an existing installed package with SOURCE on). >> >>> >> >> >> >> FWIW, johalun noticed this yesterday and addressed it here: >> >> https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f0ac7fe1a660300981d >> >> >> > Ah, of course I would miss these commits in the kms-drm repo, >> > considering that I watch them roll in. Will wait for the updated >> > snapshots in ports. >> > >> >> I'll get to updating the ports as soon as I can. >> Regards >> -- >> Niclas Zeising >> _______________________________________________ >> freebsd-x11@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-x11 >> To unsubscribe, send any mail to "freebsd-x11-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Thu Sep 26 17:35: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 B262912E800 for ; Thu, 26 Sep 2019 17:35:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (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 46fMWS2Hffz4bSv for ; Thu, 26 Sep 2019 17:35:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x743.google.com with SMTP id f16so2468990qkl.9 for ; Thu, 26 Sep 2019 10:35:00 -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=gFC3Cr8BELGNMW052dNu93NGSq6tbu0753IncuwWM/k=; b=MOs20KAYg0Wo170l9YXoAJ5pxV6bfWzLm/QOtQifGGZRiKH/ZrBJyeYexW7bJtJfbi op/Y8yP8d8U/zetwE/hG6jBnLmZDcC6qT7xzsh5QVuHYxGS+OJIYwhQnzibMiIi1IGxP dm9ULVJWLtxGAuVLI+NGVjVo63z0z6fiWE1kCXCfTVzbdEvBkiDRr1NNZIK4CZNETCuT or/XXPyz2K2sVFZ4ft4RMlduIJufFVDhjYx0dy5l288SMRi36rFE2WSEsSP7iHwV1iLT z05mRV1gsEM0LRL10q6kKrmgu5p15lb/U/WOCXpSSS+bcLJMhzyz/R2fVVALdWi+Pu5f 71GA== 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=gFC3Cr8BELGNMW052dNu93NGSq6tbu0753IncuwWM/k=; b=YLR/QC35lKkhk6Wr8zcGfXvCMNOo/RU8W+yWo/BYA4cd3HBUa53Q+iZ07GGOJHQn4X ZIzRtvRMomZU8QtZh1qqmTnM6G9bhUE7YDTSA5aVxC8Dm0S3r6CM9tL8JLCQncmzQSYz Df+1PyLo6pRL6LI4dqcoB3YhMYjRvLRyZKVoYungkZMwDwx8b0F4gaeIn1HHR3opbi7n gAJ8Lh9Sc1hfnfmoT0KDMfT+YdXwJLXHu8wyg0hexgNHotc6IvqNI0pooV4ssKIf/lEN ui7JHOE+UdivX8V5Pjkl4G2kQJsb/QGJLPJ1yDrv/CLPuSJyxqdPfA/LE+JjkwvKAZ3z YnUg== X-Gm-Message-State: APjAAAVUW/N2uQoFfkC8RQJLci1jxy6rljAdUrU2dEASaovXsep0FCEs p4sdrA5mzSBlUVQ6uMPa9l1O/G/ezQ5zrJkHAynWGQ== X-Google-Smtp-Source: APXvYqwrDnw/7zY3L9Ak2MmE1UgXhAGZLsk4VzEn+1ZW4uZRvpoXgyUT2+fXjlU9zC/D5fYa8BpusCsfqYFqusB+vZY= X-Received: by 2002:a37:30f:: with SMTP id 15mr4230169qkd.240.1569519299244; Thu, 26 Sep 2019 10:34:59 -0700 (PDT) MIME-Version: 1.0 References: <201909251826.x8PIQVUN095257@repo.freebsd.org> <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> <1681db78-6a0c-55cf-1e01-65e06f145975@vishwin.info> <18644033-d01e-1bc7-02eb-42999033d8fd@freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 26 Sep 2019 11:34:47 -0600 Message-ID: Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Ryan Stone Cc: Niclas Zeising , Charlie Li , Kyle Evans , svn-src-head , svn-src-all , Gleb Smirnoff , src-committers , FreeBSD X11 mailing list X-Rspamd-Queue-Id: 46fMWS2Hffz4bSv X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=MOs20KAY; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::743) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-0.93 / 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]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[freebsd]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.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]; RCPT_COUNT_SEVEN(0.00)[9]; 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(-0.43)[ip: (2.67), ipnet: 2607:f8b0::/32(-2.60), asn: 15169(-2.18), 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]; SUSPICIOUS_RECIPS(1.50)[]; 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: Thu, 26 Sep 2019 17:35:00 -0000 Kinda my point exactly... Warner On Thu, Sep 26, 2019 at 11:25 AM Ryan Stone wrote: > We also shouldn't have ifdef's that change the size of a kernel > structure that's part of the KBI. Isn't struct epoch_tracker part of > the KBI? > > On Thu, Sep 26, 2019 at 12:46 PM Warner Losh wrote: > > > > But we shouldn't be including opt_foo.h files in sys/*.h files. That's > the root cause of trouble here. > > > > Warner > > > > On Thu, Sep 26, 2019 at 9:11 AM Niclas Zeising > wrote: > >> > >> On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote: > >> > Kyle Evans wrote: > >> >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote: > >> >>> This breaks building the drm-kmod ports, as the build cannot find > >> >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the > >> >>> exact same way): > >> >>> > >> >>> --- linux_anon_inodes.o --- > >> >>> cc -O2 -pipe -fno-strict-aliasing -include > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h > >> >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE > >> >>> -nostdinc > >> >>> > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include > >> >>> > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include > >> >>> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys > >> >>> -I/usr/src/sys/contrib/ck/include -fno-common > -fno-omit-frame-pointer > >> >>> -mno-omit-leaf-frame-pointer > >> >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include > >> >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD > >> >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o > -mcmodel=kernel > >> >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float > >> >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv > -fstack-protector > >> >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > >> >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > >> >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > >> >>> -Wmissing-include-dirs -fdiagnostics-show-option > -Wno-unknown-pragmas > >> >>> -Wno-error-tautological-compare -Wno-error-empty-body > >> >>> -Wno-error-parentheses-equality -Wno-error-unused-function > >> >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value > >> >>> -Wno-address-of-packed-member -Wno-format-zero-length > -Wno-pointer-arith > >> >>> -mno-aes -mno-avx -std=iso9899:1999 -c > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c > >> >>> -o linux_anon_inodes.o > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > >> >>> In file included from > >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > >> >>> In file included from /usr/src/sys/net/if_var.h:83: > >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not > found > >> >>> #include "opt_epoch.h" > >> >>> ^~~~~~~~~~~~~ > >> >>> --- linux_anon_inodefs.o --- > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > >> >>> In file included from > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > >> >>> In file included from > >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > >> >>> In file included from /usr/src/sys/net/if_var.h:83: > >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not > found > >> >>> #include "opt_epoch.h" > >> >>> ^~~~~~~~~~~~~ > >> >>> --- linux_anon_inodes.o --- > >> >>> 1 error generated. > >> >>> *** [linux_anon_inodes.o] Error code 1 > >> >>> > >> >>> make[2]: stopped in > >> >>> > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi > >> >>> --- linux_anon_inodefs.o --- > >> >>> 1 error generated. > >> >>> *** [linux_anon_inodefs.o] Error code 1 > >> >>> > >> >>> Interestingly enough, does not happen when drm-current-kmod is > built as > >> >>> part of buildkernel (using an existing installed package with > SOURCE on). > >> >>> > >> >> > >> >> FWIW, johalun noticed this yesterday and addressed it here: > >> >> > https://github.com/FreeBSDDesktop/kms-drm/commit/b486949e7e9f0cfe8dac5f0ac7fe1a660300981d > >> >> > >> > Ah, of course I would miss these commits in the kms-drm repo, > >> > considering that I watch them roll in. Will wait for the updated > >> > snapshots in ports. > >> > > >> > >> I'll get to updating the ports as soon as I can. > >> Regards > >> -- > >> Niclas Zeising > >> _______________________________________________ > >> freebsd-x11@freebsd.org mailing list > >> https://lists.freebsd.org/mailman/listinfo/freebsd-x11 > >> To unsubscribe, send any mail to "freebsd-x11-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Thu Sep 26 17:53: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 0C6A212F12B; Thu, 26 Sep 2019 17:53:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 46fMxB5cXcz4dB5; Thu, 26 Sep 2019 17:53:50 +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 x8QHrgjk036355 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 26 Sep 2019 20:53:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x8QHrgjk036355 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x8QHrgfN036354; Thu, 26 Sep 2019 20:53:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 26 Sep 2019 20:53:42 +0300 From: Konstantin Belousov To: David Bright Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352747 - in head: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/posixshm usr.bin/truss Message-ID: <20190926175342.GI44691@kib.kiev.ua> References: <201909261532.x8QFWSDH049691@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201909261532.x8QFWSDH049691@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) 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 X-Rspamd-Queue-Id: 46fMxB5cXcz4dB5 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.984,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: Thu, 26 Sep 2019 17:53:51 -0000 On Thu, Sep 26, 2019 at 03:32:28PM +0000, David Bright wrote: > Author: dab > Date: Thu Sep 26 15:32:28 2019 > New Revision: 352747 > URL: https://svnweb.freebsd.org/changeset/base/352747 > > Log: > Add an shm_rename syscall > Modified: head/sys/kern/uipc_shm.c > ============================================================================== > --- head/sys/kern/uipc_shm.c Thu Sep 26 15:18:57 2019 (r352746) > +++ head/sys/kern/uipc_shm.c Thu Sep 26 15:32:28 2019 (r352747) > @@ -33,8 +33,9 @@ > > /* > * Support for shared swap-backed anonymous memory objects via > - * shm_open(2) and shm_unlink(2). While most of the implementation is > - * here, vm_mmap.c contains mapping logic changes. > + * shm_open(2), shm_rename(2), and shm_unlink(2). > + * While most of the implementation is here, vm_mmap.c contains > + * mapping logic changes. > * > * posixshmcontrol(1) allows users to inspect the state of the memory > * objects. Per-uid swap resource limit controls total amount of > @@ -945,6 +946,158 @@ sys_shm_unlink(struct thread *td, struct shm_unlink_ar > free(path, M_TEMP); > > return (error); > +} > + > +int > +sys_shm_rename(struct thread *td, struct shm_rename_args *uap) > +{ > + char *path_from = NULL, *path_to = NULL; > + Fnv32_t fnv_from, fnv_to; > + struct shmfd *fd_from; > + struct shmfd *fd_to; > + int error; > + int flags; > + > + flags = uap->flags; > + > + /* > + * Make sure the user passed only valid flags. > + * If you add a new flag, please add a new term here. > + */ > + if ((flags & ~( > + SHM_RENAME_NOREPLACE | > + SHM_RENAME_EXCHANGE > + )) != 0) { > + error = EINVAL; > + goto out; > + } > + > + /* > + * EXCHANGE and NOREPLACE don't quite make sense together. Let's > + * force the user to choose one or the other. > + */ > + if ((flags & SHM_RENAME_NOREPLACE) != 0 && > + (flags & SHM_RENAME_EXCHANGE) != 0) { > + error = EINVAL; > + goto out; > + } > + > + /* > + * Malloc zone M_SHMFD, since this path may end up freed later from > + * M_SHMFD if we end up doing an insert. > + */ I do not quite get the comment. > + path_from = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); > + error = copyinstr(uap->path_from, path_from, MAXPATHLEN, NULL); > + if (error) > + goto out; > + > + path_to = malloc(MAXPATHLEN, M_SHMFD, M_WAITOK); > + error = copyinstr(uap->path_to, path_to, MAXPATHLEN, NULL); > + if (error) > + goto out; > + > + /* Rename with from/to equal is a no-op */ > + if (strncmp(path_from, path_to, MAXPATHLEN) == 0) > + goto out; Is this needed for correctness, or just a micro-optimization ? We require that all shm names started with '/'. I do not see a check for that in your code, so it seems that you allow to create such entries. Also look at the special handling for jailed callers in kern_shm_open(). > + > + fnv_from = fnv_32_str(path_from, FNV1_32_INIT); > + fnv_to = fnv_32_str(path_to, FNV1_32_INIT); > + > + sx_xlock(&shm_dict_lock); > + > + fd_from = shm_lookup(path_from, fnv_from); > + if (fd_from == NULL) { > + sx_xunlock(&shm_dict_lock); > + error = ENOENT; > + goto out; I think you can put an out_locked label just before final unlock and jump to it instead of repeating sx_xunlock(). > + } > + > + fd_to = shm_lookup(path_to, fnv_to); You added truss support, but not ktrace. I think it would be useful to report looked up names, see the use of KTR_NAMEI tracepoints in kern_shm_open(). > + if ((flags & SHM_RENAME_NOREPLACE) != 0 && fd_to != NULL) { > + sx_xunlock(&shm_dict_lock); > + error = EEXIST; > + goto out; > + } > + > + /* > + * Unconditionally prevents shm_remove from invalidating the 'from' > + * shm's state. > + */ > + shm_hold(fd_from); > + error = shm_remove(path_from, fnv_from, td->td_ucred); > + > + /* > + * One of my assumptions failed if ENOENT (e.g. locking didn't > + * protect us) > + */ > + KASSERT(error != ENOENT, ("Our shm disappeared during shm_rename: %s", > + path_from)); > + if (error) { > + shm_drop(fd_from); > + sx_xunlock(&shm_dict_lock); > + goto out; > + } > + > + /* > + * If we are exchanging, we need to ensure the shm_remove below > + * doesn't invalidate the dest shm's state. > + */ > + if ((flags & SHM_RENAME_EXCHANGE) != 0 && fd_to != NULL) > + shm_hold(fd_to); > + > + /* > + * NOTE: if path_to is not already in the hash, c'est la vie; > + * it simply means we have nothing already at path_to to unlink. > + * That is the ENOENT case. > + * > + * If we somehow don't have access to unlink this guy, but > + * did for the shm at path_from, then relink the shm to path_from > + * and abort with EACCES. > + * > + * All other errors: that is weird; let's relink and abort the > + * operation. > + */ > + error = shm_remove(path_to, fnv_to, td->td_ucred); > + if (error && error != ENOENT) { > + shm_insert(path_from, fnv_from, fd_from); > + shm_drop(fd_from); > + /* Don't free path_from now, since the hash references it */ > + path_from = NULL; > + sx_xunlock(&shm_dict_lock); > + goto out; > + } > + > + shm_insert(path_to, fnv_to, fd_from); > + > + /* Don't free path_to now, since the hash references it */ > + path_to = NULL; > + > + /* We kept a ref when we removed, and incremented again in insert */ > + shm_drop(fd_from); > +#ifdef DEBUG This is weird. Why did you put KASSERT under some custom define protection ? > + KASSERT(fd_from->shm_refs > 0, ("Expected >0 refs; got: %d\n", > + fd_from->shm_refs)); > +#endif > + > + if ((flags & SHM_RENAME_EXCHANGE) != 0 && fd_to != NULL) { > + shm_insert(path_from, fnv_from, fd_to); > + path_from = NULL; > + shm_drop(fd_to); > +#ifdef DEBUG > + KASSERT(fd_to->shm_refs > 0, ("Expected >0 refs; got: %d\n", > + fd_to->shm_refs)); > +#endif > + } > + > + error = 0; I do not think this assignment does anything useful. > + sx_xunlock(&shm_dict_lock); > + > +out: > + if (path_from != NULL) You do not need the checks, calls free() unconditionally. > + free(path_from, M_SHMFD); > + if (path_to != NULL) > + free(path_to, M_SHMFD); > + return(error); There should be space before '('. > } > > int > > Modified: head/sys/sys/mman.h > ============================================================================== > --- head/sys/sys/mman.h Thu Sep 26 15:18:57 2019 (r352746) > +++ head/sys/sys/mman.h Thu Sep 26 15:32:28 2019 (r352747) > @@ -134,6 +134,14 @@ > #define MAP_FAILED ((void *)-1) > > /* > + * Flags provided to shm_rename > + */ > +/* Don't overwrite dest, if it exists */ > +#define SHM_RENAME_NOREPLACE (1 << 0) > +/* Atomically swap src and dest */ > +#define SHM_RENAME_EXCHANGE (1 << 1) You already got a note about namespace. > + > +/* > * msync() flags > */ > #define MS_SYNC 0x0000 /* msync synchronously */ > @@ -313,6 +321,7 @@ int posix_madvise(void *, size_t, int); > int mlockall(int); > int munlockall(void); > int shm_open(const char *, int, mode_t); > +int shm_rename(const char *, const char *, int); > int shm_unlink(const char *); > #endif > #if __BSD_VISIBLE From owner-svn-src-head@freebsd.org Thu Sep 26 21:02:21 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 E895C13466C; Thu, 26 Sep 2019 21:02:21 +0000 (UTC) (envelope-from gonzo@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 46fS6j5tjFz3yVM; Thu, 26 Sep 2019 21:02:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AD13A64A6; Thu, 26 Sep 2019 21:02:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QL2Lmn055661; Thu, 26 Sep 2019 21:02:21 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QL2L6C055660; Thu, 26 Sep 2019 21:02:21 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201909262102.x8QL2L6C055660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 26 Sep 2019 21:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352775 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 352775 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: Thu, 26 Sep 2019 21:02:22 -0000 Author: gonzo Date: Thu Sep 26 21:02:21 2019 New Revision: 352775 URL: https://svnweb.freebsd.org/changeset/base/352775 Log: snd_hda: Add Intel Cannon Lake support Add PCI ids for Intel Cannon Lake PCH Tested on: HP Spectre x360 13-p0043dx PR: 240574 Submitted by: Neel Chauhan Reviewed by: imp, mizhka, ray MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21789 Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Sep 26 20:56:07 2019 (r352774) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Sep 26 21:02:21 2019 (r352775) @@ -102,6 +102,7 @@ static const struct { { HDA_INTEL_KBLK, "Intel Kaby Lake", 0, 0 }, { HDA_INTEL_KBLKH, "Intel Kaby Lake-H", 0, 0 }, { HDA_INTEL_CFLK, "Intel Coffee Lake", 0, 0 }, + { HDA_INTEL_CNLK, "Intel Cannon Lake", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, From owner-svn-src-head@freebsd.org Thu Sep 26 21:04: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 6F35F134752; Thu, 26 Sep 2019 21:04:37 +0000 (UTC) (envelope-from gonzo@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 46fS9K2NhBz3yhd; Thu, 26 Sep 2019 21:04:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 34D4264C4; Thu, 26 Sep 2019 21:04:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QL4acQ055812; Thu, 26 Sep 2019 21:04:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QL4awH055811; Thu, 26 Sep 2019 21:04:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201909262104.x8QL4awH055811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 26 Sep 2019 21:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352776 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 352776 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: Thu, 26 Sep 2019 21:04:37 -0000 Author: gonzo Date: Thu Sep 26 21:04:36 2019 New Revision: 352776 URL: https://svnweb.freebsd.org/changeset/base/352776 Log: snd_hda: Add Intel Cannon Lake support Add missing header change ommitted in r352775 MFC after: 2 weeks X-MFC-with: 352775 Modified: head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Thu Sep 26 21:02:21 2019 (r352775) +++ head/sys/dev/sound/pci/hda/hdac.h Thu Sep 26 21:04:36 2019 (r352776) @@ -77,6 +77,7 @@ #define HDA_INTEL_KBLK HDA_MODEL_CONSTRUCT(INTEL, 0xa171) #define HDA_INTEL_KBLKH HDA_MODEL_CONSTRUCT(INTEL, 0xa2f0) #define HDA_INTEL_CFLK HDA_MODEL_CONSTRUCT(INTEL, 0xa348) +#define HDA_INTEL_CNLK HDA_MODEL_CONSTRUCT(INTEL, 0x9dc8) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ From owner-svn-src-head@freebsd.org Thu Sep 26 21:12: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 E25B7134AC8; Thu, 26 Sep 2019 21:12:47 +0000 (UTC) (envelope-from glebius@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 46fSLl5g0Wz40PF; Thu, 26 Sep 2019 21:12:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A56636689; Thu, 26 Sep 2019 21:12:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QLClf3061818; Thu, 26 Sep 2019 21:12:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QLCl9o061816; Thu, 26 Sep 2019 21:12:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201909262112.x8QLCl9o061816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 26 Sep 2019 21:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352778 - in head/sys: conf sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: conf sys X-SVN-Commit-Revision: 352778 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: Thu, 26 Sep 2019 21:12:47 -0000 Author: glebius Date: Thu Sep 26 21:12:47 2019 New Revision: 352778 URL: https://svnweb.freebsd.org/changeset/base/352778 Log: Move EPOCH_TRACE to opt_global.h, so that any external modules that use epoch don't need Makefile tweaks. The downside is that any developer who wants EPOCH_TRACE needs to rebuild kernel in full, but that's fine. Reviewed by: imp Modified: head/sys/conf/options head/sys/sys/epoch.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Sep 26 21:06:55 2019 (r352777) +++ head/sys/conf/options Thu Sep 26 21:12:47 2019 (r352778) @@ -712,7 +712,7 @@ WITNESS_SKIPSPIN opt_witness.h WITNESS_COUNT opt_witness.h OPENSOLARIS_WITNESS opt_global.h -EPOCH_TRACE opt_epoch.h +EPOCH_TRACE opt_global.h # options for ACPI support ACPI_DEBUG opt_acpi.h Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Thu Sep 26 21:06:55 2019 (r352777) +++ head/sys/sys/epoch.h Thu Sep 26 21:12:47 2019 (r352778) @@ -41,8 +41,6 @@ typedef struct epoch_context *epoch_context_t; #include #include -#include "opt_epoch.h" - struct epoch; typedef struct epoch *epoch_t; From owner-svn-src-head@freebsd.org Fri Sep 27 00:18: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 E5C40F026E; Fri, 27 Sep 2019 00:18:11 +0000 (UTC) (envelope-from rysto32@gmail.com) 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 46fXSg4jX9z48Fx; Fri, 27 Sep 2019 00:18:11 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-qt1-x844.google.com with SMTP id m15so5175644qtq.2; Thu, 26 Sep 2019 17:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MHkAUbGlQ4HQNgR4BsCjPWN42d91GT6bD0iPbrU9DRE=; b=AZxS9oLkFKmN/9+rmhkDql0za/Q2lvQkB5H8la/g9jrslEuOHjylUoULg1cbMRu7xd 3uRMKmYML0ps3i4HiUvs7oCdz4z44mR3RdYObUeIdzx4wKBetNURC6Goqf/mffGhiZXo BhzbFOvgtjppl8V3lMgTQVjarFclcN9vkK40UourwYJ49Zev/H6XI8zWJUYRDMG9nmUf o8cZASME12hf4MOUPUQMTk/ntK71ykMiVOwXVco9V9Y3E05pb0P69IPOO5efajNIjzlO 5e36i18S45NNWQdO7PeMNgMGYhm2YCPBJ5+2p9lA3qQlEvOktD75d56GG8a6O6vwYh21 Z8sg== 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=MHkAUbGlQ4HQNgR4BsCjPWN42d91GT6bD0iPbrU9DRE=; b=fwsGJakbqsZx9idBD4tFi288D5cqasPCZmRqqVrLxEtoEnvAivsSEu4FRk6JEGWa5T btGv4YoyOZbLRmWU1QTD76PQ8lcx7SsNNLJm++kQ8mp7yF56hP1gy7J3Z/urDB0xLzPJ A9wzuwbJCR0jo0w+vV/f9o9SGTGZXpiqR7LaaWPcuWAK7a3Y+jbjfSHL8uE/ngjsbjTP dpLCAKltG1n7tKGLPycoUD37fz9iCU5eF9ITrE/6afCJDWF0ymrwmVOFVxgNioLenvbg 4tPpMOTB31cSs8kzz/5CqUbMjVWFw1f8mVM/VL/tSPhSdBwoAS/7kYH8fw5SM8AUhzzx liag== X-Gm-Message-State: APjAAAWlTjw3vLJCT3g20F54I1L1DqZJJLIUF9DkrkZBJfllL21uDwgK luYRjdQS6hSxnhzUkllRpV7HkT6GgdWbPN/qXv6uHN4v X-Google-Smtp-Source: APXvYqyxyd4ApyTvHFDTmAVrfjWxbYkMQGaNLi37AyCPfNb1PUqNDKsJTi1kvwXRG4SoWqhTBO5RuC0rr/ofG9rn8vw= X-Received: by 2002:ac8:845:: with SMTP id x5mr7194679qth.42.1569543488955; Thu, 26 Sep 2019 17:18:08 -0700 (PDT) MIME-Version: 1.0 References: <201909262112.x8QLCl9o061816@repo.freebsd.org> In-Reply-To: <201909262112.x8QLCl9o061816@repo.freebsd.org> From: Ryan Stone Date: Thu, 26 Sep 2019 20:17:57 -0400 Message-ID: Subject: Re: svn commit: r352778 - in head/sys: conf sys To: Gleb Smirnoff 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: 46fXSg4jX9z48Fx X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Fri, 27 Sep 2019 00:18:12 -0000 Is this enough? Won't out-of-tree modules get compiled without EPOCH_TRACE set? If such a module is loaded on a kernel with EPOCH_TRACE set then the module will call epoch_enter_preempt() with a epoch_tracker that is too small and have its stack corrupted, won't it? On Thu, Sep 26, 2019 at 5:12 PM Gleb Smirnoff wrote: > > Author: glebius > Date: Thu Sep 26 21:12:47 2019 > New Revision: 352778 > URL: https://svnweb.freebsd.org/changeset/base/352778 > > Log: > Move EPOCH_TRACE to opt_global.h, so that any external modules that > use epoch don't need Makefile tweaks. > > The downside is that any developer who wants EPOCH_TRACE needs to > rebuild kernel in full, but that's fine. > > Reviewed by: imp > > Modified: > head/sys/conf/options > head/sys/sys/epoch.h > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Thu Sep 26 21:06:55 2019 (r352777) > +++ head/sys/conf/options Thu Sep 26 21:12:47 2019 (r352778) > @@ -712,7 +712,7 @@ WITNESS_SKIPSPIN opt_witness.h > WITNESS_COUNT opt_witness.h > OPENSOLARIS_WITNESS opt_global.h > > -EPOCH_TRACE opt_epoch.h > +EPOCH_TRACE opt_global.h > > # options for ACPI support > ACPI_DEBUG opt_acpi.h > > Modified: head/sys/sys/epoch.h > ============================================================================== > --- head/sys/sys/epoch.h Thu Sep 26 21:06:55 2019 (r352777) > +++ head/sys/sys/epoch.h Thu Sep 26 21:12:47 2019 (r352778) > @@ -41,8 +41,6 @@ typedef struct epoch_context *epoch_context_t; > #include > #include > > -#include "opt_epoch.h" > - > struct epoch; > typedef struct epoch *epoch_t; > From owner-svn-src-head@freebsd.org Fri Sep 27 00:29: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 24363F0665; Fri, 27 Sep 2019 00:29:04 +0000 (UTC) (envelope-from cy@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 46fXjC70mrz48kK; Fri, 27 Sep 2019 00:29:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFC0C8950; Fri, 27 Sep 2019 00:29:03 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8R0T3se074372; Fri, 27 Sep 2019 00:29:03 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8R0T3g9074371; Fri, 27 Sep 2019 00:29:03 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909270029.x8R0T3g9074371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 27 Sep 2019 00:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352783 - head/contrib/ipfilter/man X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/man X-SVN-Commit-Revision: 352783 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: Fri, 27 Sep 2019 00:29:04 -0000 Author: cy Date: Fri Sep 27 00:29:03 2019 New Revision: 352783 URL: https://svnweb.freebsd.org/changeset/base/352783 Log: Fix a typo. MFC after: 3 days Modified: head/contrib/ipfilter/man/ippool.8 Modified: head/contrib/ipfilter/man/ippool.8 ============================================================================== --- head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:11:09 2019 (r352782) +++ head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:03 2019 (r352783) @@ -108,7 +108,7 @@ Sets the hashing seed to the number specified. Only f type pools. .TP .B -t -Sets the type of pool being defined. Myst be one of +Sets the type of pool being defined. Must be one of .B tree, .B hash, .B group-map. From owner-svn-src-head@freebsd.org Fri Sep 27 00:29: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 1F560F0689; Fri, 27 Sep 2019 00:29:07 +0000 (UTC) (envelope-from cy@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 46fXjG734dz48kw; Fri, 27 Sep 2019 00:29:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D61228951; Fri, 27 Sep 2019 00:29:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8R0T656074417; Fri, 27 Sep 2019 00:29:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8R0T6t3074416; Fri, 27 Sep 2019 00:29:06 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909270029.x8R0T6t3074416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 27 Sep 2019 00:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352784 - head/contrib/ipfilter/man X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/man X-SVN-Commit-Revision: 352784 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: Fri, 27 Sep 2019 00:29:07 -0000 Author: cy Date: Fri Sep 27 00:29:06 2019 New Revision: 352784 URL: https://svnweb.freebsd.org/changeset/base/352784 Log: Sync with source: Only a role of "ipf" is currentlysupported as the other documented (and undocumented) roles are #ifdef'd out. The plan is to complete ippool(8) as it is even in its current state a powerful feature/tool. PR: 218433 MFC after: 1 month Modified: head/contrib/ipfilter/man/ippool.8 Modified: head/contrib/ipfilter/man/ippool.8 ============================================================================== --- head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:03 2019 (r352783) +++ head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:06 2019 (r352784) @@ -96,11 +96,8 @@ retrieving statistical information. .TP .B -o Sets the role with which this pool is to be used. Currently only -.B ipf, -.B auth -and -.B count -are accepted as arguments to this option. +.B ipf +(the default) is accepted as arguments to this option. .TP .B -S Sets the hashing seed to the number specified. Only for use with From owner-svn-src-head@freebsd.org Fri Sep 27 00:29: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 6E6ACF06A9; Fri, 27 Sep 2019 00:29:10 +0000 (UTC) (envelope-from cy@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 46fXjL1g9Mz48rY; Fri, 27 Sep 2019 00:29:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 030298953; Fri, 27 Sep 2019 00:29:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8R0T9XX074478; Fri, 27 Sep 2019 00:29:09 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8R0T9Aa074477; Fri, 27 Sep 2019 00:29:09 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909270029.x8R0T9Aa074477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 27 Sep 2019 00:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352785 - head/contrib/ipfilter/tools X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/tools X-SVN-Commit-Revision: 352785 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: Fri, 27 Sep 2019 00:29:10 -0000 Author: cy Date: Fri Sep 27 00:29:09 2019 New Revision: 352785 URL: https://svnweb.freebsd.org/changeset/base/352785 Log: The no resolve (OPT_NORESOLVE) does nothing. Additionally, it (-R) conflicts with the command option of the same name (also -R). Remove the superfluous and confusing non-global non-command -R option. PR: 218433 MFC after: 1 week Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Fri Sep 27 00:29:06 2019 (r352784) +++ head/contrib/ipfilter/tools/ippool.c Fri Sep 27 00:29:09 2019 (r352785) @@ -145,7 +145,7 @@ poolnodecommand(remove, argc, argv) bzero((char *)&pnode, sizeof(pnode)); bzero((char *)&hnode, sizeof(hnode)); - while ((c = getopt(argc, argv, "di:m:no:Rt:T:v")) != -1) + while ((c = getopt(argc, argv, "di:m:no:t:T:v")) != -1) switch (c) { case 'd' : @@ -172,9 +172,6 @@ poolnodecommand(remove, argc, argv) if (role == IPL_LOGNONE) return -1; break; - case 'R' : - opts |= OPT_NORESOLVE; - break; case 't' : if (ipset == 1) { fprintf(stderr, @@ -272,7 +269,7 @@ poolcommand(remove, argc, argv) bzero((char *)&iph, sizeof(iph)); bzero((char *)&pool, sizeof(pool)); - while ((c = getopt(argc, argv, "dm:no:RS:v")) != -1) + while ((c = getopt(argc, argv, "dm:no:S:v")) != -1) switch (c) { case 'd' : @@ -292,9 +289,6 @@ poolcommand(remove, argc, argv) return -1; } break; - case 'R' : - opts |= OPT_NORESOLVE; - break; case 'S' : if (remove == 0) iph.iph_seed = atoi(optarg); @@ -368,7 +362,7 @@ loadpoolfile(argc, argv, infile) { int c; - while ((c = getopt(argc, argv, "dnRuv")) != -1) + while ((c = getopt(argc, argv, "dnuv")) != -1) switch (c) { case 'd' : @@ -377,9 +371,6 @@ loadpoolfile(argc, argv, infile) break; case 'n' : opts |= OPT_DONOTHING|OPT_DONTOPEN; - break; - case 'R' : - opts |= OPT_NORESOLVE; break; case 'u' : opts |= OPT_REMOVE; From owner-svn-src-head@freebsd.org Fri Sep 27 00:29: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 44EFFF06E3; Fri, 27 Sep 2019 00:29:14 +0000 (UTC) (envelope-from cy@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 46fXjP62dfz490F; Fri, 27 Sep 2019 00:29:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DC758955; Fri, 27 Sep 2019 00:29:13 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8R0TDDr074537; Fri, 27 Sep 2019 00:29:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8R0TDrn074535; Fri, 27 Sep 2019 00:29:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201909270029.x8R0TDrn074535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 27 Sep 2019 00:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352786 - in head/contrib/ipfilter: man tools X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/ipfilter: man tools X-SVN-Commit-Revision: 352786 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: Fri, 27 Sep 2019 00:29:14 -0000 Author: cy Date: Fri Sep 27 00:29:12 2019 New Revision: 352786 URL: https://svnweb.freebsd.org/changeset/base/352786 Log: Implement the dynamic add (-A) and removal (-R) of ippool pools from the command line. Prior to this the functionality was mostly there however since the pool type (-t) was not recognized by the -A and -R command options -- not recognized by getopt(). Additionally the code to implement the dynamic add and removal of pools didn't work. When dynamically adding (-A) a pool a type (-t) to specify if the pool is a tree or hash pool must be specified. When dynamically removing (-R) a pool, omitting -t will cause a search-and-destroy which will remove both types of pools matching the name given (-m). PR: 218433 MFC after: 1 week Modified: head/contrib/ipfilter/man/ippool.8 head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/man/ippool.8 ============================================================================== --- head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:09 2019 (r352785) +++ head/contrib/ipfilter/man/ippool.8 Fri Sep 27 00:29:12 2019 (r352786) @@ -9,7 +9,7 @@ ippool \- user interface to the IPFilter pools -a [-dnv] [-m ] [-o ] [-t ] [-T ttl] -i [/] .br .B ippool --A [-dnv] [-m ] [-o ] [-S ] [-t ] +-A [-dnv] [-m ] [-o ] [-S ] -t .br .B ippool -f [-dnuv] Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Fri Sep 27 00:29:09 2019 (r352785) +++ head/contrib/ipfilter/tools/ippool.c Fri Sep 27 00:29:12 2019 (r352786) @@ -257,7 +257,7 @@ poolcommand(remove, argc, argv) char *argv[]; { int type, role, c, err; - char *poolname; + char *poolname, *typearg = NULL; iphtable_t iph; ip_pool_t pool; @@ -269,7 +269,7 @@ poolcommand(remove, argc, argv) bzero((char *)&iph, sizeof(iph)); bzero((char *)&pool, sizeof(pool)); - while ((c = getopt(argc, argv, "dm:no:S:v")) != -1) + while ((c = getopt(argc, argv, "dm:no:S:vt:")) != -1) switch (c) { case 'd' : @@ -295,6 +295,10 @@ poolcommand(remove, argc, argv) else usage(argv[0]); break; + case 't' : + type = gettype(optarg, &iph.iph_type); + typearg = optarg; + break; case 'v' : opts |= OPT_VERBOSE; break; @@ -314,17 +318,22 @@ poolcommand(remove, argc, argv) return -1; } - type = gettype(argv[optind], &iph.iph_type); - if (type == IPLT_NONE) { - fprintf(stderr, "unknown type '%s'\n", argv[optind]); + if (type == IPLT_NONE && remove == 0) { + if (typearg == NULL) { + fprintf(stderr, "type must be specified\n"); + usage(argv[0]); + } else { + fprintf(stderr, "unknown type '%s'\n", typearg); + } return -1; } - if (type == IPLT_HASH) { + if (type == IPLT_HASH || (type == IPLT_NONE && remove == 1)) { strncpy(iph.iph_name, poolname, sizeof(iph.iph_name)); iph.iph_name[sizeof(iph.iph_name) - 1] = '\0'; iph.iph_unit = role; - } else if (type == IPLT_POOL) { + } + if (type == IPLT_POOL || (type == IPLT_NONE && remove == 1)) { strncpy(pool.ipo_name, poolname, sizeof(pool.ipo_name)); pool.ipo_name[sizeof(pool.ipo_name) - 1] = '\0'; pool.ipo_unit = role; @@ -348,6 +357,16 @@ poolcommand(remove, argc, argv) break; case IPLT_POOL : err = remove_pool(&pool, ioctl); + break; + case IPLT_NONE : + err = 1; + { + int err_h, err_p; + err_h = remove_hash(&iph, ioctl); + err_p = remove_pool(&pool, ioctl); + if (err_h == 0 || err_p == 0) + err = 0; + } break; } } From owner-svn-src-head@freebsd.org Fri Sep 27 00:29:30 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 60150F07DA for ; Fri, 27 Sep 2019 00:29:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (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 46fXjj4wTGz49FY for ; Fri, 27 Sep 2019 00:29:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x830.google.com with SMTP id w14so5137002qto.9 for ; Thu, 26 Sep 2019 17:29:29 -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=OX7Rfh782febAYDmpjI9CCjYKOa1luLZL7QUvaeWaiY=; b=H9js1uncO+PtXu7MKs8QPYy3WD0xSq/EQCY/hHTV0iwNn0Ws3Ev/hNWrggefSvB5Jz qaM/bSQa5fG4c1PK9M5r86gVEztOynnc8X4VfPK/LMF32D2Jzd7BDaFpN6uydFLONVSJ K/H9K9/tNV+TYgzfYMgyxLT5zKciDgQUJRZ1l9PoRdwDHmDw6GbqGmxyUP2cnTBWajR0 bZgrOC0si8YZqgQkfOd+r+yC+SJ8xMM4Z2Sny3OdigsYKqxSO/bmaOQ6WJERn7ubFTBX /bUSXn3siKLEzqkZOPZ1hE1GVvZf/n1lzevQTm5le34TgEwQYH+809bPxgawSFn5aWDa hmqQ== 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=OX7Rfh782febAYDmpjI9CCjYKOa1luLZL7QUvaeWaiY=; b=PZa4IrT5FP3xfqG4UQp+zgoK1UoJKMCWlJqjcHD/fiSuv3skyW3lG3M4wJdPR3IL2s OhARWhJPPguIVhh3TEy+JV/xKZLOU32mqClDkDQCzb/sx2sXbJUc+IuTzvZsCIIRDLOq hoEA5YjmnhKWflawhCfoUMY6LVPYlWG5D7KeVrWRtY6mQjXQTtl7U1KXnM8vnTAKa0kG 5cRliJgOODnUDro4iFOIMAp2ho9LL7JRoUMMrHwJcLySMK5aWITi8VGvf1nWrsDAVIfQ pMGKrkZrRRIk4J7y9qr0wMqTnH7Yv8pIysi4dyTRkbZPjwD6miymCHieLNmIWfT4sIkc v+NA== X-Gm-Message-State: APjAAAWbQ2vHPzcME1A5lcJ1Qpna2Vme5xvJLTYyO/AjaWLQjxkhXAut mTo9VNZCnTrFdOBWG8L0oUw3+7ev1AazIoZ4kzoDyA== X-Google-Smtp-Source: APXvYqwz1yx2xA6V/nNEvkZlbyVOKCJGtBRo2/xgVqP/mEJPLoeN2AdVRUkmSW1eo+romSd4mNB7+E2D6k5GN9bptjo= X-Received: by 2002:ac8:44c9:: with SMTP id b9mr7218637qto.175.1569544167832; Thu, 26 Sep 2019 17:29:27 -0700 (PDT) MIME-Version: 1.0 References: <201909262112.x8QLCl9o061816@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 26 Sep 2019 18:29:16 -0600 Message-ID: Subject: Re: svn commit: r352778 - in head/sys: conf sys To: Ryan Stone Cc: Gleb Smirnoff , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46fXjj4wTGz49FY X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=H9js1unc; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::830) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.83 / 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)[]; 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]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[0.3.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]; 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.83)[ip: (-9.34), ipnet: 2607:f8b0::/32(-2.60), asn: 15169(-2.18), 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: Fri, 27 Sep 2019 00:29:30 -0000 This is a developer only option. Out-of-tree consumers would need to be compiled with the kernel directory, much like they would need to be for other things. You wouldn't run a system with this normally: it's only to debug specific instances of bad behavior. I think, like other debugging options, that it's fine. Warner On Thu, Sep 26, 2019 at 6:18 PM Ryan Stone wrote: > Is this enough? Won't out-of-tree modules get compiled without > EPOCH_TRACE set? If such a module is loaded on a kernel with > EPOCH_TRACE set then the module will call epoch_enter_preempt() with a > epoch_tracker that is too small and have its stack corrupted, won't > it? > > On Thu, Sep 26, 2019 at 5:12 PM Gleb Smirnoff wrote: > > > > Author: glebius > > Date: Thu Sep 26 21:12:47 2019 > > New Revision: 352778 > > URL: https://svnweb.freebsd.org/changeset/base/352778 > > > > Log: > > Move EPOCH_TRACE to opt_global.h, so that any external modules that > > use epoch don't need Makefile tweaks. > > > > The downside is that any developer who wants EPOCH_TRACE needs to > > rebuild kernel in full, but that's fine. > > > > Reviewed by: imp > > > > Modified: > > head/sys/conf/options > > head/sys/sys/epoch.h > > > > Modified: head/sys/conf/options > > > ============================================================================== > > --- head/sys/conf/options Thu Sep 26 21:06:55 2019 (r352777) > > +++ head/sys/conf/options Thu Sep 26 21:12:47 2019 (r352778) > > @@ -712,7 +712,7 @@ WITNESS_SKIPSPIN opt_witness.h > > WITNESS_COUNT opt_witness.h > > OPENSOLARIS_WITNESS opt_global.h > > > > -EPOCH_TRACE opt_epoch.h > > +EPOCH_TRACE opt_global.h > > > > # options for ACPI support > > ACPI_DEBUG opt_acpi.h > > > > Modified: head/sys/sys/epoch.h > > > ============================================================================== > > --- head/sys/sys/epoch.h Thu Sep 26 21:06:55 2019 (r352777) > > +++ head/sys/sys/epoch.h Thu Sep 26 21:12:47 2019 (r352778) > > @@ -41,8 +41,6 @@ typedef struct epoch_context *epoch_context_t; > > #include > > #include > > > > -#include "opt_epoch.h" > > - > > struct epoch; > > typedef struct epoch *epoch_t; > > > From owner-svn-src-head@freebsd.org Fri Sep 27 02:09:21 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 B7A63F25D9; Fri, 27 Sep 2019 02:09:21 +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 46fZwx4NPQz4DqS; Fri, 27 Sep 2019 02:09:21 +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 75FEF9B19; Fri, 27 Sep 2019 02:09:21 +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 x8R29LV8033504; Fri, 27 Sep 2019 02:09:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8R29LWM033503; Fri, 27 Sep 2019 02:09:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909270209.x8R29LWM033503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 27 Sep 2019 02:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352787 - head/sys/dev/ioat X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ioat X-SVN-Commit-Revision: 352787 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: Fri, 27 Sep 2019 02:09:21 -0000 Author: mav Date: Fri Sep 27 02:09:20 2019 New Revision: 352787 URL: https://svnweb.freebsd.org/changeset/base/352787 Log: Replace argument checks with assertions. Those functions are used by kernel, and we can't check all possible argument errors in production kernel. Plus according to docs many of those errors are checked by hardware. Assertions should just help with code debugging. MFC after: 2 weeks Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Fri Sep 27 00:29:12 2019 (r352786) +++ head/sys/dev/ioat/ioat.c Fri Sep 27 02:09:20 2019 (r352787) @@ -1136,17 +1136,14 @@ ioat_op_generic(struct ioat_softc *ioat, uint8_t op, KASSERT((flags & ~_DMA_GENERIC_FLAGS) == 0, ("Unrecognized flag(s): %#x", flags & ~_DMA_GENERIC_FLAGS)); + KASSERT(size <= ioat->max_xfer_size, ("%s: size too big (%u > %u)", + __func__, (unsigned)size, ioat->max_xfer_size)); + if ((flags & DMA_NO_WAIT) != 0) mflags = M_NOWAIT; else mflags = M_WAITOK; - if (size > ioat->max_xfer_size) { - ioat_log_message(0, "%s: max_xfer_size = %d, requested = %u\n", - __func__, ioat->max_xfer_size, (unsigned)size); - return (NULL); - } - if (ioat_reserve_space(ioat, 1, mflags) != 0) return (NULL); @@ -1226,11 +1223,8 @@ ioat_copy(bus_dmaengine_t dmaengine, bus_addr_t dst, ioat = to_ioat_softc(dmaengine); - if (((src | dst) & (0xffffull << 48)) != 0) { - ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n", - __func__); - return (NULL); - } + KASSERT(((src | dst) & (0xffffull << 48)) == 0, + ("%s: high 16 bits of src/dst are not zero", __func__)); desc = ioat_op_generic(ioat, IOAT_OP_COPY, len, src, dst, callback_fn, callback_arg, flags); @@ -1262,16 +1256,10 @@ ioat_copy_8k_aligned(bus_dmaengine_t dmaengine, bus_ad ioat = to_ioat_softc(dmaengine); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - if (((src1 | src2 | dst1 | dst2) & (0xffffull << 48)) != 0) { - ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n", - __func__); - return (NULL); - } - if (((src1 | src2 | dst1 | dst2) & PAGE_MASK) != 0) { - ioat_log_message(0, "%s: Addresses must be page-aligned\n", - __func__); - return (NULL); - } + KASSERT(((src1 | src2 | dst1 | dst2) & (0xffffull << 48)) == 0, + ("%s: high 16 bits of src/dst are not zero", __func__)); + KASSERT(((src1 | src2 | dst1 | dst2) & PAGE_MASK) == 0, + ("%s: addresses are not page-aligned", __func__)); desc = ioat_op_generic(ioat, IOAT_OP_COPY, 2 * PAGE_SIZE, 0, 0, callback_fn, callback_arg, flags); @@ -1349,26 +1337,15 @@ ioat_copy_crc(bus_dmaengine_t dmaengine, bus_addr_t ds ioat = to_ioat_softc(dmaengine); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - if ((ioat->capabilities & IOAT_DMACAP_MOVECRC) == 0) { - ioat_log_message(0, "%s: Device lacks MOVECRC capability\n", - __func__); - return (NULL); - } - if (((src | dst) & (0xffffffull << 40)) != 0) { - ioat_log_message(0, "%s: High 24 bits of src/dst invalid\n", - __func__); - return (NULL); - } + KASSERT((ioat->capabilities & IOAT_DMACAP_MOVECRC) != 0, + ("%s: device lacks MOVECRC capability", __func__)); + KASSERT(((src | dst) & (0xffffffull << 40)) == 0, + ("%s: high 24 bits of src/dst are not zero", __func__)); teststore = (flags & _DMA_CRC_TESTSTORE); - if (teststore == _DMA_CRC_TESTSTORE) { - ioat_log_message(0, "%s: TEST and STORE invalid\n", __func__); - return (NULL); - } - if (teststore == 0 && (flags & DMA_CRC_INLINE) != 0) { - ioat_log_message(0, "%s: INLINE invalid without TEST or STORE\n", - __func__); - return (NULL); - } + KASSERT(teststore != _DMA_CRC_TESTSTORE, + ("%s: TEST and STORE invalid", __func__)); + KASSERT(teststore != 0 || (flags & DMA_CRC_INLINE) == 0, + ("%s: INLINE invalid without TEST or STORE", __func__)); switch (teststore) { case DMA_CRC_STORE: @@ -1383,12 +1360,9 @@ ioat_copy_crc(bus_dmaengine_t dmaengine, bus_addr_t ds break; } - if ((flags & DMA_CRC_INLINE) == 0 && - (crcptr & (0xffffffull << 40)) != 0) { - ioat_log_message(0, - "%s: High 24 bits of crcptr invalid\n", __func__); - return (NULL); - } + KASSERT((flags & DMA_CRC_INLINE) != 0 || + (crcptr & (0xffffffull << 40)) == 0, + ("%s: high 24 bits of crcptr are not zero", __func__)); desc = ioat_op_generic(ioat, op, len, src, dst, callback_fn, callback_arg, flags & ~_DMA_CRC_FLAGS); @@ -1439,26 +1413,15 @@ ioat_crc(bus_dmaengine_t dmaengine, bus_addr_t src, bu ioat = to_ioat_softc(dmaengine); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - if ((ioat->capabilities & IOAT_DMACAP_CRC) == 0) { - ioat_log_message(0, "%s: Device lacks CRC capability\n", - __func__); - return (NULL); - } - if ((src & (0xffffffull << 40)) != 0) { - ioat_log_message(0, "%s: High 24 bits of src invalid\n", - __func__); - return (NULL); - } + KASSERT((ioat->capabilities & IOAT_DMACAP_CRC) != 0, + ("%s: device lacks CRC capability", __func__)); + KASSERT((src & (0xffffffull << 40)) == 0, + ("%s: high 24 bits of src are not zero", __func__)); teststore = (flags & _DMA_CRC_TESTSTORE); - if (teststore == _DMA_CRC_TESTSTORE) { - ioat_log_message(0, "%s: TEST and STORE invalid\n", __func__); - return (NULL); - } - if (teststore == 0 && (flags & DMA_CRC_INLINE) != 0) { - ioat_log_message(0, "%s: INLINE invalid without TEST or STORE\n", - __func__); - return (NULL); - } + KASSERT(teststore != _DMA_CRC_TESTSTORE, + ("%s: TEST and STORE invalid", __func__)); + KASSERT(teststore != 0 || (flags & DMA_CRC_INLINE) == 0, + ("%s: INLINE invalid without TEST or STORE", __func__)); switch (teststore) { case DMA_CRC_STORE: @@ -1473,12 +1436,9 @@ ioat_crc(bus_dmaengine_t dmaengine, bus_addr_t src, bu break; } - if ((flags & DMA_CRC_INLINE) == 0 && - (crcptr & (0xffffffull << 40)) != 0) { - ioat_log_message(0, - "%s: High 24 bits of crcptr invalid\n", __func__); - return (NULL); - } + KASSERT((flags & DMA_CRC_INLINE) != 0 || + (crcptr & (0xffffffull << 40)) == 0, + ("%s: high 24 bits of crcptr are not zero", __func__)); desc = ioat_op_generic(ioat, op, len, src, 0, callback_fn, callback_arg, flags & ~_DMA_CRC_FLAGS); @@ -1525,18 +1485,11 @@ ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t d ioat = to_ioat_softc(dmaengine); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); - if ((ioat->capabilities & IOAT_DMACAP_BFILL) == 0) { - ioat_log_message(0, "%s: Device lacks BFILL capability\n", - __func__); - return (NULL); - } + KASSERT((ioat->capabilities & IOAT_DMACAP_BFILL) != 0, + ("%s: device lacks BFILL capability", __func__)); + KASSERT((dst & (0xffffull << 48)) == 0, + ("%s: high 16 bits of crcptr are not zero", __func__)); - if ((dst & (0xffffull << 48)) != 0) { - ioat_log_message(0, "%s: High 16 bits of dst invalid\n", - __func__); - return (NULL); - } - desc = ioat_op_generic(ioat, IOAT_OP_FILL, len, 0, dst, callback_fn, callback_arg, flags); if (desc == NULL) @@ -1693,7 +1646,7 @@ ioat_poll_timer_callback(void *arg) struct ioat_softc *ioat; ioat = arg; - ioat_log_message(3, "%s\n", __func__); + CTR1(KTR_IOAT, "%s", __func__); ioat_process_events(ioat, FALSE); From owner-svn-src-head@freebsd.org Fri Sep 27 04:43: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 2124DF5BF3; Fri, 27 Sep 2019 04:43:31 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (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 46ffLn6xl6z4LkV; Fri, 27 Sep 2019 04:43:29 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pg1-x543.google.com with SMTP id s1so2750978pgv.8; Thu, 26 Sep 2019 21:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/Dfcvg8feGmjdOBbfx/24hbNfewC2V3luFlWEKEDBf0=; b=VBMxiTgLL8IJGo66vBY4EBv7HRf4K6hKjQAiDH3ZkM0Wmn3V+6oFs46NkeyqbovHLF yiUh4N/MGvlMY7tbdZN8mbk5BmgZ2HDlQZSmcScD0/z41aMrqsvCjTWkm7JGwnJMqpqM IC5s9E5annCNIxqbvQEC17WUEDmfvweVektillfJgkV44xE5CeHm3iIMCRhCOh/bkKHY wCI7TiIBUQrXf82sAK8hmgNy0mnc/ykJc7J6DEfSPQe3bjXGfz4/vM/GsEnpcyttxv18 XBRbNFuw3oOfEKtLuqgpGW2hpKX6X/1wXulFEQDNAHBUXHf7KsXBz3PQNLu1AZ0yxZob mrFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=/Dfcvg8feGmjdOBbfx/24hbNfewC2V3luFlWEKEDBf0=; b=Sj9AwHEOiqSPu/drJjFEV9jDaM/k5/6eOuAgEwFXOA2AjG9tiZmQpbAiDMDyMUzuLD 3w5cgr4PeuLPjKj/qk7mXu4JYJ361xIl6m+wmlHojtLhXsLxx3lddtr54RWgudx03v2I hfzMKpw3tC8wNYhy/ijWt/q1hZYKL9OhVwvxu8u6lqZvi4WTi52be31I5dthPkFY6WsQ ud0uCBOIXq1um4Uqad2l+URSLmoRilgtqOysNrXotmxlvpyS2jnv0cNwuybHXJSmm2Mf 4KDDarFyhoET3aOdUxLEXf11w7nye9beT+n05Ogti+mRoagZNmhiK2L/wkbcNI452PsY bC4g== X-Gm-Message-State: APjAAAU2LfutxsBx0P/avbXx1PIMDSKzAD+aZr1ws6gRTLNIwz3UjBXb DkglbMoWLhg5WevBOfMl4J49lcnY X-Google-Smtp-Source: APXvYqw83lfVjhz54MxzKw4hIuQ5X9v8KYHMz0vbVTOXl5NYjphOUFjLu0jDre9j1fl5g0IzaktbYA== X-Received: by 2002:a65:64c6:: with SMTP id t6mr7285947pgv.323.1569559407646; Thu, 26 Sep 2019 21:43:27 -0700 (PDT) Received: from ?IPv6:2403:5800:7100:5d01:f1f4:9e96:4fb0:fb4a? (2403-5800-7100-5d01-f1f4-9e96-4fb0-fb4a.ip6.aussiebb.net. [2403:5800:7100:5d01:f1f4:9e96:4fb0:fb4a]) by smtp.gmail.com with ESMTPSA id q21sm563845pgm.27.2019.09.26.21.43.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Sep 2019 21:43:27 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Charlie Li , Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: freebsd-x11@freebsd.org References: <201909251826.x8PIQVUN095257@repo.freebsd.org> <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> From: Kubilay Kocak Message-ID: <698b5ba8-359c-05e7-0f66-7d1cb980243a@FreeBSD.org> Date: Fri, 27 Sep 2019 14:43:22 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Thunderbird/70.0 MIME-Version: 1.0 In-Reply-To: <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46ffLn6xl6z4LkV X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=VBMxiTgL; dmarc=none; spf=pass (mx1.freebsd.org: domain of koobsfreebsd@gmail.com designates 2607:f8b0:4864:20::543 as permitted sender) smtp.mailfrom=koobsfreebsd@gmail.com X-Spamd-Result: default: False [-1.82 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[koobs@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; FORGED_SENDER(0.30)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[koobs@FreeBSD.org,koobsfreebsd@gmail.com]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[freebsd]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.5.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]; IP_SCORE(-1.12)[ip: (-0.77), ipnet: 2607:f8b0::/32(-2.60), asn: 15169(-2.18), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] 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: Fri, 27 Sep 2019 04:43:31 -0000 On 27/09/2019 12:48 am, Charlie Li via svn-src-head wrote: > Gleb Smirnoff wrote: >> Modified: head/sys/conf/options >> ============================================================================== >> --- head/sys/conf/options Wed Sep 25 18:09:19 2019 (r352706) >> +++ head/sys/conf/options Wed Sep 25 18:26:31 2019 (r352707) >> @@ -712,6 +712,8 @@ WITNESS_SKIPSPIN opt_witness.h >> WITNESS_COUNT opt_witness.h >> OPENSOLARIS_WITNESS opt_global.h >> >> +EPOCH_TRACE opt_epoch.h >> + >> # options for ACPI support >> ACPI_DEBUG opt_acpi.h >> ACPI_MAX_TASKS opt_acpi.h >> >> Modified: head/sys/sys/epoch.h >> ============================================================================== >> --- head/sys/sys/epoch.h Wed Sep 25 18:09:19 2019 (r352706) >> +++ head/sys/sys/epoch.h Wed Sep 25 18:26:31 2019 (r352707) >> @@ -41,6 +41,8 @@ typedef struct epoch_context *epoch_context_t; >> #include >> #include >> >> +#include "opt_epoch.h" >> + >> struct epoch; >> typedef struct epoch *epoch_t; >> > This breaks building the drm-kmod ports, as the build cannot find > opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the > exact same way): I started to get pkg-fallout emails in net/aquantia-atlantic-kmod with the same build failure https://github.com/Aquantia/aqtion-freebsd/issues/4 > --- linux_anon_inodes.o --- > cc -O2 -pipe -fno-strict-aliasing -include > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h > '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE > -nostdinc > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include > -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include > -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys > -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer > -mno-omit-leaf-frame-pointer > -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include > -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD > -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel > -mno-red-zone -mno-mmx -mno-sse -msoft-float > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector > -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas > -Wno-error-tautological-compare -Wno-error-empty-body > -Wno-error-parentheses-equality -Wno-error-unused-function > -Wno-error-pointer-sign -Wno-error-shift-negative-value > -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer-arith > -mno-aes -mno-avx -std=iso9899:1999 -c > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c > -o linux_anon_inodes.o > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > In file included from > /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > In file included from /usr/src/sys/net/if_var.h:83: > /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found > #include "opt_epoch.h" > ^~~~~~~~~~~~~ > --- linux_anon_inodefs.o --- > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6: > In file included from > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5: > In file included from > /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56: > In file included from /usr/src/sys/net/if_var.h:83: > /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not found > #include "opt_epoch.h" > ^~~~~~~~~~~~~ > --- linux_anon_inodes.o --- > 1 error generated. > *** [linux_anon_inodes.o] Error code 1 > > make[2]: stopped in > /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi > --- linux_anon_inodefs.o --- > 1 error generated. > *** [linux_anon_inodefs.o] Error code 1 > > Interestingly enough, does not happen when drm-current-kmod is built as > part of buildkernel (using an existing installed package with SOURCE on). > From owner-svn-src-head@freebsd.org Fri Sep 27 08:00: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 42AB7FA0BA; Fri, 27 Sep 2019 08:00:44 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46fkkM6tmpz4Ttf; Fri, 27 Sep 2019 08:00:43 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 46fkkK3VCWz3c7b; Fri, 27 Sep 2019 08:00:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id DiN8EnkKpkj7; Fri, 27 Sep 2019 08:00:27 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:dd74:443a:d28b:c9d3]) by mail.daemonic.se (Postfix) with ESMTPSA id 46fkk31R3zz3c7Z; Fri, 27 Sep 2019 08:00:27 +0000 (UTC) Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Warner Losh Cc: svn-src-head , src-committers , FreeBSD X11 mailing list References: <201909251826.x8PIQVUN095257@repo.freebsd.org> <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> <1681db78-6a0c-55cf-1e01-65e06f145975@vishwin.info> <18644033-d01e-1bc7-02eb-42999033d8fd@freebsd.org> <6f50f518-0f8e-4e82-a9e9-b9db14cdb648@www.fastmail.com> <201909262008.x8QK8GPB008931@slippy.cwsent.com> From: Niclas Zeising Message-ID: Date: Fri, 27 Sep 2019 10:00:26 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46fkkM6tmpz4Ttf X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.93 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.94)[-0.935,0]; ASN(0.00)[asn:36236, ipnet:176.58.89.0/24, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,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: Fri, 27 Sep 2019 08:00:44 -0000 On 2019-09-27 01:27, Warner Losh wrote: > I talked to Gleb and this will move to opt_global.h. this will fix all > these problems. > > Warner > [ trimming CC list ] So, in conclusion, the changes made to any out of tree kmods to handle this should be reverted? Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Fri Sep 27 09:14: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 320B9FC365 for ; Fri, 27 Sep 2019 09:14:45 +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.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 46fmMm40yPz4Yf4 for ; Fri, 27 Sep 2019 09:14:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82d.google.com with SMTP id u22so6327479qtq.13 for ; Fri, 27 Sep 2019 02:14:44 -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=iPz70R/06o+ActAN+InChxSE12iGgPjBZHGrQeoX3zY=; b=QtSr/og8DXVlXDkVa/odJLK7DbSwmKqt8puE8+ZofmfQr1UsX3+GOkAXQEJqf/9XIW HpsWj3EMxzsx09LERhEpmxJGvOi2VDzShkgkIERFLYrmPIB5HknA9O/aOdVtsHg5698S 7aL7mJ7UAHtqYsQbHlourPEHl48Phx8Iq8A2QOcpICfBdb1vckoMFA/mewq3TpLhVYgm dBA7Diu/uD1TzZfpg6Mi/M3O3/7cCrqF69UmlQlg7XrfoI+JVdEI8eSsdYnZ+m4GonU+ IPQrRrt9RNYw4meBOZJEXBZTmh7N+Rj8tg4bnK9MDrGXcEEpmnwnTnpR3VU/f01fzmmZ osIg== 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=iPz70R/06o+ActAN+InChxSE12iGgPjBZHGrQeoX3zY=; b=Ew6JuOvXy2FkKzZPsnUztZyBFP6djxszaZlU/vCNHLRG0b0VCBr2QE+tgSCQC65FVN mTTUndHNHHxwOhKwlsqAp28bpTwWqpWBC+xoFe+hWnSWKCigHywvWjJYgSKDSVYTJ2zf dyZJd4sS9XtoaK8BYcWqF/nd1vZ39hHCP+E7vzUC2MBtkPZeBs0m3z1UPPllJ6jb9Qm7 liI0Jy6C5iKpkQj66+dJ6SgAG2xussN3gkK0ReW/kgxDmoyQLBXhlmfAIeUrkW/kftKl 5kc27bDcAVeWVJY1vhfow9fBmmNkSSfXjbpUz6c8hdcC7CRMIY299vF9e4S35EE5TdRk RLpA== X-Gm-Message-State: APjAAAURKt5FzMMoOYZG5vDTkVShgz/7pa9lo+pz91TgfRXXiKnjM6qs yN8GeYLZlK7VaXhy768i8ytsnsAhJjrJeZlGKDpIpQ== X-Google-Smtp-Source: APXvYqxItGyWcklOpavf3qi7dMCRrVcIq+STuq0P7rhQ0+i3tdlMm3AIjjP5JQf2QjrccU4J9mdAT7pkjdJ7FXEdjk8= X-Received: by 2002:a0c:8a4f:: with SMTP id 15mr6693289qvu.188.1569575682125; Fri, 27 Sep 2019 02:14:42 -0700 (PDT) MIME-Version: 1.0 References: <201909251826.x8PIQVUN095257@repo.freebsd.org> <605f210b-cce2-d842-cc0c-53b76ef7dbd5@vishwin.info> <1681db78-6a0c-55cf-1e01-65e06f145975@vishwin.info> <18644033-d01e-1bc7-02eb-42999033d8fd@freebsd.org> <6f50f518-0f8e-4e82-a9e9-b9db14cdb648@www.fastmail.com> <201909262008.x8QK8GPB008931@slippy.cwsent.com> In-Reply-To: From: Warner Losh Date: Fri, 27 Sep 2019 03:14:29 -0600 Message-ID: Subject: Re: svn commit: r352707 - in head/sys: conf kern net sys To: Niclas Zeising Cc: svn-src-head , src-committers , FreeBSD X11 mailing list X-Rspamd-Queue-Id: 46fmMm40yPz4Yf4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=QtSr/og8; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::82d) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.84 / 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)[]; RCPT_COUNT_THREE(0.00)[4]; 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]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[d.2.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]; 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.84)[ip: (-9.38), ipnet: 2607:f8b0::/32(-2.60), asn: 15169(-2.18), 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: Fri, 27 Sep 2019 09:14:45 -0000 On Fri, Sep 27, 2019, 2:00 AM Niclas Zeising wrote: > On 2019-09-27 01:27, Warner Losh wrote: > > I talked to Gleb and this will move to opt_global.h. this will fix all > > these problems. > > > > Warner > > > > [ trimming CC list ] > So, in conclusion, the changes made to any out of tree kmods to handle > this should be reverted? > Yes. It was a momentary blip. Warner Regards > -- > Niclas Zeising > From owner-svn-src-head@freebsd.org Fri Sep 27 10:19: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 4726FFDE8C; Fri, 27 Sep 2019 10:19:29 +0000 (UTC) (envelope-from kaktus@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 46fnpT17sLz4dgM; Fri, 27 Sep 2019 10:19:29 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0A7B4F4EA; Fri, 27 Sep 2019 10:19:29 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8RAJSec024279; Fri, 27 Sep 2019 10:19:28 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RAJSp3024278; Fri, 27 Sep 2019 10:19:28 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <201909271019.x8RAJSp3024278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Fri, 27 Sep 2019 10:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352791 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 352791 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: Fri, 27 Sep 2019 10:19:29 -0000 Author: kaktus Date: Fri Sep 27 10:19:28 2019 New Revision: 352791 URL: https://svnweb.freebsd.org/changeset/base/352791 Log: Add myself (kaktus) as a src commiter. Reviewed by: kib (mentor) Approved by: kib (mentor), mjg (mentor) Differential Revision: https://reviews.freebsd.org/D21811 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Fri Sep 27 10:04:58 2019 (r352790) +++ head/share/misc/committers-src.dot Fri Sep 27 10:19:28 2019 (r352791) @@ -227,6 +227,7 @@ jtl [label="Jonathan T. Looney\njtl@FreeBSD.org\n2015/ julian [label="Julian Elischer\njulian@FreeBSD.org\n1993/04/19"] jwd [label="John De Boskey\njwd@FreeBSD.org\n2000/05/19"] kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] +kaktus [label="Pawel Biernacki\nkaktus@FreeBSD.org\n2019/09/26"] kan [label="Alexander Kabaev\nkan@FreeBSD.org\n2002/07/21"] karels [label="Mike Karels\nkarels@FreeBSD.org\n2016/06/09"] ken [label="Ken Merry\nken@FreeBSD.org\n1998/09/08"] @@ -675,6 +676,7 @@ kib -> gjb kib -> jah kib -> jlh kib -> jpaetzel +kib -> kaktus kib -> lulf kib -> melifaro kib -> mmel @@ -719,6 +721,8 @@ mdf -> gleb mdodd -> jake mike -> das + +mjg -> kaktus mlaier -> benjsc mlaier -> dhartmei From owner-svn-src-head@freebsd.org Fri Sep 27 13:14: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 95069122DEB; Fri, 27 Sep 2019 13:14:37 +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 46fshY3RFPz3KSs; Fri, 27 Sep 2019 13:14:37 +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 59D6A195A5; Fri, 27 Sep 2019 13:14:37 +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 x8RDEbgI030435; Fri, 27 Sep 2019 13:14:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RDEbg8030434; Fri, 27 Sep 2019 13:14:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271314.x8RDEbg8030434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 13:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352792 - head/contrib/compiler-rt/lib/sanitizer_common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/compiler-rt/lib/sanitizer_common X-SVN-Commit-Revision: 352792 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: Fri, 27 Sep 2019 13:14:37 -0000 Author: emaste Date: Fri Sep 27 13:14:36 2019 New Revision: 352792 URL: https://svnweb.freebsd.org/changeset/base/352792 Log: compiler-rt: correct RISC-V struct_kernel_stat64_sz The value of struct_kernel_stat64_sz introduced by review D5021 for RISC-V was incorrect. Also add a __riscv_xlen == 64 conditional as the 32-bit ABI is not yet finalized. Submitted by: Luís Marques Differential Revision: https://reviews.freebsd.org/D21684 Modified: head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h Modified: head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ============================================================================== --- head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h Fri Sep 27 10:19:28 2019 (r352791) +++ head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h Fri Sep 27 13:14:36 2019 (r352792) @@ -79,10 +79,9 @@ namespace __sanitizer { #elif defined(__powerpc64__) const unsigned struct_kernel_stat_sz = 144; const unsigned struct_kernel_stat64_sz = 104; -#elif defined(__riscv) - /* RISCVTODO: check that these values are correct */ +#elif defined(__riscv) && __riscv_xlen == 64 const unsigned struct_kernel_stat_sz = 128; - const unsigned struct_kernel_stat64_sz = 128; + const unsigned struct_kernel_stat64_sz = 104; #elif defined(__mips__) const unsigned struct_kernel_stat_sz = SANITIZER_ANDROID ? FIRST_32_SECOND_64(104, 128) : From owner-svn-src-head@freebsd.org Fri Sep 27 16:11: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 329C1126CEB; Fri, 27 Sep 2019 16:11:48 +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 46fxd00W2tz40W6; Fri, 27 Sep 2019 16:11:48 +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 EA5A91B685; Fri, 27 Sep 2019 16:11:47 +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 x8RGBlZA036117; Fri, 27 Sep 2019 16:11:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGBl0H036116; Fri, 27 Sep 2019 16:11:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909271611.x8RGBl0H036116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Sep 2019 16:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352795 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 352795 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: Fri, 27 Sep 2019 16:11:48 -0000 Author: imp Date: Fri Sep 27 16:11:47 2019 New Revision: 352795 URL: https://svnweb.freebsd.org/changeset/base/352795 Log: Document varadic args as int, since you can't have short varadic args (they are promoted to ints). - `mode_t` is `uint16_t` (`sys/sys/_types.h`) - `openat` takes variadic args - variadic args cannot be 16-bit, and indeed the code uses int - the manpage currently kinda implies the argument is 16-bit by saying `mode_t` Prompted by Rust things: https://github.com/tailhook/openat/issues/21 Submitted by: Greg V at unrelenting Differential Revision: https://reviews.freebsd.org/D21816 Modified: head/lib/libc/sys/mq_open.2 head/lib/libc/sys/open.2 Modified: head/lib/libc/sys/mq_open.2 ============================================================================== --- head/lib/libc/sys/mq_open.2 Fri Sep 27 15:28:30 2019 (r352794) +++ head/lib/libc/sys/mq_open.2 Fri Sep 27 16:11:47 2019 (r352795) @@ -133,7 +133,7 @@ Create a message queue. It requires two additional arguments: .Fa mode , which is of type -.Vt mode_t , +.Vt int , and .Fa attr , which is a pointer to an Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Fri Sep 27 15:28:30 2019 (r352794) +++ head/lib/libc/sys/open.2 Fri Sep 27 16:11:47 2019 (r352795) @@ -61,7 +61,7 @@ In this case and .Fn openat require an additional argument -.Fa "mode_t mode" , +.Fa "int mode" , and the file is created with mode .Fa mode as described in From owner-svn-src-head@freebsd.org Fri Sep 27 16:22: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 A7900127190; Fri, 27 Sep 2019 16:22:28 +0000 (UTC) (envelope-from andrew@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 46fxsJ4556z41JM; Fri, 27 Sep 2019 16:22:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6F9E91B8BD; Fri, 27 Sep 2019 16:22:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8RGMS6L043139; Fri, 27 Sep 2019 16:22:28 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGMS3v043138; Fri, 27 Sep 2019 16:22:28 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201909271622.x8RGMS3v043138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 27 Sep 2019 16:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352796 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352796 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: Fri, 27 Sep 2019 16:22:28 -0000 Author: andrew Date: Fri Sep 27 16:22:28 2019 New Revision: 352796 URL: https://svnweb.freebsd.org/changeset/base/352796 Log: Check the vfs option length is valid before accessing through When a VFS option passed to nmount is present but NULL the kernel will place an empty option in its internal list. This will have a NULL pointer and a length of 0. When we come to read one of these the kernel will try to load from the last address of virtual memory. This is normally invalid so will fault resulting in a kernel panic. Fix this by checking if the length is valid before dereferencing. MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Sep 27 16:11:47 2019 (r352795) +++ head/sys/kern/vfs_mount.c Fri Sep 27 16:22:28 2019 (r352796) @@ -646,7 +646,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru */ fstypelen = 0; error = vfs_getopt(optlist, "fstype", (void **)&fstype, &fstypelen); - if (error || fstype[fstypelen - 1] != '\0') { + if (error || fstypelen <= 0 || fstype[fstypelen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fstype", errmsg_len); @@ -654,7 +654,7 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru } fspathlen = 0; error = vfs_getopt(optlist, "fspath", (void **)&fspath, &fspathlen); - if (error || fspath[fspathlen - 1] != '\0') { + if (error || fspathlen <= 0 || fspath[fspathlen - 1] != '\0') { error = EINVAL; if (errmsg != NULL) strncpy(errmsg, "Invalid fspath", errmsg_len); From owner-svn-src-head@freebsd.org Fri Sep 27 16:27: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 3DA4B1272FB; Fri, 27 Sep 2019 16:27:54 +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 46fxzZ0KPqz41VY; Fri, 27 Sep 2019 16:27:54 +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 C83FE1B8D0; Fri, 27 Sep 2019 16:27:53 +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 x8RGRrbI043435; Fri, 27 Sep 2019 16:27:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGRrxP043432; Fri, 27 Sep 2019 16:27:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271627.x8RGRrxP043432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 16:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352797 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352797 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: Fri, 27 Sep 2019 16:27:54 -0000 Author: emaste Date: Fri Sep 27 16:27:52 2019 New Revision: 352797 URL: https://svnweb.freebsd.org/changeset/base/352797 Log: Add tool to modify ELF binary feature control bits This will allow feature control bits (e.g. for ASLR, PROT_MAX) to be inspected or modified. Some clean-up and additional work is likely still required, but we can iterate on this in the tree. Submitted by: Bora Özarslan Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19290 Added: head/tools/tools/controlelf/ head/tools/tools/controlelf/Makefile (contents, props changed) head/tools/tools/controlelf/controlelf.1 (contents, props changed) head/tools/tools/controlelf/controlelf.c (contents, props changed) Added: head/tools/tools/controlelf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/controlelf/Makefile Fri Sep 27 16:27:52 2019 (r352797) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain + +PROG= controlelf +SRCS= controlelf.c + +LIBADD= elftc elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +WARNS?= 6 + +.include Added: head/tools/tools/controlelf/controlelf.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/controlelf/controlelf.1 Fri Sep 27 16:27:52 2019 (r352797) @@ -0,0 +1,92 @@ +.\" Copyright 2019 The FreeBSD Foundation. +.\" +.\" This software was developed by Bora Ozarslan 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$ +.\" +.Dd February 21, 2019 +.Dt CONTROLELF 1 +.Os +.Sh NAME +.Nm controlelf +.Nd change an ELF binary's control features +.Sh SYNOPSIS +.Nm +.Op Fl h | Fl -help +.Op Fl l +.Op Fl e Ar featurelist +.Ar +.Sh DESCRIPTION +The +.Nm +utility modifies an ELF binary to change it's control features. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl h | Fl -help +Print a usage message and exit. +.It Fl l +Writes the list of all known ELF types to standard output. +.It Fl e Ar featurelist +Edit features from the given comma separated list +.Ar featurelist . +.Ar featurelist +starts with one of the three modes: +.Dq Li + +to turn on the features, +.Dq Li - +to turn off the features, +.Dq Li = +to only turn on the given features. +Followed by a comma separated features. +.El +.Pp +If +.Fl e , +option wasn't specified, +.Nm +will display the current control features for the files named by the arguments +.Ar . +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command +fails if a file does not exist, is too short, +or fails to find or edit features note. +.Sh EXAMPLES +The following is an example of a typical usage +of the +.Nm +command: +.Bd -literal -offset indent +controlelf file +controlelf -e +aslr file +.Ed +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 13.0 . +.Sh AUTHORS +This manual page was written by +.An Bora Ozarslan Mt borako.ozarslan@gmail.com . Added: head/tools/tools/controlelf/controlelf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/controlelf/controlelf.c Fri Sep 27 16:27:52 2019 (r352797) @@ -0,0 +1,374 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2019 The FreeBSD Foundation. + * + * This software was developed by Bora Ozarslan 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "_elftc.h" + +__FBSDID("$FreeBSD$"); + +static bool convert_to_feature_val(char*, u_int32_t*); +static bool edit_file_features(Elf *, int, int, char*); +static bool get_file_features(Elf *, int, int, u_int32_t *, u_int64_t *); +static void print_features(void); +static bool print_file_features(Elf *, int, int, char*); +static void usage(void); + +struct ControlFeatures { + const char *alias; + unsigned long featureVal; + const char *desc; +}; + +static struct ControlFeatures featurelist[] = { + { "aslr", NT_FREEBSD_FCTL_ASLR_DISABLE, "Disable ASLR" } +}; + +static struct option controlelf_longopts[] = { + { "help", no_argument, NULL, 'h' }, + { NULL, 0, NULL, 0 } +}; + +int +main(int argc, char **argv) +{ + GElf_Ehdr ehdr; + Elf *elf; + Elf_Kind kind; + int ch, fd, listed, editfeatures, retval; + char *features; + + listed = 0; + editfeatures = 0; + retval = 0; + + if (elf_version(EV_CURRENT) == EV_NONE) + errx(EXIT_FAILURE, "elf_version error"); + + while ((ch = getopt_long(argc, argv, "hle:", controlelf_longopts, + NULL)) != -1) { + switch (ch) { + case 'l': + print_features(); + listed = 1; + break; + case 'e': + features = optarg; + editfeatures = 1; + break; + case 'h': + usage(); + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + if (!argc) { + if (listed) + exit(0); + else { + warnx("no file(s) specified"); + usage(); + } + } + + while (argc) { + elf = NULL; + + if ((fd = open(argv[0], editfeatures ? O_RDWR : + O_RDONLY, 0)) < 0) { + warn("error opening file %s", argv[0]); + retval = 1; + goto fail; + } + + if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) { + warnx("elf_begin failed: %s", elf_errmsg(-1)); + retval = 1; + goto fail; + } + + if ((kind = elf_kind(elf)) != ELF_K_ELF) { + if (kind == ELF_K_AR) + warnx("file '%s' is an archive.", argv[0]); + else + warnx("file '%s' is not an ELF file.", + argv[0]); + retval = 1; + goto fail; + } + + if (gelf_getehdr(elf, &ehdr) == NULL) { + warnx("gelf_getehdr: %s", elf_errmsg(-1)); + retval = 1; + goto fail; + } + + if (!editfeatures) { + if (!print_file_features(elf, ehdr.e_phnum, fd, argv[0])) { + retval = 1; + goto fail; + } + } else if (!edit_file_features(elf, ehdr.e_phnum, fd, features)) { + retval = 1; + goto fail; + } +fail: + if (elf != NULL) + elf_end(elf); + + if (fd >= 0) + close(fd); + + argc--; + argv++; + } + + return (retval); +} + +#define USAGE_MESSAGE "\ +Usage: %s [options] file...\n\ + Set or display the control features for an ELF object.\n\n\ + Supported options are:\n\ + -l List known control features.\n\ + -e [+-=]feature,list Edit features from a comma separated list.\n\ + -h | --help Print a usage message and exit.\n" + +static void +usage(void) +{ + + fprintf(stderr, USAGE_MESSAGE, ELFTC_GETPROGNAME()); + exit(1); +} + +static bool +convert_to_feature_val(char* feature_str, u_int32_t* feature_val) +{ + char *feature_input, *feature; + int i, len; + u_int32_t input; + bool add, set; + + add = set = false; + input = 0; + + if (feature_str[0] == '+') + add = true; + else if (feature_str[0] == '=') + set = true; + else if (feature_str[0] != '-') { + warnx("'%c' is not an operator. Use instead '+', '-', '='.", + feature_str[0]); + return (false); + } + + feature_input = feature_str + 1; + len = nitems(featurelist); + while ((feature = strsep(&feature_input, ",")) != NULL) { + for (i = 0; i < len; ++i) { + if (strcmp(featurelist[i].alias, feature) == 0) { + input |= featurelist[i].featureVal; + break; + } + } + if (i == len) { + warnx("%s is not a valid feature.", feature); + return (false); + } + } + + if (add) { + *feature_val |= input; + } else if (set) { + *feature_val = input; + } else { + *feature_val -= (*feature_val) & input; + } + return (true); +} + +static bool +edit_file_features(Elf *elf, int phcount, int fd, char *val) +{ + u_int32_t features; + u_int64_t off; + + if (!get_file_features(elf, phcount, fd, &features, &off)) { + warnx("No control features note on the file.\n"); + return (false); + } + + if (!convert_to_feature_val(val, &features)) + return (false); + + lseek(fd, off, SEEK_SET); + write(fd, &features, sizeof(u_int32_t)); + return (true); +} + +static void +print_features(void) +{ + size_t i; + + printf("Known features are:\n"); + for (i = 0; i < nitems(featurelist); ++i) + printf("%s\t\t %s\n", featurelist[i].alias, + featurelist[i].desc); +} + +static bool +print_file_features(Elf *elf, int phcount, int fd, char *filename) { + u_int32_t features; + unsigned long i; + + if (!get_file_features(elf, phcount, fd, &features, NULL)) { + return (false); + } + + printf("File '%s' features:\n", filename); + for (i = 0; i < nitems(featurelist); ++i) { + printf("%s\t\t'%s' is ", featurelist[i].alias, + featurelist[i].desc); + + if ((featurelist[i].featureVal & features) == 0) + printf("un"); + + printf("set.\n"); + } + return (true); +} + +static bool +get_file_features(Elf *elf, int phcount, int fd, u_int32_t *features, u_int64_t *off) +{ + GElf_Phdr phdr; + Elf_Note note; + unsigned long read_total; + int namesz, descsz, i; + char *name; + ssize_t size; + + /* + * Go through each program header to find one that is of type PT_NOTE + * and has a note for feature control. + */ + for (i = 0; i < phcount; ++i) { + if (gelf_getphdr(elf, i, &phdr) == NULL) { + warnx("gelf_getphdr failed: %s", elf_errmsg(-1)); + return (false); + } + + if (phdr.p_type != PT_NOTE) + continue; + + if (lseek(fd, phdr.p_offset, SEEK_SET) < 0) { + warn("lseek() failed:"); + return (false); + } + + read_total = 0; + while (read_total < phdr.p_filesz) { + size = read(fd, ¬e, sizeof(note)); + if (size < (ssize_t)sizeof(note)) { + warn("read() failed:"); + return (false); + } + read_total += sizeof(note); + + /* + * XXX: Name and descriptor are 4 byte aligned, however, + * the size given doesn't include the padding. + */ + namesz = roundup2(note.n_namesz, 4); + name = malloc(namesz); + if (name == NULL) { + warn("malloc() failed.\n"); + return (false); + } + descsz = roundup2(note.n_descsz, 4); + size = read(fd, name, namesz); + read_total += namesz; + + if (note.n_namesz != 8 || + strncmp("FreeBSD", name, 7) != 0 || + note.n_type != NT_FREEBSD_FEATURE_CTL) { + /* Not the right note. Skip the description */ + if (lseek(fd, descsz, SEEK_CUR) < 0) { + warn("lseek() failed.\n"); + free(name); + return (false); + } + read_total += descsz; + free(name); + continue; + } + + if (note.n_descsz < sizeof(u_int32_t)) { + warnx("Feature descriptor can't " + "be less than 4 bytes"); + free(name); + return (false); + } + + /* + * XXX: For now we look at only 4 bytes of the + * descriptor. This should respect descsz. + */ + if (note.n_descsz > sizeof(u_int32_t)) + warnx("Feature note is bigger than expected."); + read(fd, features, sizeof(u_int32_t)); + if (off != NULL) + *off = phdr.p_offset + read_total; + free(name); + return (true); + } + } + + warnx("Couldn't find a note header with control feature note."); + return (false); +} From owner-svn-src-head@freebsd.org Fri Sep 27 16:32: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 B4250127526; Fri, 27 Sep 2019 16:32:45 +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 46fy59575Jz41vw; Fri, 27 Sep 2019 16:32:45 +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 9302C1BA9F; Fri, 27 Sep 2019 16:32:45 +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 x8RGWjHR048989; Fri, 27 Sep 2019 16:32:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGWi5d048985; Fri, 27 Sep 2019 16:32:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201909271632.x8RGWi5d048985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 27 Sep 2019 16:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352798 - in head/sys: dev/nvdimm modules/nvdimm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: dev/nvdimm modules/nvdimm X-SVN-Commit-Revision: 352798 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: Fri, 27 Sep 2019 16:32:45 -0000 Author: cem Date: Fri Sep 27 16:32:44 2019 New Revision: 352798 URL: https://svnweb.freebsd.org/changeset/base/352798 Log: nvdimm(4): Extract ACPI root bus driver No functional change intended. The intent is to add a "legacy" e820 pmem newbus bus for nvdimm device in a subsequent revision, and it's a little more clear if the parent buses get independent source files. Quite a lot of ACPI-specific logic is left in nvdimm.c; disentangling that is a much larger change (and probably not especially useful). Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21813 Added: head/sys/dev/nvdimm/nvdimm_acpi.c - copied, changed from r352792, head/sys/dev/nvdimm/nvdimm.c Modified: head/sys/dev/nvdimm/nvdimm.c head/sys/dev/nvdimm/nvdimm_var.h head/sys/modules/nvdimm/Makefile Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Fri Sep 27 16:27:52 2019 (r352797) +++ head/sys/dev/nvdimm/nvdimm.c Fri Sep 27 16:32:44 2019 (r352798) @@ -43,10 +43,12 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include #include #include + #include #define _COMPONENT ACPI_OEM @@ -59,7 +61,6 @@ static struct uuid intel_nvdimm_dsm_uuid = #define INTEL_NVDIMM_DSM_GET_LABEL_DATA 5 static devclass_t nvdimm_devclass; -static devclass_t nvdimm_root_devclass; MALLOC_DEFINE(M_NVDIMM, "nvdimm", "NVDIMM driver memory"); static int @@ -325,8 +326,7 @@ nvdimm_attach(device_t dev) nv = device_get_softc(dev); handle = nvdimm_root_get_acpi_handle(dev); - if (handle == NULL) - return (EINVAL); + MPASS(handle != NULL); nv->nv_dev = dev; nv->nv_handle = nvdimm_root_get_device_handle(dev); @@ -380,204 +380,6 @@ nvdimm_resume(device_t dev) return (0); } -static ACPI_STATUS -find_dimm(ACPI_HANDLE handle, UINT32 nesting_level, void *context, - void **return_value) -{ - ACPI_DEVICE_INFO *device_info; - ACPI_STATUS status; - - status = AcpiGetObjectInfo(handle, &device_info); - if (ACPI_FAILURE(status)) - return_ACPI_STATUS(AE_ERROR); - if (device_info->Address == (uintptr_t)context) { - *(ACPI_HANDLE *)return_value = handle; - return_ACPI_STATUS(AE_CTRL_TERMINATE); - } - return_ACPI_STATUS(AE_OK); -} - -static ACPI_HANDLE -get_dimm_acpi_handle(ACPI_HANDLE root_handle, nfit_handle_t adr) -{ - ACPI_HANDLE res; - ACPI_STATUS status; - - res = NULL; - status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, root_handle, 1, find_dimm, - NULL, (void *)(uintptr_t)adr, &res); - if (ACPI_FAILURE(status)) - res = NULL; - return (res); -} - -static int -nvdimm_root_create_devs(device_t dev, ACPI_TABLE_NFIT *nfitbl) -{ - ACPI_HANDLE root_handle, dimm_handle; - device_t child; - nfit_handle_t *dimm_ids, *dimm; - uintptr_t *ivars; - int num_dimm_ids; - - root_handle = acpi_get_handle(dev); - acpi_nfit_get_dimm_ids(nfitbl, &dimm_ids, &num_dimm_ids); - for (dimm = dimm_ids; dimm < dimm_ids + num_dimm_ids; dimm++) { - dimm_handle = get_dimm_acpi_handle(root_handle, *dimm); - child = BUS_ADD_CHILD(dev, 100, "nvdimm", -1); - if (child == NULL) { - device_printf(dev, "failed to create nvdimm\n"); - return (ENXIO); - } - ivars = mallocarray(NVDIMM_ROOT_IVAR_MAX, sizeof(uintptr_t), - M_NVDIMM, M_ZERO | M_WAITOK); - device_set_ivars(child, ivars); - nvdimm_root_set_acpi_handle(child, dimm_handle); - nvdimm_root_set_device_handle(child, *dimm); - } - free(dimm_ids, M_NVDIMM); - return (0); -} - -static int -nvdimm_root_create_spas(struct nvdimm_root_dev *dev, ACPI_TABLE_NFIT *nfitbl) -{ - ACPI_NFIT_SYSTEM_ADDRESS **spas, **spa; - struct SPA_mapping *spa_mapping; - enum SPA_mapping_type spa_type; - int error, num_spas; - - error = 0; - acpi_nfit_get_spa_ranges(nfitbl, &spas, &num_spas); - for (spa = spas; spa < spas + num_spas; spa++) { - spa_type = nvdimm_spa_type_from_uuid( - (struct uuid *)(*spa)->RangeGuid); - if (spa_type == SPA_TYPE_UNKNOWN) - continue; - spa_mapping = malloc(sizeof(struct SPA_mapping), M_NVDIMM, - M_WAITOK | M_ZERO); - error = nvdimm_spa_init(spa_mapping, *spa, spa_type); - if (error != 0) { - nvdimm_spa_fini(spa_mapping); - free(spa, M_NVDIMM); - break; - } - nvdimm_create_namespaces(spa_mapping, nfitbl); - SLIST_INSERT_HEAD(&dev->spas, spa_mapping, link); - } - free(spas, M_NVDIMM); - return (error); -} - -static char *nvdimm_root_id[] = {"ACPI0012", NULL}; - -static int -nvdimm_root_probe(device_t dev) -{ - int rv; - - if (acpi_disabled("nvdimm")) - return (ENXIO); - rv = ACPI_ID_PROBE(device_get_parent(dev), dev, nvdimm_root_id, NULL); - if (rv <= 0) - device_set_desc(dev, "ACPI NVDIMM root device"); - - return (rv); -} - -static int -nvdimm_root_attach(device_t dev) -{ - struct nvdimm_root_dev *root; - ACPI_TABLE_NFIT *nfitbl; - ACPI_STATUS status; - int error; - - status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); - if (ACPI_FAILURE(status)) { - device_printf(dev, "cannot get NFIT\n"); - return (ENXIO); - } - error = nvdimm_root_create_devs(dev, nfitbl); - if (error != 0) - return (error); - error = bus_generic_attach(dev); - if (error != 0) - return (error); - root = device_get_softc(dev); - error = nvdimm_root_create_spas(root, nfitbl); - AcpiPutTable(&nfitbl->Header); - return (error); -} - -static int -nvdimm_root_detach(device_t dev) -{ - struct nvdimm_root_dev *root; - struct SPA_mapping *spa, *next; - device_t *children; - int i, error, num_children; - - root = device_get_softc(dev); - SLIST_FOREACH_SAFE(spa, &root->spas, link, next) { - nvdimm_destroy_namespaces(spa); - nvdimm_spa_fini(spa); - SLIST_REMOVE_HEAD(&root->spas, link); - free(spa, M_NVDIMM); - } - error = bus_generic_detach(dev); - if (error != 0) - return (error); - error = device_get_children(dev, &children, &num_children); - if (error != 0) - return (error); - for (i = 0; i < num_children; i++) - free(device_get_ivars(children[i]), M_NVDIMM); - free(children, M_TEMP); - error = device_delete_children(dev); - return (error); -} - -static int -nvdimm_root_read_ivar(device_t dev, device_t child, int index, - uintptr_t *result) -{ - - if (index < 0 || index >= NVDIMM_ROOT_IVAR_MAX) - return (ENOENT); - *result = ((uintptr_t *)device_get_ivars(child))[index]; - return (0); -} - -static int -nvdimm_root_write_ivar(device_t dev, device_t child, int index, - uintptr_t value) -{ - - if (index < 0 || index >= NVDIMM_ROOT_IVAR_MAX) - return (ENOENT); - ((uintptr_t *)device_get_ivars(child))[index] = value; - return (0); -} - -static int -nvdimm_root_child_location_str(device_t dev, device_t child, char *buf, - size_t buflen) -{ - ACPI_HANDLE handle; - int res; - - handle = nvdimm_root_get_acpi_handle(child); - if (handle != NULL) - res = snprintf(buf, buflen, "handle=%s", acpi_name(handle)); - else - res = snprintf(buf, buflen, ""); - - if (res >= buflen) - return (EOVERFLOW); - return (0); -} - static device_method_t nvdimm_methods[] = { DEVMETHOD(device_probe, nvdimm_probe), DEVMETHOD(device_attach, nvdimm_attach), @@ -593,24 +395,6 @@ static driver_t nvdimm_driver = { sizeof(struct nvdimm_dev), }; -static device_method_t nvdimm_root_methods[] = { - DEVMETHOD(device_probe, nvdimm_root_probe), - DEVMETHOD(device_attach, nvdimm_root_attach), - DEVMETHOD(device_detach, nvdimm_root_detach), - DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_read_ivar, nvdimm_root_read_ivar), - DEVMETHOD(bus_write_ivar, nvdimm_root_write_ivar), - DEVMETHOD(bus_child_location_str, nvdimm_root_child_location_str), - DEVMETHOD_END -}; - -static driver_t nvdimm_root_driver = { - "nvdimm_root", - nvdimm_root_methods, - sizeof(struct nvdimm_root_dev), -}; - -DRIVER_MODULE(nvdimm_root, acpi, nvdimm_root_driver, nvdimm_root_devclass, NULL, +DRIVER_MODULE(nvdimm, nvdimm_acpi_root, nvdimm_driver, nvdimm_devclass, NULL, NULL); -DRIVER_MODULE(nvdimm, nvdimm_root, nvdimm_driver, nvdimm_devclass, NULL, NULL); MODULE_DEPEND(nvdimm, acpi, 1, 1, 1); Copied and modified: head/sys/dev/nvdimm/nvdimm_acpi.c (from r352792, head/sys/dev/nvdimm/nvdimm.c) ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Fri Sep 27 13:14:36 2019 (r352792, copy source) +++ head/sys/dev/nvdimm/nvdimm_acpi.c Fri Sep 27 16:32:44 2019 (r352798) @@ -1,6 +1,5 @@ /*- * Copyright (c) 2017 The FreeBSD Foundation - * All rights reserved. * Copyright (c) 2018, 2019 Intel Corporation * * This software was developed by Konstantin Belousov @@ -43,343 +42,23 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include #include #include + #include #define _COMPONENT ACPI_OEM -ACPI_MODULE_NAME("NVDIMM") +ACPI_MODULE_NAME("NVDIMM_ACPI") -static struct uuid intel_nvdimm_dsm_uuid = - {0x4309AC30,0x0D11,0x11E4,0x91,0x91,{0x08,0x00,0x20,0x0C,0x9A,0x66}}; -#define INTEL_NVDIMM_DSM_REV 1 -#define INTEL_NVDIMM_DSM_GET_LABEL_SIZE 4 -#define INTEL_NVDIMM_DSM_GET_LABEL_DATA 5 +struct nvdimm_root_dev { + SLIST_HEAD(, SPA_mapping) spas; +}; -static devclass_t nvdimm_devclass; -static devclass_t nvdimm_root_devclass; -MALLOC_DEFINE(M_NVDIMM, "nvdimm", "NVDIMM driver memory"); +static MALLOC_DEFINE(M_NVDIMM_ACPI, "nvdimm_acpi", "NVDIMM ACPI bus memory"); -static int -read_label_area_size(struct nvdimm_dev *nv) -{ - ACPI_OBJECT *result_buffer; - ACPI_HANDLE handle; - ACPI_STATUS status; - ACPI_BUFFER result; - uint32_t *out; - int error; - - handle = nvdimm_root_get_acpi_handle(nv->nv_dev); - if (handle == NULL) - return (ENODEV); - result.Length = ACPI_ALLOCATE_BUFFER; - result.Pointer = NULL; - status = acpi_EvaluateDSM(handle, (uint8_t *)&intel_nvdimm_dsm_uuid, - INTEL_NVDIMM_DSM_REV, INTEL_NVDIMM_DSM_GET_LABEL_SIZE, NULL, - &result); - error = ENXIO; - if (ACPI_SUCCESS(status) && result.Pointer != NULL && - result.Length >= sizeof(ACPI_OBJECT)) { - result_buffer = result.Pointer; - if (result_buffer->Type == ACPI_TYPE_BUFFER && - result_buffer->Buffer.Length >= 12) { - out = (uint32_t *)result_buffer->Buffer.Pointer; - nv->label_area_size = out[1]; - nv->max_label_xfer = out[2]; - error = 0; - } - } - if (result.Pointer != NULL) - AcpiOsFree(result.Pointer); - return (error); -} - -static int -read_label_area(struct nvdimm_dev *nv, uint8_t *dest, off_t offset, - off_t length) -{ - ACPI_BUFFER result; - ACPI_HANDLE handle; - ACPI_OBJECT params_pkg, params_buf, *result_buf; - ACPI_STATUS status; - uint32_t params[2]; - off_t to_read; - int error; - - error = 0; - handle = nvdimm_root_get_acpi_handle(nv->nv_dev); - if (offset < 0 || length <= 0 || - offset + length > nv->label_area_size || - handle == NULL) - return (ENODEV); - params_pkg.Type = ACPI_TYPE_PACKAGE; - params_pkg.Package.Count = 1; - params_pkg.Package.Elements = ¶ms_buf; - params_buf.Type = ACPI_TYPE_BUFFER; - params_buf.Buffer.Length = sizeof(params); - params_buf.Buffer.Pointer = (UINT8 *)params; - while (length > 0) { - to_read = MIN(length, nv->max_label_xfer); - params[0] = offset; - params[1] = to_read; - result.Length = ACPI_ALLOCATE_BUFFER; - result.Pointer = NULL; - status = acpi_EvaluateDSM(handle, - (uint8_t *)&intel_nvdimm_dsm_uuid, INTEL_NVDIMM_DSM_REV, - INTEL_NVDIMM_DSM_GET_LABEL_DATA, ¶ms_pkg, &result); - if (ACPI_FAILURE(status) || - result.Length < sizeof(ACPI_OBJECT) || - result.Pointer == NULL) { - error = ENXIO; - break; - } - result_buf = (ACPI_OBJECT *)result.Pointer; - if (result_buf->Type != ACPI_TYPE_BUFFER || - result_buf->Buffer.Pointer == NULL || - result_buf->Buffer.Length != 4 + to_read || - ((uint16_t *)result_buf->Buffer.Pointer)[0] != 0) { - error = ENXIO; - break; - } - bcopy(result_buf->Buffer.Pointer + 4, dest, to_read); - dest += to_read; - offset += to_read; - length -= to_read; - if (result.Pointer != NULL) { - AcpiOsFree(result.Pointer); - result.Pointer = NULL; - } - } - if (result.Pointer != NULL) - AcpiOsFree(result.Pointer); - return (error); -} - -static uint64_t -fletcher64(const void *data, size_t length) -{ - size_t i; - uint32_t a, b; - const uint32_t *d; - - a = 0; - b = 0; - d = (const uint32_t *)data; - length = length / sizeof(uint32_t); - for (i = 0; i < length; i++) { - a += d[i]; - b += a; - } - return ((uint64_t)b << 32 | a); -} - -static bool -label_index_is_valid(struct nvdimm_label_index *index, uint32_t max_labels, - size_t size, size_t offset) -{ - uint64_t checksum; - - index = (struct nvdimm_label_index *)((uint8_t *)index + offset); - if (strcmp(index->signature, NVDIMM_INDEX_BLOCK_SIGNATURE) != 0) - return false; - checksum = index->checksum; - index->checksum = 0; - if (checksum != fletcher64(index, size) || - index->this_offset != size * offset || index->this_size != size || - index->other_offset != size * (offset == 0 ? 1 : 0) || - index->seq == 0 || index->seq > 3 || index->slot_cnt > max_labels || - index->label_size != 1) - return false; - return true; -} - -static int -read_label(struct nvdimm_dev *nv, int num) -{ - struct nvdimm_label_entry *entry, *i, *next; - uint64_t checksum; - off_t offset; - int error; - - offset = nv->label_index->label_offset + - num * (128 << nv->label_index->label_size); - entry = malloc(sizeof(*entry), M_NVDIMM, M_WAITOK); - error = read_label_area(nv, (uint8_t *)&entry->label, offset, - sizeof(struct nvdimm_label)); - if (error != 0) { - free(entry, M_NVDIMM); - return (error); - } - checksum = entry->label.checksum; - entry->label.checksum = 0; - if (checksum != fletcher64(&entry->label, sizeof(entry->label)) || - entry->label.slot != num) { - free(entry, M_NVDIMM); - return (ENXIO); - } - - /* Insertion ordered by dimm_phys_addr */ - if (SLIST_EMPTY(&nv->labels) || - entry->label.dimm_phys_addr <= - SLIST_FIRST(&nv->labels)->label.dimm_phys_addr) { - SLIST_INSERT_HEAD(&nv->labels, entry, link); - return (0); - } - SLIST_FOREACH_SAFE(i, &nv->labels, link, next) { - if (next == NULL || - entry->label.dimm_phys_addr <= next->label.dimm_phys_addr) { - SLIST_INSERT_AFTER(i, entry, link); - return (0); - } - } - __unreachable(); -} - -static int -read_labels(struct nvdimm_dev *nv) -{ - struct nvdimm_label_index *indices; - size_t bitfield_size, index_size, num_labels; - int error, n; - bool index_0_valid, index_1_valid; - - for (index_size = 256; ; index_size += 256) { - num_labels = 8 * (index_size - - sizeof(struct nvdimm_label_index)); - if (index_size + num_labels * sizeof(struct nvdimm_label) >= - nv->label_area_size) - break; - } - num_labels = (nv->label_area_size - index_size) / - sizeof(struct nvdimm_label); - bitfield_size = roundup2(num_labels, 8) / 8; - indices = malloc(2 * index_size, M_NVDIMM, M_WAITOK); - error = read_label_area(nv, (void *)indices, 0, 2 * index_size); - if (error != 0) { - free(indices, M_NVDIMM); - return (error); - } - index_0_valid = label_index_is_valid(indices, num_labels, index_size, - 0); - index_1_valid = label_index_is_valid(indices, num_labels, index_size, - 1); - if (!index_0_valid && !index_1_valid) { - free(indices, M_NVDIMM); - return (ENXIO); - } - if (index_0_valid && index_1_valid && - (indices[1].seq > indices[0].seq || - (indices[1].seq == 1 && indices[0].seq == 3))) - index_0_valid = false; - nv->label_index = malloc(index_size, M_NVDIMM, M_WAITOK); - bcopy(indices + (index_0_valid ? 0 : 1), nv->label_index, index_size); - free(indices, M_NVDIMM); - for (bit_ffc_at((bitstr_t *)nv->label_index->free, 0, num_labels, &n); - n >= 0; - bit_ffc_at((bitstr_t *)nv->label_index->free, n + 1, num_labels, - &n)) { - read_label(nv, n); - } - return (0); -} - -struct nvdimm_dev * -nvdimm_find_by_handle(nfit_handle_t nv_handle) -{ - struct nvdimm_dev *res; - device_t *dimms; - int i, error, num_dimms; - - res = NULL; - error = devclass_get_devices(nvdimm_devclass, &dimms, &num_dimms); - if (error != 0) - return (NULL); - for (i = 0; i < num_dimms; i++) { - if (nvdimm_root_get_device_handle(dimms[i]) == nv_handle) { - res = device_get_softc(dimms[i]); - break; - } - } - free(dimms, M_TEMP); - return (res); -} - -static int -nvdimm_probe(device_t dev) -{ - - return (BUS_PROBE_NOWILDCARD); -} - -static int -nvdimm_attach(device_t dev) -{ - struct nvdimm_dev *nv; - ACPI_TABLE_NFIT *nfitbl; - ACPI_HANDLE handle; - ACPI_STATUS status; - int error; - - nv = device_get_softc(dev); - handle = nvdimm_root_get_acpi_handle(dev); - if (handle == NULL) - return (EINVAL); - nv->nv_dev = dev; - nv->nv_handle = nvdimm_root_get_device_handle(dev); - - status = AcpiGetTable(ACPI_SIG_NFIT, 1, (ACPI_TABLE_HEADER **)&nfitbl); - if (ACPI_FAILURE(status)) { - if (bootverbose) - device_printf(dev, "cannot get NFIT\n"); - return (ENXIO); - } - acpi_nfit_get_flush_addrs(nfitbl, nv->nv_handle, &nv->nv_flush_addr, - &nv->nv_flush_addr_cnt); - AcpiPutTable(&nfitbl->Header); - error = read_label_area_size(nv); - if (error == 0) { - /* - * Ignoring errors reading labels. Not all NVDIMMs - * support labels and namespaces. - */ - read_labels(nv); - } - return (0); -} - -static int -nvdimm_detach(device_t dev) -{ - struct nvdimm_dev *nv; - struct nvdimm_label_entry *label, *next; - - nv = device_get_softc(dev); - free(nv->nv_flush_addr, M_NVDIMM); - free(nv->label_index, M_NVDIMM); - SLIST_FOREACH_SAFE(label, &nv->labels, link, next) { - SLIST_REMOVE_HEAD(&nv->labels, link); - free(label, M_NVDIMM); - } - return (0); -} - -static int -nvdimm_suspend(device_t dev) -{ - - return (0); -} - -static int -nvdimm_resume(device_t dev) -{ - - return (0); -} - static ACPI_STATUS find_dimm(ACPI_HANDLE handle, UINT32 nesting_level, void *context, void **return_value) @@ -424,18 +103,21 @@ nvdimm_root_create_devs(device_t dev, ACPI_TABLE_NFIT acpi_nfit_get_dimm_ids(nfitbl, &dimm_ids, &num_dimm_ids); for (dimm = dimm_ids; dimm < dimm_ids + num_dimm_ids; dimm++) { dimm_handle = get_dimm_acpi_handle(root_handle, *dimm); + if (dimm_handle == NULL) + continue; + child = BUS_ADD_CHILD(dev, 100, "nvdimm", -1); if (child == NULL) { device_printf(dev, "failed to create nvdimm\n"); return (ENXIO); } ivars = mallocarray(NVDIMM_ROOT_IVAR_MAX, sizeof(uintptr_t), - M_NVDIMM, M_ZERO | M_WAITOK); + M_NVDIMM_ACPI, M_ZERO | M_WAITOK); device_set_ivars(child, ivars); nvdimm_root_set_acpi_handle(child, dimm_handle); nvdimm_root_set_device_handle(child, *dimm); } - free(dimm_ids, M_NVDIMM); + free(dimm_ids, M_NVDIMM_ACPI); return (0); } @@ -454,18 +136,18 @@ nvdimm_root_create_spas(struct nvdimm_root_dev *dev, A (struct uuid *)(*spa)->RangeGuid); if (spa_type == SPA_TYPE_UNKNOWN) continue; - spa_mapping = malloc(sizeof(struct SPA_mapping), M_NVDIMM, + spa_mapping = malloc(sizeof(struct SPA_mapping), M_NVDIMM_ACPI, M_WAITOK | M_ZERO); error = nvdimm_spa_init(spa_mapping, *spa, spa_type); if (error != 0) { nvdimm_spa_fini(spa_mapping); - free(spa, M_NVDIMM); + free(spa, M_NVDIMM_ACPI); break; } nvdimm_create_namespaces(spa_mapping, nfitbl); SLIST_INSERT_HEAD(&dev->spas, spa_mapping, link); } - free(spas, M_NVDIMM); + free(spas, M_NVDIMM_ACPI); return (error); } @@ -523,7 +205,7 @@ nvdimm_root_detach(device_t dev) nvdimm_destroy_namespaces(spa); nvdimm_spa_fini(spa); SLIST_REMOVE_HEAD(&root->spas, link); - free(spa, M_NVDIMM); + free(spa, M_NVDIMM_ACPI); } error = bus_generic_detach(dev); if (error != 0) @@ -532,7 +214,7 @@ nvdimm_root_detach(device_t dev) if (error != 0) return (error); for (i = 0; i < num_children; i++) - free(device_get_ivars(children[i]), M_NVDIMM); + free(device_get_ivars(children[i]), M_NVDIMM_ACPI); free(children, M_TEMP); error = device_delete_children(dev); return (error); @@ -578,22 +260,7 @@ nvdimm_root_child_location_str(device_t dev, device_t return (0); } -static device_method_t nvdimm_methods[] = { - DEVMETHOD(device_probe, nvdimm_probe), - DEVMETHOD(device_attach, nvdimm_attach), - DEVMETHOD(device_detach, nvdimm_detach), - DEVMETHOD(device_suspend, nvdimm_suspend), - DEVMETHOD(device_resume, nvdimm_resume), - DEVMETHOD_END -}; - -static driver_t nvdimm_driver = { - "nvdimm", - nvdimm_methods, - sizeof(struct nvdimm_dev), -}; - -static device_method_t nvdimm_root_methods[] = { +static device_method_t nvdimm_acpi_methods[] = { DEVMETHOD(device_probe, nvdimm_root_probe), DEVMETHOD(device_attach, nvdimm_root_attach), DEVMETHOD(device_detach, nvdimm_root_detach), @@ -604,13 +271,13 @@ static device_method_t nvdimm_root_methods[] = { DEVMETHOD_END }; -static driver_t nvdimm_root_driver = { - "nvdimm_root", - nvdimm_root_methods, +static driver_t nvdimm_acpi_driver = { + "nvdimm_acpi_root", + nvdimm_acpi_methods, sizeof(struct nvdimm_root_dev), }; -DRIVER_MODULE(nvdimm_root, acpi, nvdimm_root_driver, nvdimm_root_devclass, NULL, - NULL); -DRIVER_MODULE(nvdimm, nvdimm_root, nvdimm_driver, nvdimm_devclass, NULL, NULL); -MODULE_DEPEND(nvdimm, acpi, 1, 1, 1); +static devclass_t nvdimm_acpi_root_devclass; +DRIVER_MODULE(nvdimm_acpi_root, acpi, nvdimm_acpi_driver, + nvdimm_acpi_root_devclass, NULL, NULL); +MODULE_DEPEND(nvdimm_acpi_root, acpi, 1, 1, 1); Modified: head/sys/dev/nvdimm/nvdimm_var.h ============================================================================== --- head/sys/dev/nvdimm/nvdimm_var.h Fri Sep 27 16:27:52 2019 (r352797) +++ head/sys/dev/nvdimm/nvdimm_var.h Fri Sep 27 16:32:44 2019 (r352798) @@ -80,7 +80,7 @@ _Static_assert(sizeof(struct nvdimm_label) == 256, "In typedef uint32_t nfit_handle_t; -enum nvdimm_root_ivar { +enum nvdimm_acpi_ivar { NVDIMM_ROOT_IVAR_ACPI_HANDLE, NVDIMM_ROOT_IVAR_DEVICE_HANDLE, NVDIMM_ROOT_IVAR_MAX, @@ -88,10 +88,6 @@ enum nvdimm_root_ivar { __BUS_ACCESSOR(nvdimm_root, acpi_handle, NVDIMM_ROOT, ACPI_HANDLE, ACPI_HANDLE) __BUS_ACCESSOR(nvdimm_root, device_handle, NVDIMM_ROOT, DEVICE_HANDLE, nfit_handle_t) - -struct nvdimm_root_dev { - SLIST_HEAD(, SPA_mapping) spas; -}; struct nvdimm_dev { device_t nv_dev; Modified: head/sys/modules/nvdimm/Makefile ============================================================================== --- head/sys/modules/nvdimm/Makefile Fri Sep 27 16:27:52 2019 (r352797) +++ head/sys/modules/nvdimm/Makefile Fri Sep 27 16:32:44 2019 (r352798) @@ -4,6 +4,7 @@ KMOD= nvdimm SRCS= nvdimm.c \ + nvdimm_acpi.c \ nvdimm_nfit.c \ nvdimm_ns.c \ nvdimm_spa.c From owner-svn-src-head@freebsd.org Fri Sep 27 16: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 807DB1275F6; Fri, 27 Sep 2019 16:35:09 +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 46fy7x2gJLz424w; Fri, 27 Sep 2019 16:35:09 +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 273D41BAAB; Fri, 27 Sep 2019 16:35:09 +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 x8RGZ9Ca049178; Fri, 27 Sep 2019 16:35:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGZ9iZ049177; Fri, 27 Sep 2019 16:35:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271635.x8RGZ9iZ049177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 16:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352799 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352799 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: Fri, 27 Sep 2019 16:35:09 -0000 Author: emaste Date: Fri Sep 27 16:35:08 2019 New Revision: 352799 URL: https://svnweb.freebsd.org/changeset/base/352799 Log: controlelf: clean up warnings - use explicit ELF note name when not found - no trailing . on warnings - no \n Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/controlelf/controlelf.c Modified: head/tools/tools/controlelf/controlelf.c ============================================================================== --- head/tools/tools/controlelf/controlelf.c Fri Sep 27 16:32:44 2019 (r352798) +++ head/tools/tools/controlelf/controlelf.c Fri Sep 27 16:35:08 2019 (r352799) @@ -132,9 +132,9 @@ main(int argc, char **argv) if ((kind = elf_kind(elf)) != ELF_K_ELF) { if (kind == ELF_K_AR) - warnx("file '%s' is an archive.", argv[0]); + warnx("file '%s' is an archive", argv[0]); else - warnx("file '%s' is not an ELF file.", + warnx("file '%s' is not an ELF file", argv[0]); retval = 1; goto fail; @@ -201,7 +201,7 @@ convert_to_feature_val(char* feature_str, u_int32_t* f else if (feature_str[0] == '=') set = true; else if (feature_str[0] != '-') { - warnx("'%c' is not an operator. Use instead '+', '-', '='.", + warnx("'%c' not an operator - use '+', '-', '='", feature_str[0]); return (false); } @@ -216,7 +216,7 @@ convert_to_feature_val(char* feature_str, u_int32_t* f } } if (i == len) { - warnx("%s is not a valid feature.", feature); + warnx("%s is not a valid feature", feature); return (false); } } @@ -238,7 +238,7 @@ edit_file_features(Elf *elf, int phcount, int fd, char u_int64_t off; if (!get_file_features(elf, phcount, fd, &features, &off)) { - warnx("No control features note on the file.\n"); + warnx("NT_FREEBSD_FEATURE_CTL note not found"); return (false); } @@ -327,7 +327,7 @@ get_file_features(Elf *elf, int phcount, int fd, u_int namesz = roundup2(note.n_namesz, 4); name = malloc(namesz); if (name == NULL) { - warn("malloc() failed.\n"); + warn("malloc() failed."); return (false); } descsz = roundup2(note.n_descsz, 4); @@ -339,7 +339,7 @@ get_file_features(Elf *elf, int phcount, int fd, u_int note.n_type != NT_FREEBSD_FEATURE_CTL) { /* Not the right note. Skip the description */ if (lseek(fd, descsz, SEEK_CUR) < 0) { - warn("lseek() failed.\n"); + warn("lseek() failed."); free(name); return (false); } @@ -360,7 +360,7 @@ get_file_features(Elf *elf, int phcount, int fd, u_int * descriptor. This should respect descsz. */ if (note.n_descsz > sizeof(u_int32_t)) - warnx("Feature note is bigger than expected."); + warnx("Feature note is bigger than expected"); read(fd, features, sizeof(u_int32_t)); if (off != NULL) *off = phdr.p_offset + read_total; @@ -369,6 +369,6 @@ get_file_features(Elf *elf, int phcount, int fd, u_int } } - warnx("Couldn't find a note header with control feature note."); + warnx("NT_FREEBSD_FEATURE_CTL note not found"); return (false); } From owner-svn-src-head@freebsd.org Fri Sep 27 16:38: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 3A808127694; Fri, 27 Sep 2019 16:38:32 +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 46fyCq31Svz42Fq; Fri, 27 Sep 2019 16:38:31 +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 x8RGcSmj026111; Fri, 27 Sep 2019 09:38:28 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x8RGcSXk026110; Fri, 27 Sep 2019 09:38:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201909271638.x8RGcSXk026110@gndrsh.dnsmgr.net> Subject: Re: svn commit: r352757 - in head: lib/libc/sys lib/libregex/tests stand/lua tests/sys/kern In-Reply-To: <201909261619.x8QGJNAt074767@repo.freebsd.org> To: Kyle Evans Date: Fri, 27 Sep 2019 09:38:28 -0700 (PDT) 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 X-Rspamd-Queue-Id: 46fyCq31Svz42Fq 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 [0.67 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; NEURAL_HAM_MEDIUM(-0.13)[-0.126,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.15)[-0.147,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; TO_DN_SOME(0.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; IP_SCORE(0.04)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.04), country: US(-0.05)]; R_SPF_NA(0.00)[]; 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)[]; 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: Fri, 27 Sep 2019 16:38:32 -0000 > Author: kevans > Date: Thu Sep 26 16:19:22 2019 > New Revision: 352757 > URL: https://svnweb.freebsd.org/changeset/base/352757 > > Log: > Further normalize copyright notices > > - s/C/c/ where I've been inconsistent about it > - +SPDX tags > - Remove "All rights reserved" where possible > > Requested by: rgrimes (all rights reserved) Thank you Kyle! > Modified: > head/lib/libc/sys/shm_open.c > head/lib/libregex/tests/libregex_test.sh > head/stand/lua/config.lua > head/stand/lua/menu.lua > head/stand/lua/password.lua Regards, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Sep 27 16:41: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 7A9BD1277E5; Fri, 27 Sep 2019 16:41:35 +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 46fyHM2k8vz42cn; Fri, 27 Sep 2019 16:41:35 +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 41B461BC25; Fri, 27 Sep 2019 16:41:35 +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 x8RGfZtN054306; Fri, 27 Sep 2019 16:41:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGfZbE054305; Fri, 27 Sep 2019 16:41:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909271641.x8RGfZbE054305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 27 Sep 2019 16:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352800 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 352800 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: Fri, 27 Sep 2019 16:41:35 -0000 Author: markj Date: Fri Sep 27 16:41:34 2019 New Revision: 352800 URL: https://svnweb.freebsd.org/changeset/base/352800 Log: Fix object locking in vm_object_unwire() after r352174. Now, vm_page_busy_sleep() expects the page's object to be locked. vm_object_unwire() does some unusual lazy locking of the object chain and keeps objects locked until a busy page is encountered or the loop terminates. When a busy page is encountered, rather than unlocking all but the "bottom-level" object, we must instead skip the object to which "tm" belongs. Reported and tested by: pho Reviewed by: kib Discussed with: jeff Sponsored by: Intel, Netflix Differential Revision: https://reviews.freebsd.org/D21790 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Sep 27 16:35:08 2019 (r352799) +++ head/sys/vm/vm_object.c Fri Sep 27 16:41:34 2019 (r352800) @@ -2169,10 +2169,11 @@ again: m = TAILQ_NEXT(m, listq); } if (vm_page_xbusied(tm)) { - for (tobject = object; locked_depth > 1; + for (tobject = object; locked_depth >= 1; locked_depth--) { t1object = tobject->backing_object; - VM_OBJECT_RUNLOCK(tobject); + if (tm->object != tobject) + VM_OBJECT_RUNLOCK(tobject); tobject = t1object; } vm_page_busy_sleep(tm, "unwbo", true); From owner-svn-src-head@freebsd.org Fri Sep 27 16:44:30 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 0E7881279AA; Fri, 27 Sep 2019 16:44:30 +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 46fyLj6bl1z42qp; Fri, 27 Sep 2019 16:44:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6FCA1BC7C; Fri, 27 Sep 2019 16:44:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8RGiTph055123; Fri, 27 Sep 2019 16:44:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGiT7h055122; Fri, 27 Sep 2019 16:44:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271644.x8RGiT7h055122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 16:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352801 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352801 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: Fri, 27 Sep 2019 16:44:30 -0000 Author: emaste Date: Fri Sep 27 16:44:29 2019 New Revision: 352801 URL: https://svnweb.freebsd.org/changeset/base/352801 Log: controlelf: install standard BSD 2 clause license Reported by: kaktus Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/controlelf/controlelf.c Modified: head/tools/tools/controlelf/controlelf.c ============================================================================== --- head/tools/tools/controlelf/controlelf.c Fri Sep 27 16:41:34 2019 (r352800) +++ head/tools/tools/controlelf/controlelf.c Fri Sep 27 16:44:29 2019 (r352801) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2019 The FreeBSD Foundation. * @@ -10,22 +10,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. + * 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. + * + * 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 From owner-svn-src-head@freebsd.org Fri Sep 27 16:46: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 C7F84127A54; Fri, 27 Sep 2019 16:46:08 +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 46fyNc4rkfz4308; Fri, 27 Sep 2019 16:46:08 +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 705C41BC7D; Fri, 27 Sep 2019 16:46: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 x8RGk89K055253; Fri, 27 Sep 2019 16:46:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGk8IC055252; Fri, 27 Sep 2019 16:46:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909271646.x8RGk8IC055252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 27 Sep 2019 16:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352802 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 352802 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: Fri, 27 Sep 2019 16:46:08 -0000 Author: markj Date: Fri Sep 27 16:46:08 2019 New Revision: 352802 URL: https://svnweb.freebsd.org/changeset/base/352802 Log: Fix a race in vm_page_swapqueue(). vm_page_swapqueue() atomically transitions a page between queues. To do so, it must hold the page queue lock for the old queue. However, once the queue index has been updated, the queue lock no longer protects the page's queue state. Thus, we must speculatively remove the page from the old queue before committing the queue state update, and roll back if the update fails. Reported and tested by: pho Reviewed by: kib Sponsored by: Intel, Netflix Differential Revision: https://reviews.freebsd.org/D21791 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Sep 27 16:44:29 2019 (r352801) +++ head/sys/vm/vm_page.c Fri Sep 27 16:46:08 2019 (r352802) @@ -3462,27 +3462,58 @@ void vm_page_swapqueue(vm_page_t m, uint8_t oldq, uint8_t newq) { struct vm_pagequeue *pq; + vm_page_t next; + bool queued; KASSERT(oldq < PQ_COUNT && newq < PQ_COUNT && oldq != newq, ("vm_page_swapqueue: invalid queues (%d, %d)", oldq, newq)); - KASSERT((m->oflags & VPO_UNMANAGED) == 0, - ("vm_page_swapqueue: page %p is unmanaged", m)); vm_page_assert_locked(m); - /* - * Atomically update the queue field and set PGA_REQUEUE while - * ensuring that PGA_DEQUEUE has not been set. - */ pq = &vm_pagequeue_domain(m)->vmd_pagequeues[oldq]; vm_pagequeue_lock(pq); - if (!vm_page_pqstate_cmpset(m, oldq, newq, PGA_DEQUEUE, PGA_REQUEUE)) { + + /* + * The physical queue state might change at any point before the page + * queue lock is acquired, so we must verify that we hold the correct + * lock before proceeding. + */ + if (__predict_false(m->queue != oldq)) { vm_pagequeue_unlock(pq); return; } - if ((m->aflags & PGA_ENQUEUED) != 0) { - vm_pagequeue_remove(pq, m); + + /* + * Once the queue index of the page changes, there is nothing + * synchronizing with further updates to the physical queue state. + * Therefore we must remove the page from the queue now in anticipation + * of a successful commit, and be prepared to roll back. + */ + if (__predict_true((m->aflags & PGA_ENQUEUED) != 0)) { + next = TAILQ_NEXT(m, plinks.q); + TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); vm_page_aflag_clear(m, PGA_ENQUEUED); + queued = true; + } else { + queued = false; } + + /* + * Atomically update the queue field and set PGA_REQUEUE while + * ensuring that PGA_DEQUEUE has not been set. + */ + if (__predict_false(!vm_page_pqstate_cmpset(m, oldq, newq, PGA_DEQUEUE, + PGA_REQUEUE))) { + if (queued) { + vm_page_aflag_set(m, PGA_ENQUEUED); + if (next != NULL) + TAILQ_INSERT_BEFORE(next, m, plinks.q); + else + TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); + } + vm_pagequeue_unlock(pq); + return; + } + vm_pagequeue_cnt_dec(pq); vm_pagequeue_unlock(pq); vm_page_pqbatch_submit(m, newq); } From owner-svn-src-head@freebsd.org Fri Sep 27 16:57: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 E0214127CBB; Fri, 27 Sep 2019 16:57:32 +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 46fydm5ZJqz43R4; Fri, 27 Sep 2019 16:57:32 +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 A210A1BE51; Fri, 27 Sep 2019 16:57:32 +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 x8RGvWWE061179; Fri, 27 Sep 2019 16:57:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RGvW3S061178; Fri, 27 Sep 2019 16:57:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271657.x8RGvW3S061178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 16:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352803 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352803 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: Fri, 27 Sep 2019 16:57:32 -0000 Author: emaste Date: Fri Sep 27 16:57:32 2019 New Revision: 352803 URL: https://svnweb.freebsd.org/changeset/base/352803 Log: controlelf: some style(9) cleanup Submitted by: clang-format Modified: head/tools/tools/controlelf/controlelf.c Modified: head/tools/tools/controlelf/controlelf.c ============================================================================== --- head/tools/tools/controlelf/controlelf.c Fri Sep 27 16:46:08 2019 (r352802) +++ head/tools/tools/controlelf/controlelf.c Fri Sep 27 16:57:32 2019 (r352803) @@ -14,7 +14,7 @@ * 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 @@ -47,11 +47,11 @@ __FBSDID("$FreeBSD$"); -static bool convert_to_feature_val(char*, u_int32_t*); -static bool edit_file_features(Elf *, int, int, char*); +static bool convert_to_feature_val(char *, u_int32_t *); +static bool edit_file_features(Elf *, int, int, char *); static bool get_file_features(Elf *, int, int, u_int32_t *, u_int64_t *); static void print_features(void); -static bool print_file_features(Elf *, int, int, char*); +static bool print_file_features(Elf *, int, int, char *); static void usage(void); struct ControlFeatures { @@ -61,12 +61,12 @@ struct ControlFeatures { }; static struct ControlFeatures featurelist[] = { - { "aslr", NT_FREEBSD_FCTL_ASLR_DISABLE, "Disable ASLR" } + { "aslr", NT_FREEBSD_FCTL_ASLR_DISABLE, "Disable ASLR" }, }; static struct option controlelf_longopts[] = { - { "help", no_argument, NULL, 'h' }, - { NULL, 0, NULL, 0 } + { "help", no_argument, NULL, 'h' }, + { NULL, 0, NULL, 0 } }; int @@ -117,8 +117,8 @@ main(int argc, char **argv) while (argc) { elf = NULL; - if ((fd = open(argv[0], editfeatures ? O_RDWR : - O_RDONLY, 0)) < 0) { + if ((fd = open(argv[0], + editfeatures ? O_RDWR : O_RDONLY, 0)) < 0) { warn("error opening file %s", argv[0]); retval = 1; goto fail; @@ -134,8 +134,7 @@ main(int argc, char **argv) if (kind == ELF_K_AR) warnx("file '%s' is an archive", argv[0]); else - warnx("file '%s' is not an ELF file", - argv[0]); + warnx("file '%s' is not an ELF file", argv[0]); retval = 1; goto fail; } @@ -147,11 +146,13 @@ main(int argc, char **argv) } if (!editfeatures) { - if (!print_file_features(elf, ehdr.e_phnum, fd, argv[0])) { + if (!print_file_features(elf, ehdr.e_phnum, fd, + argv[0])) { retval = 1; goto fail; } - } else if (!edit_file_features(elf, ehdr.e_phnum, fd, features)) { + } else if (!edit_file_features(elf, ehdr.e_phnum, fd, + features)) { retval = 1; goto fail; } @@ -169,7 +170,8 @@ fail: return (retval); } -#define USAGE_MESSAGE "\ +#define USAGE_MESSAGE \ + "\ Usage: %s [options] file...\n\ Set or display the control features for an ELF object.\n\n\ Supported options are:\n\ @@ -186,7 +188,7 @@ usage(void) } static bool -convert_to_feature_val(char* feature_str, u_int32_t* feature_val) +convert_to_feature_val(char *feature_str, u_int32_t *feature_val) { char *feature_input, *feature; int i, len; @@ -262,7 +264,8 @@ print_features(void) } static bool -print_file_features(Elf *elf, int phcount, int fd, char *filename) { +print_file_features(Elf *elf, int phcount, int fd, char *filename) +{ u_int32_t features; unsigned long i; @@ -284,7 +287,8 @@ print_file_features(Elf *elf, int phcount, int fd, cha } static bool -get_file_features(Elf *elf, int phcount, int fd, u_int32_t *features, u_int64_t *off) +get_file_features(Elf *elf, int phcount, int fd, u_int32_t *features, + u_int64_t *off) { GElf_Phdr phdr; Elf_Note note; From owner-svn-src-head@freebsd.org Fri Sep 27 17:11:21 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 CAD1C128293; Fri, 27 Sep 2019 17:11:21 +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 46fyxj4yYDz44C9; Fri, 27 Sep 2019 17:11:21 +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 8DA021C06F; Fri, 27 Sep 2019 17:11:21 +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 x8RHBLke067857; Fri, 27 Sep 2019 17:11:21 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RHBLIR067856; Fri, 27 Sep 2019 17:11:21 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909271711.x8RHBLIR067856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 27 Sep 2019 17:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352804 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 352804 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: Fri, 27 Sep 2019 17:11:21 -0000 Author: dim Date: Fri Sep 27 17:11:21 2019 New Revision: 352804 URL: https://svnweb.freebsd.org/changeset/base/352804 Log: Correct the final argument name in the top(1) manpage. The description talks about 'number', while the final argument was 'count'. Since 'count' is already used for the count of displays, change the final argument name to 'number'. MFC after: 3 days Modified: head/usr.bin/top/top.1 Modified: head/usr.bin/top/top.1 ============================================================================== --- head/usr.bin/top/top.1 Fri Sep 27 16:57:32 2019 (r352803) +++ head/usr.bin/top/top.1 Fri Sep 27 17:11:21 2019 (r352804) @@ -15,7 +15,7 @@ .Op Fl s Ar time .Op Fl o Ar field .Op Fl p Ar pid -.Op Ar count +.Op Ar number .Sh DESCRIPTION .Nm displays the top From owner-svn-src-head@freebsd.org Fri Sep 27 17:28: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 A48311286D3; Fri, 27 Sep 2019 17:28:26 +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 46fzKQ3rsZz44tV; Fri, 27 Sep 2019 17:28:26 +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 68C381C3B8; Fri, 27 Sep 2019 17:28:26 +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 x8RHSQGk078930; Fri, 27 Sep 2019 17:28:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RHSQXY078929; Fri, 27 Sep 2019 17:28:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271728.x8RHSQXY078929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 17:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352805 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352805 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: Fri, 27 Sep 2019 17:28:26 -0000 Author: emaste Date: Fri Sep 27 17:28:25 2019 New Revision: 352805 URL: https://svnweb.freebsd.org/changeset/base/352805 Log: controlelf: add protmax control Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/controlelf/controlelf.c Modified: head/tools/tools/controlelf/controlelf.c ============================================================================== --- head/tools/tools/controlelf/controlelf.c Fri Sep 27 17:11:21 2019 (r352804) +++ head/tools/tools/controlelf/controlelf.c Fri Sep 27 17:28:25 2019 (r352805) @@ -62,6 +62,7 @@ struct ControlFeatures { static struct ControlFeatures featurelist[] = { { "aslr", NT_FREEBSD_FCTL_ASLR_DISABLE, "Disable ASLR" }, + { "protmax", NT_FREEBSD_FCTL_PROTMAX_DISABLE,"Disable implicit PROT_MAX" }, }; static struct option controlelf_longopts[] = { From owner-svn-src-head@freebsd.org Fri Sep 27 18:32: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 BDAF3129960; Fri, 27 Sep 2019 18:32:22 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) (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 46g0lB4YCZz48Jt; Fri, 27 Sep 2019 18:32:22 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-ot1-x32f.google.com with SMTP id y39so3078868ota.7; Fri, 27 Sep 2019 11:32:22 -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=Cc3vFFIt9JmZgjxK8g6wpzAwMLkQrJRd4/h8go8t1L8=; b=U37l3TffI0oirvec1grKglgX3YcsqAwzGUGZM5/u95byUDGHJBC2pLJInsSc6pvAAU y5r5UokXyqUet/WdUS2WUI+sF8vg3PqLI6Sd6sP3WgmldkJwaMF5POATyncicFYEWJCN amuj6FcPQuXb7Mydtedm6VeBwEF1roh4SldJHlpFpXK3K76Zb08LvSoppcb7g+09B053 S4vwCR5N5vTvK5q221Ebi0er3gyUkLbBJQeqvxb0CcCW+Medr+MmuoiW3H0cnmOO/yS+ rXEkV43EgrnkwJfnD/7mOn+U8vifY0WCtyQtPKIMxgX4hStG/udrKheoAMrLfuIbqWfS h2KA== 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=Cc3vFFIt9JmZgjxK8g6wpzAwMLkQrJRd4/h8go8t1L8=; b=DI3fT0xhTUaUnhdkH4sBr5Su5VumDQ15H1/Bcg0r6Wy1m7tFkJWmntZQsYdQa7C4Lp v11+Qxf5aEtWb4Jb/1Lg5e57FhSJaiplqH047hf8HOuTUVq/qF5mqOECGSq53dPNpoHM VQjI3govhj7cnjMzgRS+mTcEYAybB0rcJL3a07reSDeSwLNTjqTUKbwovPPbDu4OnNIo C/tbn4woZYEZFUTiupO/NB1dpECmcXOE7t14Y7HL0x2i5mPOnQDf4qP1vCfzs9PsQeSz HVsN4NUI0l/wSEtxMKcmx/v7CFW09E2mhU9RyKuRJql7oxmsdygh40ypy8jJ4h70vmU6 zh/Q== X-Gm-Message-State: APjAAAXkPEEgCzCf21dlTztv0h5oqAECPv3alTn86Wx2iPzWtyi8gHEL cFhz2JFdgNWbnyzHDz+cCrpoujFkLt9Xd4B6/H5pog== X-Google-Smtp-Source: APXvYqyX4fXVCBjLF0Pih7BpYVCDQ5db7ib8niSjnnHozrRC9dXTrTE4dKt01zmkKcNFS2qdIfCCQY07/KB3GFkOYTA= X-Received: by 2002:a9d:61d0:: with SMTP id h16mr4136363otk.84.1569609141138; Fri, 27 Sep 2019 11:32:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:458d:0:0:0:0:0 with HTTP; Fri, 27 Sep 2019 11:32:20 -0700 (PDT) In-Reply-To: <201909271611.x8RGBl0H036116@repo.freebsd.org> References: <201909271611.x8RGBl0H036116@repo.freebsd.org> From: Mateusz Guzik Date: Fri, 27 Sep 2019 20:32:20 +0200 Message-ID: Subject: Re: svn commit: r352795 - head/lib/libc/sys To: Warner Losh 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: 46g0lB4YCZz48Jt X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,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: Fri, 27 Sep 2019 18:32:22 -0000 On 9/27/19, Warner Losh wrote: > Author: imp > Date: Fri Sep 27 16:11:47 2019 > New Revision: 352795 > URL: https://svnweb.freebsd.org/changeset/base/352795 > > Log: > Document varadic args as int, since you can't have short varadic args > (they are > promoted to ints). > > - `mode_t` is `uint16_t` (`sys/sys/_types.h`) > - `openat` takes variadic args > - variadic args cannot be 16-bit, and indeed the code uses int > - the manpage currently kinda implies the argument is 16-bit by saying > `mode_t` > > Prompted by Rust things: https://github.com/tailhook/openat/issues/21 > Submitted by: Greg V at unrelenting > Differential Revision: https://reviews.freebsd.org/D21816 > > Modified: > head/lib/libc/sys/mq_open.2 > head/lib/libc/sys/open.2 > > Modified: head/lib/libc/sys/mq_open.2 > ============================================================================== > --- head/lib/libc/sys/mq_open.2 Fri Sep 27 15:28:30 2019 (r352794) > +++ head/lib/libc/sys/mq_open.2 Fri Sep 27 16:11:47 2019 (r352795) > @@ -133,7 +133,7 @@ Create a message queue. > It requires two additional arguments: > .Fa mode , > which is of type > -.Vt mode_t , > +.Vt int , > and > .Fa attr , > which is a pointer to an > > Modified: head/lib/libc/sys/open.2 > ============================================================================== > --- head/lib/libc/sys/open.2 Fri Sep 27 15:28:30 2019 (r352794) > +++ head/lib/libc/sys/open.2 Fri Sep 27 16:11:47 2019 (r352795) > @@ -61,7 +61,7 @@ In this case > and > .Fn openat > require an additional argument > -.Fa "mode_t mode" , > +.Fa "int mode" , > and the file is created with mode > .Fa mode > as described in > But opengroup says it is mode_t. Perhaps it is mode_t which needs to be changed? -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Sep 27 18:39: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 653E0129BA7; Fri, 27 Sep 2019 18:39:06 +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 46g0ty24Vfz48Zv; Fri, 27 Sep 2019 18:39:06 +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 263E31D06A; Fri, 27 Sep 2019 18:39:06 +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 x8RId5m8023199; Fri, 27 Sep 2019 18:39:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RId5TT023198; Fri, 27 Sep 2019 18:39:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271839.x8RId5TT023198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 18:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352806 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352806 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: Fri, 27 Sep 2019 18:39:06 -0000 Author: emaste Date: Fri Sep 27 18:39:05 2019 New Revision: 352806 URL: https://svnweb.freebsd.org/changeset/base/352806 Log: controlelf: tidy up option parsing Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/controlelf/controlelf.c Modified: head/tools/tools/controlelf/controlelf.c ============================================================================== --- head/tools/tools/controlelf/controlelf.c Fri Sep 27 17:28:25 2019 (r352805) +++ head/tools/tools/controlelf/controlelf.c Fri Sep 27 18:39:05 2019 (r352806) @@ -65,7 +65,7 @@ static struct ControlFeatures featurelist[] = { { "protmax", NT_FREEBSD_FCTL_PROTMAX_DISABLE,"Disable implicit PROT_MAX" }, }; -static struct option controlelf_longopts[] = { +static struct option long_opts[] = { { "help", no_argument, NULL, 'h' }, { NULL, 0, NULL, 0 } }; @@ -76,38 +76,36 @@ main(int argc, char **argv) GElf_Ehdr ehdr; Elf *elf; Elf_Kind kind; - int ch, fd, listed, editfeatures, retval; + int ch, fd, editfeatures, retval; char *features; + bool lflag; - listed = 0; + lflag = 0; editfeatures = 0; retval = 0; if (elf_version(EV_CURRENT) == EV_NONE) errx(EXIT_FAILURE, "elf_version error"); - while ((ch = getopt_long(argc, argv, "hle:", controlelf_longopts, - NULL)) != -1) { + while ((ch = getopt_long(argc, argv, "hle:", long_opts, NULL)) != -1) { switch (ch) { case 'l': print_features(); - listed = 1; + lflag = true; break; case 'e': features = optarg; editfeatures = 1; break; case 'h': - usage(); - break; default: usage(); } } argc -= optind; argv += optind; - if (!argc) { - if (listed) + if (argc == 0) { + if (lflag) exit(0); else { warnx("no file(s) specified"); From owner-svn-src-head@freebsd.org Fri Sep 27 18:43:39 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 EA4F2129E09; Fri, 27 Sep 2019 18:43:39 +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 46g10C6PZDz4918; Fri, 27 Sep 2019 18:43:39 +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 BE94E1D220; Fri, 27 Sep 2019 18:43:39 +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 x8RIhdlm028870; Fri, 27 Sep 2019 18:43:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RIhbwT028853; Fri, 27 Sep 2019 18:43:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201909271843.x8RIhbwT028853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 27 Sep 2019 18:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352807 - in head/sys: amd64/amd64 amd64/vmm arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 sys vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/vmm arm/arm arm64/arm64 i386/i386 kern mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 sys vm X-SVN-Commit-Revision: 352807 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: Fri, 27 Sep 2019 18:43:40 -0000 Author: kib Date: Fri Sep 27 18:43:36 2019 New Revision: 352807 URL: https://svnweb.freebsd.org/changeset/base/352807 Log: Improve MD page fault handlers. Centralize calculation of signal and ucode delivered on unhandled page fault in new function vm_fault_trap(). MD trap_pfault() now almost always uses the signal numbers and error codes calculated in consistent MI way. This introduces the protection fault compatibility sysctls to all non-x86 architectures which did not have that bug, but apparently they were already much more wrong in selecting delivered signals on protection violations. Change the delivered signal for accesses to mapped area after the backing object was truncated. According to POSIX description for mmap(2): The system shall always zero-fill any partial page at the end of an object. Further, the system shall never write out any modified portions of the last page of an object which are beyond its end. References within the address range starting at pa and continuing for len bytes to whole pages following the end of an object shall result in delivery of a SIGBUS signal. An implementation may generate SIGBUS signals when a reference would cause an error in the mapped object, such as out-of-space condition. Adjust according to the description, keeping the existing compatibility code for SIGSEGV/SIGBUS on protection failures. For situations where kernel cannot handle page fault due to resource limit enforcement, SIGBUS with a new error code BUS_OBJERR is delivered. Also, provide a new error code SEGV_PKUERR for SIGSEGV on amd64 due to protection key access violation. vm_fault_hold() is renamed to vm_fault(). Fixed some nits in trap_pfault()s like mis-interpreting Mach errors as errnos. Removed unneeded truncations of the fault addresses reported by hardware. PR: 211924 Reviewed by: alc Discussed with: jilles, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21566 Modified: head/sys/amd64/amd64/trap.c head/sys/amd64/vmm/vmm.c head/sys/arm/arm/trap-v4.c head/sys/arm/arm/trap-v6.c head/sys/arm64/arm64/trap.c head/sys/i386/i386/trap.c head/sys/kern/sys_process.c head/sys/mips/mips/trap.c head/sys/powerpc/powerpc/trap.c head/sys/riscv/riscv/trap.c head/sys/sparc64/sparc64/trap.c head/sys/sys/signal.h head/sys/vm/vm_extern.h head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/vm/vm_param.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/amd64/amd64/trap.c Fri Sep 27 18:43:36 2019 (r352807) @@ -111,7 +111,7 @@ void __noinline trap(struct trapframe *frame); void trap_check(struct trapframe *frame); void dblfault_handler(struct trapframe *frame); -static int trap_pfault(struct trapframe *, int); +static int trap_pfault(struct trapframe *, bool, int *, int *); static void trap_fatal(struct trapframe *, vm_offset_t); #ifdef KDTRACE_HOOKS static bool trap_user_dtrace(struct trapframe *, @@ -155,10 +155,6 @@ static const char *const trap_msg[] = { [T_DTRACE_RET] = "DTrace pid return trap", }; -static int prot_fault_translation; -SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RWTUN, - &prot_fault_translation, 0, - "Select signal to deliver on protection fault"); static int uprintf_signal; SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN, &uprintf_signal, 0, @@ -192,14 +188,11 @@ trap(struct trapframe *frame) struct thread *td; struct proc *p; register_t addr, dr6; - int signo, ucode; + int pf, signo, ucode; u_int type; td = curthread; p = td->td_proc; - signo = 0; - ucode = 0; - addr = 0; dr6 = 0; VM_CNT_INC(v_trap); @@ -345,47 +338,18 @@ trap(struct trapframe *frame) case T_PAGEFLT: /* page fault */ /* - * Emulator can take care about this trap? + * Can emulator handle this trap? */ if (*p->p_sysent->sv_trap != NULL && (*p->p_sysent->sv_trap)(td) == 0) return; - addr = frame->tf_addr; - signo = trap_pfault(frame, TRUE); - if (signo == -1) + pf = trap_pfault(frame, true, &signo, &ucode); + if (pf == -1) return; - if (signo == 0) + if (pf == 0) goto userret; - if (signo == SIGSEGV) { - ucode = SEGV_MAPERR; - } else if (prot_fault_translation == 0) { - /* - * Autodetect. This check also covers - * the images without the ABI-tag ELF - * note. - */ - if (SV_CURPROC_ABI() == SV_ABI_FREEBSD && - p->p_osrel >= P_OSREL_SIGSEGV) { - signo = SIGSEGV; - ucode = SEGV_ACCERR; - } else { - signo = SIGBUS; - ucode = T_PAGEFLT; - } - } else if (prot_fault_translation == 1) { - /* - * Always compat mode. - */ - signo = SIGBUS; - ucode = T_PAGEFLT; - } else { - /* - * Always SIGSEGV mode. - */ - signo = SIGSEGV; - ucode = SEGV_ACCERR; - } + addr = frame->tf_addr; break; case T_DIVIDE: /* integer divide fault */ @@ -440,7 +404,7 @@ trap(struct trapframe *frame) ("kernel trap doesn't have ucred")); switch (type) { case T_PAGEFLT: /* page fault */ - (void) trap_pfault(frame, FALSE); + (void)trap_pfault(frame, false, NULL, NULL); return; case T_DNA: @@ -712,17 +676,29 @@ trap_is_pti(struct trapframe *frame) (PCPU_GET(curpmap)->pm_cr3 & ~CR3_PCID_MASK)); } +/* + * Handle all details of a page fault. + * Returns: + * -1 if this fault was fatal, typically from kernel mode + * (cannot happen, but we need to return something). + * 0 if this fault was handled by updating either the user or kernel + * page table, execution can continue. + * 1 if this fault was from usermode and it was not handled, a synchronous + * signal should be delivered to the thread. *signo returns the signal + * number, *ucode gives si_code. + */ static int -trap_pfault(struct trapframe *frame, int usermode) +trap_pfault(struct trapframe *frame, bool usermode, int *signo, int *ucode) { struct thread *td; struct proc *p; vm_map_t map; - vm_offset_t va; + vm_offset_t eva; int rv; vm_prot_t ftype; - vm_offset_t eva; + MPASS(!usermode || (signo != NULL && ucode != NULL)); + td = curthread; p = td->td_proc; eva = frame->tf_addr; @@ -771,13 +747,15 @@ trap_pfault(struct trapframe *frame, int usermode) return (-1); } } - va = trunc_page(eva); - if (va >= VM_MIN_KERNEL_ADDRESS) { + if (eva >= VM_MIN_KERNEL_ADDRESS) { /* * Don't allow user-mode faults in kernel address space. */ - if (usermode) - return (SIGSEGV); + if (usermode) { + *signo = SIGSEGV; + *ucode = SEGV_MAPERR; + return (1); + } map = kernel_map; } else { @@ -819,7 +797,11 @@ trap_pfault(struct trapframe *frame, int usermode) trap_fatal(frame, eva); return (-1); } - rv = KERN_PROTECTION_FAILURE; + if (usermode) { + *signo = SIGSEGV; + *ucode = SEGV_PKUERR; + return (1); + } goto after_vmfault; } @@ -843,7 +825,7 @@ trap_pfault(struct trapframe *frame, int usermode) ftype = VM_PROT_READ; /* Fault in the page. */ - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, eva, ftype, VM_FAULT_NORMAL, signo, ucode); if (rv == KERN_SUCCESS) { #ifdef HWPMC_HOOKS if (ftype == VM_PROT_READ || ftype == VM_PROT_WRITE) { @@ -858,17 +840,17 @@ trap_pfault(struct trapframe *frame, int usermode) #endif return (0); } + + if (usermode) + return (1); after_vmfault: - if (!usermode) { - if (td->td_intr_nesting_level == 0 && - curpcb->pcb_onfault != NULL) { - frame->tf_rip = (long)curpcb->pcb_onfault; - return (0); - } - trap_fatal(frame, eva); - return (-1); + if (td->td_intr_nesting_level == 0 && + curpcb->pcb_onfault != NULL) { + frame->tf_rip = (long)curpcb->pcb_onfault; + return (0); } - return ((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); + trap_fatal(frame, eva); + return (-1); } static void Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/amd64/vmm/vmm.c Fri Sep 27 18:43:36 2019 (r352807) @@ -1411,7 +1411,7 @@ vm_handle_paging(struct vm *vm, int vcpuid, bool *retu } map = &vm->vmspace->vm_map; - rv = vm_fault(map, vme->u.paging.gpa, ftype, VM_FAULT_NORMAL); + rv = vm_fault(map, vme->u.paging.gpa, ftype, VM_FAULT_NORMAL, NULL); VCPU_CTR3(vm, vcpuid, "vm_handle_paging rv = %d, gpa = %#lx, " "ftype = %d", rv, vme->u.paging.gpa, ftype); Modified: head/sys/arm/arm/trap-v4.c ============================================================================== --- head/sys/arm/arm/trap-v4.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/arm/arm/trap-v4.c Fri Sep 27 18:43:36 2019 (r352807) @@ -94,12 +94,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include #ifdef KDB #include @@ -181,7 +181,7 @@ abort_handler(struct trapframe *tf, int type) vm_prot_t ftype; void *onfault; vm_offset_t va; - int error = 0; + int error = 0, signo, ucode; struct ksig ksig; struct proc *p; @@ -230,6 +230,8 @@ abort_handler(struct trapframe *tf, int type) if (__predict_false(data_aborts[fsr & FAULT_TYPE_MASK].func != NULL)) { if ((data_aborts[fsr & FAULT_TYPE_MASK].func)(tf, fsr, far, td, &ksig)) { + signo = ksig.signb; + ucode = ksig.code; goto do_trapsignal; } goto out; @@ -262,8 +264,8 @@ abort_handler(struct trapframe *tf, int type) * Give the user an illegal instruction signal. */ /* Deliver a SIGILL to the process */ - ksig.signb = SIGILL; - ksig.code = 0; + signo = SIGILL; + ucode = 0; goto do_trapsignal; } @@ -299,8 +301,8 @@ abort_handler(struct trapframe *tf, int type) * but uses USR mode permissions for its accesses. */ user = 1; - ksig.signb = SIGSEGV; - ksig.code = 0; + signo = SIGSEGV; + ucode = 0; goto do_trapsignal; } } else { @@ -350,9 +352,9 @@ abort_handler(struct trapframe *tf, int type) onfault = pcb->pcb_onfault; pcb->pcb_onfault = NULL; - error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + error = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, &signo, &ucode); pcb->pcb_onfault = onfault; - if (__predict_true(error == 0)) + if (__predict_true(error == KERN_SUCCESS)) goto out; fatal_pagefault: if (user == 0) { @@ -368,18 +370,8 @@ fatal_pagefault: } - if (error == ENOMEM) { - printf("VM: pid %d (%s), uid %d killed: " - "out of swap\n", td->td_proc->p_pid, td->td_name, - (td->td_proc->p_ucred) ? - td->td_proc->p_ucred->cr_uid : -1); - ksig.signb = SIGKILL; - } else { - ksig.signb = SIGSEGV; - } - ksig.code = 0; do_trapsignal: - call_trapsignal(td, ksig.signb, ksig.code); + call_trapsignal(td, signo, ucode); out: /* If returning to user mode, make sure to invoke userret() */ if (user) @@ -613,10 +605,9 @@ prefetch_abort_handler(struct trapframe *tf) struct proc * p; struct vm_map *map; vm_offset_t fault_pc, va; - int error = 0; + int error = 0, signo, ucode; struct ksig ksig; - #if 0 /* Update vmmeter statistics */ uvmexp.traps++; @@ -652,8 +643,8 @@ prefetch_abort_handler(struct trapframe *tf) /* Ok validate the address, can only execute in USER space */ if (__predict_false(fault_pc >= VM_MAXUSER_ADDRESS || (fault_pc < VM_MIN_ADDRESS && vector_page == ARM_VECTORS_LOW))) { - ksig.signb = SIGSEGV; - ksig.code = 0; + signo = SIGSEGV; + ucode = 0; goto do_trapsignal; } @@ -669,24 +660,13 @@ prefetch_abort_handler(struct trapframe *tf) if (pmap_fault_fixup(map->pmap, va, VM_PROT_READ, 1)) goto out; - error = vm_fault(map, va, VM_PROT_READ | VM_PROT_EXECUTE, - VM_FAULT_NORMAL); - if (__predict_true(error == 0)) + error = vm_fault_trap(map, va, VM_PROT_READ | VM_PROT_EXECUTE, + VM_FAULT_NORMAL, &signo, &ucode); + if (__predict_true(error == KERN_SUCCESS)) goto out; - if (error == ENOMEM) { - printf("VM: pid %d (%s), uid %d killed: " - "out of swap\n", td->td_proc->p_pid, td->td_name, - (td->td_proc->p_ucred) ? - td->td_proc->p_ucred->cr_uid : -1); - ksig.signb = SIGKILL; - } else { - ksig.signb = SIGSEGV; - } - ksig.code = 0; - do_trapsignal: - call_trapsignal(td, ksig.signb, ksig.code); + call_trapsignal(td, signo, ucode); out: userret(td, tf); Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/arm/arm/trap-v6.c Fri Sep 27 18:43:36 2019 (r352807) @@ -287,7 +287,7 @@ abort_handler(struct trapframe *tf, int prefetch) struct vmspace *vm; vm_prot_t ftype; bool usermode; - int bp_harden; + int bp_harden, ucode; #ifdef INVARIANTS void *onfault; #endif @@ -497,7 +497,9 @@ abort_handler(struct trapframe *tf, int prefetch) #endif /* Fault in the page. */ - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, &ksig.sig, + &ucode); + ksig.code = ucode; #ifdef INVARIANTS pcb->pcb_onfault = onfault; @@ -518,8 +520,6 @@ nogo: return; } - ksig.sig = SIGSEGV; - ksig.code = (rv == KERN_PROTECTION_FAILURE) ? SEGV_ACCERR : SEGV_MAPERR; ksig.addr = far; do_trapsignal: Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/arm64/arm64/trap.c Fri Sep 27 18:43:36 2019 (r352807) @@ -155,7 +155,6 @@ data_abort(struct thread *td, struct trapframe *frame, struct proc *p; struct pcb *pcb; vm_prot_t ftype; - vm_offset_t va; int error, sig, ucode; #ifdef KDB bool handled; @@ -211,7 +210,6 @@ data_abort(struct thread *td, struct trapframe *frame, panic("data abort in critical section or under mutex"); } - va = trunc_page(far); if (exec) ftype = VM_PROT_EXECUTE; else @@ -219,14 +217,9 @@ data_abort(struct thread *td, struct trapframe *frame, VM_PROT_READ | VM_PROT_WRITE; /* Fault in the page. */ - error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + error = vm_fault_trap(map, far, ftype, VM_FAULT_NORMAL, &sig, &ucode); if (error != KERN_SUCCESS) { if (lower) { - sig = SIGSEGV; - if (error == KERN_PROTECTION_FAILURE) - ucode = SEGV_ACCERR; - else - ucode = SEGV_MAPERR; call_trapsignal(td, sig, ucode, (void *)far); } else { if (td->td_intr_nesting_level == 0 && Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/i386/i386/trap.c Fri Sep 27 18:43:36 2019 (r352807) @@ -114,7 +114,7 @@ PMC_SOFT_DEFINE( , , page_fault, write); void trap(struct trapframe *frame); void syscall(struct trapframe *frame); -static int trap_pfault(struct trapframe *, int, vm_offset_t); +static int trap_pfault(struct trapframe *, bool, vm_offset_t, int *, int *); static void trap_fatal(struct trapframe *, vm_offset_t); #ifdef KDTRACE_HOOKS static bool trap_user_dtrace(struct trapframe *, @@ -181,9 +181,6 @@ trap_msg(int trapno) int has_f00f_bug = 0; /* Initialized so that it can be patched. */ #endif -static int prot_fault_translation = 0; -SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW, - &prot_fault_translation, 0, "Select signal to deliver on protection fault"); static int uprintf_signal; SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW, &uprintf_signal, 0, @@ -202,7 +199,7 @@ trap(struct trapframe *frame) ksiginfo_t ksi; struct thread *td; struct proc *p; - int signo, ucode; + int pf, signo, ucode; u_int type; register_t addr, dr6; vm_offset_t eva; @@ -212,9 +209,6 @@ trap(struct trapframe *frame) td = curthread; p = td->td_proc; - signo = 0; - ucode = 0; - addr = 0; dr6 = 0; VM_CNT_INC(v_trap); @@ -365,6 +359,7 @@ user_trctrap_out: case T_STKFLT: /* stack fault */ if (frame->tf_eflags & PSL_VM) { signo = vm86_emulate((struct vm86frame *)frame); + ucode = 0; /* XXXKIB: better code ? */ if (signo == SIGTRAP) { load_dr6(rdr6() | 0x4000); goto user_trctrap_out; @@ -395,57 +390,23 @@ user_trctrap_out: break; case T_PAGEFLT: /* page fault */ - signo = trap_pfault(frame, TRUE, eva); + addr = eva; + pf = trap_pfault(frame, true, eva, &signo, &ucode); #if defined(I586_CPU) && !defined(NO_F00F_HACK) - if (signo == -2) { + if (pf == -2) { /* * The f00f hack workaround has triggered, so * treat the fault as an illegal instruction * (T_PRIVINFLT) instead of a page fault. */ type = frame->tf_trapno = T_PRIVINFLT; - - /* Proceed as in that case. */ - ucode = ILL_PRVOPC; - signo = SIGILL; break; } #endif - if (signo == -1) + if (pf == -1) return; - if (signo == 0) + if (pf == 0) goto user; - - if (signo == SIGSEGV) - ucode = SEGV_MAPERR; - else if (prot_fault_translation == 0) { - /* - * Autodetect. This check also covers - * the images without the ABI-tag ELF - * note. - */ - if (SV_CURPROC_ABI() == SV_ABI_FREEBSD && - p->p_osrel >= P_OSREL_SIGSEGV) { - signo = SIGSEGV; - ucode = SEGV_ACCERR; - } else { - signo = SIGBUS; - ucode = T_PAGEFLT; - } - } else if (prot_fault_translation == 1) { - /* - * Always compat mode. - */ - signo = SIGBUS; - ucode = T_PAGEFLT; - } else { - /* - * Always SIGSEGV mode. - */ - signo = SIGSEGV; - ucode = SEGV_ACCERR; - } - addr = eva; break; case T_DIVIDE: /* integer divide fault */ @@ -517,7 +478,7 @@ user_trctrap_out: ("kernel trap doesn't have ucred")); switch (type) { case T_PAGEFLT: /* page fault */ - (void) trap_pfault(frame, FALSE, eva); + (void)trap_pfault(frame, false, eva, NULL, NULL); return; case T_DNA: @@ -769,16 +730,31 @@ user: ("Return from trap with kernel FPU ctx leaked")); } +/* + * Handle all details of a page fault. + * Returns: + * -2 if the fault was caused by triggered workaround for Intel Pentium + * 0xf00f bug. + * -1 if this fault was fatal, typically from kernel mode + * (cannot happen, but we need to return something). + * 0 if this fault was handled by updating either the user or kernel + * page table, execution can continue. + * 1 if this fault was from usermode and it was not handled, a synchronous + * signal should be delivered to the thread. *signo returns the signal + * number, *ucode gives si_code. + */ static int -trap_pfault(struct trapframe *frame, int usermode, vm_offset_t eva) +trap_pfault(struct trapframe *frame, bool usermode, vm_offset_t eva, + int *signo, int *ucode) { struct thread *td; struct proc *p; - vm_offset_t va; vm_map_t map; int rv; vm_prot_t ftype; + MPASS(!usermode || (signo != NULL && ucode != NULL)); + td = curthread; p = td->td_proc; @@ -826,8 +802,7 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ return (-1); } } - va = trunc_page(eva); - if (va >= PMAP_TRM_MIN_ADDRESS) { + if (eva >= PMAP_TRM_MIN_ADDRESS) { /* * Don't allow user-mode faults in kernel address space. * An exception: if the faulting address is the invalid @@ -837,11 +812,17 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ * fault. */ #if defined(I586_CPU) && !defined(NO_F00F_HACK) - if ((eva == (unsigned int)&idt[6]) && has_f00f_bug) + if ((eva == (unsigned int)&idt[6]) && has_f00f_bug) { + *ucode = ILL_PRVOPC; + *signo = SIGILL; return (-2); + } #endif - if (usermode) - return (SIGSEGV); + if (usermode) { + *signo = SIGSEGV; + *ucode = SEGV_MAPERR; + return (1); + } trap_fatal(frame, eva); return (-1); } else { @@ -878,7 +859,7 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ ftype = VM_PROT_READ; /* Fault in the page. */ - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, eva, ftype, VM_FAULT_NORMAL, signo, ucode); if (rv == KERN_SUCCESS) { #ifdef HWPMC_HOOKS if (ftype == VM_PROT_READ || ftype == VM_PROT_WRITE) { @@ -893,16 +874,15 @@ trap_pfault(struct trapframe *frame, int usermode, vm_ #endif return (0); } - if (!usermode) { - if (td->td_intr_nesting_level == 0 && - curpcb->pcb_onfault != NULL) { - frame->tf_eip = (int)curpcb->pcb_onfault; - return (0); - } - trap_fatal(frame, eva); - return (-1); + if (usermode) + return (1); + if (td->td_intr_nesting_level == 0 && + curpcb->pcb_onfault != NULL) { + frame->tf_eip = (int)curpcb->pcb_onfault; + return (0); } - return ((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); + trap_fatal(frame, eva); + return (-1); } static void Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/kern/sys_process.c Fri Sep 27 18:43:36 2019 (r352807) @@ -286,7 +286,7 @@ proc_rwmem(struct proc *p, struct uio *uio) /* * Fault and hold the page on behalf of the process. */ - error = vm_fault_hold(map, pageno, reqprot, fault_flags, &m); + error = vm_fault(map, pageno, reqprot, fault_flags, &m); if (error != KERN_SUCCESS) { if (error == KERN_RESOURCE_SHORTAGE) error = ENOMEM; Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/mips/mips/trap.c Fri Sep 27 18:43:36 2019 (r352807) @@ -669,8 +669,9 @@ trap(struct trapframe *trapframe) int rv; kernel_fault: - va = trunc_page((vm_offset_t)trapframe->badvaddr); - rv = vm_fault(kernel_map, va, ftype, VM_FAULT_NORMAL); + va = (vm_offset_t)trapframe->badvaddr; + rv = vm_fault_trap(kernel_map, va, ftype, + VM_FAULT_NORMAL, NULL, NULL); if (rv == KERN_SUCCESS) return (trapframe->pc); if (td->td_pcb->pcb_onfault != NULL) { @@ -705,7 +706,7 @@ dofault: vm = p->p_vmspace; map = &vm->vm_map; - va = trunc_page((vm_offset_t)trapframe->badvaddr); + va = (vm_offset_t)trapframe->badvaddr; if (KERNLAND(trapframe->badvaddr)) { /* * Don't allow user-mode faults in kernel @@ -714,7 +715,8 @@ dofault: goto nogo; } - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, + &i, &ucode); /* * XXXDTRACE: add dtrace_doubletrap_func here? */ @@ -739,11 +741,6 @@ dofault: } goto err; } - i = SIGSEGV; - if (rv == KERN_PROTECTION_FAILURE) - ucode = SEGV_ACCERR; - else - ucode = SEGV_MAPERR; addr = trapframe->pc; msg = "BAD_PAGE_FAULT"; Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/powerpc/powerpc/trap.c Fri Sep 27 18:43:36 2019 (r352807) @@ -87,7 +87,8 @@ __FBSDID("$FreeBSD$"); static void trap_fatal(struct trapframe *frame); static void printtrap(u_int vector, struct trapframe *frame, int isfatal, int user); -static int trap_pfault(struct trapframe *frame, int user); +static bool trap_pfault(struct trapframe *frame, bool user, int *signo, + int *ucode); static int fix_unaligned(struct thread *td, struct trapframe *frame); static int handle_onfault(struct trapframe *frame); static void syscall(struct trapframe *frame); @@ -269,9 +270,8 @@ trap(struct trapframe *frame) #endif case EXC_DSI: case EXC_ISI: - sig = trap_pfault(frame, 1); - if (sig == SIGSEGV) - ucode = SEGV_MAPERR; + if (trap_pfault(frame, true, &sig, &ucode)) + sig = 0; break; case EXC_SC: @@ -460,7 +460,7 @@ trap(struct trapframe *frame) break; #endif case EXC_DSI: - if (trap_pfault(frame, 0) == 0) + if (trap_pfault(frame, false, NULL, NULL)) return; break; case EXC_MCHK: @@ -718,10 +718,10 @@ syscall(struct trapframe *frame) syscallret(td); } -static int -trap_pfault(struct trapframe *frame, int user) +static bool +trap_pfault(struct trapframe *frame, bool user, int *signo, int *ucode) { - vm_offset_t eva, va; + vm_offset_t eva; struct thread *td; struct proc *p; vm_map_t map; @@ -753,28 +753,27 @@ trap_pfault(struct trapframe *frame, int user) } else { rv = pmap_decode_kernel_ptr(eva, &is_user, &eva); if (rv != 0) - return (SIGSEGV); + return (false); if (is_user) map = &p->p_vmspace->vm_map; else map = kernel_map; } - va = trunc_page(eva); /* Fault in the page. */ - rv = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, eva, ftype, VM_FAULT_NORMAL, signo, ucode); /* * XXXDTRACE: add dtrace_doubletrap_func here? */ if (rv == KERN_SUCCESS) - return (0); + return (true); if (!user && handle_onfault(frame)) - return (0); + return (true); - return (SIGSEGV); + return (false); } /* Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/riscv/riscv/trap.c Fri Sep 27 18:43:36 2019 (r352807) @@ -217,14 +217,9 @@ data_abort(struct trapframe *frame, int usermode) if (pmap_fault_fixup(map->pmap, va, ftype)) goto done; - error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); + error = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, &sig, &ucode); if (error != KERN_SUCCESS) { if (usermode) { - sig = SIGSEGV; - if (error == KERN_PROTECTION_FAILURE) - ucode = SEGV_ACCERR; - else - ucode = SEGV_MAPERR; call_trapsignal(td, sig, ucode, (void *)stval); } else { if (pcb->pcb_onfault != 0) { Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/sparc64/sparc64/trap.c Fri Sep 27 18:43:36 2019 (r352807) @@ -91,7 +91,8 @@ void trap(struct trapframe *tf); void syscall(struct trapframe *tf); static int trap_cecc(void); -static int trap_pfault(struct thread *td, struct trapframe *tf); +static bool trap_pfault(struct thread *td, struct trapframe *tf, int *signo, + int *ucode); extern char copy_fault[]; extern char copy_nofault_begin[]; @@ -287,7 +288,8 @@ trap(struct trapframe *tf) addr = tf->tf_sfar; /* FALLTHROUGH */ case T_INSTRUCTION_MISS: - sig = trap_pfault(td, tf); + if (trap_pfault(td, tf, &sig, &ucode)) + sig = 0; break; case T_FILL: sig = rwindow_load(td, tf, 2); @@ -358,7 +360,7 @@ trap(struct trapframe *tf) case T_DATA_MISS: case T_DATA_PROTECTION: case T_INSTRUCTION_MISS: - error = trap_pfault(td, tf); + error = !trap_pfault(td, tf, &sig, &ucode); break; case T_DATA_EXCEPTION: case T_MEM_ADDRESS_NOT_ALIGNED: @@ -443,8 +445,8 @@ trap_cecc(void) return (0); } -static int -trap_pfault(struct thread *td, struct trapframe *tf) +static bool +trap_pfault(struct thread *td, struct trapframe *tf, int *signo, int *ucode) { vm_map_t map; struct proc *p; @@ -508,27 +510,27 @@ trap_pfault(struct thread *td, struct trapframe *tf) } /* Fault in the page. */ - rv = vm_fault(map, va, prot, VM_FAULT_NORMAL); + rv = vm_fault_trap(map, va, prot, VM_FAULT_NORMAL, signo, ucode); CTR3(KTR_TRAP, "trap_pfault: return td=%p va=%#lx rv=%d", td, va, rv); if (rv == KERN_SUCCESS) - return (0); + return (true); if (ctx != TLB_CTX_KERNEL && (tf->tf_tstate & TSTATE_PRIV) != 0) { if (tf->tf_tpc >= (u_long)fs_nofault_begin && tf->tf_tpc <= (u_long)fs_nofault_end) { tf->tf_tpc = (u_long)fs_fault; tf->tf_tnpc = tf->tf_tpc + 4; - return (0); + return (true); } if (tf->tf_tpc >= (u_long)copy_nofault_begin && tf->tf_tpc <= (u_long)copy_nofault_end) { tf->tf_tpc = (u_long)copy_fault; tf->tf_tnpc = tf->tf_tpc + 4; - return (0); + return (true); } } - return ((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV); + return (false); } /* Maximum number of arguments that can be passed via the out registers. */ Modified: head/sys/sys/signal.h ============================================================================== --- head/sys/sys/signal.h Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/sys/signal.h Fri Sep 27 18:43:36 2019 (r352807) @@ -315,11 +315,13 @@ struct siginfo32 { #define BUS_ADRALN 1 /* Invalid address alignment. */ #define BUS_ADRERR 2 /* Nonexistent physical address. */ #define BUS_OBJERR 3 /* Object-specific hardware error. */ +#define BUS_OOMERR 100 /* Non-standard: No memory. */ /* codes for SIGSEGV */ #define SEGV_MAPERR 1 /* Address not mapped to object. */ #define SEGV_ACCERR 2 /* Invalid permissions for mapped */ /* object. */ +#define SEGV_PKUERR 100 /* x86: PKU violation */ /* codes for SIGFPE */ #define FPE_INTOVF 1 /* Integer overflow. */ Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/vm/vm_extern.h Fri Sep 27 18:43:36 2019 (r352807) @@ -85,15 +85,16 @@ void kmeminit(void); int kernacc(void *, int, int); int useracc(void *, int, int); -int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int); +int vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, + int fault_flags, vm_page_t *m_hold); void vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t, vm_ooffset_t *); int vm_fault_disable_pagefaults(void); void vm_fault_enable_pagefaults(int save); -int vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, - int fault_flags, vm_page_t *m_hold); int vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len, vm_prot_t prot, vm_page_t *ma, int max_count); +int vm_fault_trap(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, + int fault_flags, int *signo, int *ucode); int vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int); void vm_waitproc(struct proc *); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Sep 27 18:39:05 2019 (r352806) +++ head/sys/vm/vm_fault.c Fri Sep 27 18:43:36 2019 (r352807) @@ -90,7 +90,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #ifdef KTRACE @@ -520,8 +522,19 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro return (KERN_SUCCESS); } +static int prot_fault_translation; +SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RWTUN, + &prot_fault_translation, 0, + "Control signal to deliver on protection fault"); + +/* compat definition to keep common code for signal translation */ +#define UCODE_PAGEFLT 12 +#ifdef T_PAGEFLT +_Static_assert(UCODE_PAGEFLT == T_PAGEFLT, "T_PAGEFLT"); +#endif + /* - * vm_fault: + * vm_fault_trap: * * Handle a page fault occurring at the given address, * requiring the given permissions, in the map specified. @@ -538,12 +551,13 @@ vm_fault_populate(struct faultstate *fs, vm_prot_t pro * Caller may hold no locks. */ int -vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, - int fault_flags) +vm_fault_trap(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type, + int fault_flags, int *signo, int *ucode) { struct thread *td; int result; + MPASS(signo == NULL || ucode != NULL); td = curthread; if ((td->td_pflags & TDP_NOFAULTING) != 0) return (KERN_PROTECTION_FAILURE); @@ -551,17 +565,69 @@ vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fa if (map != kernel_map && KTRPOINT(td, KTR_FAULT)) ktrfault(vaddr, fault_type); #endif - result = vm_fault_hold(map, trunc_page(vaddr), fault_type, fault_flags, + result = vm_fault(map, trunc_page(vaddr), fault_type, fault_flags, NULL); + KASSERT(result == KERN_SUCCESS || result == KERN_FAILURE || + result == KERN_INVALID_ADDRESS || + result == KERN_RESOURCE_SHORTAGE || + result == KERN_PROTECTION_FAILURE || + result == KERN_OUT_OF_BOUNDS, + ("Unexpected Mach error %d from vm_fault()", result)); #ifdef KTRACE if (map != kernel_map && KTRPOINT(td, KTR_FAULTEND)) ktrfaultend(result); #endif + if (result != KERN_SUCCESS && signo != NULL) { + switch (result) { + case KERN_FAILURE: + case KERN_INVALID_ADDRESS: + *signo = SIGSEGV; + *ucode = SEGV_MAPERR; + break; + case KERN_RESOURCE_SHORTAGE: + *signo = SIGBUS; + *ucode = BUS_OOMERR; + break; + case KERN_OUT_OF_BOUNDS: + *signo = SIGBUS; + *ucode = BUS_OBJERR; + break; + case KERN_PROTECTION_FAILURE: + if (prot_fault_translation == 0) { + /* + * Autodetect. This check also covers + * the images without the ABI-tag ELF + * note. + */ + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD && + curproc->p_osrel >= P_OSREL_SIGSEGV) { + *signo = SIGSEGV; + *ucode = SEGV_ACCERR; + } else { + *signo = SIGBUS; + *ucode = UCODE_PAGEFLT; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Sep 27 18:46:39 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 41A8F129F8F; Fri, 27 Sep 2019 18:46:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 46g13f2BN2z49Gr; Fri, 27 Sep 2019 18:46:37 +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 x8RIkNoU089051 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 27 Sep 2019 21:46:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x8RIkNoU089051 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x8RIkNin089050; Fri, 27 Sep 2019 21:46:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Sep 2019 21:46:23 +0300 From: Konstantin Belousov To: Mateusz Guzik Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352795 - head/lib/libc/sys Message-ID: <20190927184623.GM44691@kib.kiev.ua> References: <201909271611.x8RGBl0H036116@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) 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 X-Rspamd-Queue-Id: 46g13f2BN2z49Gr X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-2.70), ipnet: 2001:470::/32(-4.51), asn: 6939(-3.31), country: US(-0.05)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; 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: Fri, 27 Sep 2019 18:46:39 -0000 On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote: > On 9/27/19, Warner Losh wrote: > > Author: imp > > Date: Fri Sep 27 16:11:47 2019 > > New Revision: 352795 > > URL: https://svnweb.freebsd.org/changeset/base/352795 > > > > Log: > > Document varadic args as int, since you can't have short varadic args > > (they are > > promoted to ints). > > > > - `mode_t` is `uint16_t` (`sys/sys/_types.h`) > > - `openat` takes variadic args > > - variadic args cannot be 16-bit, and indeed the code uses int > > - the manpage currently kinda implies the argument is 16-bit by saying > > `mode_t` > > > > Prompted by Rust things: https://github.com/tailhook/openat/issues/21 > > Submitted by: Greg V at unrelenting > > Differential Revision: https://reviews.freebsd.org/D21816 > > > > Modified: > > head/lib/libc/sys/mq_open.2 > > head/lib/libc/sys/open.2 > > > > Modified: head/lib/libc/sys/mq_open.2 > > ============================================================================== > > --- head/lib/libc/sys/mq_open.2 Fri Sep 27 15:28:30 2019 (r352794) > > +++ head/lib/libc/sys/mq_open.2 Fri Sep 27 16:11:47 2019 (r352795) > > @@ -133,7 +133,7 @@ Create a message queue. > > It requires two additional arguments: > > .Fa mode , > > which is of type > > -.Vt mode_t , > > +.Vt int , > > and > > .Fa attr , > > which is a pointer to an > > > > Modified: head/lib/libc/sys/open.2 > > ============================================================================== > > --- head/lib/libc/sys/open.2 Fri Sep 27 15:28:30 2019 (r352794) > > +++ head/lib/libc/sys/open.2 Fri Sep 27 16:11:47 2019 (r352795) > > @@ -61,7 +61,7 @@ In this case > > and > > .Fn openat > > require an additional argument > > -.Fa "mode_t mode" , > > +.Fa "int mode" , > > and the file is created with mode > > .Fa mode > > as described in > > > > But opengroup says it is mode_t. Perhaps it is mode_t which needs > to be changed? Yes, users must pass mode_t, and the man page is written for users. Implementation needs to be aware of the implicit promotion and handle it accordingly. In theory, mode_t might be wider than int. From owner-svn-src-head@freebsd.org Fri Sep 27 18:49: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 0049D12A062; Fri, 27 Sep 2019 18:49:14 +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 46g16d69Dhz49Qk; Fri, 27 Sep 2019 18:49:13 +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 B75F21D24D; Fri, 27 Sep 2019 18:49:13 +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 x8RInDQR029238; Fri, 27 Sep 2019 18:49:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RInD0Y029237; Fri, 27 Sep 2019 18:49:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271849.x8RInD0Y029237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 18:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352808 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352808 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: Fri, 27 Sep 2019 18:49:14 -0000 Author: emaste Date: Fri Sep 27 18:49:13 2019 New Revision: 352808 URL: https://svnweb.freebsd.org/changeset/base/352808 Log: controlelf: simplify feature string parsing Also add error handling on failure to seek/write updated value. Modified: head/tools/tools/controlelf/controlelf.c Modified: head/tools/tools/controlelf/controlelf.c ============================================================================== --- head/tools/tools/controlelf/controlelf.c Fri Sep 27 18:43:36 2019 (r352807) +++ head/tools/tools/controlelf/controlelf.c Fri Sep 27 18:49:13 2019 (r352808) @@ -56,7 +56,7 @@ static void usage(void); struct ControlFeatures { const char *alias; - unsigned long featureVal; + unsigned long value; const char *desc; }; @@ -189,30 +189,19 @@ usage(void) static bool convert_to_feature_val(char *feature_str, u_int32_t *feature_val) { - char *feature_input, *feature; + char *feature; int i, len; u_int32_t input; - bool add, set; + char operation; - add = set = false; input = 0; - - if (feature_str[0] == '+') - add = true; - else if (feature_str[0] == '=') - set = true; - else if (feature_str[0] != '-') { - warnx("'%c' not an operator - use '+', '-', '='", - feature_str[0]); - return (false); - } - - feature_input = feature_str + 1; + operation = *feature_str; + feature_str++; len = nitems(featurelist); - while ((feature = strsep(&feature_input, ",")) != NULL) { + while ((feature = strsep(&feature_str, ",")) != NULL) { for (i = 0; i < len; ++i) { if (strcmp(featurelist[i].alias, feature) == 0) { - input |= featurelist[i].featureVal; + input |= featurelist[i].value; break; } } @@ -222,12 +211,16 @@ convert_to_feature_val(char *feature_str, u_int32_t *f } } - if (add) { + if (operation == '+') { *feature_val |= input; - } else if (set) { + } else if (operation == '=') { *feature_val = input; + } else if (operation == '-') { + *feature_val &= ~input; } else { - *feature_val -= (*feature_val) & input; + warnx("'%c' not an operator - use '+', '-', '='", + feature_str[0]); + return (false); } return (true); } @@ -246,8 +239,12 @@ edit_file_features(Elf *elf, int phcount, int fd, char if (!convert_to_feature_val(val, &features)) return (false); - lseek(fd, off, SEEK_SET); - write(fd, &features, sizeof(u_int32_t)); + if (lseek(fd, off, SEEK_SET) == -1 || + write(fd, &features, sizeof(features)) < + (ssize_t)sizeof(features)) { + warnx("error writing feature value"); + return (false); + } return (true); } @@ -277,7 +274,7 @@ print_file_features(Elf *elf, int phcount, int fd, cha printf("%s\t\t'%s' is ", featurelist[i].alias, featurelist[i].desc); - if ((featurelist[i].featureVal & features) == 0) + if ((featurelist[i].value & features) == 0) printf("un"); printf("set.\n"); From owner-svn-src-head@freebsd.org Fri Sep 27 19:07: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 0EC4C12A53F; Fri, 27 Sep 2019 19:07:12 +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 46g1WM6NLqz4BM1; Fri, 27 Sep 2019 19:07:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9D821D615; Fri, 27 Sep 2019 19:07:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8RJ7BLp041005; Fri, 27 Sep 2019 19:07:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RJ7B8S041004; Fri, 27 Sep 2019 19:07:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271907.x8RJ7B8S041004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 19:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352809 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352809 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: Fri, 27 Sep 2019 19:07:12 -0000 Author: emaste Date: Fri Sep 27 19:07:11 2019 New Revision: 352809 URL: https://svnweb.freebsd.org/changeset/base/352809 Log: controlelf: exit with error if file endianness does not match host We need to add support for cross-endian operation, but until that's done just exit with an error rather than misbehaving. Modified: head/tools/tools/controlelf/controlelf.c Modified: head/tools/tools/controlelf/controlelf.c ============================================================================== --- head/tools/tools/controlelf/controlelf.c Fri Sep 27 18:49:13 2019 (r352808) +++ head/tools/tools/controlelf/controlelf.c Fri Sep 27 19:07:11 2019 (r352809) @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -70,6 +71,12 @@ static struct option long_opts[] = { { NULL, 0, NULL, 0 } }; +#if BYTE_ORDER == LITTLE_ENDIAN +#define SUPPORTED_ENDIAN ELFDATA2LSB +#else +#define SUPPORTED_ENDIAN ELFDATA2MSB +#endif + int main(int argc, char **argv) { @@ -140,6 +147,15 @@ main(int argc, char **argv) if (gelf_getehdr(elf, &ehdr) == NULL) { warnx("gelf_getehdr: %s", elf_errmsg(-1)); + retval = 1; + goto fail; + } + /* + * XXX need to support cross-endian operation, but for now + * exit on error rather than misbehaving. + */ + if (ehdr.e_ident[EI_DATA] != SUPPORTED_ENDIAN) { + warnx("file endianness must match host"); retval = 1; goto fail; } From owner-svn-src-head@freebsd.org Fri Sep 27 19:12:21 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 420FC12A749; Fri, 27 Sep 2019 19:12:21 +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 46g1dK0yDSz4BlD; Fri, 27 Sep 2019 19:12:21 +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 04CEC1D7B7; Fri, 27 Sep 2019 19:12:21 +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 x8RJCKSF046035; Fri, 27 Sep 2019 19:12:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RJCKvn046034; Fri, 27 Sep 2019 19:12:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909271912.x8RJCKvn046034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 Sep 2019 19:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352810 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352810 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: Fri, 27 Sep 2019 19:12:21 -0000 Author: mjg Date: Fri Sep 27 19:12:20 2019 New Revision: 352810 URL: https://svnweb.freebsd.org/changeset/base/352810 Log: cache: stop recalculating upper limit each time a new entry is added Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Sep 27 19:07:11 2019 (r352809) +++ head/sys/kern/vfs_cache.c Fri Sep 27 19:12:20 2019 (r352810) @@ -214,7 +214,7 @@ SYSCTL_ULONG(_debug, OID_AUTO, numcache, CTLFLAG_RD, & static u_long __exclusive_cache_line numcachehv;/* number of cache entries with vnodes held */ SYSCTL_ULONG(_debug, OID_AUTO, numcachehv, CTLFLAG_RD, &numcachehv, 0, "Number of namecache entries with vnodes held"); -u_int __read_mostly ncsizefactor = 2; +u_int ncsizefactor = 2; SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0, "Size factor for namecache"); static u_int __read_mostly ncpurgeminvnodes; @@ -223,6 +223,7 @@ SYSCTL_UINT(_vfs, OID_AUTO, ncpurgeminvnodes, CTLFLAG_ static u_int __read_mostly ncneghitsrequeue = 8; SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsrequeue, CTLFLAG_RW, &ncneghitsrequeue, 0, "Number of hits to requeue a negative entry in the LRU list"); +static u_int __read_mostly ncsize; /* the size as computed on creation or resizing */ struct nchstats nchstats; /* cache effectiveness statistics */ @@ -1713,7 +1714,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * Avoid blowout in namecache entries. */ lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; - if (__predict_false(lnumcache >= desiredvnodes * ncsizefactor)) { + if (__predict_false(lnumcache >= ncsize)) { atomic_add_long(&numcache, -1); return; } @@ -1969,6 +1970,7 @@ nchinit(void *dummy __unused) NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), UMA_ZONE_ZINIT); + ncsize = desiredvnodes * ncsizefactor; nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); ncbuckethash = cache_roundup_2(mp_ncpus * mp_ncpus) - 1; if (ncbuckethash < 7) /* arbitrarily chosen to avoid having one lock */ @@ -2024,8 +2026,10 @@ cache_changesize(int newmaxvnodes) u_long new_nchash, old_nchash; struct namecache *ncp; uint32_t hash; + int newncsize; int i; + newncsize = newmaxvnodes * ncsizefactor; newmaxvnodes = cache_roundup_2(newmaxvnodes * 2); if (newmaxvnodes < numbucketlocks) newmaxvnodes = numbucketlocks; @@ -2055,6 +2059,7 @@ cache_changesize(int newmaxvnodes) LIST_INSERT_HEAD(NCHHASH(hash), ncp, nc_hash); } } + ncsize = newncsize; cache_unlock_all_buckets(); cache_unlock_all_vnodes(); free(old_nchashtbl, M_VFSCACHE); From owner-svn-src-head@freebsd.org Fri Sep 27 19:12: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 08FC812A7A4; Fri, 27 Sep 2019 19:12: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 46g1dl6PM9z4Bvw; Fri, 27 Sep 2019 19:12:43 +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 BEF1B1D7F2; Fri, 27 Sep 2019 19:12: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 x8RJChZL046795; Fri, 27 Sep 2019 19:12:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RJChaB046794; Fri, 27 Sep 2019 19:12:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909271912.x8RJChaB046794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 Sep 2019 19:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352811 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352811 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: Fri, 27 Sep 2019 19:12:44 -0000 Author: mjg Date: Fri Sep 27 19:12:43 2019 New Revision: 352811 URL: https://svnweb.freebsd.org/changeset/base/352811 Log: cache: make negative list shrinking a little bit concurrent Continue protecting demotion from the hotlist and selection of the target list with the ncneg_shrink_lock lock, but drop it before relocking to zap the node. While here count how many times we skipped shrinking due to the lock being already taken. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Sep 27 19:12:20 2019 (r352810) +++ head/sys/kern/vfs_cache.c Fri Sep 27 19:12:43 2019 (r352811) @@ -380,8 +380,6 @@ STATNODE_COUNTER(numfullpathfail2, "Number of fullpath search errors (VOP_VPTOCNP failures)"); STATNODE_COUNTER(numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); STATNODE_COUNTER(numfullpathfound, "Number of successful fullpath calls"); -static long numneg_evicted; STATNODE_ULONG(numneg_evicted, - "Number of negative entries evicted when adding a new entry"); STATNODE_COUNTER(zap_and_exit_bucket_relock_success, "Number of successful removals after relocking"); static long zap_and_exit_bucket_fail; STATNODE_ULONG(zap_and_exit_bucket_fail, @@ -392,6 +390,10 @@ static long cache_lock_vnodes_cel_3_failures; STATNODE_ULONG(cache_lock_vnodes_cel_3_failures, "Number of times 3-way vnode locking failed"); STATNODE_ULONG(numhotneg, "Number of hot negative entries"); +STATNODE_COUNTER(numneg_evicted, + "Number of negative entries evicted when adding a new entry"); +STATNODE_COUNTER(shrinking_skipped, + "Number of times shrinking was already in progress"); static void cache_zap_locked(struct namecache *ncp, bool neg_locked); static int vn_fullpath1(struct thread *td, struct vnode *vp, struct vnode *rdir, @@ -809,8 +811,10 @@ cache_negative_zap_one(void) struct rwlock *blp; if (mtx_owner(&ncneg_shrink_lock) != NULL || - !mtx_trylock(&ncneg_shrink_lock)) + !mtx_trylock(&ncneg_shrink_lock)) { + counter_u64_add(shrinking_skipped, 1); return; + } mtx_lock(&ncneg_hot.nl_lock); ncp = TAILQ_FIRST(&ncneg_hot.nl_list); @@ -831,8 +835,9 @@ cache_negative_zap_one(void) shrink_list_turn = 0; if (ncp == NULL && shrink_list_turn == 0) cache_negative_shrink_select(shrink_list_turn, &ncp, &neglist); + mtx_unlock(&ncneg_shrink_lock); if (ncp == NULL) - goto out; + return; MPASS(ncp->nc_flag & NCF_NEGATIVE); dvlp = VP2VNODELOCK(ncp->nc_dvp); @@ -845,19 +850,15 @@ cache_negative_zap_one(void) if (ncp != ncp2 || dvlp != VP2VNODELOCK(ncp2->nc_dvp) || blp != NCP2BUCKETLOCK(ncp2) || !(ncp2->nc_flag & NCF_NEGATIVE)) { ncp = NULL; - goto out_unlock_all; + } else { + SDT_PROBE3(vfs, namecache, shrink_negative, done, ncp->nc_dvp, + ncp->nc_name, ncp->nc_neghits); + cache_zap_locked(ncp, true); + counter_u64_add(numneg_evicted, 1); } - SDT_PROBE3(vfs, namecache, shrink_negative, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_neghits); - - cache_zap_locked(ncp, true); - numneg_evicted++; -out_unlock_all: mtx_unlock(&neglist->nl_lock); rw_wunlock(blp); mtx_unlock(dvlp); -out: - mtx_unlock(&ncneg_shrink_lock); cache_free(ncp); } @@ -2016,6 +2017,8 @@ nchinit(void *dummy __unused) numfullpathfail4 = counter_u64_alloc(M_WAITOK); numfullpathfound = counter_u64_alloc(M_WAITOK); zap_and_exit_bucket_relock_success = counter_u64_alloc(M_WAITOK); + numneg_evicted = counter_u64_alloc(M_WAITOK); + shrinking_skipped = counter_u64_alloc(M_WAITOK); } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL); From owner-svn-src-head@freebsd.org Fri Sep 27 19:13: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 9BB5012A82C; Fri, 27 Sep 2019 19:13:23 +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 46g1fW3Zldz4C5W; Fri, 27 Sep 2019 19:13:23 +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 5E2FC1D81B; Fri, 27 Sep 2019 19:13:23 +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 x8RJDNAE046872; Fri, 27 Sep 2019 19:13:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RJDNFF046871; Fri, 27 Sep 2019 19:13:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909271913.x8RJDNFF046871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 Sep 2019 19:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352812 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352812 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: Fri, 27 Sep 2019 19:13:23 -0000 Author: mjg Date: Fri Sep 27 19:13:22 2019 New Revision: 352812 URL: https://svnweb.freebsd.org/changeset/base/352812 Log: cache: stop requeuing negative entries on the hot list Turns out it does not improve hit ratio, but it does come with a cost induces stemming from dirtying hit entries. Sample result: hit counts of evicted entries after 2 buildworlds before: value ------------- Distribution ------------- count -1 | 0 0 |@@@@@@@@@@@@@@@@@@@@@@@@@ 180865 1 |@@@@@@@ 49150 2 |@@@ 19067 4 |@ 9825 8 |@ 7340 16 |@ 5952 32 |@ 5243 64 |@ 4446 128 | 3556 256 | 3035 512 | 1705 1024 | 1078 2048 | 365 4096 | 95 8192 | 34 16384 | 26 32768 | 23 65536 | 8 131072 | 6 262144 | 0 after: value ------------- Distribution ------------- count -1 | 0 0 |@@@@@@@@@@@@@@@@@@@@@@@@@ 184004 1 |@@@@@@ 47577 2 |@@@ 19446 4 |@ 10093 8 |@ 7470 16 |@ 5544 32 |@ 5475 64 |@ 5011 128 | 3451 256 | 3002 512 | 1729 1024 | 1086 2048 | 363 4096 | 86 8192 | 26 16384 | 25 32768 | 24 65536 | 7 131072 | 5 262144 | 0 Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Sep 27 19:12:43 2019 (r352811) +++ head/sys/kern/vfs_cache.c Fri Sep 27 19:13:22 2019 (r352812) @@ -92,10 +92,10 @@ SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE3(vfs, namecache, zap_negative, done, "struct vnode *", - "char *", "int"); -SDT_PROBE_DEFINE3(vfs, namecache, shrink_negative, done, "struct vnode *", - "char *", "int"); +SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", + "char *"); +SDT_PROBE_DEFINE2(vfs, namecache, shrink_negative, done, "struct vnode *", + "char *"); /* * This structure describes the elements in the cache of recent @@ -109,7 +109,6 @@ struct namecache { struct vnode *nc_dvp; /* vnode of parent of name */ union { struct vnode *nu_vp; /* vnode the name refers to */ - u_int nu_neghits; /* negative entry hits */ } n_un; u_char nc_flag; /* flag bits */ u_char nc_nlen; /* length of name */ @@ -132,7 +131,6 @@ struct namecache_ts { }; #define nc_vp n_un.nu_vp -#define nc_neghits n_un.nu_neghits /* * Flags in namecache.nc_flag @@ -220,9 +218,6 @@ SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, static u_int __read_mostly ncpurgeminvnodes; SYSCTL_UINT(_vfs, OID_AUTO, ncpurgeminvnodes, CTLFLAG_RW, &ncpurgeminvnodes, 0, "Number of vnodes below which purgevfs ignores the request"); -static u_int __read_mostly ncneghitsrequeue = 8; -SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsrequeue, CTLFLAG_RW, &ncneghitsrequeue, 0, - "Number of hits to requeue a negative entry in the LRU list"); static u_int __read_mostly ncsize; /* the size as computed on creation or resizing */ struct nchstats nchstats; /* cache effectiveness statistics */ @@ -676,8 +671,6 @@ SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE * * A variation of LRU scheme is used. New entries are hashed into one of * numneglists cold lists. Entries get promoted to the hot list on first hit. - * Partial LRU for the hot list is maintained by requeueing them every - * ncneghitsrequeue hits. * * The shrinker will demote hot list head and evict from the cold list in a * round-robin manner. @@ -686,28 +679,12 @@ static void cache_negative_hit(struct namecache *ncp) { struct neglist *neglist; - u_int hits; MPASS(ncp->nc_flag & NCF_NEGATIVE); - hits = atomic_fetchadd_int(&ncp->nc_neghits, 1); - if (ncp->nc_flag & NCF_HOTNEGATIVE) { - if ((hits % ncneghitsrequeue) != 0) - return; - mtx_lock(&ncneg_hot.nl_lock); - if (ncp->nc_flag & NCF_HOTNEGATIVE) { - TAILQ_REMOVE(&ncneg_hot.nl_list, ncp, nc_dst); - TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); - mtx_unlock(&ncneg_hot.nl_lock); - return; - } - /* - * The shrinker cleared the flag and removed the entry from - * the hot list. Put it back. - */ - } else { - mtx_lock(&ncneg_hot.nl_lock); - } + if (ncp->nc_flag & NCF_HOTNEGATIVE) + return; neglist = NCP2NEGLIST(ncp); + mtx_lock(&ncneg_hot.nl_lock); mtx_lock(&neglist->nl_lock); if (!(ncp->nc_flag & NCF_HOTNEGATIVE)) { numhotneg++; @@ -851,8 +828,9 @@ cache_negative_zap_one(void) blp != NCP2BUCKETLOCK(ncp2) || !(ncp2->nc_flag & NCF_NEGATIVE)) { ncp = NULL; } else { - SDT_PROBE3(vfs, namecache, shrink_negative, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_neghits); + SDT_PROBE2(vfs, namecache, shrink_negative, done, ncp->nc_dvp, + ncp->nc_name); + cache_zap_locked(ncp, true); counter_u64_add(numneg_evicted, 1); } @@ -887,8 +865,8 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke if (ncp == ncp->nc_vp->v_cache_dd) ncp->nc_vp->v_cache_dd = NULL; } else { - SDT_PROBE3(vfs, namecache, zap_negative, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_neghits); + SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, + ncp->nc_name); cache_negative_remove(ncp, neg_locked); } if (ncp->nc_flag & NCF_ISDOTDOT) { From owner-svn-src-head@freebsd.org Fri Sep 27 19:14: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 3794012A8A5; Fri, 27 Sep 2019 19:14:04 +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 46g1gJ0jsxz4CDP; Fri, 27 Sep 2019 19:14:04 +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 EFF0B1D81C; Fri, 27 Sep 2019 19:14:03 +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 x8RJE3Px046958; Fri, 27 Sep 2019 19:14:03 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RJE3u7046957; Fri, 27 Sep 2019 19:14:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201909271914.x8RJE3u7046957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 Sep 2019 19:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352813 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352813 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: Fri, 27 Sep 2019 19:14:04 -0000 Author: mjg Date: Fri Sep 27 19:14:03 2019 New Revision: 352813 URL: https://svnweb.freebsd.org/changeset/base/352813 Log: cache: decrease ncnegfactor to 5 The current mechanism is bogus in several ways: - the limit is a percentage of total entries added, which means negative entries get evicted all the time even if there are plenty of resources - evicting code is almost not concurrent, which makes it unable to remove entries fast enough when doing something as simple as -j 104 buildworld - there is no support for performing mass removal if necessary Vast majority of negative entries never get any hits. Only evicting them when the filesystem demands it results in a significant growth of the namecache with almost no improvement in the hit ratio. Sample result about afer 90 minutes of poudriere -j 104: current no evict % of the original numneg 219737 2013157 916 numneghits 266711906 263544562 98 [1] [1] this may look funny but there is a certain dose of variation to the build The number was chosen as something which mostly eliminates spurious evictions during lighter workloads but still keeps the total at bay. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Sep 27 19:13:22 2019 (r352812) +++ head/sys/kern/vfs_cache.c Fri Sep 27 19:14:03 2019 (r352813) @@ -200,7 +200,7 @@ static __read_mostly LIST_HEAD(nchashhead, namecache) static u_long __read_mostly nchash; /* size of hash table */ SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, "Size of namecache hash table"); -static u_long __read_mostly ncnegfactor = 12; /* ratio of negative entries */ +static u_long __read_mostly ncnegfactor = 5; /* ratio of negative entries */ SYSCTL_ULONG(_vfs, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0, "Ratio of negative namecache entries"); static u_long __exclusive_cache_line numneg; /* number of negative entries allocated */ From owner-svn-src-head@freebsd.org Fri Sep 27 19:17: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 2013512A9B2; Fri, 27 Sep 2019 19:17:42 +0000 (UTC) (envelope-from gallatin@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 46g1lV03Wyz4CSN; Fri, 27 Sep 2019 19:17:42 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D98481D875; Fri, 27 Sep 2019 19:17:41 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8RJHf7r047194; Fri, 27 Sep 2019 19:17:41 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RJHec7047188; Fri, 27 Sep 2019 19:17:40 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201909271917.x8RJHec7047188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 27 Sep 2019 19:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352814 - in head/sys: kern net opencrypto sys X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head/sys: kern net opencrypto sys X-SVN-Commit-Revision: 352814 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: Fri, 27 Sep 2019 19:17:42 -0000 Author: gallatin Date: Fri Sep 27 19:17:40 2019 New Revision: 352814 URL: https://svnweb.freebsd.org/changeset/base/352814 Log: kTLS support for TLS 1.3 TLS 1.3 requires a few changes because 1.3 pretends to be 1.2 with a record type of application data. The "real" record type is then included at the end of the user-supplied plaintext data. This required adding a field to the mbuf_ext_pgs struct to save the record type, and passing the real record type to the sw_encrypt() ktls backend functions. Reviewed by: jhb, hselasky Sponsored by: Netflix Differential Revision: D21801 Modified: head/sys/kern/uipc_ktls.c head/sys/net/iflib.c head/sys/opencrypto/ktls_ocf.c head/sys/sys/ktls.h head/sys/sys/mbuf.h Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Fri Sep 27 19:14:03 2019 (r352813) +++ head/sys/kern/uipc_ktls.c Fri Sep 27 19:17:40 2019 (r352814) @@ -389,14 +389,14 @@ ktls_create_session(struct socket *so, struct tls_enab if (en->tls_vmajor != TLS_MAJOR_VER_ONE) return (EINVAL); if (en->tls_vminor < TLS_MINOR_VER_ZERO || - en->tls_vminor > TLS_MINOR_VER_TWO) + en->tls_vminor > TLS_MINOR_VER_THREE) return (EINVAL); if (en->auth_key_len < 0 || en->auth_key_len > TLS_MAX_PARAM_SIZE) return (EINVAL); if (en->cipher_key_len < 0 || en->cipher_key_len > TLS_MAX_PARAM_SIZE) return (EINVAL); - if (en->iv_len < 0 || en->iv_len > TLS_MAX_PARAM_SIZE) + if (en->iv_len < 0 || en->iv_len > sizeof(tls->params.iv)) return (EINVAL); /* All supported algorithms require a cipher key. */ @@ -425,7 +425,10 @@ ktls_create_session(struct socket *so, struct tls_enab } if (en->auth_key_len != 0) return (EINVAL); - if (en->iv_len != TLS_AEAD_GCM_LEN) + if ((en->tls_vminor == TLS_MINOR_VER_TWO && + en->iv_len != TLS_AEAD_GCM_LEN) || + (en->tls_vminor == TLS_MINOR_VER_THREE && + en->iv_len != TLS_1_3_GCM_IV_LEN)) return (EINVAL); break; case CRYPTO_AES_CBC: @@ -477,8 +480,22 @@ ktls_create_session(struct socket *so, struct tls_enab tls->params.tls_hlen = sizeof(struct tls_record_layer); switch (en->cipher_algorithm) { case CRYPTO_AES_NIST_GCM_16: - tls->params.tls_hlen += 8; + /* + * TLS 1.2 uses a 4 byte implicit IV with an explicit 8 byte + * nonce. TLS 1.3 uses a 12 byte implicit IV. + */ + if (en->tls_vminor < TLS_MINOR_VER_THREE) + tls->params.tls_hlen += sizeof(uint64_t); tls->params.tls_tlen = AES_GMAC_HASH_LEN; + + /* + * TLS 1.3 includes optional padding which we + * do not support, and also puts the "real" record + * type at the end of the encrypted data. + */ + if (en->tls_vminor == TLS_MINOR_VER_THREE) + tls->params.tls_tlen += sizeof(uint8_t); + tls->params.tls_bs = 1; break; case CRYPTO_AES_CBC: @@ -539,7 +556,6 @@ ktls_create_session(struct socket *so, struct tls_enab * of the IV are generated in ktls_frame() and ktls_seq(). */ if (en->iv_len != 0) { - MPASS(en->iv_len <= sizeof(tls->params.iv)); tls->params.iv_len = en->iv_len; error = copyin(en->iv, tls->params.iv, en->iv_len); if (error) @@ -1188,8 +1204,21 @@ ktls_frame(struct mbuf *top, struct ktls_session *tls, /* Populate the TLS header. */ tlshdr = (void *)pgs->hdr; tlshdr->tls_vmajor = tls->params.tls_vmajor; - tlshdr->tls_vminor = tls->params.tls_vminor; - tlshdr->tls_type = record_type; + + /* + * TLS 1.3 masquarades as TLS 1.2 with a record type + * of TLS_RLTYPE_APP. + */ + if (tls->params.tls_vminor == TLS_MINOR_VER_THREE && + tls->params.tls_vmajor == TLS_MAJOR_VER_ONE) { + tlshdr->tls_vminor = TLS_MINOR_VER_TWO; + tlshdr->tls_type = TLS_RLTYPE_APP; + /* save the real record type for later */ + pgs->record_type = record_type; + } else { + tlshdr->tls_vminor = tls->params.tls_vminor; + tlshdr->tls_type = record_type; + } tlshdr->tls_length = htons(m->m_len - sizeof(*tlshdr)); /* @@ -1365,7 +1394,8 @@ retry_page: error = (*tls->sw_encrypt)(tls, (const struct tls_record_layer *)pgs->hdr, - pgs->trail, src_iov, dst_iov, i, pgs->seqno); + pgs->trail, src_iov, dst_iov, i, pgs->seqno, + pgs->record_type); if (error) { counter_u64_add(ktls_offload_failed_crypto, 1); break; Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Fri Sep 27 19:14:03 2019 (r352813) +++ head/sys/net/iflib.c Fri Sep 27 19:17:40 2019 (r352814) @@ -4076,7 +4076,7 @@ iflib_if_qflush(if_t ifp) #define IFCAP_FLAGS (IFCAP_HWCSUM_IPV6 | IFCAP_HWCSUM | IFCAP_LRO | \ IFCAP_TSO | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \ IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | \ - IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM) + IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_NOMAP) static int iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) @@ -4201,7 +4201,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) oldmask = if_getcapenable(ifp); mask = ifr->ifr_reqcap ^ oldmask; - mask &= ctx->ifc_softc_ctx.isc_capabilities; + mask &= ctx->ifc_softc_ctx.isc_capabilities | IFCAP_NOMAP; setmask = 0; #ifdef TCP_OFFLOAD setmask |= mask & (IFCAP_TOE4|IFCAP_TOE6); @@ -4596,8 +4596,10 @@ iflib_device_register(device_t dev, void *sc, if_share MPASS(scctx->isc_tx_csum_flags); #endif - if_setcapabilities(ifp, scctx->isc_capabilities | IFCAP_HWSTATS); - if_setcapenable(ifp, scctx->isc_capenable | IFCAP_HWSTATS); + if_setcapabilities(ifp, + scctx->isc_capabilities | IFCAP_HWSTATS | IFCAP_NOMAP); + if_setcapenable(ifp, + scctx->isc_capenable | IFCAP_HWSTATS | IFCAP_NOMAP); if (scctx->isc_ntxqsets == 0 || (scctx->isc_ntxqsets_max && scctx->isc_ntxqsets_max < scctx->isc_ntxqsets)) scctx->isc_ntxqsets = scctx->isc_ntxqsets_max; Modified: head/sys/opencrypto/ktls_ocf.c ============================================================================== --- head/sys/opencrypto/ktls_ocf.c Fri Sep 27 19:14:03 2019 (r352813) +++ head/sys/opencrypto/ktls_ocf.c Fri Sep 27 19:17:40 2019 (r352814) @@ -86,7 +86,7 @@ ktls_ocf_callback(struct cryptop *crp) static int ktls_ocf_encrypt(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *iniov, struct iovec *outiov, int iovcnt, - uint64_t seqno) + uint64_t seqno, uint8_t record_type __unused) { struct uio uio; struct tls_aead_data ad; Modified: head/sys/sys/ktls.h ============================================================================== --- head/sys/sys/ktls.h Fri Sep 27 19:14:03 2019 (r352813) +++ head/sys/sys/ktls.h Fri Sep 27 19:17:40 2019 (r352814) @@ -43,6 +43,7 @@ struct tls_record_layer { #define TLS_MAX_MSG_SIZE_V10_2 16384 #define TLS_MAX_PARAM_SIZE 1024 /* Max key/mac/iv in sockopt */ #define TLS_AEAD_GCM_LEN 4 +#define TLS_1_3_GCM_IV_LEN 12 #define TLS_CBC_IMPLICIT_IV_LEN 16 /* Type values for the record layer */ @@ -85,6 +86,7 @@ struct tls_mac_data { #define TLS_MINOR_VER_ZERO 1 /* 3, 1 */ #define TLS_MINOR_VER_ONE 2 /* 3, 2 */ #define TLS_MINOR_VER_TWO 3 /* 3, 3 */ +#define TLS_MINOR_VER_THREE 4 /* 3, 4 */ /* For TCP_TXTLS_ENABLE */ struct tls_enable { @@ -121,7 +123,7 @@ struct tls_session_params { #ifdef _KERNEL -#define KTLS_API_VERSION 5 +#define KTLS_API_VERSION 6 struct iovec; struct ktls_session; @@ -144,7 +146,7 @@ struct ktls_session { int (*sw_encrypt)(struct ktls_session *tls, const struct tls_record_layer *hdr, uint8_t *trailer, struct iovec *src, struct iovec *dst, int iovcnt, - uint64_t seqno); + uint64_t seqno, uint8_t record_type); union { void *cipher; struct m_snd_tag *snd_tag; Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Fri Sep 27 19:14:03 2019 (r352813) +++ head/sys/sys/mbuf.h Fri Sep 27 19:17:40 2019 (r352814) @@ -359,6 +359,7 @@ struct mbuf_ext_pgs { union { char trail[MBUF_PEXT_TRAIL_LEN]; /* TLS trailer */ struct { + uint8_t record_type; /* Must be first */ struct socket *so; struct mbuf *mbuf; uint64_t seqno; From owner-svn-src-head@freebsd.org Fri Sep 27 19:26: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 CB09212AF76; Fri, 27 Sep 2019 19:26: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 46g1y454l3z4DC3; Fri, 27 Sep 2019 19:26: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 8D1E91DA56; Fri, 27 Sep 2019 19:26: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 x8RJQqHD053055; Fri, 27 Sep 2019 19:26:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RJQqfB053054; Fri, 27 Sep 2019 19:26:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201909271926.x8RJQqfB053054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Sep 2019 19:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352815 - head/tools/tools/controlelf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/controlelf X-SVN-Commit-Revision: 352815 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: Fri, 27 Sep 2019 19:26:52 -0000 Author: emaste Date: Fri Sep 27 19:26:52 2019 New Revision: 352815 URL: https://svnweb.freebsd.org/changeset/base/352815 Log: controlelf: update man page Some minor corrections, clarifications or rewording. Modified: head/tools/tools/controlelf/controlelf.1 Modified: head/tools/tools/controlelf/controlelf.1 ============================================================================== --- head/tools/tools/controlelf/controlelf.1 Fri Sep 27 19:17:40 2019 (r352814) +++ head/tools/tools/controlelf/controlelf.1 Fri Sep 27 19:26:52 2019 (r352815) @@ -26,12 +26,12 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2019 +.Dd September 27, 2019 .Dt CONTROLELF 1 .Os .Sh NAME .Nm controlelf -.Nd change an ELF binary's control features +.Nd change an ELF binary's feature control note .Sh SYNOPSIS .Nm .Op Fl h | Fl -help @@ -41,33 +41,33 @@ .Sh DESCRIPTION The .Nm -utility modifies an ELF binary to change it's control features. +utility modifies feature flags in the feature control note in an ELF binary. .Pp The options are as follows: .Bl -tag -width indent .It Fl h | Fl -help Print a usage message and exit. .It Fl l -Writes the list of all known ELF types to standard output. +List known ELF feature flags. .It Fl e Ar featurelist Edit features from the given comma separated list .Ar featurelist . .Ar featurelist -starts with one of the three modes: +starts with one of the three operations: .Dq Li + to turn on the features, .Dq Li - to turn off the features, .Dq Li = to only turn on the given features. -Followed by a comma separated features. +A comma separated list of feature names follows the operation. .El .Pp If -.Fl e , -option wasn't specified, +.Fl e +is not specified .Nm -will display the current control features for the files named by the arguments +displays the status of each feature in the ELF note in each .Ar . .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command @@ -83,10 +83,12 @@ controlelf file controlelf -e +aslr file .Ed .Sh HISTORY -The .Nm -manual page first appeared in +first appeared in .Fx 13.0 . .Sh AUTHORS -This manual page was written by -.An Bora Ozarslan Mt borako.ozarslan@gmail.com . +.Nm +was written by +.An Bora Ozarslan Mt borako.ozarslan@gmail.com +under sponsorship from the +.Fx Foundation. From owner-svn-src-head@freebsd.org Fri Sep 27 20:08:20 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 AF9B912B8EE; Fri, 27 Sep 2019 20:08:20 +0000 (UTC) (envelope-from gallatin@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 46g2sw4H62z4FyT; Fri, 27 Sep 2019 20:08:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 764481E1EF; Fri, 27 Sep 2019 20:08:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8RK8KY3076944; Fri, 27 Sep 2019 20:08:20 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RK8JNu076941; Fri, 27 Sep 2019 20:08:19 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201909272008.x8RK8JNu076941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 27 Sep 2019 20:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352816 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 352816 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: Fri, 27 Sep 2019 20:08:20 -0000 Author: gallatin Date: Fri Sep 27 20:08:19 2019 New Revision: 352816 URL: https://svnweb.freebsd.org/changeset/base/352816 Log: kTLS: Fix a bug where we would not encrypt anon data inplace. Software Kernel TLS needs to allocate a new destination crypto buffer when encrypting data from the page cache, so as to avoid overwriting shared clear-text file data with encrypted data specific to a single socket. When the data is anonymous, eg, not tied to a file, then we can encrypt in place and avoid allocating a new page. This fixes a bug where the existing code always assumes the data is private, and never encrypts in place. This results in unneeded page allocations and potentially more memory bandwidth consumption when doing socket writes. When the code was written at Netflix, ktls_encrypt() looked at private sendfile flags to determine if the pages being encrypted where part of the page cache (coming from sendfile) or anonymous (coming from sosend). This was broken internally at Netflix when the sendfile flags were made private, and the M_WRITABLE() check was added. Unfortunately, M_WRITABLE() will always be false for M_NOMAP mbufs, since one cannot just mtod() them. This change introduces a new flags field to the mbuf_ext_pgs struct by stealing a byte from the tls hdr. Note that the current header is still 2 bytes larger than the largest header we support: AES-CBC with explicit IV. We set MBUF_PEXT_FLAG_ANON when creating an unmapped mbuf in m_uiotombuf_nomap() (which is the path that socket writes take), and we check for that flag in ktls_encrypt() when looking for anon pages. Reviewed by: jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21796 Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_ktls.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri Sep 27 19:26:52 2019 (r352815) +++ head/sys/kern/kern_mbuf.c Fri Sep 27 20:08:19 2019 (r352816) @@ -1171,6 +1171,7 @@ mb_alloc_ext_pgs(int how, bool pkthdr, m_ext_free_t ex ext_pgs->nrdy = 0; ext_pgs->first_pg_off = 0; ext_pgs->last_pg_len = 0; + ext_pgs->flags = 0; ext_pgs->hdr_len = 0; ext_pgs->trail_len = 0; ext_pgs->tls = NULL; Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Fri Sep 27 19:26:52 2019 (r352815) +++ head/sys/kern/uipc_ktls.c Fri Sep 27 20:08:19 2019 (r352816) @@ -1363,7 +1363,7 @@ ktls_encrypt(struct mbuf_ext_pgs *pgs) * (from sendfile), anonymous wired pages are * allocated and assigned to the destination iovec. */ - is_anon = M_WRITABLE(m); + is_anon = (pgs->flags & MBUF_PEXT_FLAG_ANON) != 0; off = pgs->first_pg_off; for (i = 0; i < pgs->npgs; i++, off = 0) { @@ -1416,6 +1416,9 @@ retry_page: /* Use the basic free routine. */ m->m_ext.ext_free = mb_free_mext_pgs; + + /* Pages are now writable. */ + pgs->flags |= MBUF_PEXT_FLAG_ANON; } /* Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Fri Sep 27 19:26:52 2019 (r352815) +++ head/sys/kern/uipc_mbuf.c Fri Sep 27 20:08:19 2019 (r352816) @@ -1664,6 +1664,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, i prev->m_next = mb; prev = mb; pgs = mb->m_ext.ext_pgs; + pgs->flags = MBUF_PEXT_FLAG_ANON; needed = length = MIN(maxseg, total); for (i = 0; needed > 0; i++, needed -= PAGE_SIZE) { retry_page: Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Fri Sep 27 19:26:52 2019 (r352815) +++ head/sys/sys/mbuf.h Fri Sep 27 20:08:19 2019 (r352816) @@ -312,7 +312,7 @@ struct socket; * - 21 (AES-CBC with explicit IV) * - 13 (AES-GCM with 8 byte explicit IV) */ -#define MBUF_PEXT_HDR_LEN 24 +#define MBUF_PEXT_HDR_LEN 23 /* * TLS records for TLS 1.0-1.2 can have the following maximum trailer @@ -333,6 +333,8 @@ struct socket; #define MBUF_PEXT_MAX_BYTES \ (MBUF_PEXT_MAX_PGS * PAGE_SIZE + MBUF_PEXT_HDR_LEN + MBUF_PEXT_TRAIL_LEN) +#define MBUF_PEXT_FLAG_ANON 1 /* Data can be encrypted in place. */ + /* * This struct is 256 bytes in size and is arranged so that the most * common case (accessing the first 4 pages of a 16KB TLS record) will @@ -347,6 +349,7 @@ struct mbuf_ext_pgs { uint16_t last_pg_len; /* Length of last page */ vm_paddr_t pa[MBUF_PEXT_MAX_PGS]; /* phys addrs of pages */ char hdr[MBUF_PEXT_HDR_LEN]; /* TLS header */ + uint8_t flags; /* Flags */ struct ktls_session *tls; /* TLS session */ #if defined(__i386__) || \ (defined(__powerpc__) && !defined(__powerpc64__) && defined(BOOKE)) From owner-svn-src-head@freebsd.org Fri Sep 27 20:20: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 7B59512BBF9; Fri, 27 Sep 2019 20:20:22 +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 46g37p2mYDz4Gd4; Fri, 27 Sep 2019 20:20:22 +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 432D91E3BA; Fri, 27 Sep 2019 20:20:22 +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 x8RKKMFd083024; Fri, 27 Sep 2019 20:20:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RKKL8d083022; Fri, 27 Sep 2019 20:20:21 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909272020.x8RKKL8d083022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 27 Sep 2019 20:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352818 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 352818 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: Fri, 27 Sep 2019 20:20:22 -0000 Author: dim Date: Fri Sep 27 20:20:21 2019 New Revision: 352818 URL: https://svnweb.freebsd.org/changeset/base/352818 Log: Make fractional delays for top(1) work for interactive mode. In r334906, the -s option was changed to allow fractional times, but this only functioned correctly for batch mode. In interactive mode, any delay below 1.0 would get floored to zero. This would put top(1) into a tight loop, which could be difficult to interrupt. Fix this by storing the -s option value (after validation) into a struct timeval, and using that struct consistently for delaying with select(2). Next up is to allow interactive entry of a fractional delay value. MFC after: 3 days Modified: head/usr.bin/top/top.1 head/usr.bin/top/top.c Modified: head/usr.bin/top/top.1 ============================================================================== --- head/usr.bin/top/top.1 Fri Sep 27 20:09:43 2019 (r352817) +++ head/usr.bin/top/top.1 Fri Sep 27 20:20:21 2019 (r352818) @@ -147,7 +147,7 @@ no information is available about the percentage of ti .It Fl s Ar time Set the delay between screen updates to .Ar time -seconds. +seconds, which may be fractional. The default delay between updates is 1 second. .It Fl o Ar field Sort the process display area on the specified field. Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Fri Sep 27 20:09:43 2019 (r352817) +++ head/usr.bin/top/top.c Fri Sep 27 20:20:21 2019 (r352818) @@ -233,7 +233,7 @@ main(int argc, const char *argv[]) static char tempbuf2[50]; sigset_t old_sigmask, new_sigmask; int topn = Infinity; - double delay = 2; + struct timeval delay = { 2, 0 }; int displays = 0; /* indicates unspecified */ int sel_ret = 0; time_t curr_time; @@ -377,21 +377,27 @@ main(int argc, const char *argv[]) break; } - case 's': - delay = strtod(optarg, &nptr); - if (nptr == optarg) { - warnx("warning: invalid delay"); - delay = 2; - warnings++; - } - if (delay < 0) { - warnx("warning: seconds delay should be positive -- using default"); - delay = 2; - warnings++; - } + case 's': + { + double delay_d = strtod(optarg, &nptr); + if (nptr == optarg) + { + warnx("warning: invalid delay"); + warnings++; + } + else if (delay_d <= 0) + { + warnx("warning: seconds delay should be positive -- using default"); + warnings++; + } + else + { + delay.tv_sec = delay_d; + delay.tv_usec = (delay_d - delay.tv_sec) * 1e6; + } + break; + } - break; - case 'q': /* be quick about it */ errno = 0; i = setpriority(PRIO_PROCESS, 0, PRIO_MIN); @@ -704,7 +710,8 @@ restart: no_command = true; if (!interactive) { - usleep(delay * 1e6); + timeout = delay; + select(0, NULL, NULL, NULL, &timeout); if (leaveflag) { end_screen(); exit(0); @@ -718,8 +725,7 @@ restart: /* set up arguments for select with timeout */ FD_ZERO(&readfds); FD_SET(0, &readfds); /* for standard input */ - timeout.tv_sec = delay; - timeout.tv_usec = 0; + timeout = delay; if (leaveflag) { end_screen(); @@ -880,12 +886,10 @@ restart: case CMD_delay: /* new seconds delay */ new_message(MT_standout, "Seconds to delay: "); - if ((i = readline(tempbuf1, 8, true)) > -1) + if ((i = readline(tempbuf1, 8, true)) > 0) { - if ((delay = i) == 0) - { - delay = 1; - } + delay.tv_sec = i; + delay.tv_usec = 0; } clear_message(); break; From owner-svn-src-head@freebsd.org Fri Sep 27 20:24: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 5217412BE31; Fri, 27 Sep 2019 20:24:07 +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 46g3D546b6z4H2q; Fri, 27 Sep 2019 20:24:04 +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 C8FC0361B01; Sat, 28 Sep 2019 06:24:00 +1000 (AEST) Date: Sat, 28 Sep 2019 06:23:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Mateusz Guzik , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r352795 - head/lib/libc/sys In-Reply-To: <20190927184623.GM44691@kib.kiev.ua> Message-ID: <20190928051802.Y3006@besplex.bde.org> References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@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 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=2Z3r3uBQAAAA:20 a=ELv_8EtWw7of5XQUhMEA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 46g3D546b6z4H2q X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of brde@optusnet.com.au designates 211.29.132.249 as permitted sender) smtp.mailfrom=brde@optusnet.com.au X-Spamd-Result: default: False [-2.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_TWO(0.00)[2]; RWL_MAILSPIKE_POSSIBLE(0.00)[249.132.29.211.rep.mailspike.net : 127.0.0.17]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[optusnet.com.au]; R_SPF_ALLOW(-0.20)[+ip4:211.29.132.0/23]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[optusnet.com.au]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-5.35), ipnet: 211.28.0.0/14(-3.27), asn: 4804(-2.41), country: AU(0.01)]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[249.132.29.211.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[optusnet.com.au]; ASN(0.00)[asn:4804, ipnet:211.28.0.0/14, country:AU]; FREEMAIL_CC(0.00)[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: Fri, 27 Sep 2019 20:24:07 -0000 On Fri, 27 Sep 2019, Konstantin Belousov wrote: > On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote: >> On 9/27/19, Warner Losh wrote: >>> Author: imp >>> Date: Fri Sep 27 16:11:47 2019 >>> New Revision: 352795 >>> URL: https://svnweb.freebsd.org/changeset/base/352795 >>> >>> Log: >>> Document varadic args as int, since you can't have short varadic args >>> (they are >>> promoted to ints). >>> >>> - `mode_t` is `uint16_t` (`sys/sys/_types.h`) >>> - `openat` takes variadic args >>> - variadic args cannot be 16-bit, and indeed the code uses int >>> - the manpage currently kinda implies the argument is 16-bit by saying >>> `mode_t` >>> >>> Prompted by Rust things: https://github.com/tailhook/openat/issues/21 >>> Submitted by: Greg V at unrelenting >>> Differential Revision: https://reviews.freebsd.org/D21816 >>> >>> Modified: >>> head/lib/libc/sys/mq_open.2 >>> head/lib/libc/sys/open.2 >>> >>> Modified: head/lib/libc/sys/mq_open.2 >>> ============================================================================== >>> --- head/lib/libc/sys/mq_open.2 Fri Sep 27 15:28:30 2019 (r352794) >>> +++ head/lib/libc/sys/mq_open.2 Fri Sep 27 16:11:47 2019 (r352795) >>> @@ -133,7 +133,7 @@ Create a message queue. >>> It requires two additional arguments: >>> .Fa mode , >>> which is of type >>> -.Vt mode_t , >>> +.Vt int , >>> and >>> .Fa attr , >>> which is a pointer to an >>> >>> Modified: head/lib/libc/sys/open.2 >>> ============================================================================== >>> --- head/lib/libc/sys/open.2 Fri Sep 27 15:28:30 2019 (r352794) >>> +++ head/lib/libc/sys/open.2 Fri Sep 27 16:11:47 2019 (r352795) >>> @@ -61,7 +61,7 @@ In this case >>> and >>> .Fn openat >>> require an additional argument >>> -.Fa "mode_t mode" , >>> +.Fa "int mode" , >>> and the file is created with mode >>> .Fa mode >>> as described in >> >> But opengroup says it is mode_t. Perhaps it is mode_t which needs >> to be changed? POSIX needed to be changed before it became standard in 1988, but it is too late now. Types shorter than int shouldn't be used in APIs since they cause ABI and API problems. Especially in 1988 when non-prototyped functions were common. Non-prototyped functions use the default promotions much like variadic functions. open() is variadic, so its mode_t arg is always promoted, but 'int chmod(const char *path, mode_t mode)' is just wrong since in 1988 prototypes were not required and the prototype matching the K&R API was 'int chmod(const char *path, __default_promotion_of(mode_t) mode)'. > Yes, users must pass mode_t, and the man page is written for users. > Implementation needs to be aware of the implicit promotion and handle > it accordingly. > > In theory, mode_t might be wider than int. Indeed. mode_t can also be the same size as int, but unsigned. This happens naturally if int is 16 bits, which POSIX allowed before 2001. In V7, mode_t was really a 16-bit u_int, but it was type-punned to int. When mode_t is u_int or wider than int, then the promotion is null, and variadic and K&R do it consistently (but the arg type before the call must be precisely mode_t, not int). The POSIX list recently discussed a related problem with variadic pid_t args for fcntl(). For F_SETOWN, the original arg type should be pid_t as for mode_t for open(). Howver, F_GETOWN only returns int, so pids larger than INT_MAX cannot work and making pid_t different from int is just foot shooting. Bruce From owner-svn-src-head@freebsd.org Fri Sep 27 20:37: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 B651E12C40B; Fri, 27 Sep 2019 20:37:59 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) (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 46g3X70Pcpz4HqQ; Fri, 27 Sep 2019 20:37:58 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-ot1-x341.google.com with SMTP id s22so3392006otr.6; Fri, 27 Sep 2019 13:37:58 -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=OffG3ovIMvd58uspKI5SUnIVxLKpvULuNsqOLYoTOuk=; b=B2il52UGrGbk3+XjXXS5WgkfOC14zCBioXGkYz5dwBBHpbG6olTBisdvhRfqn28yEK mL0vzGeZTJqbnQ1SCOmKHoE2iQb7JEnz2o+DLqYSbbrnEiR0NEEZ0mB2OqoBDQnczbNx alJfbrE6rSsb53bAEjrxEWk8X1pEMmQD+EQDi1TdSROmGuL+S7+5nP9lCrxGthn3aLwz MRJrrxURjVHbPY/+BSFbCz1+gy6RLNBKMGrgaXPMq9M27SrU7wtZIzhm1bNYCZE+kvAn pJYKWNI1pesaG7Kg2mwlRs/wCRkXVxr+E3TawjgglyvRmVlAV4RjoHkAM2VOulvyRrgO iffA== 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=OffG3ovIMvd58uspKI5SUnIVxLKpvULuNsqOLYoTOuk=; b=MetvEk5rVn+yCzPF98tXASQ7OtF2azzM4HwGB0rfepah2oWynpNrqkVOyg2cLBzZm2 EQe/axdlm6BA3O4DpVACLjqVTa3moIGmGAdNb7R1QUys9OSC18gpwWG4S3SUd1fvyKwx ORo5sgoDUpTzYEte8xZbSOd6d0y45A+Z/dY39NcxTr/DKlpY4H8Q/zmQmshjkzf1Djab NZbLKiNhZXA0y2VkojIl5STWUVIJIVPLFJ1Ul9UCxQ3F5guoEnXclellPWlBkL6JsKMl N5PH1BDsWQxSr5OWnYORJoRH2T/FPQ9qgAAYGd4AeA9Bnqh3FeBpVYstiYYwj4n/72D7 Uz1g== X-Gm-Message-State: APjAAAUQ9NET05croBgeN/nq7N6iPfF0S2TuvIG5wnmdSzFelkWzlhV2 FN3IBfzXfstw+oYL/Jhr9wNr8LQzoUwadbX4jK0= X-Google-Smtp-Source: APXvYqzyx6juSXnuPIzFbOLe/2hFYNSLLTVjUBwEXxc0nDxIeGPHBTEDDLrPJDTsGoaIwlqDpCnv04R96WAIGlk8G9k= X-Received: by 2002:a9d:61d0:: with SMTP id h16mr4522916otk.84.1569616677449; Fri, 27 Sep 2019 13:37:57 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:458d:0:0:0:0:0 with HTTP; Fri, 27 Sep 2019 13:37:56 -0700 (PDT) In-Reply-To: <20190927184623.GM44691@kib.kiev.ua> References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> From: Mateusz Guzik Date: Fri, 27 Sep 2019 22:37:56 +0200 Message-ID: Subject: Re: svn commit: r352795 - head/lib/libc/sys To: Konstantin Belousov Cc: Warner Losh , 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: 46g3X70Pcpz4HqQ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=B2il52UG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::341 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.00 / 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)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (3.06), ipnet: 2607:f8b0::/32(-2.59), asn: 15169(-2.17), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; 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)[1.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]; FREEMAIL_TO(0.00)[gmail.com]; 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: Fri, 27 Sep 2019 20:37:59 -0000 On 9/27/19, Konstantin Belousov wrote: > On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote: >> On 9/27/19, Warner Losh wrote: >> > Document varadic args as int, since you can't have short varadic args >> > (they are >> > promoted to ints). >> > >> > - `mode_t` is `uint16_t` (`sys/sys/_types.h`) >> > - `openat` takes variadic args >> > - variadic args cannot be 16-bit, and indeed the code uses int >> > - the manpage currently kinda implies the argument is 16-bit by >> > saying >> > `mode_t` >> > >> But opengroup says it is mode_t. Perhaps it is mode_t which needs >> to be changed? > > Yes, users must pass mode_t, and the man page is written for users. > Implementation needs to be aware of the implicit promotion and handle > it accordingly. > > In theory, mode_t might be wider than int. > So I think the change should be reverted. Whatever workaround is being in place in rust should remain for the current codebase. If anyone is to fixed the problem they should bump mode_t to uint32_t, to match Linux. This is ABI breakage, I don't know how that's handled. I have no interest in handling any of this, but the change committed is definitely wrong. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Sep 27 20:53: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 BDF3212CB0F; Fri, 27 Sep 2019 20:53:32 +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 46g3t44gd9z4JrR; Fri, 27 Sep 2019 20:53:32 +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 84C411EAD0; Fri, 27 Sep 2019 20:53:32 +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 x8RKrWfQ006564; Fri, 27 Sep 2019 20:53:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RKrWwc006563; Fri, 27 Sep 2019 20:53:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909272053.x8RKrWwc006563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 27 Sep 2019 20:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352819 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 352819 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: Fri, 27 Sep 2019 20:53:32 -0000 Author: dim Date: Fri Sep 27 20:53:31 2019 New Revision: 352819 URL: https://svnweb.freebsd.org/changeset/base/352819 Log: Allow entering fractional delays in top(1) interactive mode. This uses the same logic as with the -s option, first validating the entered value, then storing the result in a struct timeval. MFC after: 3 days X-MFC-With: r352818 Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Fri Sep 27 20:20:21 2019 (r352818) +++ head/usr.bin/top/top.c Fri Sep 27 20:53:31 2019 (r352819) @@ -886,12 +886,22 @@ restart: case CMD_delay: /* new seconds delay */ new_message(MT_standout, "Seconds to delay: "); - if ((i = readline(tempbuf1, 8, true)) > 0) + if ((i = readline(tempbuf1, 8, false)) > 0) { - delay.tv_sec = i; - delay.tv_usec = 0; + double delay_d = strtod(tempbuf1, &nptr); + if (nptr == tempbuf1 || delay_d <= 0) + { + new_message(MT_standout, " Invalid delay"); + putchar('\r'); + no_command = true; + } + else + { + delay.tv_sec = delay_d; + delay.tv_usec = (delay_d - delay.tv_sec) * 1e6; + clear_message(); + } } - clear_message(); break; case CMD_displays: /* change display count */ From owner-svn-src-head@freebsd.org Fri Sep 27 20:56: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 274B712CC5E; Fri, 27 Sep 2019 20:56:32 +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 46g3xX0DHVz4K2f; Fri, 27 Sep 2019 20:56:32 +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 DFC611EAD3; Fri, 27 Sep 2019 20:56:31 +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 x8RKuVFH006794; Fri, 27 Sep 2019 20:56:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RKuVwU006793; Fri, 27 Sep 2019 20:56:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909272056.x8RKuVwU006793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Sep 2019 20:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352820 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 352820 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: Fri, 27 Sep 2019 20:56:32 -0000 Author: imp Date: Fri Sep 27 20:56:31 2019 New Revision: 352820 URL: https://svnweb.freebsd.org/changeset/base/352820 Log: Remove workaround for building on FreeBSD hosts prior to FreeBSD 10. rm -x was introduced in the FreeBSD 10 time frame. 4 years ago I added a function to cope with building nanobsd images on hosts as old FreeBSD 7 that lacked rm -x. The workaround is no longer needed as FreeBSD 9 hasn't been supported for almost 3 years. Eliminate the wrapper and use rm -x directly again. Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Fri Sep 27 20:53:31 2019 (r352819) +++ head/tools/tools/nanobsd/defaults.sh Fri Sep 27 20:56:31 2019 (r352820) @@ -241,16 +241,6 @@ nano_global_make_env ( ) ( [ -z "${NANO_CPUTYPE}" ] || echo TARGET_CPUTYPE="${NANO_CPUTYPE}" ) -# rm doesn't know -x prior to FreeBSD 10, so cope with a variety of build -# hosts for now. This will go away when support in the base goes away. -rm ( ) { - echo "NANO RM $*" - case $(uname -r) in - 7*|8*|9*) command rm $* ;; - *) command rm -x $* ;; - esac -} - # # Create empty files in the target tree, and record the fact. All paths # are relative to NANO_WORLDDIR. @@ -274,7 +264,7 @@ tgt_dir2symlink ( ) ( symlink=$2 cd "${NANO_WORLDDIR}" - rm -rf "$dir" + rm -xrf "$dir" ln -s "$symlink" "$dir" if [ -n "$NANO_METALOG" ]; then echo "./${dir} type=link mode=0777 link=${symlink}" >> ${NANO_METALOG} @@ -294,9 +284,9 @@ CR0 ( ) { clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" - if ! rm -rf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then + if ! rm -xrf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then chflags -R noschg ${MAKEOBJDIRPREFIX}/ - rm -r ${MAKEOBJDIRPREFIX}/ + rm -xr ${MAKEOBJDIRPREFIX}/ fi ) @@ -348,17 +338,17 @@ build_kernel ( ) ( clean_world ( ) ( if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then pprint 2 "Clean and create object directory (${NANO_OBJ})" - if ! rm -rf ${NANO_OBJ}/ > /dev/null 2>&1 ; then + if ! rm -xrf ${NANO_OBJ}/ > /dev/null 2>&1 ; then chflags -R noschg ${NANO_OBJ} - rm -r ${NANO_OBJ}/ + rm -xr ${NANO_OBJ}/ fi mkdir -p "${NANO_OBJ}" "${NANO_WORLDDIR}" printenv > ${NANO_LOG}/_.env else pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" - if ! rm -rf "${NANO_WORLDDIR}/" > /dev/null 2>&1 ; then + if ! rm -xrf "${NANO_WORLDDIR}/" > /dev/null 2>&1 ; then chflags -R noschg "${NANO_WORLDDIR}" - rm -rf "${NANO_WORLDDIR}/" + rm -xrf "${NANO_WORLDDIR}/" fi mkdir -p "${NANO_WORLDDIR}" fi @@ -531,7 +521,7 @@ setup_nanobsd ( ) ( cd usr/local/etc find . -print | cpio -dumpl ../../../etc/local cd .. - rm -rf etc + rm -xrf etc ) fi @@ -780,7 +770,7 @@ cust_pkgng ( ) ( mount -t nullfs -o noatime -o ro ${NANO_PACKAGE_DIR} ${NANO_WORLDDIR}/_.p mount -t devfs devfs ${NANO_WORLDDIR}/dev - trap "umount ${NANO_WORLDDIR}/dev; umount ${NANO_WORLDDIR}/_.p ; rm -rf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT + trap "umount ${NANO_WORLDDIR}/dev; umount ${NANO_WORLDDIR}/_.p ; rm -xrf ${NANO_WORLDDIR}/_.p" 1 2 15 EXIT # Install pkg-* package CR "${PKGCMD} add /_.p/${_NANO_PKG_PACKAGE}" @@ -807,7 +797,7 @@ cust_pkgng ( ) ( trap - 1 2 15 EXIT umount ${NANO_WORLDDIR}/dev umount ${NANO_WORLDDIR}/_.p - rm -rf ${NANO_WORLDDIR}/_.p + rm -xrf ${NANO_WORLDDIR}/_.p ) ####################################################################### From owner-svn-src-head@freebsd.org Fri Sep 27 20:56: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 9ADAA12CCA8; Fri, 27 Sep 2019 20:56:45 +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 46g3xn2qDHz4K95; Fri, 27 Sep 2019 20:56:45 +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 443881EAD4; Fri, 27 Sep 2019 20:56:45 +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 x8RKujYg006854; Fri, 27 Sep 2019 20:56:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RKujGY006853; Fri, 27 Sep 2019 20:56:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909272056.x8RKujGY006853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Sep 2019 20:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352821 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 352821 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: Fri, 27 Sep 2019 20:56:45 -0000 Author: imp Date: Fri Sep 27 20:56:44 2019 New Revision: 352821 URL: https://svnweb.freebsd.org/changeset/base/352821 Log: Push and pop xtrace correctly for run_early_customize run_early_customize is run as a shell list, not as a subshell, so that the side effects of setting variables can affect later stages of the build (for better or worse, it's been like this since it was introduced). It therefore has the side effect of turning off xtrace always, which limits the usefulness of sh -x nanobsd.sh. Remember the old setting and only turn off tracing after the command if tracing was off before. All the other places where we do similar things we use a subshell, so we don't need to do this. Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Fri Sep 27 20:56:31 2019 (r352820) +++ head/tools/tools/nanobsd/defaults.sh Fri Sep 27 20:56:44 2019 (r352821) @@ -445,7 +445,11 @@ run_early_customize ( ) { pprint 2 "early customize \"$c\"" pprint 3 "log: ${NANO_LOG}/_.early_cust.$c" pprint 4 "`type $c`" - { set -x ; $c ; set +x ; } >${NANO_LOG}/_.early_cust.$c 2>&1 + { t=$(set -o | awk '$1 == "xtrace" && $2 == "off" { print "set +x"}'); + set -x ; + $c ; + eval $t + } >${NANO_LOG}/_.early_cust.$c 2>&1 done } From owner-svn-src-head@freebsd.org Fri Sep 27 20:56: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 E4CCC12CCE2; Fri, 27 Sep 2019 20:56:50 +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 46g3xt185kz4KFS; Fri, 27 Sep 2019 20:56:50 +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 E1B5E1EAD5; Fri, 27 Sep 2019 20:56:49 +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 x8RKunrj006909; Fri, 27 Sep 2019 20:56:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RKunJP006908; Fri, 27 Sep 2019 20:56:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909272056.x8RKunJP006908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Sep 2019 20:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352822 - head/tools/tools/nanobsd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/nanobsd X-SVN-Commit-Revision: 352822 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: Fri, 27 Sep 2019 20:56:51 -0000 Author: imp Date: Fri Sep 27 20:56:49 2019 New Revision: 352822 URL: https://svnweb.freebsd.org/changeset/base/352822 Log: Use set -o xtrace in preference to set -x for consistency with the rest of nanobsd.sh. Modified: head/tools/tools/nanobsd/defaults.sh Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Fri Sep 27 20:56:44 2019 (r352821) +++ head/tools/tools/nanobsd/defaults.sh Fri Sep 27 20:56:49 2019 (r352822) @@ -445,8 +445,8 @@ run_early_customize ( ) { pprint 2 "early customize \"$c\"" pprint 3 "log: ${NANO_LOG}/_.early_cust.$c" pprint 4 "`type $c`" - { t=$(set -o | awk '$1 == "xtrace" && $2 == "off" { print "set +x"}'); - set -x ; + { t=$(set -o | awk '$1 == "xtrace" && $2 == "off" { print "set +o xtrace"}'); + set -o xtrace ; $c ; eval $t } >${NANO_LOG}/_.early_cust.$c 2>&1 @@ -466,7 +466,7 @@ run_customize ( ) ( pprint 2 "customize \"$c\"" pprint 3 "log: ${NANO_LOG}/_.cust.$c" pprint 4 "`type $c`" - ( set -x ; $c ) > ${NANO_LOG}/_.cust.$c 2>&1 + ( set -o xtrace ; $c ) > ${NANO_LOG}/_.cust.$c 2>&1 done ) @@ -481,7 +481,7 @@ run_late_customize ( ) ( pprint 2 "late customize \"$c\"" pprint 3 "log: ${NANO_LOG}/_.late_cust.$c" pprint 4 "`type $c`" - ( set -x ; $c ) > ${NANO_LOG}/_.late_cust.$c 2>&1 + ( set -o xtrace ; $c ) > ${NANO_LOG}/_.late_cust.$c 2>&1 done ) From owner-svn-src-head@freebsd.org Fri Sep 27 21:04: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 9ECA312D002; Fri, 27 Sep 2019 21:04:34 +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 46g46p3k76z4KkY; Fri, 27 Sep 2019 21:04:34 +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 5F5111EC95; Fri, 27 Sep 2019 21:04:34 +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 x8RL4Yrb012463; Fri, 27 Sep 2019 21:04:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RL4XKb012460; Fri, 27 Sep 2019 21:04:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909272104.x8RL4XKb012460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 27 Sep 2019 21:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352823 - in head/sys: amd64/vmm/amd amd64/vmm/intel dev/qlnx/qlnxe X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/vmm/amd amd64/vmm/intel dev/qlnx/qlnxe X-SVN-Commit-Revision: 352823 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: Fri, 27 Sep 2019 21:04:34 -0000 Author: markj Date: Fri Sep 27 21:04:33 2019 New Revision: 352823 URL: https://svnweb.freebsd.org/changeset/base/352823 Log: Correct the scope of several global variables. They are accessed from multiple compilation units. No functional change intended. MFC after: 1 week Sponsored by: Netflix Modified: head/sys/amd64/vmm/amd/amdvi_hw.c head/sys/amd64/vmm/intel/vmx.c head/sys/dev/qlnx/qlnxe/qlnx_os.c Modified: head/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_hw.c Fri Sep 27 20:56:49 2019 (r352822) +++ head/sys/amd64/vmm/amd/amdvi_hw.c Fri Sep 27 21:04:33 2019 (r352823) @@ -96,7 +96,7 @@ SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, host_ptp, CTLFLAG_ TUNABLE_INT("hw.vmm.amdvi.host_ptp", &amdvi_host_ptp); /* Page table level used <= supported by h/w[v1=7]. */ -static int amdvi_ptp_level = 4; +int amdvi_ptp_level = 4; SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, ptp_level, CTLFLAG_RDTUN, &amdvi_ptp_level, 0, NULL); TUNABLE_INT("hw.vmm.amdvi.ptp_level", &amdvi_ptp_level); Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Fri Sep 27 20:56:49 2019 (r352822) +++ head/sys/amd64/vmm/intel/vmx.c Fri Sep 27 21:04:33 2019 (r352823) @@ -189,10 +189,10 @@ static u_int vpid_alloc_failed; SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_alloc_failed, CTLFLAG_RD, &vpid_alloc_failed, 0, NULL); -static int guest_l1d_flush; +int guest_l1d_flush; SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush, CTLFLAG_RD, &guest_l1d_flush, 0, NULL); -static int guest_l1d_flush_sw; +int guest_l1d_flush_sw; SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, l1d_flush_sw, CTLFLAG_RD, &guest_l1d_flush_sw, 0, NULL); Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Fri Sep 27 20:56:49 2019 (r352822) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Fri Sep 27 21:04:33 2019 (r352823) @@ -232,10 +232,9 @@ MODULE_DEPEND(if_qlnxev, ether, 1, 1, 1); MALLOC_DEFINE(M_QLNXBUF, "qlnxbuf", "Buffers for qlnx driver"); - -static char qlnx_dev_str[128]; -static char qlnx_ver_str[VER_SIZE]; -static char qlnx_name_str[NAME_SIZE]; +char qlnx_dev_str[128]; +char qlnx_ver_str[VER_SIZE]; +char qlnx_name_str[NAME_SIZE]; /* * Some PCI Configuration Space Related Defines From owner-svn-src-head@freebsd.org Fri Sep 27 21:20: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 B568D12D45C for ; Fri, 27 Sep 2019 21:20:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (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 46g4Sq6lrDz4LPc for ; Fri, 27 Sep 2019 21:20:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id u186so3157169qkc.5 for ; Fri, 27 Sep 2019 14:20:11 -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=RkF39S2AyqlOQmS/S+c1RcnLVvc/XQRI2oQeXJudGGw=; b=qlkojCDM7gLyoQptYMj6+7akWw7GhNahjHtp6GVx1Mq1vREGF7nvok2do9j6j/7j/z 8fCmiM6P77v5NEAEjZy6Df/sCstXoPekqPOvpKVI1+LPTfxCW60mElqPwzPgH5JUo5QM cOt5/FHnZdsR5tRZG91sBA3XwK0y6HlWCidwMX+IYBvOE859zLFcfNwkfoBEFJ6NK/p0 s0uPDytJ/2esxI9yqeIMLzqMA2Hdb21sUjAPQsvovkh1165E2/QkQq6l7bzcw0ysvcGu 1cmGgsvHfD16jy5YKJAvRVjH1cWtSaQWLkj7MmNlG2bdsIpt6RzE0PP3626/CeJd3r3L upmg== 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=RkF39S2AyqlOQmS/S+c1RcnLVvc/XQRI2oQeXJudGGw=; b=HQcKN4hZWr8pYgHY6zqdHAZolUhbB+67CSlWeN0u21i1VLtOAk70CK/LoEz9ws9M0f m8N6MP1OSUhGNGHzKttAbw1jRVh47SQ/IvCBEX0XnG8CQ7J3WaKZdqeJALxSSwvzquod iwy66QKMUSGKlyppF93bnK1VRHzm5Wj9HSJTGKhLreNVUEK2l4gkE2+g+DrWk+QulEM6 wAzVp+6c6OApgSSsuAkaXKazitzT/9GKxp83353W7ySyFBJkvH1n2oM6hHeiPnG0QE6s 0WwwbUjx23tQZggoz2SxvimCLqWi9vpB36OzD5OvtHgygPRJ3dPB6gIhrPkBY4SLwydn ppfQ== X-Gm-Message-State: APjAAAXtADfKJJ+A4roI2NtH04ZDKYDqMPyJ3hnpaX5DCkPaWyzsHNWi lEyY9DF19fn2xtNAo7g1cSX9yA6/1hr3FEfuJbfLzQ== X-Google-Smtp-Source: APXvYqz/ub+j7bHCibvg5bDMPDfE+WnonUaNxT6k7ONJj0xbPbsGYoz/DISv3Du74xCPALegcpTLmQQlWfGa7hAviV4= X-Received: by 2002:a37:6787:: with SMTP id b129mr7229402qkc.60.1569619210599; Fri, 27 Sep 2019 14:20:10 -0700 (PDT) MIME-Version: 1.0 References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> In-Reply-To: From: Warner Losh Date: Fri, 27 Sep 2019 15:19:59 -0600 Message-ID: Subject: Re: svn commit: r352795 - head/lib/libc/sys To: Mateusz Guzik Cc: Konstantin Belousov , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 46g4Sq6lrDz4LPc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=qlkojCDM; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72e) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.83 / 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)[]; RCVD_COUNT_TWO(0.00)[2]; 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)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[e.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.83)[ip: (-9.32), ipnet: 2607:f8b0::/32(-2.59), asn: 15169(-2.17), 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)[]; FREEMAIL_CC(0.00)[gmail.com] 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: Fri, 27 Sep 2019 21:20:12 -0000 On Fri, Sep 27, 2019 at 2:38 PM Mateusz Guzik wrote: > On 9/27/19, Konstantin Belousov wrote: > > On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote: > >> On 9/27/19, Warner Losh wrote: > >> > Document varadic args as int, since you can't have short varadic > args > >> > (they are > >> > promoted to ints). > >> > > >> > - `mode_t` is `uint16_t` (`sys/sys/_types.h`) > >> > - `openat` takes variadic args > >> > - variadic args cannot be 16-bit, and indeed the code uses int > >> > - the manpage currently kinda implies the argument is 16-bit by > >> > saying > >> > `mode_t` > >> > > >> But opengroup says it is mode_t. Perhaps it is mode_t which needs > >> to be changed? > > > > Yes, users must pass mode_t, and the man page is written for users. > > Implementation needs to be aware of the implicit promotion and handle > > it accordingly. > > > > In theory, mode_t might be wider than int. > > > > So I think the change should be reverted. Whatever workaround is being > in place in rust should remain for the current codebase. > Rust needs to understand that it's not C. It's mistake was assuming it was just like C and this is a case where the languages differ because C is so quirky. > If anyone is to fixed the problem they should bump mode_t to uint32_t, > to match Linux. This is ABI breakage, I don't know how that's handled. > That's not going to happen. And there's no need. It would cause more heartache than it's worth. > I have no interest in handling any of this, but the change committed > is definitely wrong. > I tend to agree, but the manual was/is incomplete. The arg *IS* promoted to an int, per normal C rules, so that part is right and there's no type-checking against truncation or the wrong type being used as would be the case if it weren't varadic (so don't pass a long here). However, type purity aside, that's not how things are implemented. Open is expecting an int (as is openat): int open(const char *path, int flags, ...) { va_list ap; int mode; if ((flags & O_CREAT) != 0) { va_start(ap, flags); mode = va_arg(ap, int); va_end(ap); } else { mode = 0; } return (((int (*)(int, const char *, int, ...)) __libc_interposing[INTERPOS_openat])(fd, path, flags, mode)); } so the change, from that perspective, actually documents the interface (so isn't definitely wrong, and my guarded 'tend to agree'). So if you did change the type of mode_t, the above code might be wrong afterwards (hence my can of worms comment). And then we're passing it again through a varadic function pointer... So while POSIX says one thing, we implement something else. Should we document POSIX or what we implement? Or do we fix our implementation to match the docs? For all programs that don't pass in a 'long' or a pointer, the difference is zero, however. To be honest, though, quibbling over how it should be implemented aside, I think we should actually do the following: diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index a771461e2e49..aa912b797f74 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -61,7 +61,7 @@ In this case and .Fn openat require an additional argument -.Fa "int mode" , +.Fa "mode_t mode" , and the file is created with mode .Fa mode as described in @@ -615,3 +615,8 @@ permits searches. The present implementation of the .Fa openat checks the current permissions of directory instead. +.Pp +The +.Fa mode +argument is varadic and may result in different calling conventions +than might otherwise be expected. Is what I was thinking of committing instead. It's in the BUGS section, and is useful to know if you are debugging code that has this in the call path (since values may be on the stack instead of in registers, depending on the calling convention for the underlying architecture). Warner From owner-svn-src-head@freebsd.org Fri Sep 27 23:37: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 DF26EF03EE; Fri, 27 Sep 2019 23:37:02 +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 46g7Vk5Y5Rz4VXl; Fri, 27 Sep 2019 23:37:02 +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 8460120791; Fri, 27 Sep 2019 23:37:02 +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 x8RNb2gC005019; Fri, 27 Sep 2019 23:37:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8RNb1cC005015; Fri, 27 Sep 2019 23:37:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909272337.x8RNb1cC005015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 27 Sep 2019 23:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352826 - in head/sys: arm64/arm64 arm64/include riscv/include riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include riscv/include riscv/riscv X-SVN-Commit-Revision: 352826 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: Fri, 27 Sep 2019 23:37:02 -0000 Author: markj Date: Fri Sep 27 23:37:01 2019 New Revision: 352826 URL: https://svnweb.freebsd.org/changeset/base/352826 Log: Implement pmap_page_is_mapped() correctly on arm64 and riscv. We must also check for large mappings. pmap_page_is_mapped() is mostly used in assertions, so the problem was not very noticeable. Reviewed by: alc MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21824 Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pmap.h head/sys/riscv/include/pmap.h head/sys/riscv/riscv/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Fri Sep 27 22:18:50 2019 (r352825) +++ head/sys/arm64/arm64/pmap.c Fri Sep 27 23:37:01 2019 (r352826) @@ -4241,6 +4241,27 @@ restart: } /* + * Returns true if the given page is mapped individually or as part of + * a 2mpage. Otherwise, returns false. + */ +bool +pmap_page_is_mapped(vm_page_t m) +{ + struct rwlock *lock; + bool rv; + + if ((m->oflags & VPO_UNMANAGED) != 0) + return (false); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + rw_rlock(lock); + rv = !TAILQ_EMPTY(&m->md.pv_list) || + ((m->flags & PG_FICTITIOUS) == 0 && + !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); + rw_runlock(lock); + return (rv); +} + +/* * Destroy all managed, non-wired mappings in the given user-space * pmap. This pmap cannot be active on any processor besides the * caller. Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Fri Sep 27 22:18:50 2019 (r352825) +++ head/sys/arm64/include/pmap.h Fri Sep 27 23:37:01 2019 (r352826) @@ -150,6 +150,7 @@ vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); void *pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma); +bool pmap_page_is_mapped(vm_page_t m); bool pmap_ps_enabled(pmap_t pmap); void *pmap_mapdev(vm_offset_t, vm_size_t); @@ -166,8 +167,6 @@ bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t * int pmap_fault(pmap_t, uint64_t, uint64_t); struct pcb *pmap_switch(struct thread *, struct thread *); - -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) static inline int pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) Modified: head/sys/riscv/include/pmap.h ============================================================================== --- head/sys/riscv/include/pmap.h Fri Sep 27 22:18:50 2019 (r352825) +++ head/sys/riscv/include/pmap.h Fri Sep 27 23:37:01 2019 (r352826) @@ -146,6 +146,7 @@ void pmap_kenter_device(vm_offset_t, vm_size_t, vm_pad vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); +bool pmap_page_is_mapped(vm_page_t m); bool pmap_ps_enabled(pmap_t); void *pmap_mapdev(vm_offset_t, vm_size_t); @@ -158,8 +159,6 @@ void pmap_unmap_io_transient(vm_page_t *, vm_offset_t bool pmap_get_tables(pmap_t, vm_offset_t, pd_entry_t **, pd_entry_t **, pt_entry_t **); - -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) int pmap_fault_fixup(pmap_t, vm_offset_t, vm_prot_t); Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri Sep 27 22:18:50 2019 (r352825) +++ head/sys/riscv/riscv/pmap.c Fri Sep 27 23:37:01 2019 (r352826) @@ -3541,6 +3541,27 @@ restart: return (count); } +/* + * Returns true if the given page is mapped individually or as part of + * a 2mpage. Otherwise, returns false. + */ +bool +pmap_page_is_mapped(vm_page_t m) +{ + struct rwlock *lock; + bool rv; + + if ((m->oflags & VPO_UNMANAGED) != 0) + return (false); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); + rw_rlock(lock); + rv = !TAILQ_EMPTY(&m->md.pv_list) || + ((m->flags & PG_FICTITIOUS) == 0 && + !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)); + rw_runlock(lock); + return (rv); +} + static void pmap_remove_pages_pv(pmap_t pmap, vm_page_t m, pv_entry_t pv, struct spglist *free, bool superpage) From owner-svn-src-head@freebsd.org Sat Sep 28 01:20: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 11E43F2DD0; Sat, 28 Sep 2019 01:20:18 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) (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 46g9nr3G5Rz4ZdM; Sat, 28 Sep 2019 01:20:16 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-oi1-x241.google.com with SMTP id o205so6709325oib.12; Fri, 27 Sep 2019 18:20:16 -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=3TF5zcgfSmB+0WhMc/nH1tWr3vA0c786h/0LYR8rdqc=; b=hzUjGJDOltd2X7m4/MS4qfvPEIu7xvOY9PznjTdnjYGGRPEVbyRi2Q6d4dLxJ3JhkV r89ngStTGEYu5aSBOfmleb93ERG3hHHaTtGlu4GSOg9lM+N1Oen/X+siT9V++hXtK3U5 9cSRbZAGFIEbmQ+1M87lTjjM+AUHfkkqr4bGPKkG7J9pKCgvi+yFFJHxmNLE6/quSDrX cCQjYy+jH5vbnp2vdr8BSn34Kvrgcd0t9htLpvz+EYAIfYssVrWbGgE8py5hGYwSHuJx vNumdMxiGZSX1Gr6y+zCDk78ti3y+5tiqOxXR5UjmVVR/sDax/7CLDDMjT+vSOqUxfpS 9y9A== 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=3TF5zcgfSmB+0WhMc/nH1tWr3vA0c786h/0LYR8rdqc=; b=Egqbf5JhDpmNs+50Tg3RL0zE8iQpXQIJHNLpVsFeTeCIMgeskXWDe10SZlijf0Au1M zalu8x+7Sgdx3hApdZSwl4HSvtbyI2dNfPPuCaRTq7o4jPCtwE3h6lNT+o6VNEXDgJMM lDYKVMP6PbqyFGgiEH09YfdNtsWM/4UFT902FIyT3gznbvt/c4B52APUkwTSyUBKcMJZ MG7Y56UrrecpVbte63Z7IKu43Un+rADzNvFn22Ek0Ea7T6Xk3Po6LdKL+Mpr3KuENaAW CO87N4ismjBNx2ZNU3puvY0gqJCi11jl+zKDpyFh4aVmS4kmvhBWVKdI5v/uzdJgIzvL wJ/A== X-Gm-Message-State: APjAAAU7CnonINEVae9FtxAMdNV9WEaKGgNZUWEfd8HzlxK8wgWlhl14 6LObdp5RxKX4z2jvoYzDGZJYFbqrzGBftfMmAUNLrg== X-Google-Smtp-Source: APXvYqysHSDeWaaNVJUlqvNdffZQgHd7oqKARwO+qNCfk59rjEQ1zZE9Zy7vjIH8ncOo3N3DcEjx/CIM7nmfnh1xlVk= X-Received: by 2002:a54:4f1b:: with SMTP id e27mr3997019oiy.85.1569633614920; Fri, 27 Sep 2019 18:20:14 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:458d:0:0:0:0:0 with HTTP; Fri, 27 Sep 2019 18:20:14 -0700 (PDT) In-Reply-To: References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> From: Mateusz Guzik Date: Sat, 28 Sep 2019 03:20:14 +0200 Message-ID: Subject: Re: svn commit: r352795 - head/lib/libc/sys To: Warner Losh Cc: Konstantin Belousov , Warner Losh , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46g9nr3G5Rz4ZdM X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=hzUjGJDO; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2607:f8b0:4864:20::241 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.00 / 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)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; 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: (2.12), ipnet: 2607:f8b0::/32(-2.59), asn: 15169(-2.17), 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)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[1.4.2.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]; 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]; FREEMAIL_CC(0.00)[gmail.com]; 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: Sat, 28 Sep 2019 01:20:18 -0000 On 9/27/19, Warner Losh wrote: > On Fri, Sep 27, 2019 at 2:38 PM Mateusz Guzik wrote: > >> On 9/27/19, Konstantin Belousov wrote: >> > On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote: >> >> On 9/27/19, Warner Losh wrote: >> >> > Document varadic args as int, since you can't have short varadic >> args >> >> > (they are >> >> > promoted to ints). >> >> > >> >> > - `mode_t` is `uint16_t` (`sys/sys/_types.h`) >> >> > - `openat` takes variadic args >> >> > - variadic args cannot be 16-bit, and indeed the code uses int >> >> > - the manpage currently kinda implies the argument is 16-bit by >> >> > saying >> >> > `mode_t` >> >> > >> >> But opengroup says it is mode_t. Perhaps it is mode_t which needs >> >> to be changed? >> > >> > Yes, users must pass mode_t, and the man page is written for users. >> > Implementation needs to be aware of the implicit promotion and handle >> > it accordingly. >> > >> > In theory, mode_t might be wider than int. >> > >> >> So I think the change should be reverted. Whatever workaround is being >> in place in rust should remain for the current codebase. >> > > Rust needs to understand that it's not C. It's mistake was assuming it was > just like C and this is a case where the languages differ because C is so > quirky. > > >> If anyone is to fixed the problem they should bump mode_t to uint32_t, >> to match Linux. This is ABI breakage, I don't know how that's handled. >> > > That's not going to happen. And there's no need. It would cause more > heartache than it's worth. > > In isolation, sure. Someone(tm) should do a type comprehensive type check against Linux. There are probably many cases where something has a different size, but software hardcodes what happens to work on Linux (instead of using the type documented by opengroup or whatever else is applicable). >> I have no interest in handling any of this, but the change committed >> is definitely wrong. >> > > I tend to agree, but the manual was/is incomplete. The arg *IS* promoted to > an int, per normal C rules, so that part is right and there's no > type-checking against truncation or the wrong type being used as would be > the case if it weren't varadic (so don't pass a long here). > But the fact there is any need for promotion in the first place is only an implementation wart. > However, type purity aside, that's not how things are implemented. Open is > expecting an int (as is openat): > > int > open(const char *path, int flags, ...) > { > va_list ap; > int mode; > > if ((flags & O_CREAT) != 0) { > va_start(ap, flags); > mode = va_arg(ap, int); > va_end(ap); > } else { > mode = 0; > } > return (((int (*)(int, const char *, int, ...)) > __libc_interposing[INTERPOS_openat])(fd, path, flags, mode)); > } > > so the change, from that perspective, actually documents the interface (so > isn't definitely wrong, and my guarded 'tend to agree'). So if you did > change the type of mode_t, the above code might be wrong afterwards (hence > my can of worms comment). And then we're passing it again through a varadic > function pointer... > > So while POSIX says one thing, we implement something else. Should we > document POSIX or what we implement? Or do we fix our implementation to > match the docs? For all programs that don't pass in a 'long' or a pointer, > the difference is zero, however. > > To be honest, though, quibbling over how it should be implemented aside, I > think we should actually do the following: > > diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 > index a771461e2e49..aa912b797f74 100644 > --- a/lib/libc/sys/open.2 > +++ b/lib/libc/sys/open.2 > @@ -61,7 +61,7 @@ In this case > and > .Fn openat > require an additional argument > -.Fa "int mode" , > +.Fa "mode_t mode" , > and the file is created with mode > .Fa mode > as described in > @@ -615,3 +615,8 @@ permits searches. > The present implementation of the > .Fa openat > checks the current permissions of directory instead. > +.Pp > +The > +.Fa mode > +argument is varadic and may result in different calling conventions > +than might otherwise be expected. > > Is what I was thinking of committing instead. It's in the BUGS section, and > is useful to know if you are debugging code that has this in the call path > (since values may be on the stack instead of in registers, depending on the > calling convention for the underlying architecture). > I think this is fine. I mostly object to telling people to pass int instead of mode_t. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Sep 28 01:43: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 127DAF61FD; Sat, 28 Sep 2019 01:43:00 +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 46gBJ36PLVz4dJR; Sat, 28 Sep 2019 01:42:59 +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 BF03C2209D; Sat, 28 Sep 2019 01:42:59 +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 x8S1gx53082133; Sat, 28 Sep 2019 01:42:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8S1gxHB082132; Sat, 28 Sep 2019 01:42:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201909280142.x8S1gxHB082132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 28 Sep 2019 01:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352829 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 352829 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: Sat, 28 Sep 2019 01:43:00 -0000 Author: markj Date: Sat Sep 28 01:42:59 2019 New Revision: 352829 URL: https://svnweb.freebsd.org/changeset/base/352829 Log: Fix some problems with the SPARSE_MAPPING option in the kernel linker. - Ensure that the end of the mapping passed to vm_page_wire() is page-aligned. vm_page_wire() expects this. - Wire pages before reading data into them. - Apply protections specified in the segment descriptor using vm_map_protect() once relocation processing is done. - On amd64, ensure that we load KLDs above KERNBASE, since they are compiled with the "kernel" memory model by default. Reviewed by: kib MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D21756 Modified: head/sys/kern/link_elf.c Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Sat Sep 28 01:31:33 2019 (r352828) +++ head/sys/kern/link_elf.c Sat Sep 28 01:42:59 2019 (r352829) @@ -40,6 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef SPARSE_MAPPING +#include +#endif #include #include #include @@ -419,7 +422,7 @@ link_elf_init(void* arg) ef->address = 0; #endif #ifdef SPARSE_MAPPING - ef->object = 0; + ef->object = NULL; #endif ef->dynamic = dp; @@ -772,7 +775,7 @@ link_elf_link_preload(linker_class_t cls, ef->modptr = modptr; ef->address = *(caddr_t *)baseptr; #ifdef SPARSE_MAPPING - ef->object = 0; + ef->object = NULL; #endif dp = (vm_offset_t)ef->address + *(vm_offset_t *)dynptr; ef->dynamic = (Elf_Dyn *)dp; @@ -826,7 +829,7 @@ link_elf_load_file(linker_class_t cls, const char* fil struct nameidata nd; struct thread* td = curthread; /* XXX */ Elf_Ehdr *hdr; - caddr_t firstpage; + caddr_t firstpage, segbase; int nbytes, i; Elf_Phdr *phdr; Elf_Phdr *phlimit; @@ -993,47 +996,61 @@ link_elf_load_file(linker_class_t cls, const char* fil error = ENOMEM; goto out; } - ef->address = (caddr_t) vm_map_min(kernel_map); +#ifdef __amd64__ + mapbase = (caddr_t)KERNBASE; +#else + mapbase = (caddr_t)vm_map_min(kernel_map); +#endif + /* + * Mapping protections are downgraded after relocation processing. + */ error = vm_map_find(kernel_map, ef->object, 0, - (vm_offset_t *) &ef->address, mapsize, 0, VMFS_OPTIMAL_SPACE, + (vm_offset_t *)&mapbase, mapsize, 0, VMFS_OPTIMAL_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); if (error != 0) { vm_object_deallocate(ef->object); - ef->object = 0; + ef->object = NULL; goto out; } #else - ef->address = malloc(mapsize, M_LINKER, M_EXEC | M_WAITOK); + mapbase = malloc(mapsize, M_LINKER, M_EXEC | M_WAITOK); #endif - mapbase = ef->address; + ef->address = mapbase; /* * Read the text and data sections and zero the bss. */ for (i = 0; i < nsegs; i++) { - caddr_t segbase = mapbase + segs[i]->p_vaddr - base_vaddr; - error = vn_rdwr(UIO_READ, nd.ni_vp, - segbase, segs[i]->p_filesz, segs[i]->p_offset, - UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, - &resid, td); - if (error != 0) - goto out; - bzero(segbase + segs[i]->p_filesz, - segs[i]->p_memsz - segs[i]->p_filesz); + segbase = mapbase + segs[i]->p_vaddr - base_vaddr; #ifdef SPARSE_MAPPING /* - * Wire down the pages + * Consecutive segments may have different mapping permissions, + * so be strict and verify that their mappings do not overlap. */ + if (((vm_offset_t)segbase & PAGE_MASK) != 0) { + error = EINVAL; + goto out; + } + error = vm_map_wire(kernel_map, - (vm_offset_t) segbase, - (vm_offset_t) segbase + segs[i]->p_memsz, - VM_MAP_WIRE_SYSTEM|VM_MAP_WIRE_NOHOLES); + (vm_offset_t)segbase, + (vm_offset_t)segbase + round_page(segs[i]->p_memsz), + VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); if (error != KERN_SUCCESS) { error = ENOMEM; goto out; } #endif + + error = vn_rdwr(UIO_READ, nd.ni_vp, + segbase, segs[i]->p_filesz, segs[i]->p_offset, + UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, + &resid, td); + if (error != 0) + goto out; + bzero(segbase + segs[i]->p_filesz, + segs[i]->p_memsz - segs[i]->p_filesz); } #ifdef GPROF @@ -1070,6 +1087,34 @@ link_elf_load_file(linker_class_t cls, const char* fil error = relocate_file(ef); if (error != 0) goto out; + +#ifdef SPARSE_MAPPING + /* + * Downgrade permissions on text segment mappings now that relocation + * processing is complete. Restrict permissions on read-only segments. + */ + for (i = 0; i < nsegs; i++) { + vm_prot_t prot; + + if (segs[i]->p_type != PT_LOAD) + continue; + + prot = VM_PROT_READ; + if ((segs[i]->p_flags & PF_W) != 0) + prot |= VM_PROT_WRITE; + if ((segs[i]->p_flags & PF_X) != 0) + prot |= VM_PROT_EXECUTE; + segbase = mapbase + segs[i]->p_vaddr - base_vaddr; + error = vm_map_protect(kernel_map, + (vm_offset_t)segbase, + (vm_offset_t)segbase + round_page(segs[i]->p_memsz), + prot, FALSE); + if (error != KERN_SUCCESS) { + error = ENOMEM; + goto out; + } + } +#endif /* * Try and load the symbol table if it's present. (you can From owner-svn-src-head@freebsd.org Sat Sep 28 02:49: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 CDFEDF8DE0; Sat, 28 Sep 2019 02:49:46 +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 46gCn64qD6z3Cfb; Sat, 28 Sep 2019 02:49:46 +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 8A09C22BA5; Sat, 28 Sep 2019 02:49:46 +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 x8S2nkFE017568; Sat, 28 Sep 2019 02:49:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8S2nkUs017567; Sat, 28 Sep 2019 02:49:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201909280249.x8S2nkUs017567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 28 Sep 2019 02:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352831 - head/sys/contrib/ncsw/Peripherals/BM X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/contrib/ncsw/Peripherals/BM X-SVN-Commit-Revision: 352831 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: Sat, 28 Sep 2019 02:49:46 -0000 Author: jhibbits Date: Sat Sep 28 02:49:46 2019 New Revision: 352831 URL: https://svnweb.freebsd.org/changeset/base/352831 Log: dpaa(4): Fix memcpy size for threshold copy in NCSW contrib On 64-bit platforms uintptr_t makes the copy twice as large as it should be. This code isn't actually used in FreeBSD, since it's for guest mode only, not hypervisor mode, but fixing it for completeness sake. Reported by: bdragon (clang9 build) Modified: head/sys/contrib/ncsw/Peripherals/BM/bm.c Modified: head/sys/contrib/ncsw/Peripherals/BM/bm.c ============================================================================== --- head/sys/contrib/ncsw/Peripherals/BM/bm.c Sat Sep 28 02:15:23 2019 (r352830) +++ head/sys/contrib/ncsw/Peripherals/BM/bm.c Sat Sep 28 02:49:46 2019 (r352831) @@ -258,7 +258,7 @@ t_Error BmSetPoolThresholds(t_Handle h_Bm, uint8_t bpi memset(&msg, 0, sizeof(t_BmIpcMsg)); ipcPoolThresh.bpid = bpid; - memcpy(ipcPoolThresh.thresholds, thresholds, sizeof(uintptr_t) * MAX_DEPLETION_THRESHOLDS); + memcpy(ipcPoolThresh.thresholds, thresholds, sizeof(uint32_t) * MAX_DEPLETION_THRESHOLDS); msg.msgId = BM_SET_POOL_THRESH; memcpy(msg.msgBody, &ipcPoolThresh, sizeof(t_BmIpcPoolThreshParams)); if ((errCode = XX_IpcSendMessage(p_Bm->h_Session, From owner-svn-src-head@freebsd.org Sat Sep 28 03:33: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 D4A50FA057; Sat, 28 Sep 2019 03:33: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 46gDl75JvRz3G6g; Sat, 28 Sep 2019 03:33: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 702BF235A0; Sat, 28 Sep 2019 03:33: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 x8S3X7e1048247; Sat, 28 Sep 2019 03:33:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8S3X7BN048246; Sat, 28 Sep 2019 03:33:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201909280333.x8S3X7BN048246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 28 Sep 2019 03:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352832 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 352832 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: Sat, 28 Sep 2019 03:33:07 -0000 Author: jhibbits Date: Sat Sep 28 03:33:07 2019 New Revision: 352832 URL: https://svnweb.freebsd.org/changeset/base/352832 Log: powerpc/booke64: Align initial stack setting to match that of aim64's Clang9/LLD9 appears to get quite confused with the instruction stream used to obtain the tmpstack pointer, almost as though it thinks this is a C function, so tries to optimize it. Since the AIM64 method doesn't use the TOC to obtain the tmpstack, just follow that model, and lld won't get confused. Reported by: bdragon MFC after: 2 weeks Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Sep 28 02:49:46 2019 (r352831) +++ head/sys/powerpc/booke/locore.S Sat Sep 28 03:33:07 2019 (r352832) @@ -298,16 +298,18 @@ done_mapping: ld %r1,0(%r2) add %r2,%r1,%r2 mtspr SPR_SPRG8, %r2 + nop /* Get load offset */ ld %r31,-0x8000(%r2) /* First TOC entry is TOC base */ subf %r31,%r31,%r2 /* Subtract from real TOC base to get base */ /* Set up the stack pointer */ - 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 + .llong tmpstack + TMPSTACKSZ - 96 - . +1: mflr %r3 + ld %r1,0(%r3) + add %r1,%r1,%r3 bl 1f .llong _DYNAMIC-. 1: mflr %r3 From owner-svn-src-head@freebsd.org Sat Sep 28 07:26: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 5E45BFD705; Sat, 28 Sep 2019 07:26:00 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 46gKvp6tNgz3QBN; Sat, 28 Sep 2019 07:25:58 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x8S7PnIh067027 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 28 Sep 2019 10:25:52 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x8S7PnIh067027 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x8S7Pml9067026; Sat, 28 Sep 2019 10:25:48 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sat, 28 Sep 2019 10:25:48 +0300 From: Konstantin Belousov To: Warner Losh Cc: Mateusz Guzik , Warner Losh , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r352795 - head/lib/libc/sys Message-ID: <20190928072548.GN44691@kib.kiev.ua> References: <201909271611.x8RGBl0H036116@repo.freebsd.org> <20190927184623.GM44691@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 46gKvp6tNgz3QBN X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.80 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.80)[-0.804,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country: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: Sat, 28 Sep 2019 07:26:00 -0000 On Fri, Sep 27, 2019 at 03:19:59PM -0600, Warner Losh wrote: > On Fri, Sep 27, 2019 at 2:38 PM Mateusz Guzik wrote: > > > On 9/27/19, Konstantin Belousov wrote: > > > On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote: > > >> On 9/27/19, Warner Losh wrote: > > >> > Document varadic args as int, since you can't have short varadic > > args > > >> > (they are > > >> > promoted to ints). > > >> > > > >> > - `mode_t` is `uint16_t` (`sys/sys/_types.h`) > > >> > - `openat` takes variadic args > > >> > - variadic args cannot be 16-bit, and indeed the code uses int > > >> > - the manpage currently kinda implies the argument is 16-bit by > > >> > saying > > >> > `mode_t` > > >> > > > >> But opengroup says it is mode_t. Perhaps it is mode_t which needs > > >> to be changed? > > > > > > Yes, users must pass mode_t, and the man page is written for users. > > > Implementation needs to be aware of the implicit promotion and handle > > > it accordingly. > > > > > > In theory, mode_t might be wider than int. > > > > > > > So I think the change should be reverted. Whatever workaround is being > > in place in rust should remain for the current codebase. > > > > Rust needs to understand that it's not C. It's mistake was assuming it was > just like C and this is a case where the languages differ because C is so > quirky. > > > > If anyone is to fixed the problem they should bump mode_t to uint32_t, > > to match Linux. This is ABI breakage, I don't know how that's handled. > > > > That's not going to happen. And there's no need. It would cause more > heartache than it's worth. > > > > I have no interest in handling any of this, but the change committed > > is definitely wrong. > > > > I tend to agree, but the manual was/is incomplete. The arg *IS* promoted to > an int, per normal C rules, so that part is right and there's no > type-checking against truncation or the wrong type being used as would be > the case if it weren't varadic (so don't pass a long here). > > However, type purity aside, that's not how things are implemented. Open is > expecting an int (as is openat): > > int > open(const char *path, int flags, ...) > { > va_list ap; > int mode; > > if ((flags & O_CREAT) != 0) { > va_start(ap, flags); > mode = va_arg(ap, int); > va_end(ap); > } else { > mode = 0; > } > return (((int (*)(int, const char *, int, ...)) > __libc_interposing[INTERPOS_openat])(fd, path, flags, mode)); > } > > so the change, from that perspective, actually documents the interface (so > isn't definitely wrong, and my guarded 'tend to agree'). So if you did > change the type of mode_t, the above code might be wrong afterwards (hence > my can of worms comment). And then we're passing it again through a varadic > function pointer... > > So while POSIX says one thing, we implement something else. Should we > document POSIX or what we implement? I do not see how did you come to this conclusion. > Or do we fix our implementation to > match the docs? For all programs that don't pass in a 'long' or a pointer, > the difference is zero, however. ... on all supported architectures. On 32bit it actually does not matter even for long or pointers. But this is irrelevant, because correct programs must only pass mode_t as the third arg, and then our libc does the right thing on all currently supported platforms. More, I do not expect that this fragment would need any revisions for future architectures. > > To be honest, though, quibbling over how it should be implemented aside, I > think we should actually do the following: > > diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 > index a771461e2e49..aa912b797f74 100644 > --- a/lib/libc/sys/open.2 > +++ b/lib/libc/sys/open.2 > @@ -61,7 +61,7 @@ In this case > and > .Fn openat > require an additional argument > -.Fa "int mode" , > +.Fa "mode_t mode" , > and the file is created with mode > .Fa mode > as described in > @@ -615,3 +615,8 @@ permits searches. > The present implementation of the > .Fa openat > checks the current permissions of directory instead. > +.Pp > +The > +.Fa mode > +argument is varadic and may result in different calling conventions > +than might otherwise be expected. I do not see how this could be useful for a user trying to call open(2). I think it would be much easier to understand and use if you simply mention that 'on all supported arches, mode_t is promoted to int by C rules for implicit conversions of arguments for variadic functions'. And perhaps put it somewhere else, not in the BUGS section. > > Is what I was thinking of committing instead. It's in the BUGS section, and > is useful to know if you are debugging code that has this in the call path > (since values may be on the stack instead of in registers, depending on the > calling convention for the underlying architecture). The Rust issue, from my reading, is specific to Rust. From owner-svn-src-head@freebsd.org Sat Sep 28 09:12: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 59FAD12125E; Sat, 28 Sep 2019 09:12: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 46gNGz1dmCz40mR; Sat, 28 Sep 2019 09:12:43 +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 1C0CA272B9; Sat, 28 Sep 2019 09:12:43 +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 x8S9CgOK048454; Sat, 28 Sep 2019 09:12:42 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8S9Cfrl048448; Sat, 28 Sep 2019 09:12:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201909280912.x8S9Cfrl048448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 28 Sep 2019 09:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352836 - in head/libexec/rc: . rc.d X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/libexec/rc: . rc.d X-SVN-Commit-Revision: 352836 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: Sat, 28 Sep 2019 09:12:43 -0000 Author: trasz Date: Sat Sep 28 09:12:41 2019 New Revision: 352836 URL: https://svnweb.freebsd.org/changeset/base/352836 Log: Move the SysV IPC stuff out of the 'abi' rc script, into a new one: 'sysvipc' - it has nothing to do with ABIs, and I'd like to later rename 'abi' to 'linux', which better describes its purpose and also matches the rcvar name. Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21615 Added: head/libexec/rc/rc.d/sysvipc - copied, changed from r352676, head/libexec/rc/rc.d/abi Modified: head/libexec/rc/rc.conf head/libexec/rc/rc.d/Makefile head/libexec/rc/rc.d/SERVERS head/libexec/rc/rc.d/abi head/libexec/rc/rc.d/localpkg Modified: head/libexec/rc/rc.conf ============================================================================== --- head/libexec/rc/rc.conf Sat Sep 28 08:57:29 2019 (r352835) +++ head/libexec/rc/rc.conf Sat Sep 28 09:12:41 2019 (r352836) @@ -638,8 +638,6 @@ accounting_enable="NO" # Turn on process accounting (o firstboot_sentinel="/firstboot" # Scripts with "firstboot" keyword are run if # this file exists. Should be on a R/W filesystem so # the file can be deleted after the boot completes. - -# Emulation/compatibility services provided by /etc/rc.d/abi sysvipc_enable="NO" # Load System V IPC primitives at startup (or NO). linux_enable="NO" # Linux binary compatibility loaded at startup (or NO). clear_tmp_enable="NO" # Clear /tmp at startup. Modified: head/libexec/rc/rc.d/Makefile ============================================================================== --- head/libexec/rc/rc.d/Makefile Sat Sep 28 08:57:29 2019 (r352835) +++ head/libexec/rc/rc.d/Makefile Sat Sep 28 09:12:41 2019 (r352836) @@ -107,6 +107,7 @@ CONFS= DAEMON \ swaplate \ sysctl \ syslogd \ + sysvipc \ tmp \ ugidfw \ ${_utx} \ Modified: head/libexec/rc/rc.d/SERVERS ============================================================================== --- head/libexec/rc/rc.d/SERVERS Sat Sep 28 08:57:29 2019 (r352835) +++ head/libexec/rc/rc.d/SERVERS Sat Sep 28 09:12:41 2019 (r352836) @@ -4,7 +4,7 @@ # # PROVIDE: SERVERS -# REQUIRE: mountcritremote abi ldconfig savecore watchdogd +# REQUIRE: mountcritremote sysvipc abi ldconfig savecore watchdogd # This is a dummy dependency, for early-start servers relying on # some basic configuration. Modified: head/libexec/rc/rc.d/abi ============================================================================== --- head/libexec/rc/rc.d/abi Sat Sep 28 08:57:29 2019 (r352835) +++ head/libexec/rc/rc.d/abi Sat Sep 28 09:12:41 2019 (r352836) @@ -14,14 +14,6 @@ desc="Enable foreign ABIs" start_cmd="${name}_start" stop_cmd=":" -sysv_start() -{ - echo -n ' sysvipc' - load_kld sysvmsg - load_kld sysvsem - load_kld sysvshm -} - linux_start() { local _tmpdir @@ -48,12 +40,11 @@ abi_start() local _echostop _echostop= - if checkyesno sysvipc_enable || checkyesno linux_enable; then + if checkyesno linux_enable; then echo -n 'Additional ABI support:' _echostop=yes fi - checkyesno sysvipc_enable && sysv_start checkyesno linux_enable && linux_start [ -n "${_echostop}" ] && echo '.' Modified: head/libexec/rc/rc.d/localpkg ============================================================================== --- head/libexec/rc/rc.d/localpkg Sat Sep 28 08:57:29 2019 (r352835) +++ head/libexec/rc/rc.d/localpkg Sat Sep 28 09:12:41 2019 (r352836) @@ -4,7 +4,7 @@ # # PROVIDE: localpkg -# REQUIRE: abi +# REQUIRE: sysvipc abi # BEFORE: securelevel # KEYWORD: shutdown Copied and modified: head/libexec/rc/rc.d/sysvipc (from r352676, head/libexec/rc/rc.d/abi) ============================================================================== --- head/libexec/rc/rc.d/abi Wed Sep 25 10:46:05 2019 (r352676, copy source) +++ head/libexec/rc/rc.d/sysvipc Sat Sep 28 09:12:41 2019 (r352836) @@ -3,60 +3,23 @@ # $FreeBSD$ # -# PROVIDE: abi +# PROVIDE: sysvipc # REQUIRE: archdep # KEYWORD: nojail . /etc/rc.subr -name="abi" -desc="Enable foreign ABIs" +name="sysvipc" +desc="Load SysV IPC modules" +rcvar="sysvipc_enable" start_cmd="${name}_start" stop_cmd=":" -sysv_start() +sysvipc_start() { - echo -n ' sysvipc' load_kld sysvmsg load_kld sysvsem load_kld sysvshm -} - -linux_start() -{ - local _tmpdir - - echo -n ' linux' - load_kld -e 'linux(aout|elf)' linux - case `sysctl -n hw.machine_arch` in - amd64) - load_kld -e 'linux64elf' linux64 - ;; - esac - if [ -x /compat/linux/sbin/ldconfigDisabled ]; then - _tmpdir=`mktemp -d -t linux-ldconfig` - /compat/linux/sbin/ldconfig -C ${_tmpdir}/ld.so.cache - if ! cmp -s ${_tmpdir}/ld.so.cache /compat/linux/etc/ld.so.cache; then - cat ${_tmpdir}/ld.so.cache > /compat/linux/etc/ld.so.cache - fi - rm -rf ${_tmpdir} - fi -} - -abi_start() -{ - local _echostop - - _echostop= - if checkyesno sysvipc_enable || checkyesno linux_enable; then - echo -n 'Additional ABI support:' - _echostop=yes - fi - - checkyesno sysvipc_enable && sysv_start - checkyesno linux_enable && linux_start - - [ -n "${_echostop}" ] && echo '.' } load_rc_config $name From owner-svn-src-head@freebsd.org Sat Sep 28 09:22: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 BE0411214F3; Sat, 28 Sep 2019 09:22:53 +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 46gNVj3X1Qz41D4; Sat, 28 Sep 2019 09:22:53 +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 5C709274C1; Sat, 28 Sep 2019 09:22:53 +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 x8S9MrMw054556; Sat, 28 Sep 2019 09:22:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8S9MqlC054553; Sat, 28 Sep 2019 09:22:52 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201909280922.x8S9MqlC054553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 28 Sep 2019 09:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352837 - in head: share/man/man3 sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man3 sys/sys X-SVN-Commit-Revision: 352837 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: Sat, 28 Sep 2019 09:22:53 -0000 Author: trasz Date: Sat Sep 28 09:22:52 2019 New Revision: 352837 URL: https://svnweb.freebsd.org/changeset/base/352837 Log: Add RB_REINSERT(3), a low overhead alternative to removing a node and reinserting it back with an updated key. This is one of dependencies for the upcoming stats(3) code. Reviewed by: cem Obtained from: Netflix MFC after: 2 weeks Sponsored by: Klara Inc, Netflix Differential Revision: https://reviews.freebsd.org/D21786 Modified: head/share/man/man3/Makefile head/share/man/man3/tree.3 head/sys/sys/tree.h Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Sat Sep 28 09:12:41 2019 (r352836) +++ head/share/man/man3/Makefile Sat Sep 28 09:22:52 2019 (r352837) @@ -324,6 +324,7 @@ MLINKS+= tree.3 RB_EMPTY.3 \ tree.3 RB_PROTOTYPE_REMOVE.3 \ tree.3 RB_PROTOTYPE_REMOVE_COLOR.3 \ tree.3 RB_PROTOTYPE_STATIC.3 \ + tree.3 RB_REINSERT.3 \ tree.3 RB_REMOVE.3 \ tree.3 RB_RIGHT.3 \ tree.3 RB_ROOT.3 \ Modified: head/share/man/man3/tree.3 ============================================================================== --- head/share/man/man3/tree.3 Sat Sep 28 09:12:41 2019 (r352836) +++ head/share/man/man3/tree.3 Sat Sep 28 09:22:52 2019 (r352837) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2019 +.Dd September 28, 2019 .Dt TREE 3 .Os .Sh NAME @@ -62,6 +62,7 @@ .Nm RB_PROTOTYPE_NEXT , .Nm RB_PROTOTYPE_PREV , .Nm RB_PROTOTYPE_MINMAX , +.Nm RB_PROTOTYPE_REINSERT , .Nm RB_GENERATE , .Nm RB_GENERATE_STATIC , .Nm RB_GENERATE_INSERT , @@ -73,6 +74,7 @@ .Nm RB_GENERATE_NEXT , .Nm RB_GENERATE_PREV , .Nm RB_GENERATE_MINMAX , +.Nm RB_GENERATE_REINSERT , .Nm RB_ENTRY , .Nm RB_HEAD , .Nm RB_INITIALIZER , @@ -95,7 +97,8 @@ .Nm RB_FOREACH_REVERSE_SAFE , .Nm RB_INIT , .Nm RB_INSERT , -.Nm RB_REMOVE +.Nm RB_REMOVE , +.Nm RB_REINSERT .Nd "implementations of splay and red-black trees" .Sh SYNOPSIS .In sys/tree.h @@ -138,6 +141,7 @@ .Fn RB_PROTOTYPE_NEXT NAME TYPE ATTR .Fn RB_PROTOTYPE_PREV NAME TYPE ATTR .Fn RB_PROTOTYPE_MINMAX NAME TYPE ATTR +.Fn RB_PROTOTYPE_REINSERT NAME TYPE ATTR .Fn RB_GENERATE NAME TYPE FIELD CMP .Fn RB_GENERATE_STATIC NAME TYPE FIELD CMP .Fn RB_GENERATE_INSERT NAME TYPE FIELD CMP ATTR @@ -149,6 +153,7 @@ .Fn RB_GENERATE_NEXT NAME TYPE FIELD ATTR .Fn RB_GENERATE_PREV NAME TYPE FIELD ATTR .Fn RB_GENERATE_MINMAX NAME TYPE FIELD ATTR +.Fn RB_GENERATE_REINSERT NAME TYPE FIELD CMP ATTR .Fn RB_ENTRY TYPE .Fn RB_HEAD HEADNAME TYPE .Fn RB_INITIALIZER "RB_HEAD *head" @@ -186,6 +191,8 @@ .Fn RB_INSERT NAME "RB_HEAD *head" "struct TYPE *elm" .Ft "struct TYPE *" .Fn RB_REMOVE NAME "RB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" +.Fn RB_REINSERT NAME "RB_HEAD *head" "struct TYPE *elm" .Sh DESCRIPTION These macros define data structures for different types of trees: splay trees and red-black trees. @@ -422,8 +429,9 @@ Individual prototypes can be declared with .Fn RB_PROTOTYPE_NFIND , .Fn RB_PROTOTYPE_NEXT , .Fn RB_PROTOTYPE_PREV , +.Fn RB_PROTOTYPE_MINMAX , and -.Fn RB_PROTOTYPE_MINMAX +.Fn RB_PROTOTYPE_REINSERT in case not all functions are required. The individual prototype macros expect .Fa NAME , @@ -456,8 +464,9 @@ As an alternative individual function bodies are gener .Fn RB_GENERATE_NFIND , .Fn RB_GENERATE_NEXT , .Fn RB_GENERATE_PREV , +.Fn RB_GENERATE_MINMAX , and -.Fn RB_GENERATE_MINMAX +.Fn RB_GENERATE_REINSERT macros. .Pp Finally, @@ -559,6 +568,18 @@ and will be overwritten to provide safe traversal. The .Fn RB_EMPTY macro should be used to check whether a red-black tree is empty. +.Pp +The +.Fn RB_REINSERT +macro updates the position of the element +.Fa elm +in the tree. +This must be called if a member of a +.Nm tree +is modified in a way that affects comparison, such as by modifying +a node's key. +This is a lower overhead alternative to removing the element +and reinserting it again. .Sh EXAMPLES The following example demonstrates how to declare a red-black tree holding integers. Modified: head/sys/sys/tree.h ============================================================================== --- head/sys/sys/tree.h Sat Sep 28 09:12:41 2019 (r352836) +++ head/sys/sys/tree.h Sat Sep 28 09:22:52 2019 (r352837) @@ -393,7 +393,8 @@ struct { \ RB_PROTOTYPE_NFIND(name, type, attr); \ RB_PROTOTYPE_NEXT(name, type, attr); \ RB_PROTOTYPE_PREV(name, type, attr); \ - RB_PROTOTYPE_MINMAX(name, type, attr); + RB_PROTOTYPE_MINMAX(name, type, attr); \ + RB_PROTOTYPE_REINSERT(name, type, attr); #define RB_PROTOTYPE_INSERT_COLOR(name, type, attr) \ attr void name##_RB_INSERT_COLOR(struct name *, struct type *) #define RB_PROTOTYPE_REMOVE_COLOR(name, type, attr) \ @@ -412,6 +413,8 @@ struct { \ attr struct type *name##_RB_PREV(struct type *) #define RB_PROTOTYPE_MINMAX(name, type, attr) \ attr struct type *name##_RB_MINMAX(struct name *, int) +#define RB_PROTOTYPE_REINSERT(name, type, attr) \ + attr struct type *name##_RB_REINSERT(struct name *, struct type *) /* Main rb operation. * Moves node close to the key of elm to top @@ -429,8 +432,10 @@ struct { \ RB_GENERATE_NFIND(name, type, field, cmp, attr) \ RB_GENERATE_NEXT(name, type, field, attr) \ RB_GENERATE_PREV(name, type, field, attr) \ - RB_GENERATE_MINMAX(name, type, field, attr) + RB_GENERATE_MINMAX(name, type, field, attr) \ + RB_GENERATE_REINSERT(name, type, field, cmp, attr) + #define RB_GENERATE_INSERT_COLOR(name, type, field, attr) \ attr void \ name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ @@ -758,6 +763,22 @@ name##_RB_MINMAX(struct name *head, int val) \ return (parent); \ } +#define RB_GENERATE_REINSERT(name, type, field, cmp, attr) \ +attr struct type * \ +name##_RB_REINSERT(struct name *head, struct type *elm) \ +{ \ + struct type *cmpelm; \ + if (((cmpelm = RB_PREV(name, head, elm)) != NULL && \ + cmp(cmpelm, elm) >= 0) || \ + ((cmpelm = RB_NEXT(name, head, elm)) != NULL && \ + cmp(elm, cmpelm) >= 0)) { \ + /* XXXLAS: Remove/insert is heavy handed. */ \ + RB_REMOVE(name, head, elm); \ + return (RB_INSERT(name, head, elm)); \ + } \ + return (NULL); \ +} \ + #define RB_NEGINF -1 #define RB_INF 1 @@ -769,6 +790,7 @@ name##_RB_MINMAX(struct name *head, int val) \ #define RB_PREV(name, x, y) name##_RB_PREV(y) #define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF) #define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF) +#define RB_REINSERT(name, x, y) name##_RB_REINSERT(x, y) #define RB_FOREACH(x, name, head) \ for ((x) = RB_MIN(name, head); \ From owner-svn-src-head@freebsd.org Sat Sep 28 09:37: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 D5F8A121809; Sat, 28 Sep 2019 09:37:05 +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 46gNq55Mqzz41f7; Sat, 28 Sep 2019 09:37:05 +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 9784227696; Sat, 28 Sep 2019 09:37:05 +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 x8S9b5Q5060792; Sat, 28 Sep 2019 09:37:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8S9b5R7060791; Sat, 28 Sep 2019 09:37:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201909280937.x8S9b5R7060791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 28 Sep 2019 09:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352838 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 352838 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: Sat, 28 Sep 2019 09:37:05 -0000 Author: trasz Date: Sat Sep 28 09:37:05 2019 New Revision: 352838 URL: https://svnweb.freebsd.org/changeset/base/352838 Log: Sort MLINKS for arb(3), and actually make them work by fixing a '=' vs '+=' mixup. MFC after: 2 weeks Sponsored by: Klara Inc, Netflix Modified: head/share/man/man3/Makefile Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Sat Sep 28 09:22:52 2019 (r352837) +++ head/share/man/man3/Makefile Sat Sep 28 09:37:05 2019 (r352838) @@ -33,43 +33,43 @@ MAN= arb.3 \ timeradd.3 \ tree.3 -MLINKS+= arb.3 ARB8_ENTRY.3 \ - arb.3 ARB16_ENTRY.3 \ - arb.3 ARB32_ENTRY.3 \ +MLINKS= arb.3 ARB8_ENTRY.3 \ arb.3 ARB8_HEAD.3 \ + arb.3 ARB16_ENTRY.3 \ arb.3 ARB16_HEAD.3 \ + arb.3 ARB32_ENTRY.3 \ arb.3 ARB32_HEAD.3 \ arb.3 ARB_ALLOCSIZE.3 \ - arb.3 ARB_INITIALIZER.3 \ - arb.3 ARB_ROOT.3 \ - arb.3 ARB_EMPTY.3 \ - arb.3 ARB_FULL.3 \ arb.3 ARB_CURNODES.3 \ - arb.3 ARB_MAXNODES.3 \ - arb.3 ARB_NEXT.3 \ - arb.3 ARB_PREV.3 \ - arb.3 ARB_MIN.3 \ - arb.3 ARB_MAX.3 \ + arb.3 ARB_EMPTY.3 \ arb.3 ARB_FIND.3 \ - arb.3 ARB_NFIND.3 \ - arb.3 ARB_LEFT.3 \ - arb.3 ARB_LEFTIDX.3 \ - arb.3 ARB_RIGHT.3 \ - arb.3 ARB_RIGHTIDX.3 \ - arb.3 ARB_PARENT.3 \ - arb.3 ARB_PARENTIDX.3 \ - arb.3 ARB_GETFREE.3 \ - arb.3 ARB_FREEIDX.3 \ arb.3 ARB_FOREACH.3 \ arb.3 ARB_FOREACH_FROM.3 \ - arb.3 ARB_FOREACH_SAFE.3 \ arb.3 ARB_FOREACH_REVERSE.3 \ arb.3 ARB_FOREACH_REVERSE_FROM.3 \ arb.3 ARB_FOREACH_REVERSE_SAFE.3 \ + arb.3 ARB_FOREACH_SAFE.3 \ + arb.3 ARB_FREEIDX.3 \ + arb.3 ARB_FULL.3 \ + arb.3 ARB_GETFREE.3 \ arb.3 ARB_INIT.3 \ + arb.3 ARB_INITIALIZER.3 \ arb.3 ARB_INSERT.3 \ - arb.3 ARB_REMOVE.3 -MLINKS= ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \ + arb.3 ARB_LEFT.3 \ + arb.3 ARB_LEFTIDX.3 \ + arb.3 ARB_MAX.3 \ + arb.3 ARB_MAXNODES.3 \ + arb.3 ARB_MIN.3 \ + arb.3 ARB_NEXT.3 \ + arb.3 ARB_NFIND.3 \ + arb.3 ARB_PARENT.3 \ + arb.3 ARB_PARENTIDX.3 \ + arb.3 ARB_PREV.3 \ + arb.3 ARB_REMOVE.3 \ + arb.3 ARB_RIGHT.3 \ + arb.3 ARB_RIGHTIDX.3 \ + arb.3 ARB_ROOT.3 +MLINKS+= ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak_explicit.3 \ From owner-svn-src-head@freebsd.org Sat Sep 28 09:50: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 E0440121CF4; Sat, 28 Sep 2019 09:50: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 46gP625dfBz42JT; Sat, 28 Sep 2019 09:50:02 +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 A4CB92785B; Sat, 28 Sep 2019 09:50:02 +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 x8S9o2kY066711; Sat, 28 Sep 2019 09:50:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8S9o2XY066708; Sat, 28 Sep 2019 09:50:02 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201909280950.x8S9o2XY066708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 28 Sep 2019 09:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352839 - in head: share/man/man3 sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man3 sys/sys X-SVN-Commit-Revision: 352839 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: Sat, 28 Sep 2019 09:50:02 -0000 Author: trasz Date: Sat Sep 28 09:50:01 2019 New Revision: 352839 URL: https://svnweb.freebsd.org/changeset/base/352839 Log: Rename ARB_REBALANCE(3) to ARB_REINSERT(3) to match tree(3), and document it. MFC after: 2 weeks Sponsored by: Klara Inc, Netflix Modified: head/share/man/man3/Makefile head/share/man/man3/arb.3 head/sys/sys/arb.h Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Sat Sep 28 09:37:05 2019 (r352838) +++ head/share/man/man3/Makefile Sat Sep 28 09:50:01 2019 (r352839) @@ -65,6 +65,7 @@ MLINKS= arb.3 ARB8_ENTRY.3 \ arb.3 ARB_PARENT.3 \ arb.3 ARB_PARENTIDX.3 \ arb.3 ARB_PREV.3 \ + arb.3 ARB_REINSERT.3 \ arb.3 ARB_REMOVE.3 \ arb.3 ARB_RIGHT.3 \ arb.3 ARB_RIGHTIDX.3 \ Modified: head/share/man/man3/arb.3 ============================================================================== --- head/share/man/man3/arb.3 Sat Sep 28 09:37:05 2019 (r352838) +++ head/share/man/man3/arb.3 Sat Sep 28 09:50:01 2019 (r352839) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2019 +.Dd September 28, 2019 .Dt ARB 3 .Os .Sh NAME @@ -45,6 +45,7 @@ .Nm ARB_PROTOTYPE_NEXT , .Nm ARB_PROTOTYPE_PREV , .Nm ARB_PROTOTYPE_MINMAX , +.Nm ARB_PROTOTYPE_REINSERT , .Nm ARB_GENERATE , .Nm ARB_GENERATE_STATIC , .Nm ARB_GENERATE_INSERT , @@ -56,6 +57,7 @@ .Nm ARB_GENERATE_NEXT , .Nm ARB_GENERATE_PREV , .Nm ARB_GENERATE_MINMAX , +.Nm ARB_GENERATE_REINSERT , .Nm ARB8_ENTRY , .Nm ARB16_ENTRY , .Nm ARB32_ENTRY , @@ -91,7 +93,8 @@ .Nm ARB_FOREACH_REVERSE_SAFE , .Nm ARB_INIT , .Nm ARB_INSERT , -.Nm ARB_REMOVE +.Nm ARB_REMOVE , +.Nm ARB_REINSERT .Nd "array-based red-black trees" .Sh SYNOPSIS .In sys/arb.h @@ -106,6 +109,7 @@ .Fn ARB_PROTOTYPE_NEXT NAME TYPE ATTR .Fn ARB_PROTOTYPE_PREV NAME TYPE ATTR .Fn ARB_PROTOTYPE_MINMAX NAME TYPE ATTR +.Fn ARB_PROTOTYPE_REINSERT NAME TYPE ATTR .Fn ARB_GENERATE NAME TYPE FIELD CMP .Fn ARB_GENERATE_STATIC NAME TYPE FIELD CMP .Fn ARB_GENERATE_INSERT NAME TYPE FIELD CMP ATTR @@ -117,6 +121,7 @@ .Fn ARB_GENERATE_NEXT NAME TYPE FIELD ATTR .Fn ARB_GENERATE_PREV NAME TYPE FIELD ATTR .Fn ARB_GENERATE_MINMAX NAME TYPE FIELD ATTR +.Fn ARB_GENERATE_REINSERT NAME TYPE FIELD CMP ATTR .Fn ARB<8|16|32>_ENTRY .Fn ARB<8|16|32>_HEAD HEADNAME TYPE .Ft "size_t" @@ -172,6 +177,8 @@ .Fn ARB_INSERT NAME "ARB_HEAD *head" "struct TYPE *elm" .Ft "struct TYPE *" .Fn ARB_REMOVE NAME "ARB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" +.Fn ARB_REINSERT NAME "ARB_HEAD *head" "struct TYPE *elm" .Sh DESCRIPTION These macros define data structures for and array-based red-black trees. They use a single, continuous chunk of memory, and are useful @@ -297,8 +304,9 @@ Individual prototypes can be declared with .Fn ARB_PROTOTYPE_NFIND , .Fn ARB_PROTOTYPE_NEXT , .Fn ARB_PROTOTYPE_PREV , +.Fn ARB_PROTOTYPE_MINMAX , and -.Fn ARB_PROTOTYPE_MINMAX +.Fn ARB_PROTOTYPE_REINSERT in case not all functions are required. The individual prototype macros expect .Fa NAME , @@ -331,8 +339,9 @@ As an alternative individual function bodies are gener .Fn ARB_GENERATE_NFIND , .Fn ARB_GENERATE_NEXT , .Fn ARB_GENERATE_PREV , +.Fn ARB_GENERATE_MINMAX , and -.Fn ARB_GENERATE_MINMAX +.Fn ARB_GENERATE_REINSERT macros. .Pp Finally, @@ -464,6 +473,18 @@ Accordingly, returns the pointer to the removed element otherwise they return .Dv NULL to indicate an error. +.Pp +The +.Fn RB_REINSERT +macro updates the position of the element +.Fa elm +in the tree. +This must be called if a member of a +.Nm tree +is modified in a way that affects comparison, such as by modifying +a node's key. +This is a lower overhead alternative to removing the element +and reinserting it again. .Sh SEE ALSO .Xr queue 3 , .Xr tree 3 Modified: head/sys/sys/arb.h ============================================================================== --- head/sys/sys/arb.h Sat Sep 28 09:37:05 2019 (r352838) +++ head/sys/sys/arb.h Sat Sep 28 09:50:01 2019 (r352839) @@ -253,7 +253,7 @@ struct { \ ARB_PROTOTYPE_PREV(name, type, attr); \ ARB_PROTOTYPE_CMINMAX(name, type, attr); \ ARB_PROTOTYPE_MINMAX(name, type, attr); \ - ARB_PROTOTYPE_REBALANCE(name, type, attr); + ARB_PROTOTYPE_REINSERT(name, type, attr); #define ARB_PROTOTYPE_INSERT_COLOR(name, type, attr) \ attr void name##_ARB_INSERT_COLOR(struct name *, struct type *) #define ARB_PROTOTYPE_REMOVE_COLOR(name, type, attr) \ @@ -289,8 +289,8 @@ struct { \ attr const struct type *name##_ARB_CMINMAX(const struct name *, int) #define ARB_PROTOTYPE_MINMAX(name, type, attr) \ attr struct type *name##_ARB_MINMAX(const struct name *, int) -#define ARB_PROTOTYPE_REBALANCE(name, type, attr) \ - attr struct type *name##_ARB_REBALANCE(struct name *, struct type *) +#define ARB_PROTOTYPE_REINSERT(name, type, attr) \ + attr struct type *name##_ARB_REINSERT(struct name *, struct type *) #define ARB_GENERATE(name, type, field, cmp) \ ARB_GENERATE_INTERNAL(name, type, field, cmp,) @@ -309,7 +309,7 @@ struct { \ ARB_GENERATE_PREV(name, type, field, attr) \ ARB_GENERATE_CMINMAX(name, type, field, attr) \ ARB_GENERATE_MINMAX(name, type, field, attr) \ - ARB_GENERATE_REBALANCE(name, type, field, cmp, attr) + ARB_GENERATE_REINSERT(name, type, field, cmp, attr) #define ARB_GENERATE_INSERT_COLOR(name, type, field, attr) \ attr void \ @@ -695,9 +695,9 @@ attr struct type * \ name##_ARB_MINMAX(const struct name *head, int val) \ { return (__DECONST(struct type *, name##_ARB_CMINMAX(head, val))); } -#define ARB_GENERATE_REBALANCE(name, type, field, cmp, attr) \ +#define ARB_GENERATE_REINSERT(name, type, field, cmp, attr) \ attr struct type * \ -name##_ARB_REBALANCE(struct name *head, struct type *elm) \ +name##_ARB_REINSERT(struct name *head, struct type *elm) \ { \ struct type *cmpelm; \ if (((cmpelm = ARB_PREV(name, head, elm)) != NULL && \ @@ -731,7 +731,7 @@ name##_ARB_REBALANCE(struct name *head, struct type *e name##_ARB_CMINMAX(x, ARB_INF) : ARB_CNODE(x, ARB_MAXIDX(x))) #define ARB_MAX(name, x) (ARB_MAXIDX(x) == ARB_NULLIDX ? \ name##_ARB_MINMAX(x, ARB_INF) : ARB_NODE(x, ARB_MAXIDX(x))) -#define ARB_REBALANCE(name, x, y) name##_ARB_REBALANCE(x, y) +#define ARB_REINSERT(name, x, y) name##_ARB_REINSERT(x, y) #define ARB_FOREACH(x, name, head) \ for ((x) = ARB_MIN(name, head); \ From owner-svn-src-head@freebsd.org Sat Sep 28 09:54: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 D21E9121FE2; Sat, 28 Sep 2019 09:54:03 +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 46gPBg56Fjz42jH; Sat, 28 Sep 2019 09:54:03 +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 7D90F27A0D; Sat, 28 Sep 2019 09:54:03 +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 x8S9s3BN071998; Sat, 28 Sep 2019 09:54:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8S9s3i6071997; Sat, 28 Sep 2019 09:54:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201909280954.x8S9s3i6071997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 28 Sep 2019 09:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352840 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 352840 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: Sat, 28 Sep 2019 09:54:03 -0000 Author: trasz Date: Sat Sep 28 09:54:03 2019 New Revision: 352840 URL: https://svnweb.freebsd.org/changeset/base/352840 Log: Fix Q_TOSTR(3) with GCC when it's called with first parameter being const. Discussed with: cem MFC after: 2 weeks Sponsored by: Klara Inc, Netflix Differential Revision: https://reviews.freebsd.org/D21766 Modified: head/sys/sys/qmath.h Modified: head/sys/sys/qmath.h ============================================================================== --- head/sys/sys/qmath.h Sat Sep 28 09:50:01 2019 (r352839) +++ head/sys/sys/qmath.h Sat Sep 28 09:54:03 2019 (r352840) @@ -58,11 +58,16 @@ typedef uint64_t u64q_t; typedef s64q_t smaxq_t; typedef u64q_t umaxq_t; +#if defined(__GNUC__) +/* Ancient GCC hack to de-const, remove when GCC4 is removed. */ +#define Q_BT(q) __typeof(1 * q) +#else /* The underlying base type of 'q'. */ #define Q_BT(q) __typeof(q) +#endif /* Type-cast variable 'v' to the same underlying type as 'q'. */ -#define Q_TC(q, v) ((Q_BT(q))(v)) +#define Q_TC(q, v) ((__typeof(q))(v)) /* Number of total bits associated with the data type underlying 'q'. */ #define Q_NTBITS(q) ((uint32_t)(sizeof(q) << 3)) From owner-svn-src-head@freebsd.org Sat Sep 28 12:02: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 6AD971257C3; Sat, 28 Sep 2019 12:02:44 +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 46gS382GRZz48vy; Sat, 28 Sep 2019 12:02:44 +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 21906118D; Sat, 28 Sep 2019 12:02:44 +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 x8SC2hxd050327; Sat, 28 Sep 2019 12:02:43 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SC2hwV050325; Sat, 28 Sep 2019 12:02:43 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201909281202.x8SC2hwV050325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sat, 28 Sep 2019 12:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352841 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 352841 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: Sat, 28 Sep 2019 12:02:44 -0000 Author: vmaffione Date: Sat Sep 28 12:02:43 2019 New Revision: 352841 URL: https://svnweb.freebsd.org/changeset/base/352841 Log: bhyve: support for enabling/disabling the net backend Extend the net backend interface with two functions, namely netbe_rx_disable() and netbe_rx_enable(), which can be used by the net device emulators to stop the backend from invoking the receive callback. This is useful for device emulators, i.e., on hardware resets or to implement receive backpressure. The mevent module has been extendede to support the addition of a disabled event. To prevent race conditions, the net backends will start with receive operation disabled. A follow-up patch will use the new functionalities in the virtio-net device. Reviewed by: jhb, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20973 Modified: head/usr.sbin/bhyve/mevent.c head/usr.sbin/bhyve/net_backends.c head/usr.sbin/bhyve/net_backends.h Modified: head/usr.sbin/bhyve/mevent.c ============================================================================== --- head/usr.sbin/bhyve/mevent.c Sat Sep 28 09:54:03 2019 (r352840) +++ head/usr.sbin/bhyve/mevent.c Sat Sep 28 12:02:43 2019 (r352841) @@ -62,10 +62,11 @@ __FBSDID("$FreeBSD$"); #define MEVENT_MAX 64 -#define MEV_ADD 1 -#define MEV_ENABLE 2 -#define MEV_DISABLE 3 -#define MEV_DEL_PENDING 4 +#define MEV_ADD 1 +#define MEV_ENABLE 2 +#define MEV_DISABLE 3 +#define MEV_DEL_PENDING 4 +#define MEV_ADD_DISABLED 5 extern char *vmname; @@ -161,6 +162,9 @@ mevent_kq_flags(struct mevent *mevp) case MEV_ADD: ret = EV_ADD; /* implicitly enabled */ break; + case MEV_ADD_DISABLED: + ret = EV_ADD | EV_DISABLE; + break; case MEV_ENABLE: ret = EV_ENABLE; break; @@ -249,9 +253,10 @@ mevent_handle(struct kevent *kev, int numev) } } -struct mevent * -mevent_add(int tfd, enum ev_type type, - void (*func)(int, enum ev_type, void *), void *param) +static struct mevent * +mevent_add_state(int tfd, enum ev_type type, + void (*func)(int, enum ev_type, void *), void *param, + int state) { struct mevent *lp, *mevp; @@ -299,13 +304,21 @@ mevent_add(int tfd, enum ev_type type, LIST_INSERT_HEAD(&change_head, mevp, me_list); mevp->me_cq = 1; - mevp->me_state = MEV_ADD; + mevp->me_state = state; mevent_notify(); exit: mevent_qunlock(); return (mevp); +} + +struct mevent * +mevent_add(int tfd, enum ev_type type, + void (*func)(int, enum ev_type, void *), void *param) +{ + + return mevent_add_state(tfd, type, func, param, MEV_ADD); } static int Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Sat Sep 28 09:54:03 2019 (r352840) +++ head/usr.sbin/bhyve/net_backends.c Sat Sep 28 12:02:43 2019 (r352841) @@ -110,6 +110,17 @@ struct net_backend { ssize_t (*recv)(struct net_backend *be, struct iovec *iov, int iovcnt); /* + * Ask the backend to enable or disable receive operation in the + * backend. On return from a disable operation, it is guaranteed + * that the receive callback won't be called until receive is + * enabled again. Note however that it is up to the caller to make + * sure that netbe_recv() is not currently being executed by another + * thread. + */ + void (*recv_enable)(struct net_backend *be); + void (*recv_disable)(struct net_backend *be); + + /* * Ask the backend for the virtio-net features it is able to * support. Possible features are TSO, UFO and checksum offloading * in both rx and tx direction and for both IPv4 and IPv6. @@ -248,6 +259,22 @@ tap_recv(struct net_backend *be, struct iovec *iov, in return (ret); } +static void +tap_recv_enable(struct net_backend *be) +{ + struct tap_priv *priv = (struct tap_priv *)be->opaque; + + mevent_enable(priv->mevp); +} + +static void +tap_recv_disable(struct net_backend *be) +{ + struct tap_priv *priv = (struct tap_priv *)be->opaque; + + mevent_disable(priv->mevp); +} + static uint64_t tap_get_cap(struct net_backend *be) { @@ -270,6 +297,8 @@ static struct net_backend tap_backend = { .cleanup = tap_cleanup, .send = tap_send, .recv = tap_recv, + .recv_enable = tap_recv_enable, + .recv_disable = tap_recv_disable, .get_cap = tap_get_cap, .set_cap = tap_set_cap, }; @@ -282,6 +311,8 @@ static struct net_backend vmnet_backend = { .cleanup = tap_cleanup, .send = tap_send, .recv = tap_recv, + .recv_enable = tap_recv_enable, + .recv_disable = tap_recv_disable, .get_cap = tap_get_cap, .set_cap = tap_set_cap, }; @@ -571,6 +602,22 @@ netmap_recv(struct net_backend *be, struct iovec *iov, return (totlen); } +static void +netmap_recv_enable(struct net_backend *be) +{ + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + + mevent_enable(priv->mevp); +} + +static void +netmap_recv_disable(struct net_backend *be) +{ + struct netmap_priv *priv = (struct netmap_priv *)be->opaque; + + mevent_disable(priv->mevp); +} + static struct net_backend netmap_backend = { .prefix = "netmap", .priv_size = sizeof(struct netmap_priv), @@ -578,6 +625,8 @@ static struct net_backend netmap_backend = { .cleanup = netmap_cleanup, .send = netmap_send, .recv = netmap_recv, + .recv_enable = netmap_recv_enable, + .recv_disable = netmap_recv_disable, .get_cap = netmap_get_cap, .set_cap = netmap_set_cap, }; @@ -590,6 +639,8 @@ static struct net_backend vale_backend = { .cleanup = netmap_cleanup, .send = netmap_send, .recv = netmap_recv, + .recv_enable = netmap_recv_enable, + .recv_disable = netmap_recv_disable, .get_cap = netmap_get_cap, .set_cap = netmap_set_cap, }; @@ -805,3 +856,16 @@ netbe_rx_discard(struct net_backend *be) return netbe_recv(be, &iov, 1); } +void +netbe_rx_disable(struct net_backend *be) +{ + + return be->recv_enable(be); +} + +void +netbe_rx_enable(struct net_backend *be) +{ + + return be->recv_disable(be); +} Modified: head/usr.sbin/bhyve/net_backends.h ============================================================================== --- head/usr.sbin/bhyve/net_backends.h Sat Sep 28 09:54:03 2019 (r352840) +++ head/usr.sbin/bhyve/net_backends.h Sat Sep 28 12:02:43 2019 (r352841) @@ -46,6 +46,8 @@ int netbe_set_cap(net_backend_t *be, uint64_t cap, ssize_t netbe_send(net_backend_t *be, struct iovec *iov, int iovcnt); ssize_t netbe_recv(net_backend_t *be, struct iovec *iov, int iovcnt); ssize_t netbe_rx_discard(net_backend_t *be); +void netbe_rx_disable(net_backend_t *be); +void netbe_rx_enable(net_backend_t *be); /* From owner-svn-src-head@freebsd.org Sat Sep 28 13:05:38 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 05174126C7A; Sat, 28 Sep 2019 13:05:38 +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 46gTRj6KF1z4CMr; Sat, 28 Sep 2019 13:05:37 +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 B7E781C4F; Sat, 28 Sep 2019 13:05:37 +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 x8SD5bF5085918; Sat, 28 Sep 2019 13:05:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SD5bPo085917; Sat, 28 Sep 2019 13:05:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909281305.x8SD5bPo085917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 28 Sep 2019 13:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352842 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 352842 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: Sat, 28 Sep 2019 13:05:38 -0000 Author: tuexen Date: Sat Sep 28 13:05:37 2019 New Revision: 352842 URL: https://svnweb.freebsd.org/changeset/base/352842 Log: Ensure that the INP lock is released before leaving [gs]etsockopt() for RACK specific socket options. These issues were found by a syzkaller instance. Reviewed by: rrs@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21825 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Sat Sep 28 12:02:43 2019 (r352841) +++ head/sys/netinet/tcp_stacks/rack.c Sat Sep 28 13:05:37 2019 (r352842) @@ -10261,10 +10261,10 @@ rack_set_sockopt(struct socket *so, struct sockopt *so break; case TCP_RACK_TLP_INC_VAR: /* Does TLP include rtt variance in t-o */ - return (EINVAL); + error = EINVAL; break; case TCP_RACK_IDLE_REDUCE_HIGH: - return (EINVAL); + error = EINVAL; break; case TCP_DELACK: if (optval == 0) @@ -10329,6 +10329,7 @@ rack_get_sockopt(struct socket *so, struct sockopt *so * add a option that is not a int, then this will have quite an * impact to this routine. */ + error = 0; switch (sopt->sopt_name) { case TCP_RACK_DO_DETECTION: optval = rack->do_detection; @@ -10398,10 +10399,10 @@ rack_get_sockopt(struct socket *so, struct sockopt *so break; case TCP_RACK_TLP_INC_VAR: /* Does TLP include rtt variance in t-o */ - return (EINVAL); + error = EINVAL; break; case TCP_RACK_IDLE_REDUCE_HIGH: - return (EINVAL); + error = EINVAL; break; case TCP_RACK_MIN_PACE: optval = rack->r_enforce_min_pace; @@ -10423,7 +10424,9 @@ rack_get_sockopt(struct socket *so, struct sockopt *so break; } INP_WUNLOCK(inp); - error = sooptcopyout(sopt, &optval, sizeof optval); + if (error == 0) { + error = sooptcopyout(sopt, &optval, sizeof optval); + } return (error); } From owner-svn-src-head@freebsd.org Sat Sep 28 13:13: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 C4475126F99; Sat, 28 Sep 2019 13:13:23 +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 46gTcg4qfrz4Cqc; Sat, 28 Sep 2019 13:13:23 +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 8A7121E1C; Sat, 28 Sep 2019 13:13:23 +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 x8SDDNUp091652; Sat, 28 Sep 2019 13:13:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SDDNix091651; Sat, 28 Sep 2019 13:13:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201909281313.x8SDDNix091651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 28 Sep 2019 13:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352843 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 352843 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: Sat, 28 Sep 2019 13:13:23 -0000 Author: tuexen Date: Sat Sep 28 13:13:23 2019 New Revision: 352843 URL: https://svnweb.freebsd.org/changeset/base/352843 Log: Replacing MD5 by SipHash improves the performance of the TCP time stamp initialisation, which is important when the host is dealing with a SYN flood. This affects the computation of the initial TCP sequence number for the client side. This has been discussed with secteam@. Reviewed by: gallatin@ Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D21616 Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sat Sep 28 13:05:37 2019 (r352842) +++ head/sys/netinet/tcp_subr.c Sat Sep 28 13:13:23 2019 (r352843) @@ -126,7 +126,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include @@ -242,7 +242,7 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone); VNET_DEFINE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]); #endif -#define TS_OFFSET_SECRET_LENGTH 32 +#define TS_OFFSET_SECRET_LENGTH SIPHASH_KEY_LENGTH VNET_DEFINE_STATIC(u_char, ts_offset_secret[TS_OFFSET_SECRET_LENGTH]); #define V_ts_offset_secret VNET(ts_offset_secret) @@ -2621,30 +2621,32 @@ out: static uint32_t tcp_keyed_hash(struct in_conninfo *inc, u_char *key, u_int len) { - MD5_CTX ctx; - uint32_t hash[4]; + SIPHASH_CTX ctx; + uint32_t hash[2]; - MD5Init(&ctx); - MD5Update(&ctx, &inc->inc_fport, sizeof(uint16_t)); - MD5Update(&ctx, &inc->inc_lport, sizeof(uint16_t)); + KASSERT(len >= SIPHASH_KEY_LENGTH, + ("%s: keylen %u too short ", __func__, len)); + SipHash24_Init(&ctx); + SipHash_SetKey(&ctx, (uint8_t *)key); + SipHash_Update(&ctx, &inc->inc_fport, sizeof(uint16_t)); + SipHash_Update(&ctx, &inc->inc_lport, sizeof(uint16_t)); switch (inc->inc_flags & INC_ISIPV6) { #ifdef INET case 0: - MD5Update(&ctx, &inc->inc_faddr, sizeof(struct in_addr)); - MD5Update(&ctx, &inc->inc_laddr, sizeof(struct in_addr)); + SipHash_Update(&ctx, &inc->inc_faddr, sizeof(struct in_addr)); + SipHash_Update(&ctx, &inc->inc_laddr, sizeof(struct in_addr)); break; #endif #ifdef INET6 case INC_ISIPV6: - MD5Update(&ctx, &inc->inc6_faddr, sizeof(struct in6_addr)); - MD5Update(&ctx, &inc->inc6_laddr, sizeof(struct in6_addr)); + SipHash_Update(&ctx, &inc->inc6_faddr, sizeof(struct in6_addr)); + SipHash_Update(&ctx, &inc->inc6_laddr, sizeof(struct in6_addr)); break; #endif } - MD5Update(&ctx, key, len); - MD5Final((unsigned char *)hash, &ctx); + SipHash_Final((uint8_t *)hash, &ctx); - return (hash[0]); + return (hash[0] ^ hash[1]); } uint32_t @@ -2711,7 +2713,7 @@ tcp_new_ts_offset(struct in_conninfo *inc) #define ISN_BYTES_PER_SECOND 1048576 #define ISN_STATIC_INCREMENT 4096 #define ISN_RANDOM_INCREMENT (4096 - 1) -#define ISN_SECRET_LENGTH 32 +#define ISN_SECRET_LENGTH SIPHASH_KEY_LENGTH VNET_DEFINE_STATIC(u_char, isn_secret[ISN_SECRET_LENGTH]); VNET_DEFINE_STATIC(int, isn_last); @@ -2740,7 +2742,7 @@ tcp_new_isn(struct in_conninfo *inc) V_isn_last_reseed = ticks; } - /* Compute the md5 hash and return the ISN. */ + /* Compute the hash and return the ISN. */ new_isn = (tcp_seq)tcp_keyed_hash(inc, V_isn_secret, sizeof(V_isn_secret)); V_isn_offset += ISN_STATIC_INCREMENT + From owner-svn-src-head@freebsd.org Sat Sep 28 14:14: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 B5F051285CA; Sat, 28 Sep 2019 14:14:42 +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 46gVzQ4Rr7z4Gg9; Sat, 28 Sep 2019 14:14:42 +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 7BBDA28E3; Sat, 28 Sep 2019 14:14:42 +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 x8SEEgvR027804; Sat, 28 Sep 2019 14:14:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SEEg2Z027803; Sat, 28 Sep 2019 14:14:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201909281414.x8SEEg2Z027803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 28 Sep 2019 14:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352844 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 352844 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: Sat, 28 Sep 2019 14:14:42 -0000 Author: jhb Date: Sat Sep 28 14:14:42 2019 New Revision: 352844 URL: https://svnweb.freebsd.org/changeset/base/352844 Log: Disable REPRODUCIBLE_BUILD for kernel builds. The REPRODUCIBLE_BUILD option is actually managed in two separate files. src.opts.mk governs the setting for world builds and kern.opts.mk governs it for kernel builds. r350550 only changed the default for world builds. Reported by: emaste Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D21444 Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Sat Sep 28 13:13:23 2019 (r352843) +++ head/sys/conf/kern.opts.mk Sat Sep 28 14:14:42 2019 (r352844) @@ -42,7 +42,6 @@ __DEFAULT_YES_OPTIONS = \ KERNEL_SYMBOLS \ NETGRAPH \ PF \ - REPRODUCIBLE_BUILD \ SOURCELESS_HOST \ SOURCELESS_UCODE \ TESTS \ @@ -53,7 +52,8 @@ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ KERNEL_RETPOLINE \ OFED \ - RATELIMIT + RATELIMIT \ + REPRODUCIBLE_BUILD # Some options are totally broken on some architectures. We disable # them. If you need to enable them on an experimental basis, you From owner-svn-src-head@freebsd.org Sat Sep 28 14:20: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 4ABC3128811; Sat, 28 Sep 2019 14:20:29 +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 46gW651HB5z4Gw8; Sat, 28 Sep 2019 14:20:29 +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 0FF9728EC; Sat, 28 Sep 2019 14:20:29 +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 x8SEKSDt028156; Sat, 28 Sep 2019 14:20:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SEKSp3028155; Sat, 28 Sep 2019 14:20:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201909281420.x8SEKSp3028155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 28 Sep 2019 14:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352845 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 352845 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: Sat, 28 Sep 2019 14:20:29 -0000 Author: jhb Date: Sat Sep 28 14:20:28 2019 New Revision: 352845 URL: https://svnweb.freebsd.org/changeset/base/352845 Log: Disable build of LOCAL_MODULES for cross-builds by default. WITHOUT_LOCAL_MODULES can be set to disable LOCAL_MODULES for native builds. WITH_LOCAL_MODULES can be set to leave it enabled for cross builds. This does not use a knob in kern.opts.mk because the options framework does not currently support options whose default varies on the build type. I discussed a few options there with Warner (e.g. maybe having a tri-state where the default value is "auto" and having Makefile.inc1 apply logic when MK_LOCAL_MODULES is set to "auto"), but Warner ok'd this approach for now until a better solution is implemented. Requested by: many Reviewed by: imp (in person at EuroBSDCon) Differential Revision: https://reviews.freebsd.org/D21608 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Sep 28 14:14:42 2019 (r352844) +++ head/Makefile.inc1 Sat Sep 28 14:20:28 2019 (r352845) @@ -678,6 +678,10 @@ CROSSENV+= BUILD_TOOLS_META=.NOMETA .if defined(TARGET_CFLAGS) CROSSENV+= ${TARGET_CFLAGS} .endif +.if (${TARGET} != ${MACHINE} && !defined(WITH_LOCAL_MODULES)) || \ + defined(WITHOUT_LOCAL_MODULES) +CROSSENV+= LOCAL_MODULES= +.endif BOOTSTRAPPING_OSRELDATE?=${OSRELDATE} From owner-svn-src-head@freebsd.org Sat Sep 28 16:35: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 51B9C12B035 for ; Sat, 28 Sep 2019 16:35:11 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (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 46gZ5V6Wzbz4NV8 for ; Sat, 28 Sep 2019 16:35:10 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1569688509; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=twfqhwrPIJ8EBg5i2iQ+PYctIYpaGQeRcYIod+CMKo0Pny38l5xAeXIYxnGWBTpvsz0onQ54h302Q cbiBPPESFlOOV/Yqsrna1j12Ihc1oNQo2jKH78SnZvC5Tkyx1xevwCjnwd0doTiP6sLVd3o01Cwwec XdvymXfT/Aio6Ou0DlFoBPBh2S2xdYleJQJleskXWTiTUJbO6KVGurSpiOWxnLeOC01urRYdGAy/qj vuB9fdYM/EL37gc18RGkicn7Ey9FstksmONB528orKHiMc8J1PbH1xOTH3YVNitrCX9goujdPiEmUu UDnkFdLsHQHMJ12/O+IPXujXmUqSSzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=InRP89POJRp6SJoWzlA2+RR5feZNPRuHTqwKZ9OMqv8=; b=Uho81i/e2VIsGzZNQKpoS1Yg7yOmbCaK5JrUuvBbosFMp61NmAKUJdvDAGU2fGooBZXUeKz5CPaWi XMhiZLRKAaV4fl/3pHo3twebkpsSGLK3IJPP8bx8pWOFNeu0SBmbQmYgwIXGPMtgpjU91/zIO85VHL 1wqfPvYNtf1rwYzcGqVWHZmpEFsvLakT20szpxR219g6KYOfd1WdWA1ugGf2hNCKdknzzyLR1KhAKs Q56lwfmvnsGnTV3etVuEvJVZ7opMY+XUk6LMEgyMwmhWNadNNkiP4fT7PE6VB7GBB5Cj3C1jb1l04q qNt4ZD1nb/yxGH1pV9TzDRYREF4qLlg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=InRP89POJRp6SJoWzlA2+RR5feZNPRuHTqwKZ9OMqv8=; b=KVdyUS2QDmhI4hxr1cT8HuiGlQIT2dNtMijjq30GVtU5ZNKSRE4CGJNqlnZOKWMYvlB+TWJSsyM7f UmNpX9q0pQOOcbmmL8djqo7EI8/pvSR0NnVYFU2QjkBkkaaAUvgmLUiMo3o9frDDlrUn6KtjxN5TLE 7oqdQVzrTGbIaUEqhu6suUjmr0Zo9p2MnFy0BdW8ss5vDiC/4uoDPVrctkAS/TpxXlm5qEhlO3TE6y 2lHtpwmA4AzfDwTUMr/SEEcKT56mRAtEPWhTDIokv0WqhCLSqm/NRPWvWvFOCtJqXzwikD6XwSyhCV oYMgD3hHSVNGjJU73LEE8ilfS8H9IyA== X-MHO-RoutePath: aGlwcGll X-MHO-User: ee080cd8-e20d-11e9-85ed-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id ee080cd8-e20d-11e9-85ed-13b9aae3a1d2; Sat, 28 Sep 2019 16:35:07 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x8SGZ6VI044669; Sat, 28 Sep 2019 10:35:06 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r352838 - head/share/man/man3 From: Ian Lepore To: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 28 Sep 2019 10:35:06 -0600 In-Reply-To: <201909280937.x8S9b5R7060791@repo.freebsd.org> References: <201909280937.x8S9b5R7060791@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46gZ5V6Wzbz4NV8 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country: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: Sat, 28 Sep 2019 16:35:11 -0000 On Sat, 2019-09-28 at 09:37 +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Sep 28 09:37:05 2019 > New Revision: 352838 > URL: https://svnweb.freebsd.org/changeset/base/352838 > > Log: > Sort MLINKS for arb(3), and actually make them work by fixing a '=' > vs '+=' > mixup. > ::sigh:: This wouldn't happen if we just always used += for all lines in lists of things, but sadly (IMO, surrealistically), style.Makefile explicitly prohibits that. I'm not sure what value the prohibition is supposed to provide, but the downsides are making this mistake over and over again, and if you manage to avoid the mistake your consolation prize is a diff that's less-clear because you have to change lines that aren't actually involed in the change you're making. -- Ian From owner-svn-src-head@freebsd.org Sat Sep 28 17:15: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 9F0BE12BB3A; Sat, 28 Sep 2019 17:15:49 +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 46gb0P3l3lz4PvV; Sat, 28 Sep 2019 17:15:49 +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 452014B98; Sat, 28 Sep 2019 17:15:49 +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 x8SHFnjA034895; Sat, 28 Sep 2019 17:15:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SHFmZR034892; Sat, 28 Sep 2019 17:15:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201909281715.x8SHFmZR034892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 28 Sep 2019 17:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352846 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 352846 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: Sat, 28 Sep 2019 17:15:49 -0000 Author: imp Date: Sat Sep 28 17:15:48 2019 New Revision: 352846 URL: https://svnweb.freebsd.org/changeset/base/352846 Log: Revert the mode_t -> int changes and add a warning in the BUGS section instead. While FreeBSD's implementation of these expect an int inside of libc, that's an implementation detail that we can hide from the user as it's the natural promotion of the current mode_t type and before it is used in the kernel, it's converted back to the narrower type that's the current definition of mode_t. As such, documenting int is at best confusing and at worst misleading. Instead add a note that these args are variadic and as such calling conventions may differ from non-variadic arguments. Modified: head/lib/libc/sys/mq_open.2 head/lib/libc/sys/open.2 Modified: head/lib/libc/sys/mq_open.2 ============================================================================== --- head/lib/libc/sys/mq_open.2 Sat Sep 28 14:20:28 2019 (r352845) +++ head/lib/libc/sys/mq_open.2 Sat Sep 28 17:15:48 2019 (r352846) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2014 +.Dd September 28, 2019 .Dt MQ_OPEN 2 .Os .Sh NAME @@ -133,7 +133,7 @@ Create a message queue. It requires two additional arguments: .Fa mode , which is of type -.Vt int , +.Vt mode_t , and .Fa attr , which is a pointer to an @@ -317,6 +317,13 @@ This implementation places strict requirements on the it must begin with a slash .Pq Ql / and contain no other slash characters. +.Pp +The +.Fa mode +and +.Fa attr +arguments are variadic and may result in different calling conventions +than might otherwise be expected. .Sh COPYRIGHT Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Sat Sep 28 14:20:28 2019 (r352845) +++ head/lib/libc/sys/open.2 Sat Sep 28 17:15:48 2019 (r352846) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd September 17, 2019 +.Dd September 28, 2019 .Dt OPEN 2 .Os .Sh NAME @@ -61,7 +61,7 @@ In this case and .Fn openat require an additional argument -.Fa "int mode" , +.Fa "mode_t mode" , and the file is created with mode .Fa mode as described in @@ -615,3 +615,8 @@ permits searches. The present implementation of the .Fa openat checks the current permissions of directory instead. +.Pp +The +.Fa mode +argument is variadic and may result in different calling conventions +than might otherwise be expected. From owner-svn-src-head@freebsd.org Sat Sep 28 17:16: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 3D40012BB7C; Sat, 28 Sep 2019 17:16:04 +0000 (UTC) (envelope-from alc@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 46gb0h0pjCz4Q3H; Sat, 28 Sep 2019 17:16:04 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 006374BA5; Sat, 28 Sep 2019 17:16:04 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8SHG36G034958; Sat, 28 Sep 2019 17:16:03 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SHG3mC034957; Sat, 28 Sep 2019 17:16:03 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201909281716.x8SHG3mC034957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sat, 28 Sep 2019 17:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352847 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 352847 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: Sat, 28 Sep 2019 17:16:04 -0000 Author: alc Date: Sat Sep 28 17:16:03 2019 New Revision: 352847 URL: https://svnweb.freebsd.org/changeset/base/352847 Log: Eliminate redundant calls to critical_enter() and critical_exit() from pmap_update_entry(). It suffices that interrupts are blocked. Reviewed by: andrew, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21753 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sat Sep 28 17:15:48 2019 (r352846) +++ head/sys/arm64/arm64/pmap.c Sat Sep 28 17:16:03 2019 (r352847) @@ -3007,7 +3007,6 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent * as they may make use of an address we are about to invalidate. */ intr = intr_disable(); - critical_enter(); /* * Clear the old mapping's valid bit, but leave the rest of the entry @@ -3021,7 +3020,6 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent pmap_store(pte, newpte); dsb(ishst); - critical_exit(); intr_restore(intr); } From owner-svn-src-head@freebsd.org Sat Sep 28 22:14: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 C111113140F; Sat, 28 Sep 2019 22:14:35 +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 46gjd75RQQz4f3x; Sat, 28 Sep 2019 22:14:35 +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 9D45A8165; Sat, 28 Sep 2019 22:14:35 +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 x8SMEZF5015122; Sat, 28 Sep 2019 22:14:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SMEYRA015115; Sat, 28 Sep 2019 22:14:34 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909282214.x8SMEYRA015115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 28 Sep 2019 22:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352848 - in head/sys: arm/allwinner/clkng conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner/clkng conf X-SVN-Commit-Revision: 352848 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: Sat, 28 Sep 2019 22:14:35 -0000 Author: manu Date: Sat Sep 28 22:14:33 2019 New Revision: 352848 URL: https://svnweb.freebsd.org/changeset/base/352848 Log: arm64: allwinner: a64: Add PLL_MIPI PLL_MIPI is the last important PLL that we missed. Add support for it. Since it's one of the possible parent for TCON0 also add this clock now that we can. While here add some info about what video related clocks should be enabled at boot and with what frequency. Added: head/sys/arm/allwinner/clkng/aw_clk_mipi.c (contents, props changed) head/sys/arm/allwinner/clkng/aw_clk_mipi.h (contents, props changed) Modified: head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm/allwinner/clkng/aw_ccung.h head/sys/arm/allwinner/clkng/aw_clk.h head/sys/arm/allwinner/clkng/ccu_a64.c head/sys/conf/files.arm64 Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Sat Sep 28 17:16:03 2019 (r352847) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Sat Sep 28 22:14:33 2019 (r352848) @@ -311,6 +311,8 @@ aw_ccung_attach(device_t dev) case AW_CLK_FRAC: aw_clk_frac_register(sc->clkdom, sc->clks[i].clk.frac); break; + case AW_CLK_MIPI: + aw_clk_mipi_register(sc->clkdom, sc->clks[i].clk.mipi); } } Modified: head/sys/arm/allwinner/clkng/aw_ccung.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.h Sat Sep 28 17:16:03 2019 (r352847) +++ head/sys/arm/allwinner/clkng/aw_ccung.h Sat Sep 28 22:14:33 2019 (r352848) @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -50,6 +51,7 @@ enum aw_ccung_clk_type { AW_CLK_PREDIV_MUX, AW_CLK_FRAC, AW_CLK_M, + AW_CLK_MIPI, }; struct aw_ccung_clk { @@ -63,6 +65,7 @@ struct aw_ccung_clk { struct aw_clk_prediv_mux_def *prediv_mux; struct aw_clk_frac_def *frac; struct aw_clk_m_def *m; + struct aw_clk_mipi_def *mipi; } clk; }; Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Sat Sep 28 17:16:03 2019 (r352847) +++ head/sys/arm/allwinner/clkng/aw_clk.h Sat Sep 28 22:14:33 2019 (r352848) @@ -73,6 +73,8 @@ struct aw_clk_init { #define AW_CLK_FACTOR_HAS_COND 0x0004 #define AW_CLK_FACTOR_FIXED 0x0008 #define AW_CLK_FACTOR_ZERO_IS_ONE 0x0010 +#define AW_CLK_FACTOR_MIN_VALUE 0x0020 +#define AW_CLK_FACTOR_MAX_VALUE 0x0040 struct aw_clk_factor { uint32_t shift; /* Shift bits for the factor */ @@ -85,6 +87,9 @@ struct aw_clk_factor { uint32_t cond_width; uint32_t cond_value; + uint32_t min_value; + uint32_t max_value; + uint32_t flags; /* Flags */ }; @@ -147,6 +152,8 @@ aw_clk_factor_get_min(struct aw_clk_factor *factor) min = factor->value; else if (factor->flags & AW_CLK_FACTOR_ZERO_BASED) min = 0; + else if (factor->flags & AW_CLK_FACTOR_MIN_VALUE) + min = factor->min_value; else min = 1; @@ -166,7 +173,9 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, else if (factor->flags & AW_CLK_FACTOR_POWER_OF_TWO) { for (val = 0; raw != 1; val++) raw >>= 1; - } else + } else if (factor->flags & AW_CLK_FACTOR_MAX_VALUE) + val = factor->max_value; + else val = raw - 1; return (val); @@ -456,6 +465,32 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .prediv.cond_mask = _prediv_cond_mask, \ .prediv.cond_value = _prediv_cond_value, \ } + +#define MIPI_CLK(_clkname, _id, _name, _pnames, \ + _offset, \ + _kshift, _kwidth, _kflags, _kmin, \ + _mshift, _mwidth, \ + _nshift, _nwidth, \ + _gate_shift, _lock_shift) \ + static struct aw_clk_mipi_def _clkname = { \ + .clkdef = { \ + .id = _id, \ + .name = _name, \ + .parent_names = _pnames, \ + .parent_cnt = nitems(_pnames) \ + }, \ + .offset = _offset, \ + .k.shift = _kshift, \ + .k.width = _kwidth, \ + .k.flags = _kflags, \ + .k.min_value = _kmin, \ + .m.shift = _mshift, \ + .m.width = _mwidth, \ + .n.shift = _nshift, \ + .n.width = _nwidth, \ + .gate_shift = _gate_shift, \ + .lock_shift = _lock_shift, \ + } #define MUX_CLK(_clkname, _id, _name, _pnames, \ _offset, _shift, _width) \ Added: head/sys/arm/allwinner/clkng/aw_clk_mipi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/aw_clk_mipi.c Sat Sep 28 22:14:33 2019 (r352848) @@ -0,0 +1,300 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * 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 +#include + +#include + +#include +#include + +#include "clkdev_if.h" + +/* #define dprintf(format, arg...) printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */ +#define dprintf(format, arg...) + +/* + * clknode for PLL_MIPI : + * + * clk = (pll_video0 * n * k) / m when vfb_sel=0 + * clk depend on sint_frac, sdiv2, s6p25_7p5, pll_feedback_div when vfb_sel=1 + * + */ + +struct aw_clk_mipi_sc { + uint32_t offset; + + struct aw_clk_factor k; + struct aw_clk_factor m; + struct aw_clk_factor n; + + uint64_t min_freq; + uint64_t max_freq; + + uint32_t gate_shift; + uint32_t lock_shift; + uint32_t lock_retries; + + uint32_t flags; +}; + +#define WRITE4(_clk, off, val) \ + CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) +#define READ4(_clk, off, val) \ + CLKDEV_READ_4(clknode_get_device(_clk), off, val) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) + +#define LDO1_EN_SHIFT 23 +#define LDO2_EN_SHIFT 22 +#define VFB_SEL_SHIFT 16 + +static int +aw_clk_mipi_init(struct clknode *clk, device_t dev) +{ + struct aw_clk_mipi_sc *sc; + + sc = clknode_get_softc(clk); + + clknode_init_parent_idx(clk, 0); + return (0); +} + +static int +aw_clk_mipi_set_gate(struct clknode *clk, bool enable) +{ + struct aw_clk_mipi_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + dprintf("%sabling gate\n", enable ? "En" : "Dis"); + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + if (enable) { + val |= (1 << sc->gate_shift); + val |= (1 << LDO1_EN_SHIFT); + val |= (1 << LDO2_EN_SHIFT); + } else { + val &= ~(1 << sc->gate_shift); + val &= ~(1 << LDO1_EN_SHIFT); + val &= ~(1 << LDO2_EN_SHIFT); + } + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static uint64_t +aw_clk_mipi_find_best(struct aw_clk_mipi_sc *sc, uint64_t fparent, uint64_t *fout, + uint32_t *factor_k, uint32_t *factor_m, uint32_t *factor_n) +{ + uint64_t cur, best; + uint32_t n, k, m; + + best = 0; + *factor_n = 0; + *factor_k = 0; + *factor_m = 0; + + for (n = aw_clk_factor_get_min(&sc->n); n <= aw_clk_factor_get_max(&sc->n); ) { + for (k = aw_clk_factor_get_min(&sc->k); k <= aw_clk_factor_get_max(&sc->k); ) { + for (m = aw_clk_factor_get_min(&sc->m); m <= aw_clk_factor_get_max(&sc->m); ) { + cur = (fparent * n * k) / m; + if ((*fout - cur) < (*fout - best)) { + best = cur; + *factor_n = n; + *factor_k = k; + *factor_m = m; + } + if (best == *fout) + return (best); + m++; + } + k++; + } + n++; + } + + return best; +} + +static int +aw_clk_mipi_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, + int flags, int *stop) +{ + struct aw_clk_mipi_sc *sc; + uint64_t best = 0; + uint32_t best_k, best_m, best_n; + uint32_t k, m, n; + uint32_t val; + uint32_t retry; + + sc = clknode_get_softc(clk); + + best = aw_clk_mipi_find_best(sc, fparent, fout, &best_k, &best_m, &best_n); + + if (best < sc->min_freq || + best > sc->max_freq) { + printf("%s: Cannot set %ju for %s (min=%ju max=%ju)\n", + __func__, best, clknode_get_name(clk), + sc->min_freq, sc->max_freq); + return (ERANGE); + } + if ((flags & CLK_SET_DRYRUN) != 0) { + *fout = best; + *stop = 1; + return (0); + } + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + /* Disable clock during freq changes */ + val &= ~(1 << sc->gate_shift); + WRITE4(clk, sc->offset, val); + + k = aw_clk_factor_get_value(&sc->k, best_k); + n = aw_clk_factor_get_value(&sc->n, best_n); + m = aw_clk_factor_get_value(&sc->m, best_m); + val &= ~sc->k.mask; + val &= ~sc->m.mask; + val &= ~sc->n.mask; + val |= k << sc->k.shift; + val |= m << sc->m.shift; + val |= n << sc->n.shift; + + /* Write the clock changes */ + WRITE4(clk, sc->offset, val); + + /* Enable clock now that we've change it */ + val |= 1 << sc->gate_shift; + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + for (retry = 0; retry < sc->lock_retries; retry++) { + READ4(clk, sc->offset, &val); + if ((val & (1 << sc->lock_shift)) != 0) + break; + DELAY(1000); + } + + *fout = best; + *stop = 1; + + return (0); +} + +static int +aw_clk_mipi_recalc(struct clknode *clk, uint64_t *freq) +{ + struct aw_clk_mipi_sc *sc; + uint32_t val, m, n, k; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + k = aw_clk_get_factor(val, &sc->k); + m = aw_clk_get_factor(val, &sc->m); + n = aw_clk_get_factor(val, &sc->n); + + *freq = (*freq * n * k) / m; + + return (0); +} + +static clknode_method_t aw_mipi_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, aw_clk_mipi_init), + CLKNODEMETHOD(clknode_set_gate, aw_clk_mipi_set_gate), + CLKNODEMETHOD(clknode_recalc_freq, aw_clk_mipi_recalc), + CLKNODEMETHOD(clknode_set_freq, aw_clk_mipi_set_freq), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(aw_mipi_clknode, aw_mipi_clknode_class, aw_mipi_clknode_methods, + sizeof(struct aw_clk_mipi_sc), clknode_class); + +int +aw_clk_mipi_register(struct clkdom *clkdom, struct aw_clk_mipi_def *clkdef) +{ + struct clknode *clk; + struct aw_clk_mipi_sc *sc; + + clk = clknode_create(clkdom, &aw_mipi_clknode_class, &clkdef->clkdef); + if (clk == NULL) + return (1); + + sc = clknode_get_softc(clk); + + sc->offset = clkdef->offset; + + sc->k.shift = clkdef->k.shift; + sc->k.width = clkdef->k.width; + sc->k.mask = ((1 << sc->k.width) - 1) << sc->k.shift; + sc->k.value = clkdef->k.value; + sc->k.flags = clkdef->k.flags; + sc->k.min_value = clkdef->k.min_value; + + sc->m.shift = clkdef->m.shift; + sc->m.width = clkdef->m.width; + sc->m.mask = ((1 << sc->m.width) - 1) << sc->m.shift; + sc->m.value = clkdef->m.value; + sc->m.flags = clkdef->m.flags; + sc->m.min_value = clkdef->m.min_value; + + sc->n.shift = clkdef->n.shift; + sc->n.width = clkdef->n.width; + sc->n.mask = ((1 << sc->n.width) - 1) << sc->n.shift; + sc->n.value = clkdef->n.value; + sc->n.flags = clkdef->n.flags; + sc->n.min_value = clkdef->n.min_value; + + sc->min_freq = clkdef->min_freq; + sc->max_freq = clkdef->max_freq; + + sc->gate_shift = clkdef->gate_shift; + + sc->lock_shift = clkdef->lock_shift; + sc->lock_retries = clkdef->lock_retries; + + sc->flags = clkdef->flags; + + clknode_register(clkdom, clk); + + return (0); +} Added: head/sys/arm/allwinner/clkng/aw_clk_mipi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/aw_clk_mipi.h Sat Sep 28 22:14:33 2019 (r352848) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * 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$ + */ + +#ifndef __AW_CLK_MIPI_H__ +#define __AW_CLK_MIPI_H__ + +#include + +struct aw_clk_mipi_def { + struct clknode_init_def clkdef; + uint32_t offset; + + struct aw_clk_factor k; + struct aw_clk_factor m; + struct aw_clk_factor n; + + uint64_t min_freq; + uint64_t max_freq; + + uint32_t gate_shift; + uint32_t lock_shift; + uint32_t lock_retries; + + uint32_t flags; +}; + +int aw_clk_mipi_register(struct clkdom *clkdom, struct aw_clk_mipi_def *clkdef); + +#endif /* __AW_CLK_MIPI_H__ */ Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Sat Sep 28 17:16:03 2019 (r352847) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Sat Sep 28 22:14:33 2019 (r352848) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #define CLK_PLL_PERIPH1_2X 14 #define CLK_PLL_VIDEO1 15 #define CLK_PLL_GPU 16 +#define CLK_PLL_MIPI 17 #define CLK_PLL_HSIC 18 #define CLK_PLL_DE 19 #define CLK_PLL_DDR1 20 @@ -397,7 +398,15 @@ FRAC_CLK(pll_gpu_clk, 24, 25, /* mode sel, freq sel */ 192000000, 600000000); /* min freq, max freq */ -/* PLL MIPI is missing */ +static const char *pll_mipi_parents[] = {"pll_video0"}; +MIPI_CLK(pll_mipi_clk, + CLK_PLL_MIPI, + "pll_mipi", pll_mipi_parents, + 0x40, + 4, 2, AW_CLK_FACTOR_MIN_VALUE, 2, + 0, 3, + 8, 4, + 31, 28); static const char *pll_hsic_parents[] = {"osc24M"}; FRAC_CLK(pll_hsic_clk, @@ -642,8 +651,13 @@ M_CLK(de_clk, 31, /* gate */ AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ -/* TCON0/1 Needs mux table */ -static const char *tcon1_parents[] = {"pll_video0", "pll_video0", "pll_video1"}; +static const char *tcon0_parents[] = {"pll_mipi", NULL, "pll_video0-2x"}; +MUX_CLK(tcon0_clk, + CLK_TCON0, /* id */ + "tcon0", tcon0_parents, /* name, parents */ + 0x118, 24, 2); /* offset, shift, width */ + +static const char *tcon1_parents[] = {"pll_video0", NULL, "pll_video1"}; M_CLK(tcon1_clk, CLK_TCON1, "tcon1", tcon1_parents, /* id, name, parents */ 0x11C, /* offset */ @@ -726,7 +740,7 @@ static struct aw_ccung_clk a64_ccu_clks[] = { { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph1_2x_clk}, { .type = AW_CLK_FRAC, .clk.frac = &pll_video1_clk}, { .type = AW_CLK_FRAC, .clk.frac = &pll_gpu_clk}, - /* PLL_MIPI */ + { .type = AW_CLK_MIPI, .clk.mipi = &pll_mipi_clk}, { .type = AW_CLK_FRAC, .clk.frac = &pll_hsic_clk}, { .type = AW_CLK_FRAC, .clk.frac = &pll_de_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr1_clk}, @@ -757,6 +771,7 @@ static struct aw_ccung_clk a64_ccu_clks[] = { { .type = AW_CLK_MUX, .clk.mux = &i2s0mux_clk}, { .type = AW_CLK_MUX, .clk.mux = &i2s1mux_clk}, { .type = AW_CLK_MUX, .clk.mux = &i2s2mux_clk}, + { .type = AW_CLK_MUX, .clk.mux = &tcon0_clk}, { .type = AW_CLK_DIV, .clk.div = &axi_clk}, { .type = AW_CLK_DIV, .clk.div = &apb1_clk}, { .type = AW_CLK_DIV, .clk.div = &apb_clk}, @@ -774,6 +789,10 @@ static struct aw_clk_init a64_init_clks[] = { {"ahb1", "pll_periph0", 0, false}, {"ahb2", "pll_periph0", 0, false}, {"dram", "pll_ddr0", 0, false}, + {"pll_de", NULL, 432000000, true}, + {"de", "pll_de", 0, true}, + {"tcon0", "pll_video0-2x", 0, false}, + {"tcon1", "pll_video1", 0, false}, }; static int Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Sep 28 17:16:03 2019 (r352847) +++ head/sys/conf/files.arm64 Sat Sep 28 22:14:33 2019 (r352848) @@ -51,6 +51,7 @@ arm/allwinner/if_awg.c optional awg ext_resources sys arm/allwinner/clkng/aw_ccung.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_frac.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_m.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_mipi.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nkmp.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nm.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt From owner-svn-src-head@freebsd.org Sat Sep 28 22:17: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 DC977131539; Sat, 28 Sep 2019 22:17:26 +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 46gjhQ59Bmz4fCr; Sat, 28 Sep 2019 22:17:26 +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 9505B816D; Sat, 28 Sep 2019 22:17:26 +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 x8SMHQMd015318; Sat, 28 Sep 2019 22:17:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SMHQuu015317; Sat, 28 Sep 2019 22:17:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909282217.x8SMHQuu015317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 28 Sep 2019 22:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352849 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 352849 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: Sat, 28 Sep 2019 22:17:26 -0000 Author: manu Date: Sat Sep 28 22:17:26 2019 New Revision: 352849 URL: https://svnweb.freebsd.org/changeset/base/352849 Log: arm64: rockchip: rk3399: Add usb2 clocks Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3399_cru.c Sat Sep 28 22:14:33 2019 (r352848) +++ head/sys/arm64/rockchip/clk/rk3399_cru.c Sat Sep 28 22:17:26 2019 (r352849) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); /* GATES */ +#define SCLK_USB2PHY0_REF 123 +#define SCLK_USB2PHY1_REF 124 #define ACLK_EMMC_CORE 241 #define ACLK_EMMC_NOC 242 #define ACLK_EMMC_GRF 243 @@ -64,6 +66,10 @@ __FBSDID("$FreeBSD$"); #define PCLK_I2C5 344 #define PCLK_I2C6 345 #define PCLK_I2C7 346 +#define HCLK_HOST0 456 +#define HCLK_HOST0_ARB 457 +#define HCLK_HOST1 458 +#define HCLK_HOST1_ARB 459 #define HCLK_SDMMC 462 static struct rk_cru_gate rk3399_gates[] = { @@ -86,6 +92,8 @@ static struct rk_cru_gate rk3399_gates[] = { /* CRU_CLKGATE_CON6 */ CRU_GATE(0, "gpll_aclk_emmc_src", "gpll", 0x318, 12) CRU_GATE(0, "cpll_aclk_emmc_src", "cpll", 0x318, 13) + CRU_GATE(SCLK_USB2PHY0_REF, "clk_usb2phy0_ref", "xin24m", 0x318, 5) + CRU_GATE(SCLK_USB2PHY1_REF, "clk_usb2phy1_ref", "xin24m", 0x318, 6) /* CRU_CLKGATE_CON7 */ CRU_GATE(0, "gpll_aclk_perilp0_src", "gpll", 0x31C, 0) @@ -94,6 +102,12 @@ static struct rk_cru_gate rk3399_gates[] = { /* CRU_CLKGATE_CON8 */ CRU_GATE(0, "hclk_perilp1_cpll_src", "cpll", 0x320, 1) CRU_GATE(0, "hclk_perilp1_gpll_src", "gpll", 0x320, 0) + + /* CRU_CLKGATE_CON20 */ + CRU_GATE(HCLK_HOST0, "hclk_host0", "hclk_perihp", 0x350, 5) + CRU_GATE(HCLK_HOST0_ARB, "hclk_host0_arb", "hclk_perihp", 0x350, 6) + CRU_GATE(HCLK_HOST1, "hclk_host1", "hclk_perihp", 0x350, 7) + CRU_GATE(HCLK_HOST1_ARB, "hclk_host1_arb", "hclk_perihp", 0x350, 8) /* CRU_CLKGATE_CON22 */ CRU_GATE(PCLK_I2C7, "pclk_rki2c7", "pclk_perilp1", 0x358, 5) From owner-svn-src-head@freebsd.org Sat Sep 28 22:19: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 6CD221315C7; Sat, 28 Sep 2019 22:19:53 +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 46gjlF2FZYz4fLm; Sat, 28 Sep 2019 22:19:53 +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 30A578170; Sat, 28 Sep 2019 22:19:53 +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 x8SMJrtx015511; Sat, 28 Sep 2019 22:19:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SMJq6G015505; Sat, 28 Sep 2019 22:19:52 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909282219.x8SMJq6G015505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 28 Sep 2019 22:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352850 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 352850 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: Sat, 28 Sep 2019 22:19:53 -0000 Author: manu Date: Sat Sep 28 22:19:52 2019 New Revision: 352850 URL: https://svnweb.freebsd.org/changeset/base/352850 Log: arm64: rockchip: Implement resets Module resets where not implemented when rockchip clocks were commited. Implement them. Since all resets registers are contiguous a driver only need to give the start offset and the number of resets. This avoid to have to declare every resets. Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c head/sys/arm64/rockchip/clk/rk3399_cru.c head/sys/arm64/rockchip/clk/rk3399_pmucru.c head/sys/arm64/rockchip/clk/rk_cru.c head/sys/arm64/rockchip/clk/rk_cru.h Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Sat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Sat Sep 28 22:19:52 2019 (r352850) @@ -1083,6 +1083,9 @@ rk3328_cru_attach(device_t dev) sc->clks = rk3328_clks; sc->nclks = nitems(rk3328_clks); + sc->reset_offset = 0x300; + sc->reset_num = 184; + return (rk_cru_attach(dev)); } Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3399_cru.c Sat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk3399_cru.c Sat Sep 28 22:19:52 2019 (r352850) @@ -1673,6 +1673,9 @@ rk3399_cru_attach(device_t dev) sc->clks = rk3399_clks; sc->nclks = nitems(rk3399_clks); + sc->reset_offset = 0x400; + sc->reset_num = 335; + return (rk_cru_attach(dev)); } Modified: head/sys/arm64/rockchip/clk/rk3399_pmucru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3399_pmucru.c Sat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk3399_pmucru.c Sat Sep 28 22:19:52 2019 (r352850) @@ -846,6 +846,9 @@ rk3399_pmucru_attach(device_t dev) sc->clks = rk3399_pmu_clks; sc->nclks = nitems(rk3399_pmu_clks); + sc->reset_offset = 0x110; + sc->reset_num = 30; + return (rk_cru_attach(dev)); } Modified: head/sys/arm64/rockchip/clk/rk_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.c Sat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk_cru.c Sat Sep 28 22:19:52 2019 (r352850) @@ -114,20 +114,23 @@ static int rk_cru_reset_assert(device_t dev, intptr_t id, bool reset) { struct rk_cru_softc *sc; + uint32_t reg; + int bit; uint32_t val; sc = device_get_softc(dev); - if (id >= sc->nresets || sc->resets[id].offset == 0) - return (0); + if (id > sc->reset_num) + return (ENXIO); + reg = sc->reset_offset + id / 16 * 4; + bit = id % 16; + mtx_lock(&sc->mtx); - val = CCU_READ4(sc, sc->resets[id].offset); + val = 0; if (reset) - val &= ~(1 << sc->resets[id].shift); - else - val |= 1 << sc->resets[id].shift; - CCU_WRITE4(sc, sc->resets[id].offset, val); + val = (1 << bit); + CCU_WRITE4(sc, reg, val | ((1 << bit) << 16)); mtx_unlock(&sc->mtx); return (0); @@ -137,18 +140,25 @@ static int rk_cru_reset_is_asserted(device_t dev, intptr_t id, bool *reset) { struct rk_cru_softc *sc; + uint32_t reg; + int bit; uint32_t val; sc = device_get_softc(dev); - if (id >= sc->nresets || sc->resets[id].offset == 0) - return (0); + if (id > sc->reset_num) + return (ENXIO); + reg = sc->reset_offset + id / 16 * 4; + bit = id % 16; mtx_lock(&sc->mtx); - val = CCU_READ4(sc, sc->resets[id].offset); - *reset = (val & (1 << sc->resets[id].shift)) != 0 ? false : true; + val = CCU_READ4(sc, reg); mtx_unlock(&sc->mtx); + *reset = true; + if (val & (1 << bit)) + *reset = true; + return (0); } @@ -256,8 +266,8 @@ rk_cru_attach(device_t dev) clk_set_assigned(dev, node); /* If we have resets, register our self as a reset provider */ - if (sc->resets) - hwreset_register_ofw_provider(dev); + /* if (sc->resets) */ + /* hwreset_register_ofw_provider(dev); */ return (0); } Modified: head/sys/arm64/rockchip/clk/rk_cru.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.h Sat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk_cru.h Sat Sep 28 22:19:52 2019 (r352850) @@ -37,11 +37,6 @@ #include #include -struct rk_cru_reset { - uint32_t offset; - uint32_t shift; -}; - struct rk_cru_gate { const char *name; const char *parent_name; @@ -84,8 +79,8 @@ struct rk_cru_softc { struct clkdom *clkdom; struct mtx mtx; int type; - struct rk_cru_reset *resets; - int nresets; + uint32_t reset_offset; + uint32_t reset_num; struct rk_cru_gate *gates; int ngates; struct rk_clk *clks; From owner-svn-src-head@freebsd.org Sat Sep 28 22:21: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 6EE8F13165C; Sat, 28 Sep 2019 22:21:17 +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 46gjms2PT9z4fWc; Sat, 28 Sep 2019 22:21:17 +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 3708981B1; Sat, 28 Sep 2019 22:21:17 +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 x8SMLHL2016356; Sat, 28 Sep 2019 22:21:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SMLGqx016355; Sat, 28 Sep 2019 22:21:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909282221.x8SMLGqx016355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 28 Sep 2019 22:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352851 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 352851 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: Sat, 28 Sep 2019 22:21:17 -0000 Author: manu Date: Sat Sep 28 22:21:16 2019 New Revision: 352851 URL: https://svnweb.freebsd.org/changeset/base/352851 Log: arm64: rockchip: Fix map_gpio The map_gpio function wasn't correct, the first element is the pin and not the phandle. Modified: head/sys/arm64/rockchip/rk_gpio.c Modified: head/sys/arm64/rockchip/rk_gpio.c ============================================================================== --- head/sys/arm64/rockchip/rk_gpio.c Sat Sep 28 22:19:52 2019 (r352850) +++ head/sys/arm64/rockchip/rk_gpio.c Sat Sep 28 22:21:16 2019 (r352851) @@ -390,9 +390,9 @@ rk_gpio_map_gpios(device_t bus, phandle_t dev, phandle pcell_t *gpios, uint32_t *pin, uint32_t *flags) { - /* The gpios are mapped as */ - *pin = gpios[1]; - *flags = gpios[2]; + /* The gpios are mapped as */ + *pin = gpios[0]; + *flags = gpios[1]; return (0); } From owner-svn-src-head@freebsd.org Sat Sep 28 22:23: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 32B451317EF; Sat, 28 Sep 2019 22:23:22 +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 46gjqG0RzSz4fqG; Sat, 28 Sep 2019 22:23:22 +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 E82008329; Sat, 28 Sep 2019 22:23:21 +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 x8SMNLGu020880; Sat, 28 Sep 2019 22:23:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SMNLH3020879; Sat, 28 Sep 2019 22:23:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909282223.x8SMNLH3020879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 28 Sep 2019 22:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352852 - head/sys/dev/dwc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/dwc X-SVN-Commit-Revision: 352852 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: Sat, 28 Sep 2019 22:23:22 -0000 Author: manu Date: Sat Sep 28 22:23:21 2019 New Revision: 352852 URL: https://svnweb.freebsd.org/changeset/base/352852 Log: dwc: Add more delay for chip reset On rockchip board it seems that the value in the DTS are not enough for reseting the chip, I don't know if the value are really incorrect or if DELAY is not precise enough or if the rockchip gpio driver have some "lag" of some kind or not. For now just add more delay. Modified: head/sys/dev/dwc/if_dwc.c Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Sat Sep 28 22:21:16 2019 (r352851) +++ head/sys/dev/dwc/if_dwc.c Sat Sep 28 22:23:21 2019 (r352852) @@ -1074,16 +1074,13 @@ dwc_reset(device_t dev) if (OF_hasprop(node, "snps,reset-active-low")) pin_value = GPIO_PIN_HIGH; - if (flags & GPIO_ACTIVE_LOW) - pin_value = !pin_value; - GPIO_PIN_SETFLAGS(gpio, pin, GPIO_PIN_OUTPUT); GPIO_PIN_SET(gpio, pin, pin_value); - DELAY(delay_prop[0]); + DELAY(delay_prop[0] * 5); GPIO_PIN_SET(gpio, pin, !pin_value); - DELAY(delay_prop[1]); + DELAY(delay_prop[1] * 5); GPIO_PIN_SET(gpio, pin, pin_value); - DELAY(delay_prop[2]); + DELAY(delay_prop[2] * 5); return (0); } From owner-svn-src-head@freebsd.org Sat Sep 28 22:25: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 F248A131891; Sat, 28 Sep 2019 22:25:22 +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 46gjsZ69vrz4fyK; Sat, 28 Sep 2019 22:25:22 +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 B4005832B; Sat, 28 Sep 2019 22:25:22 +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 x8SMPMcs021033; Sat, 28 Sep 2019 22:25:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SMPMxW021031; Sat, 28 Sep 2019 22:25:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909282225.x8SMPMxW021031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 28 Sep 2019 22:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352853 - in head/sys: arm64/conf arm64/rockchip conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf arm64/rockchip conf X-SVN-Commit-Revision: 352853 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: Sat, 28 Sep 2019 22:25:23 -0000 Author: manu Date: Sat Sep 28 22:25:21 2019 New Revision: 352853 URL: https://svnweb.freebsd.org/changeset/base/352853 Log: arm64: rockchip: Add usb2phy driver This driver is for the usb phy present on rockchip SoC. It only support RK3399 and host mode for now. The driver expose the usb clock needed by the usb controller. Added: head/sys/arm64/rockchip/rk_usb2phy.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat Sep 28 22:23:21 2019 (r352852) +++ head/sys/arm64/conf/GENERIC Sat Sep 28 22:25:21 2019 (r352853) @@ -205,6 +205,7 @@ device pl011 # USB support device aw_ehci # Allwinner EHCI USB interface (USB 2.0) device aw_usbphy # Allwinner USB PHY +device rk_usb2phy # Rockchip USB2PHY device dwcotg # DWC OTG controller device ohci # OHCI USB interface device ehci # EHCI USB interface (USB 2.0) Added: head/sys/arm64/rockchip/rk_usb2phy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_usb2phy.c Sat Sep 28 22:25:21 2019 (r352853) @@ -0,0 +1,374 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Emmanuel Vadot + * + * 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. + */ + +/* + * Rockchip USB2PHY + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "clkdev_if.h" +#include "syscon_if.h" + +#define RK3399_GRF_USB20_PHY0_CON0 0x0 +#define RK3399_GRF_USB20_PHY0_CON1 0x4 +#define RK3399_GRF_USB20_PHY0_CON2 0x8 +#define RK3399_GRF_USB20_PHY0_CON3 0xC + +struct rk_usb2phy_reg { + uint32_t offset; + uint32_t enable_mask; + uint32_t disable_mask; +}; + +struct rk_usb2phy_regs { + struct rk_usb2phy_reg clk_ctl; +}; + +struct rk_usb2phy_regs rk3399_regs = { + .clk_ctl = { + /* bit 4 put pll in suspend */ + .enable_mask = 0x100000, + .disable_mask = 0x100010, + } +}; + +static struct ofw_compat_data compat_data[] = { + { "rockchip,rk3399-usb2phy", (uintptr_t)&rk3399_regs }, + { NULL, 0 } +}; + +struct rk_usb2phy_softc { + device_t dev; + struct syscon *grf; + regulator_t phy_supply; + clk_t clk; +}; + +/* Phy class and methods. */ +static int rk_usb2phy_enable(struct phynode *phynode, bool enable); +static phynode_method_t rk_usb2phy_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, rk_usb2phy_enable), + + PHYNODEMETHOD_END +}; + +DEFINE_CLASS_1(rk_usb2phy_phynode, rk_usb2phy_phynode_class, + rk_usb2phy_phynode_methods, + sizeof(struct phynode_usb_sc), phynode_usb_class); + +enum RK3399_USBPHY { + RK3399_USBPHY_HOST = 0, + RK3399_USBPHY_OTG, +}; + +static int +rk_usb2phy_enable(struct phynode *phynode, bool enable) +{ + struct rk_usb2phy_softc *sc; + device_t dev; + intptr_t phy; + int error; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (phy != RK3399_USBPHY_HOST) + return (ERANGE); + + if (sc->phy_supply) { + if (enable) + error = regulator_enable(sc->phy_supply); + else + error = regulator_disable(sc->phy_supply); + if (error != 0) { + device_printf(dev, "Cannot %sable the regulator\n", + enable ? "En" : "Dis"); + goto fail; + } + } + + return (0); +fail: + return (ENXIO); +} + +/* Clock class and method */ +struct rk_usb2phy_clk_sc { + device_t clkdev; + struct syscon *grf; + struct rk_usb2phy_regs *regs; +}; + +static int +rk_usb2phy_clk_init(struct clknode *clk, device_t dev) +{ + + clknode_init_parent_idx(clk, 0); + return (0); +} + +static int +rk_usb2phy_clk_set_gate(struct clknode *clk, bool enable) +{ + struct rk_usb2phy_clk_sc *sc; + + sc = clknode_get_softc(clk); + + if (enable) + SYSCON_WRITE_4(sc->grf, sc->regs->clk_ctl.offset, + sc->regs->clk_ctl.enable_mask); + else + SYSCON_WRITE_4(sc->grf, sc->regs->clk_ctl.offset, + sc->regs->clk_ctl.disable_mask); + return (0); +} + +static int +rk_usb2phy_clk_recalc(struct clknode *clk, uint64_t *freq) +{ + + *freq = 480000000; + + return (0); +} + +static clknode_method_t rk_usb2phy_clk_clknode_methods[] = { + /* Device interface */ + + CLKNODEMETHOD(clknode_init, rk_usb2phy_clk_init), + CLKNODEMETHOD(clknode_set_gate, rk_usb2phy_clk_set_gate), + CLKNODEMETHOD(clknode_recalc_freq, rk_usb2phy_clk_recalc), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(rk_usb2phy_clk_clknode, rk_usb2phy_clk_clknode_class, + rk_usb2phy_clk_clknode_methods, sizeof(struct rk_usb2phy_clk_sc), + clknode_class); + +static int +rk_usb2phy_clk_ofw_map(struct clkdom *clkdom, uint32_t ncells, + phandle_t *cells, struct clknode **clk) +{ + + if (ncells != 0) + return (ERANGE); + + *clk = clknode_find_by_id(clkdom, 0); + + if (*clk == NULL) + return (ENXIO); + return (0); +} + +static int +rk_usb2phy_export_clock(struct rk_usb2phy_softc *devsc) +{ + struct clknode_init_def def; + struct rk_usb2phy_clk_sc *sc; + const char **clknames; + struct clkdom *clkdom; + struct clknode *clk; + clk_t clk_parent; + phandle_t node; + phandle_t regs[2]; + int i, nclocks, ncells, error; + + node = ofw_bus_get_node(devsc->dev); + + error = ofw_bus_parse_xref_list_get_length(node, "clocks", + "#clock-cells", &ncells); + if (error != 0 || ncells != 1) { + device_printf(devsc->dev, "couldn't find parent clock\n"); + return (ENXIO); + } + + nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", + &clknames); + if (nclocks != 1) + return (ENXIO); + + clkdom = clkdom_create(devsc->dev); + clkdom_set_ofw_mapper(clkdom, rk_usb2phy_clk_ofw_map); + + memset(&def, 0, sizeof(def)); + def.id = 0; + def.name = clknames[0]; + def.parent_names = malloc(sizeof(char *) * ncells, M_OFWPROP, M_WAITOK); + for (i = 0; i < ncells; i++) { + error = clk_get_by_ofw_index(devsc->dev, 0, i, &clk_parent); + if (error != 0) { + device_printf(devsc->dev, "cannot get clock %d\n", error); + return (ENXIO); + } + def.parent_names[i] = clk_get_name(clk_parent); + clk_release(clk_parent); + } + def.parent_cnt = ncells; + + clk = clknode_create(clkdom, &rk_usb2phy_clk_clknode_class, &def); + if (clk == NULL) { + device_printf(devsc->dev, "cannot create clknode\n"); + return (ENXIO); + } + + sc = clknode_get_softc(clk); + sc->clkdev = device_get_parent(devsc->dev); + sc->grf = devsc->grf; + sc->regs = (struct rk_usb2phy_regs *)ofw_bus_search_compatible(devsc->dev, compat_data)->ocd_data; + OF_getencprop(node, "reg", regs, sizeof(regs)); + sc->regs->clk_ctl.offset = regs[0]; + clknode_register(clkdom, clk); + + if (clkdom_finit(clkdom) != 0) { + device_printf(devsc->dev, "cannot finalize clkdom initialization\n"); + return (ENXIO); + } + + if (bootverbose) + clkdom_dump(clkdom); + + return (0); +} + +static int +rk_usb2phy_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Rockchip RK3399 USB2PHY"); + return (BUS_PROBE_DEFAULT); +} + +static int +rk_usb2phy_attach(device_t dev) +{ + struct rk_usb2phy_softc *sc; + struct phynode_init_def phy_init; + struct phynode *phynode; + phandle_t node, host; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + if (syscon_get_handle_default(dev, &sc->grf) != 0) { + device_printf(dev, "Cannot get syscon handle\n"); + return (ENXIO); + } + + if (clk_get_by_ofw_name(dev, 0, "phyclk", &sc->clk) != 0) { + device_printf(dev, "Cannot get clock\n"); + return (ENXIO); + } + err = clk_enable(sc->clk); + if (err != 0) { + device_printf(dev, "Could not enable clock %s\n", + clk_get_name(sc->clk)); + return (ENXIO); + } + + err = rk_usb2phy_export_clock(sc); + if (err != 0) + return (err); + + /* Only host is supported right now */ + + host = ofw_bus_find_child(node, "host-port"); + if (host == 0) { + device_printf(dev, "Cannot find host-port child node\n"); + return (ENXIO); + } + + if (!ofw_bus_node_status_okay(host)) { + device_printf(dev, "host-port isn't okay\n"); + return (0); + } + + regulator_get_by_ofw_property(dev, host, "phy-supply", &sc->phy_supply); + phy_init.id = RK3399_USBPHY_HOST; + phy_init.ofw_node = host; + phynode = phynode_create(dev, &rk_usb2phy_phynode_class, &phy_init); + if (phynode == NULL) { + device_printf(dev, "failed to create host USB2PHY\n"); + return (ENXIO); + } + if (phynode_register(phynode) == NULL) { + device_printf(dev, "failed to register host USB2PHY\n"); + return (ENXIO); + } + + OF_device_register_xref(OF_xref_from_node(host), dev); + + return (0); +} + +static device_method_t rk_usb2phy_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rk_usb2phy_probe), + DEVMETHOD(device_attach, rk_usb2phy_attach), + + DEVMETHOD_END +}; + +static driver_t rk_usb2phy_driver = { + "rk_usb2phy", + rk_usb2phy_methods, + sizeof(struct rk_usb2phy_softc) +}; + +static devclass_t rk_usb2phy_devclass; +EARLY_DRIVER_MODULE(rk_usb2phy, simplebus, rk_usb2phy_driver, + rk_usb2phy_devclass, 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(rk_usb2phy, 1); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Sep 28 22:23:21 2019 (r352852) +++ head/sys/conf/files.arm64 Sat Sep 28 22:25:21 2019 (r352853) @@ -282,6 +282,7 @@ arm64/rockchip/rk805.c optional fdt rk805 soc_rockch arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 arm64/rockchip/rk_pinctrl.c optional fdt rk_pinctrl soc_rockchip_rk3328 | fdt rk_pinctrl soc_rockchip_rk3399 arm64/rockchip/rk_gpio.c optional fdt rk_gpio soc_rockchip_rk3328 | fdt rk_gpio soc_rockchip_rk3399 +arm64/rockchip/rk_usb2phy.c optional fdt rk_usb2phy soc_rockchip_rk3328 | soc_rockchip_rk3399 arm64/rockchip/if_dwc_rk.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 dev/dwc/if_dwc.c optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 dev/dwc/if_dwc_if.m optional fdt dwc_rk soc_rockchip_rk3328 | fdt dwc_rk soc_rockchip_rk3399 From owner-svn-src-head@freebsd.org Sat Sep 28 22:54: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 F02EB1321E3; Sat, 28 Sep 2019 22:54:59 +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 46gkWl6Xssz3D2M; Sat, 28 Sep 2019 22:54:59 +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 BEC0A887E; Sat, 28 Sep 2019 22:54:59 +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 x8SMsxeR039153; Sat, 28 Sep 2019 22:54:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SMsvMP039138; Sat, 28 Sep 2019 22:54:57 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909282254.x8SMsvMP039138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 28 Sep 2019 22:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352858 - in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/apm arm64/arm arm64/bitmain arm64/broadcom arm64/cavium arm64/exynos arm64/freescale arm64/hisilicon ... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/apm arm64/arm arm64/bitmain arm64/broadcom arm64/cavium arm64/exynos arm64/freescale arm64/hisilicon arm64/intel arm64/marvell... X-SVN-Commit-Revision: 352858 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: Sat, 28 Sep 2019 22:55:00 -0000 Author: manu Date: Sat Sep 28 22:54:56 2019 New Revision: 352858 URL: https://svnweb.freebsd.org/changeset/base/352858 Log: Import DTS files from Linux 5.2 Added: - copied unchanged from r352854, vendor/device-tree/dist/src/arm/am5718.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/am5728.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/am5748.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/dra71x.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx50-kobo-aura.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx53-m53menlo.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx6dl-eckelmann-ci4x10.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7-mba7.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7-tqma7.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7d-mba7.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7d-tqma7.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7d-zii-rpu2.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7s-mba7.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7s-tqma7.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp42x-linksys-nslu2.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp42x.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp43x-gateworks-gw2358.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp43x.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp45x-ixp46x.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp4xx.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/omap4-l4-abe.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/omap4-mcpdm.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/omap5-l4-abe.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/rk3288-veyron-mighty.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/stm32mp157a-dk1.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/stm32mp157c-dk2.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/sun8i-h3-rervision-dvk.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/vf610-zii-spb4.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-oceanic-5205-5inmfd.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-beelink-gs1.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-orangepi-3.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/amlogic/meson-g12a-sei510.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mm-evk.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mm.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mq-zii-ultra-rmb3.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mq-zii-ultra-zest.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mq-zii-ultra.dtsi head/sys/gnu/dts/arm64/intel/ - copied from r352854, vendor/device-tree/dist/src/arm64/intel/ - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/mediatek/mt8183-pinfunc.h - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/nvidia/tegra210-p3450-0000.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/rockchip/rk3399-nanopi-neo4.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/rockchip/rk3399-orangepi.dts - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/clock/mt8183-clk.h - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/clock/mt8516-clk.h - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/clock/qcom,turingcc-qcs404.h - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/clock/xlnx-zynqmp-clk.h head/sys/gnu/dts/include/dt-bindings/iio/temperature/ - copied from r352854, vendor/device-tree/dist/include/dt-bindings/iio/temperature/ - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/phy/phy-am654-serdes.h Directory Properties: head/sys/gnu/dts/arm/am5718.dtsi (props changed) head/sys/gnu/dts/arm/am5728.dtsi (props changed) head/sys/gnu/dts/arm/am5748.dtsi (props changed) head/sys/gnu/dts/arm/dra71x.dtsi (props changed) head/sys/gnu/dts/arm/imx50-kobo-aura.dts (props changed) head/sys/gnu/dts/arm/imx53-m53menlo.dts (props changed) head/sys/gnu/dts/arm/imx6dl-eckelmann-ci4x10.dts (props changed) head/sys/gnu/dts/arm/imx7-mba7.dtsi (props changed) head/sys/gnu/dts/arm/imx7-tqma7.dtsi (props changed) head/sys/gnu/dts/arm/imx7d-mba7.dts (props changed) head/sys/gnu/dts/arm/imx7d-tqma7.dtsi (props changed) head/sys/gnu/dts/arm/imx7d-zii-rpu2.dts (props changed) head/sys/gnu/dts/arm/imx7s-mba7.dts (props changed) head/sys/gnu/dts/arm/imx7s-tqma7.dtsi (props changed) head/sys/gnu/dts/arm/intel-ixp42x-linksys-nslu2.dts (props changed) head/sys/gnu/dts/arm/intel-ixp42x.dtsi (props changed) head/sys/gnu/dts/arm/intel-ixp43x-gateworks-gw2358.dts (props changed) head/sys/gnu/dts/arm/intel-ixp43x.dtsi (props changed) head/sys/gnu/dts/arm/intel-ixp45x-ixp46x.dtsi (props changed) head/sys/gnu/dts/arm/intel-ixp4xx.dtsi (props changed) head/sys/gnu/dts/arm/omap4-l4-abe.dtsi (props changed) head/sys/gnu/dts/arm/omap4-mcpdm.dtsi (props changed) head/sys/gnu/dts/arm/omap5-l4-abe.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-veyron-mighty.dts (props changed) head/sys/gnu/dts/arm/stm32mp157a-dk1.dts (props changed) head/sys/gnu/dts/arm/stm32mp157c-dk2.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-rervision-dvk.dts (props changed) head/sys/gnu/dts/arm/vf610-zii-spb4.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-a64-oceanic-5205-5inmfd.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h6-beelink-gs1.dts (props changed) head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-3.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-g12a-sei510.dts (props changed) head/sys/gnu/dts/arm64/freescale/imx8mm-evk.dts (props changed) head/sys/gnu/dts/arm64/freescale/imx8mm.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/imx8mq-zii-ultra-rmb3.dts (props changed) head/sys/gnu/dts/arm64/freescale/imx8mq-zii-ultra-zest.dts (props changed) head/sys/gnu/dts/arm64/freescale/imx8mq-zii-ultra.dtsi (props changed) head/sys/gnu/dts/arm64/mediatek/mt8183-pinfunc.h (props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p3450-0000.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-nanopi-neo4.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-orangepi.dts (props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt8183-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt8516-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,turingcc-qcs404.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/xlnx-zynqmp-clk.h (props changed) head/sys/gnu/dts/include/dt-bindings/phy/phy-am654-serdes.h (props changed) Deleted: head/sys/gnu/dts/include/dt-bindings/clock/xlnx,zynqmp-clk.h Modified: head/sys/gnu/dts/arm/aks-cdu.dts head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts head/sys/gnu/dts/arm/am335x-baltos-leds.dtsi head/sys/gnu/dts/arm/am335x-baltos.dtsi head/sys/gnu/dts/arm/am335x-base0033.dts head/sys/gnu/dts/arm/am335x-bone-common.dtsi head/sys/gnu/dts/arm/am335x-bone.dts head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts head/sys/gnu/dts/arm/am335x-boneblack.dts head/sys/gnu/dts/arm/am335x-boneblue.dts head/sys/gnu/dts/arm/am335x-bonegreen-common.dtsi head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts head/sys/gnu/dts/arm/am335x-bonegreen.dts head/sys/gnu/dts/arm/am335x-chiliboard.dts head/sys/gnu/dts/arm/am335x-chilisom.dtsi head/sys/gnu/dts/arm/am335x-cm-t335.dts head/sys/gnu/dts/arm/am335x-evm.dts head/sys/gnu/dts/arm/am335x-evmsk.dts head/sys/gnu/dts/arm/am335x-icev2.dts head/sys/gnu/dts/arm/am335x-igep0033.dtsi head/sys/gnu/dts/arm/am335x-lxm.dts head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi head/sys/gnu/dts/arm/am335x-moxa-uc-2101.dts head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts head/sys/gnu/dts/arm/am335x-nano.dts head/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts head/sys/gnu/dts/arm/am335x-osd335x-common.dtsi head/sys/gnu/dts/arm/am335x-pcm-953.dtsi head/sys/gnu/dts/arm/am335x-pdu001.dts head/sys/gnu/dts/arm/am335x-pepper.dts head/sys/gnu/dts/arm/am335x-phycore-rdk.dts head/sys/gnu/dts/arm/am335x-phycore-som.dtsi head/sys/gnu/dts/arm/am335x-pocketbeagle.dts head/sys/gnu/dts/arm/am335x-sancloud-bbe.dts head/sys/gnu/dts/arm/am335x-sbc-t335.dts head/sys/gnu/dts/arm/am335x-shc.dts head/sys/gnu/dts/arm/am335x-sl50.dts head/sys/gnu/dts/arm/am335x-wega-rdk.dts head/sys/gnu/dts/arm/am335x-wega.dtsi head/sys/gnu/dts/arm/am33xx-clocks.dtsi head/sys/gnu/dts/arm/am33xx-l4.dtsi head/sys/gnu/dts/arm/am3517-craneboard.dts head/sys/gnu/dts/arm/am3517-evm-ui.dtsi head/sys/gnu/dts/arm/am3517-evm.dts head/sys/gnu/dts/arm/am3517-som.dtsi head/sys/gnu/dts/arm/am3517_mt_ventoux.dts head/sys/gnu/dts/arm/am35xx-clocks.dtsi head/sys/gnu/dts/arm/am437x-cm-t43.dts head/sys/gnu/dts/arm/am437x-gp-evm.dts head/sys/gnu/dts/arm/am437x-idk-evm.dts head/sys/gnu/dts/arm/am437x-l4.dtsi head/sys/gnu/dts/arm/am437x-sbc-t43.dts head/sys/gnu/dts/arm/am437x-sk-evm.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/am43xx-clocks.dtsi head/sys/gnu/dts/arm/am571x-idk.dts head/sys/gnu/dts/arm/am572x-idk.dts head/sys/gnu/dts/arm/am574x-idk.dts head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi head/sys/gnu/dts/arm/am57xx-beagle-x15-revb1.dts head/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts head/sys/gnu/dts/arm/am57xx-beagle-x15.dts head/sys/gnu/dts/arm/am57xx-cl-som-am57x.dts head/sys/gnu/dts/arm/am57xx-idk-common.dtsi head/sys/gnu/dts/arm/am57xx-sbc-am57x.dts head/sys/gnu/dts/arm/animeo_ip.dts head/sys/gnu/dts/arm/armada-38x.dtsi head/sys/gnu/dts/arm/armada-xp-98dx3236.dtsi head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-ariag25.dts head/sys/gnu/dts/arm/at91-cosino.dtsi head/sys/gnu/dts/arm/at91-cosino_mega2560.dts head/sys/gnu/dts/arm/at91-foxg20.dts head/sys/gnu/dts/arm/at91-kizbox.dts head/sys/gnu/dts/arm/at91-kizbox2.dts head/sys/gnu/dts/arm/at91-kizboxmini.dts head/sys/gnu/dts/arm/at91-linea.dtsi head/sys/gnu/dts/arm/at91-qil_a9260.dts head/sys/gnu/dts/arm/at91-sam9_l9260.dts head/sys/gnu/dts/arm/at91-sama5d27_som1.dtsi head/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-sama5d3_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4_ma5d4.dtsi head/sys/gnu/dts/arm/at91-sama5d4_ma5d4evk.dts head/sys/gnu/dts/arm/at91-sama5d4_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4ek.dts head/sys/gnu/dts/arm/at91-tse850-3.dts head/sys/gnu/dts/arm/at91-vinco.dts head/sys/gnu/dts/arm/at91rm9200.dtsi head/sys/gnu/dts/arm/at91rm9200_pqfp.dtsi head/sys/gnu/dts/arm/at91rm9200ek.dts head/sys/gnu/dts/arm/at91sam9260.dtsi head/sys/gnu/dts/arm/at91sam9260ek.dts head/sys/gnu/dts/arm/at91sam9261.dtsi head/sys/gnu/dts/arm/at91sam9261ek.dts head/sys/gnu/dts/arm/at91sam9263.dtsi head/sys/gnu/dts/arm/at91sam9263ek.dts head/sys/gnu/dts/arm/at91sam9g15.dtsi head/sys/gnu/dts/arm/at91sam9g15ek.dts head/sys/gnu/dts/arm/at91sam9g20.dtsi head/sys/gnu/dts/arm/at91sam9g20ek.dts head/sys/gnu/dts/arm/at91sam9g20ek_2mmc.dts head/sys/gnu/dts/arm/at91sam9g20ek_common.dtsi head/sys/gnu/dts/arm/at91sam9g25.dtsi head/sys/gnu/dts/arm/at91sam9g25ek.dts head/sys/gnu/dts/arm/at91sam9g35.dtsi head/sys/gnu/dts/arm/at91sam9g35ek.dts head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9m10g45ek.dts head/sys/gnu/dts/arm/at91sam9n12.dtsi head/sys/gnu/dts/arm/at91sam9n12ek.dts head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9rlek.dts head/sys/gnu/dts/arm/at91sam9x25.dtsi head/sys/gnu/dts/arm/at91sam9x25ek.dts head/sys/gnu/dts/arm/at91sam9x35.dtsi head/sys/gnu/dts/arm/at91sam9x35ek.dts head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/at91sam9x5_can.dtsi head/sys/gnu/dts/arm/at91sam9x5_isi.dtsi head/sys/gnu/dts/arm/at91sam9x5_lcd.dtsi head/sys/gnu/dts/arm/at91sam9x5_macb0.dtsi head/sys/gnu/dts/arm/at91sam9x5_macb1.dtsi head/sys/gnu/dts/arm/at91sam9x5_usart3.dtsi head/sys/gnu/dts/arm/at91sam9x5cm.dtsi head/sys/gnu/dts/arm/at91sam9x5dm.dtsi head/sys/gnu/dts/arm/at91sam9x5ek.dtsi head/sys/gnu/dts/arm/at91sam9xe.dtsi head/sys/gnu/dts/arm/atlas6-evb.dts head/sys/gnu/dts/arm/atlas6.dtsi head/sys/gnu/dts/arm/atlas7-evb.dts head/sys/gnu/dts/arm/atlas7.dtsi head/sys/gnu/dts/arm/axm5516-amarillo.dts head/sys/gnu/dts/arm/axm5516-cpus.dtsi head/sys/gnu/dts/arm/axm55xx.dtsi head/sys/gnu/dts/arm/axp81x.dtsi head/sys/gnu/dts/arm/bcm4708-asus-rt-ac56u.dts head/sys/gnu/dts/arm/bcm4708-asus-rt-ac68u.dts head/sys/gnu/dts/arm/bcm4708-buffalo-wzr-1750dhp.dts head/sys/gnu/dts/arm/bcm4708-linksys-ea6300-v1.dts head/sys/gnu/dts/arm/bcm4708-linksys-ea6500-v2.dts head/sys/gnu/dts/arm/bcm4708-luxul-xap-1510.dts head/sys/gnu/dts/arm/bcm4708-luxul-xwc-1000.dts head/sys/gnu/dts/arm/bcm4708-netgear-r6250.dts head/sys/gnu/dts/arm/bcm4708-netgear-r6300-v2.dts head/sys/gnu/dts/arm/bcm4708-smartrg-sr400ac.dts head/sys/gnu/dts/arm/bcm4709-asus-rt-ac87u.dts head/sys/gnu/dts/arm/bcm4709-buffalo-wxr-1900dhp.dts head/sys/gnu/dts/arm/bcm4709-linksys-ea9200.dts head/sys/gnu/dts/arm/bcm4709-netgear-r7000.dts head/sys/gnu/dts/arm/bcm4709-netgear-r8000.dts head/sys/gnu/dts/arm/bcm4709-tplink-archer-c9-v1.dts head/sys/gnu/dts/arm/bcm47094-phicomm-k3.dts (contents, props changed) head/sys/gnu/dts/arm/bcm59056.dtsi head/sys/gnu/dts/arm/bcm94708.dts head/sys/gnu/dts/arm/bcm94709.dts head/sys/gnu/dts/arm/bcm963138dvt.dts head/sys/gnu/dts/arm/compulab-sb-som.dtsi head/sys/gnu/dts/arm/cros-adc-thermistors.dtsi head/sys/gnu/dts/arm/cros-ec-keyboard.dtsi head/sys/gnu/dts/arm/da850-enbw-cmc.dts head/sys/gnu/dts/arm/da850-evm.dts head/sys/gnu/dts/arm/da850-lcdk.dts head/sys/gnu/dts/arm/da850-lego-ev3.dts head/sys/gnu/dts/arm/da850.dtsi head/sys/gnu/dts/arm/dm8148-evm.dts head/sys/gnu/dts/arm/dm8148-t410.dts head/sys/gnu/dts/arm/dm814x-clocks.dtsi head/sys/gnu/dts/arm/dm8168-evm.dts head/sys/gnu/dts/arm/dm816x-clocks.dtsi head/sys/gnu/dts/arm/dra62x-clocks.dtsi head/sys/gnu/dts/arm/dra62x-j5eco-evm.dts head/sys/gnu/dts/arm/dra7-evm-common.dtsi head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7-l4.dtsi head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/dra71-evm.dts head/sys/gnu/dts/arm/dra72-evm-common.dtsi head/sys/gnu/dts/arm/dra72-evm-revc.dts head/sys/gnu/dts/arm/dra72-evm-tps65917.dtsi head/sys/gnu/dts/arm/dra72-evm.dts head/sys/gnu/dts/arm/dra72x.dtsi head/sys/gnu/dts/arm/dra74x.dtsi head/sys/gnu/dts/arm/dra76-evm.dts head/sys/gnu/dts/arm/dra76x-mmc-iodelay.dtsi head/sys/gnu/dts/arm/dra76x.dtsi head/sys/gnu/dts/arm/dra7xx-clocks.dtsi head/sys/gnu/dts/arm/ecx-2000.dts head/sys/gnu/dts/arm/ecx-common.dtsi head/sys/gnu/dts/arm/emev2-kzm9d.dts head/sys/gnu/dts/arm/ep7209.dtsi head/sys/gnu/dts/arm/ep7211-edb7211.dts head/sys/gnu/dts/arm/ep7211.dtsi head/sys/gnu/dts/arm/ethernut5.dts head/sys/gnu/dts/arm/evk-pro3.dts head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-origen.dts head/sys/gnu/dts/arm/exynos4210-smdkv310.dts head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4412-odroidu3.dts head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos4412-smdk4412.dts head/sys/gnu/dts/arm/exynos4412-trats2.dts head/sys/gnu/dts/arm/exynos4412.dtsi head/sys/gnu/dts/arm/exynos5250-smdk5250.dts head/sys/gnu/dts/arm/exynos5250.dtsi head/sys/gnu/dts/arm/exynos5260-pinctrl.dtsi head/sys/gnu/dts/arm/exynos5260-xyref5260.dts head/sys/gnu/dts/arm/exynos5260.dtsi head/sys/gnu/dts/arm/exynos5410-odroidxu.dts head/sys/gnu/dts/arm/exynos5410-smdk5410.dts head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts head/sys/gnu/dts/arm/exynos5420-smdk5420.dts head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-audio.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi head/sys/gnu/dts/arm/exynos54xx.dtsi head/sys/gnu/dts/arm/ge863-pro3.dtsi head/sys/gnu/dts/arm/gemini-dlink-dir-685.dts head/sys/gnu/dts/arm/gemini-dlink-dns-313.dts head/sys/gnu/dts/arm/hi3519-demb.dts head/sys/gnu/dts/arm/hi3519.dtsi head/sys/gnu/dts/arm/hi3620-hi4511.dts head/sys/gnu/dts/arm/hi3620.dtsi head/sys/gnu/dts/arm/highbank.dts head/sys/gnu/dts/arm/hip01-ca9x2.dts head/sys/gnu/dts/arm/hip01.dtsi head/sys/gnu/dts/arm/hip04-d01.dts head/sys/gnu/dts/arm/hip04.dtsi head/sys/gnu/dts/arm/hisi-x5hd2-dkb.dts head/sys/gnu/dts/arm/hisi-x5hd2.dtsi head/sys/gnu/dts/arm/imx1-ads.dts head/sys/gnu/dts/arm/imx1-apf9328.dts head/sys/gnu/dts/arm/imx1-pinfunc.h head/sys/gnu/dts/arm/imx23-olinuxino.dts head/sys/gnu/dts/arm/imx23-stmp378x_devb.dts head/sys/gnu/dts/arm/imx25-eukrea-cpuimx25.dtsi head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard.dts head/sys/gnu/dts/arm/imx25-karo-tx25.dts head/sys/gnu/dts/arm/imx25-pinfunc.h head/sys/gnu/dts/arm/imx27-apf27.dts head/sys/gnu/dts/arm/imx27-apf27dev.dts head/sys/gnu/dts/arm/imx27-eukrea-cpuimx27.dtsi head/sys/gnu/dts/arm/imx27-eukrea-mbimxsd27-baseboard.dts head/sys/gnu/dts/arm/imx27-phytec-phycard-s-rdk.dts head/sys/gnu/dts/arm/imx27-phytec-phycard-s-som.dtsi head/sys/gnu/dts/arm/imx27-phytec-phycore-rdk.dts head/sys/gnu/dts/arm/imx27-phytec-phycore-som.dtsi head/sys/gnu/dts/arm/imx27-pinfunc.h head/sys/gnu/dts/arm/imx28-apf28.dts head/sys/gnu/dts/arm/imx28-apf28dev.dts head/sys/gnu/dts/arm/imx28-cfa10036.dts head/sys/gnu/dts/arm/imx28-cfa10037.dts head/sys/gnu/dts/arm/imx28-cfa10049.dts head/sys/gnu/dts/arm/imx28-cfa10055.dts head/sys/gnu/dts/arm/imx28-cfa10056.dts head/sys/gnu/dts/arm/imx28-cfa10057.dts head/sys/gnu/dts/arm/imx28-cfa10058.dts head/sys/gnu/dts/arm/imx28-duckbill-2-485.dts head/sys/gnu/dts/arm/imx28-duckbill-2-enocean.dts head/sys/gnu/dts/arm/imx28-duckbill-2-spi.dts head/sys/gnu/dts/arm/imx28-duckbill-2.dts head/sys/gnu/dts/arm/imx28-duckbill.dts head/sys/gnu/dts/arm/imx28-eukrea-mbmx283lc.dts head/sys/gnu/dts/arm/imx28-eukrea-mbmx287lc.dts head/sys/gnu/dts/arm/imx28-eukrea-mbmx28lc.dtsi head/sys/gnu/dts/arm/imx28-m28.dtsi head/sys/gnu/dts/arm/imx28-m28cu3.dts head/sys/gnu/dts/arm/imx28-m28evk.dts head/sys/gnu/dts/arm/imx28-sps1.dts head/sys/gnu/dts/arm/imx28-ts4600.dts head/sys/gnu/dts/arm/imx31-bug.dts head/sys/gnu/dts/arm/imx35-eukrea-cpuimx35.dtsi head/sys/gnu/dts/arm/imx35-eukrea-mbimxsd35-baseboard.dts head/sys/gnu/dts/arm/imx35-pinfunc.h head/sys/gnu/dts/arm/imx35.dtsi head/sys/gnu/dts/arm/imx50-pinfunc.h head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx51-apf51.dts head/sys/gnu/dts/arm/imx51-apf51dev.dts head/sys/gnu/dts/arm/imx51-digi-connectcore-jsk.dts head/sys/gnu/dts/arm/imx51-digi-connectcore-som.dtsi head/sys/gnu/dts/arm/imx51-eukrea-cpuimx51.dtsi head/sys/gnu/dts/arm/imx51-eukrea-mbimxsd51-baseboard.dts head/sys/gnu/dts/arm/imx51-pinfunc.h head/sys/gnu/dts/arm/imx51-zii-rdu1.dts head/sys/gnu/dts/arm/imx51.dtsi head/sys/gnu/dts/arm/imx53-ard.dts head/sys/gnu/dts/arm/imx53-cx9020.dts head/sys/gnu/dts/arm/imx53-m53.dtsi head/sys/gnu/dts/arm/imx53-m53evk.dts head/sys/gnu/dts/arm/imx53-mba53.dts head/sys/gnu/dts/arm/imx53-pinfunc.h head/sys/gnu/dts/arm/imx53-tqma53.dtsi head/sys/gnu/dts/arm/imx53-voipac-bsb.dts head/sys/gnu/dts/arm/imx53-voipac-dmm-668.dtsi head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6-logicpd-baseboard.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6dl-aristainetos_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos_7.dts head/sys/gnu/dts/arm/imx6dl-dfi-fs700-m60.dts head/sys/gnu/dts/arm/imx6dl-gw51xx.dts head/sys/gnu/dts/arm/imx6dl-gw52xx.dts head/sys/gnu/dts/arm/imx6dl-gw53xx.dts head/sys/gnu/dts/arm/imx6dl-gw54xx.dts head/sys/gnu/dts/arm/imx6dl-gw552x.dts head/sys/gnu/dts/arm/imx6dl-phytec-pbab01.dts head/sys/gnu/dts/arm/imx6dl-phytec-pfla02.dtsi head/sys/gnu/dts/arm/imx6dl-pinfunc.h head/sys/gnu/dts/arm/imx6dl-rex-basic.dts head/sys/gnu/dts/arm/imx6dl-riotboard.dts head/sys/gnu/dts/arm/imx6dl-sabreauto.dts head/sys/gnu/dts/arm/imx6q-arm2.dts head/sys/gnu/dts/arm/imx6q-ba16.dtsi head/sys/gnu/dts/arm/imx6q-dfi-fs700-m60.dts head/sys/gnu/dts/arm/imx6q-dmo-edmqmx6.dts head/sys/gnu/dts/arm/imx6q-gw51xx.dts head/sys/gnu/dts/arm/imx6q-gw52xx.dts head/sys/gnu/dts/arm/imx6q-gw53xx.dts head/sys/gnu/dts/arm/imx6q-gw5400-a.dts head/sys/gnu/dts/arm/imx6q-gw54xx.dts head/sys/gnu/dts/arm/imx6q-gw552x.dts head/sys/gnu/dts/arm/imx6q-logicpd.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-marsboard.dts head/sys/gnu/dts/arm/imx6q-mccmon6.dts head/sys/gnu/dts/arm/imx6q-phytec-pbab01.dts head/sys/gnu/dts/arm/imx6q-phytec-pfla02.dtsi head/sys/gnu/dts/arm/imx6q-pinfunc.h head/sys/gnu/dts/arm/imx6q-rex-pro.dts head/sys/gnu/dts/arm/imx6q-sbc6x.dts head/sys/gnu/dts/arm/imx6q-tbs2910.dts head/sys/gnu/dts/arm/imx6q-zii-rdu2.dts head/sys/gnu/dts/arm/imx6qdl-apf6.dtsi head/sys/gnu/dts/arm/imx6qdl-aristainetos.dtsi head/sys/gnu/dts/arm/imx6qdl-emcon.dtsi head/sys/gnu/dts/arm/imx6qdl-gw51xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw52xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw53xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw5903.dtsi head/sys/gnu/dts/arm/imx6qdl-phytec-pbab01.dtsi head/sys/gnu/dts/arm/imx6qdl-phytec-pfla02.dtsi head/sys/gnu/dts/arm/imx6qdl-rex.dtsi head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl-sr-som.dtsi head/sys/gnu/dts/arm/imx6qdl-var-dart.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi head/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6qp-zii-rdu2.dts head/sys/gnu/dts/arm/imx6sl-pinfunc.h head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sll.dtsi head/sys/gnu/dts/arm/imx6sx-pinfunc.h head/sys/gnu/dts/arm/imx6sx-sabreauto.dts head/sys/gnu/dts/arm/imx6sx-sdb.dtsi head/sys/gnu/dts/arm/imx6sx-softing-vining-2000.dts head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-pinfunc.h head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx6ull-pinfunc.h head/sys/gnu/dts/arm/imx7d-pico.dtsi head/sys/gnu/dts/arm/imx7d-pinfunc.h head/sys/gnu/dts/arm/imx7d.dtsi head/sys/gnu/dts/arm/imx7s-warp.dts head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/imx7ulp-pinfunc.h head/sys/gnu/dts/arm/imx7ulp.dtsi head/sys/gnu/dts/arm/logicpd-som-lv-35xx-devkit.dts head/sys/gnu/dts/arm/logicpd-som-lv-37xx-devkit.dts head/sys/gnu/dts/arm/logicpd-som-lv-baseboard.dtsi head/sys/gnu/dts/arm/logicpd-som-lv.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-35xx-devkit.dts head/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit.dts head/sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi head/sys/gnu/dts/arm/lpc3250-ea3250.dts head/sys/gnu/dts/arm/lpc3250-phy3250.dts head/sys/gnu/dts/arm/lpc32xx.dtsi head/sys/gnu/dts/arm/ls1021a-moxa-uc-8410a.dts head/sys/gnu/dts/arm/ls1021a-qds.dts head/sys/gnu/dts/arm/ls1021a-twr.dts head/sys/gnu/dts/arm/ls1021a.dtsi head/sys/gnu/dts/arm/meson.dtsi head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/meson8b-ec100.dts head/sys/gnu/dts/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/mmp2-brownstone.dts head/sys/gnu/dts/arm/mmp2.dtsi head/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi head/sys/gnu/dts/arm/moxart-uc7112lx.dts head/sys/gnu/dts/arm/moxart.dtsi head/sys/gnu/dts/arm/mpa1600.dts head/sys/gnu/dts/arm/mt2701-pinfunc.h head/sys/gnu/dts/arm/mt8135-pinfunc.h head/sys/gnu/dts/arm/nspire-classic.dtsi head/sys/gnu/dts/arm/nspire-clp.dts head/sys/gnu/dts/arm/nspire-cx.dts head/sys/gnu/dts/arm/nspire-tp.dts head/sys/gnu/dts/arm/nspire.dtsi head/sys/gnu/dts/arm/omap2420-clocks.dtsi head/sys/gnu/dts/arm/omap2420-h4.dts head/sys/gnu/dts/arm/omap2420-n810.dts head/sys/gnu/dts/arm/omap2430-clocks.dtsi head/sys/gnu/dts/arm/omap2430-sdp.dts head/sys/gnu/dts/arm/omap24xx-clocks.dtsi head/sys/gnu/dts/arm/omap3-beagle-xm-ab.dts head/sys/gnu/dts/arm/omap3-beagle-xm.dts head/sys/gnu/dts/arm/omap3-beagle.dts head/sys/gnu/dts/arm/omap3-devkit8000-common.dtsi head/sys/gnu/dts/arm/omap3-devkit8000-lcd-common.dtsi head/sys/gnu/dts/arm/omap3-devkit8000-lcd43.dts head/sys/gnu/dts/arm/omap3-devkit8000-lcd70.dts head/sys/gnu/dts/arm/omap3-devkit8000.dts head/sys/gnu/dts/arm/omap3-evm-37xx.dts head/sys/gnu/dts/arm/omap3-evm.dts head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-gta04a3.dts head/sys/gnu/dts/arm/omap3-gta04a4.dts head/sys/gnu/dts/arm/omap3-gta04a5.dts head/sys/gnu/dts/arm/omap3-gta04a5one.dts head/sys/gnu/dts/arm/omap3-ha-common.dtsi head/sys/gnu/dts/arm/omap3-ha-lcd.dts head/sys/gnu/dts/arm/omap3-ha.dts head/sys/gnu/dts/arm/omap3-igep.dtsi head/sys/gnu/dts/arm/omap3-igep0020-common.dtsi head/sys/gnu/dts/arm/omap3-igep0020-rev-f.dts head/sys/gnu/dts/arm/omap3-igep0020.dts head/sys/gnu/dts/arm/omap3-igep0030-common.dtsi head/sys/gnu/dts/arm/omap3-igep0030-rev-g.dts head/sys/gnu/dts/arm/omap3-igep0030.dts head/sys/gnu/dts/arm/omap3-ldp.dts head/sys/gnu/dts/arm/omap3-lilly-a83x.dtsi head/sys/gnu/dts/arm/omap3-lilly-dbb056.dts head/sys/gnu/dts/arm/omap3-n9.dts head/sys/gnu/dts/arm/omap3-n900.dts head/sys/gnu/dts/arm/omap3-n950-n9.dtsi head/sys/gnu/dts/arm/omap3-n950.dts head/sys/gnu/dts/arm/omap3-overo-alto35-common.dtsi head/sys/gnu/dts/arm/omap3-overo-alto35.dts head/sys/gnu/dts/arm/omap3-overo-base.dtsi head/sys/gnu/dts/arm/omap3-overo-chestnut43-common.dtsi head/sys/gnu/dts/arm/omap3-overo-chestnut43.dts head/sys/gnu/dts/arm/omap3-overo-common-dvi.dtsi head/sys/gnu/dts/arm/omap3-overo-common-lcd35.dtsi head/sys/gnu/dts/arm/omap3-overo-common-lcd43.dtsi head/sys/gnu/dts/arm/omap3-overo-common-peripherals.dtsi head/sys/gnu/dts/arm/omap3-overo-gallop43-common.dtsi head/sys/gnu/dts/arm/omap3-overo-gallop43.dts head/sys/gnu/dts/arm/omap3-overo-palo35-common.dtsi head/sys/gnu/dts/arm/omap3-overo-palo35.dts head/sys/gnu/dts/arm/omap3-overo-palo43-common.dtsi head/sys/gnu/dts/arm/omap3-overo-palo43.dts head/sys/gnu/dts/arm/omap3-overo-storm-alto35.dts head/sys/gnu/dts/arm/omap3-overo-storm-chestnut43.dts head/sys/gnu/dts/arm/omap3-overo-storm-gallop43.dts head/sys/gnu/dts/arm/omap3-overo-storm-palo35.dts head/sys/gnu/dts/arm/omap3-overo-storm-palo43.dts head/sys/gnu/dts/arm/omap3-overo-storm-summit.dts head/sys/gnu/dts/arm/omap3-overo-storm-tobi.dts head/sys/gnu/dts/arm/omap3-overo-storm-tobiduo.dts head/sys/gnu/dts/arm/omap3-overo-storm.dtsi head/sys/gnu/dts/arm/omap3-overo-summit-common.dtsi head/sys/gnu/dts/arm/omap3-overo-summit.dts head/sys/gnu/dts/arm/omap3-overo-tobi-common.dtsi head/sys/gnu/dts/arm/omap3-overo-tobi.dts head/sys/gnu/dts/arm/omap3-overo-tobiduo-common.dtsi head/sys/gnu/dts/arm/omap3-overo-tobiduo.dts head/sys/gnu/dts/arm/omap3-overo.dtsi head/sys/gnu/dts/arm/omap3-pandora-1ghz.dts head/sys/gnu/dts/arm/omap3-pandora-600mhz.dts head/sys/gnu/dts/arm/omap3-pandora-common.dtsi head/sys/gnu/dts/arm/omap3-sniper.dts head/sys/gnu/dts/arm/omap3-tao3530.dtsi head/sys/gnu/dts/arm/omap3-thunder.dts head/sys/gnu/dts/arm/omap3-zoom3.dts head/sys/gnu/dts/arm/omap3430-sdp.dts head/sys/gnu/dts/arm/omap3430es1-clocks.dtsi head/sys/gnu/dts/arm/omap34xx-omap36xx-clocks.dtsi head/sys/gnu/dts/arm/omap36xx-am35xx-omap3430es2plus-clocks.dtsi head/sys/gnu/dts/arm/omap36xx-clocks.dtsi head/sys/gnu/dts/arm/omap36xx-omap3430es2plus-clocks.dtsi head/sys/gnu/dts/arm/omap3xxx-clocks.dtsi head/sys/gnu/dts/arm/omap4-droid4-xt894.dts head/sys/gnu/dts/arm/omap4-duovero-parlor.dts head/sys/gnu/dts/arm/omap4-duovero.dtsi head/sys/gnu/dts/arm/omap4-kc1.dts head/sys/gnu/dts/arm/omap4-panda-a4.dts head/sys/gnu/dts/arm/omap4-panda-common.dtsi head/sys/gnu/dts/arm/omap4-panda-es.dts head/sys/gnu/dts/arm/omap4-panda.dts head/sys/gnu/dts/arm/omap4-sdp-es23plus.dts head/sys/gnu/dts/arm/omap4-sdp.dts head/sys/gnu/dts/arm/omap4-var-dvk-om44.dts head/sys/gnu/dts/arm/omap4-var-om44customboard.dtsi head/sys/gnu/dts/arm/omap4-var-som-om44-wlan.dtsi head/sys/gnu/dts/arm/omap4-var-som-om44.dtsi head/sys/gnu/dts/arm/omap4-var-stk-om44.dts head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap443x-clocks.dtsi head/sys/gnu/dts/arm/omap446x-clocks.dtsi head/sys/gnu/dts/arm/omap44xx-clocks.dtsi head/sys/gnu/dts/arm/omap5-board-common.dtsi head/sys/gnu/dts/arm/omap5-igep0050.dts head/sys/gnu/dts/arm/omap5-uevm.dts head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/omap54xx-clocks.dtsi head/sys/gnu/dts/arm/ox810se-wd-mbwe.dts head/sys/gnu/dts/arm/ox810se.dtsi head/sys/gnu/dts/arm/ox820-cloudengines-pogoplug-series-3.dts head/sys/gnu/dts/arm/ox820.dtsi head/sys/gnu/dts/arm/picoxcell-pc3x2.dtsi head/sys/gnu/dts/arm/picoxcell-pc3x3.dtsi head/sys/gnu/dts/arm/picoxcell-pc7302-pc3x2.dts head/sys/gnu/dts/arm/picoxcell-pc7302-pc3x3.dts head/sys/gnu/dts/arm/pm9g45.dts head/sys/gnu/dts/arm/prima2-evb.dts head/sys/gnu/dts/arm/prima2.dtsi head/sys/gnu/dts/arm/pxa168-aspenite.dts head/sys/gnu/dts/arm/pxa168.dtsi head/sys/gnu/dts/arm/pxa25x.dtsi head/sys/gnu/dts/arm/pxa2xx.dtsi head/sys/gnu/dts/arm/pxa910-dkb.dts head/sys/gnu/dts/arm/pxa910.dtsi head/sys/gnu/dts/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-ipq4019.dtsi head/sys/gnu/dts/arm/qcom-mdm9615.dtsi head/sys/gnu/dts/arm/qcom-msm8660.dtsi head/sys/gnu/dts/arm/qcom-pma8084.dtsi head/sys/gnu/dts/arm/r7s72100-rskrza1.dts head/sys/gnu/dts/arm/r8a73a4-ape6evm.dts head/sys/gnu/dts/arm/r8a77470-iwg23s-sbc.dts head/sys/gnu/dts/arm/r8a77470.dtsi head/sys/gnu/dts/arm/r8a7778-bockw.dts head/sys/gnu/dts/arm/r8a7779-marzen.dts head/sys/gnu/dts/arm/r8a7792-blanche.dts head/sys/gnu/dts/arm/r8a7792.dtsi head/sys/gnu/dts/arm/r8a7794-alt.dts head/sys/gnu/dts/arm/rk3036-kylin.dts head/sys/gnu/dts/arm/rk3036.dtsi head/sys/gnu/dts/arm/rk3066a-marsboard.dts head/sys/gnu/dts/arm/rk3066a-mk808.dts head/sys/gnu/dts/arm/rk3066a-rayeager.dts head/sys/gnu/dts/arm/rk3066a.dtsi head/sys/gnu/dts/arm/rk3188-px3-evb.dts head/sys/gnu/dts/arm/rk3188-radxarock.dts head/sys/gnu/dts/arm/rk3188.dtsi head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-evb-act8846.dts head/sys/gnu/dts/arm/rk3288-evb.dtsi head/sys/gnu/dts/arm/rk3288-fennec.dts head/sys/gnu/dts/arm/rk3288-firefly-beta.dts head/sys/gnu/dts/arm/rk3288-firefly-reload-core.dtsi head/sys/gnu/dts/arm/rk3288-firefly-reload.dts head/sys/gnu/dts/arm/rk3288-firefly.dts head/sys/gnu/dts/arm/rk3288-firefly.dtsi head/sys/gnu/dts/arm/rk3288-miqi.dts head/sys/gnu/dts/arm/rk3288-phycore-rdk.dts head/sys/gnu/dts/arm/rk3288-phycore-som.dtsi head/sys/gnu/dts/arm/rk3288-r89.dts head/sys/gnu/dts/arm/rk3288-rock2-som.dtsi head/sys/gnu/dts/arm/rk3288-rock2-square.dts head/sys/gnu/dts/arm/rk3288-tinker-s.dts head/sys/gnu/dts/arm/rk3288-tinker.dtsi head/sys/gnu/dts/arm/rk3288-veyron-analog-audio.dtsi head/sys/gnu/dts/arm/rk3288-veyron-brain.dts head/sys/gnu/dts/arm/rk3288-veyron-chromebook.dtsi head/sys/gnu/dts/arm/rk3288-veyron-jaq.dts head/sys/gnu/dts/arm/rk3288-veyron-jerry.dts head/sys/gnu/dts/arm/rk3288-veyron-mickey.dts head/sys/gnu/dts/arm/rk3288-veyron-minnie.dts head/sys/gnu/dts/arm/rk3288-veyron-pinky.dts head/sys/gnu/dts/arm/rk3288-veyron-sdmmc.dtsi head/sys/gnu/dts/arm/rk3288-veyron-speedy.dts head/sys/gnu/dts/arm/rk3288-veyron.dtsi head/sys/gnu/dts/arm/rk3288-vyasa.dts head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/rv1108-elgin-r1.dts (contents, props changed) head/sys/gnu/dts/arm/rv1108.dtsi head/sys/gnu/dts/arm/s5pv210-goni.dts head/sys/gnu/dts/arm/s5pv210.dtsi head/sys/gnu/dts/arm/sama5d2.dtsi head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sama5d31.dtsi head/sys/gnu/dts/arm/sama5d31ek.dts head/sys/gnu/dts/arm/sama5d33.dtsi head/sys/gnu/dts/arm/sama5d33ek.dts head/sys/gnu/dts/arm/sama5d34.dtsi head/sys/gnu/dts/arm/sama5d34ek.dts head/sys/gnu/dts/arm/sama5d35.dtsi head/sys/gnu/dts/arm/sama5d35ek.dts head/sys/gnu/dts/arm/sama5d36.dtsi head/sys/gnu/dts/arm/sama5d36ek.dts head/sys/gnu/dts/arm/sama5d36ek_cmp.dts head/sys/gnu/dts/arm/sama5d3_can.dtsi head/sys/gnu/dts/arm/sama5d3_emac.dtsi head/sys/gnu/dts/arm/sama5d3_gmac.dtsi head/sys/gnu/dts/arm/sama5d3_lcd.dtsi head/sys/gnu/dts/arm/sama5d3_mci2.dtsi head/sys/gnu/dts/arm/sama5d3_tcb1.dtsi head/sys/gnu/dts/arm/sama5d3_uart.dtsi head/sys/gnu/dts/arm/sama5d3xcm.dtsi head/sys/gnu/dts/arm/sama5d3xcm_cmp.dtsi head/sys/gnu/dts/arm/sama5d3xdm.dtsi head/sys/gnu/dts/arm/sama5d3xmb.dtsi head/sys/gnu/dts/arm/sama5d3xmb_cmp.dtsi head/sys/gnu/dts/arm/sama5d3xmb_emac.dtsi head/sys/gnu/dts/arm/sama5d3xmb_gmac.dtsi head/sys/gnu/dts/arm/sama5d4.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk_sdmmc.dts head/sys/gnu/dts/arm/spear1310-evb.dts head/sys/gnu/dts/arm/spear1310.dtsi head/sys/gnu/dts/arm/spear1340-evb.dts head/sys/gnu/dts/arm/spear1340.dtsi head/sys/gnu/dts/arm/spear13xx.dtsi head/sys/gnu/dts/arm/spear300-evb.dts head/sys/gnu/dts/arm/spear300.dtsi head/sys/gnu/dts/arm/spear310-evb.dts head/sys/gnu/dts/arm/spear310.dtsi head/sys/gnu/dts/arm/spear320-evb.dts head/sys/gnu/dts/arm/spear320-hmi.dts head/sys/gnu/dts/arm/spear320.dtsi head/sys/gnu/dts/arm/spear3xx.dtsi head/sys/gnu/dts/arm/spear600-evb.dts head/sys/gnu/dts/arm/spear600.dtsi head/sys/gnu/dts/arm/ste-dbx5x0.dtsi head/sys/gnu/dts/arm/ste-href-ab8500.dtsi head/sys/gnu/dts/arm/ste-href-ab8505.dtsi head/sys/gnu/dts/arm/ste-href-family-pinctrl.dtsi head/sys/gnu/dts/arm/ste-href-stuib.dtsi head/sys/gnu/dts/arm/ste-href-tvk1281618.dtsi head/sys/gnu/dts/arm/ste-href.dtsi head/sys/gnu/dts/arm/ste-hrefprev60-stuib.dts head/sys/gnu/dts/arm/ste-hrefprev60-tvk.dts head/sys/gnu/dts/arm/ste-hrefprev60.dtsi head/sys/gnu/dts/arm/ste-hrefv60plus-stuib.dts head/sys/gnu/dts/arm/ste-hrefv60plus-tvk.dts head/sys/gnu/dts/arm/ste-hrefv60plus.dtsi head/sys/gnu/dts/arm/ste-nomadik-pinctrl.dtsi head/sys/gnu/dts/arm/ste-snowball.dts head/sys/gnu/dts/arm/stih407-b2120.dts head/sys/gnu/dts/arm/stih407-clock.dtsi head/sys/gnu/dts/arm/stih407-family.dtsi head/sys/gnu/dts/arm/stih407-pinctrl.dtsi head/sys/gnu/dts/arm/stih407.dtsi head/sys/gnu/dts/arm/stih410-b2120.dts head/sys/gnu/dts/arm/stih410-b2260.dts head/sys/gnu/dts/arm/stih410-clock.dtsi head/sys/gnu/dts/arm/stih410-pinctrl.dtsi head/sys/gnu/dts/arm/stih410.dtsi head/sys/gnu/dts/arm/stih418-b2199.dts head/sys/gnu/dts/arm/stih418-clock.dtsi head/sys/gnu/dts/arm/stih418.dtsi head/sys/gnu/dts/arm/stihxxx-b2120.dtsi head/sys/gnu/dts/arm/stm32f429.dtsi head/sys/gnu/dts/arm/stm32f769-disco.dts head/sys/gnu/dts/arm/stm32h743-pinctrl.dtsi head/sys/gnu/dts/arm/stm32h743.dtsi head/sys/gnu/dts/arm/stm32h743i-disco.dts head/sys/gnu/dts/arm/stm32h743i-eval.dts head/sys/gnu/dts/arm/stm32mp157-pinctrl.dtsi head/sys/gnu/dts/arm/stm32mp157c-ed1.dts head/sys/gnu/dts/arm/stm32mp157c.dtsi head/sys/gnu/dts/arm/sun4i-a10-chuwi-v7-cw0825.dts head/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts head/sys/gnu/dts/arm/sun4i-a10-dserve-dsrv9703c.dts head/sys/gnu/dts/arm/sun4i-a10-hyundai-a7hd.dts head/sys/gnu/dts/arm/sun4i-a10-inet1.dts head/sys/gnu/dts/arm/sun4i-a10-inet97fv2.dts head/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts head/sys/gnu/dts/arm/sun4i-a10-marsboard.dts head/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino.dts head/sys/gnu/dts/arm/sun4i-a10-pov-protab2-ips9.dts head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t004.dts head/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a13-empire-electronix-d709.dts head/sys/gnu/dts/arm/sun5i-a13-hsg-h702.dts head/sys/gnu/dts/arm/sun5i-a13-licheepi-one.dts head/sys/gnu/dts/arm/sun5i-a13-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a13-olinuxino.dts head/sys/gnu/dts/arm/sun5i-a13-q8-tablet.dts head/sys/gnu/dts/arm/sun5i-a13-utoo-p66.dts head/sys/gnu/dts/arm/sun5i-gr8-chip-pro.dts head/sys/gnu/dts/arm/sun5i-gr8-evb.dts head/sys/gnu/dts/arm/sun5i-r8-chip.dts head/sys/gnu/dts/arm/sun5i-reference-design-tablet.dtsi head/sys/gnu/dts/arm/sun5i.dtsi head/sys/gnu/dts/arm/sun6i-a31-colombus.dts head/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts head/sys/gnu/dts/arm/sun6i-a31-i7.dts head/sys/gnu/dts/arm/sun6i-a31.dtsi head/sys/gnu/dts/arm/sun6i-a31s-primo81.dts head/sys/gnu/dts/arm/sun6i-reference-design-tablet.dtsi head/sys/gnu/dts/arm/sun7i-a20-bananapi.dts head/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts head/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts head/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi-mini.dts head/sys/gnu/dts/arm/sun7i-a20-orangepi.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3-nano.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3.dts head/sys/gnu/dts/arm/sun7i-a20-wexler-tab7200.dts head/sys/gnu/dts/arm/sun7i-a20-wits-pro-a20-dkt.dts head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a23-a33.dtsi head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v1.2.dts head/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v5.dts head/sys/gnu/dts/arm/sun8i-a23-q8-tablet.dts head/sys/gnu/dts/arm/sun8i-a33-et-q8-v1.6.dts head/sys/gnu/dts/arm/sun8i-a33-ippo-q8h-v1.2.dts head/sys/gnu/dts/arm/sun8i-a33-q8-tablet.dts head/sys/gnu/dts/arm/sun8i-a33-sinlinx-sina33.dts head/sys/gnu/dts/arm/sun8i-a33.dtsi head/sys/gnu/dts/arm/sun8i-a83t-bananapi-m3.dts head/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts head/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-bananapi-m2-zero.dts head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts head/sys/gnu/dts/arm/sun8i-h3-beelink-x2.dts head/sys/gnu/dts/arm/sun8i-h3-mapleboard-mp130.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1-plus.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-neo-air.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi.dtsi head/sys/gnu/dts/arm/sun8i-h3-orangepi-2.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-lite.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-zero-plus2.dts head/sys/gnu/dts/arm/sun8i-h3.dtsi head/sys/gnu/dts/arm/sun8i-q8-common.dtsi head/sys/gnu/dts/arm/sun8i-r16-nintendo-nes-classic.dts head/sys/gnu/dts/arm/sun8i-r16-parrot.dts head/sys/gnu/dts/arm/sun8i-r40.dtsi head/sys/gnu/dts/arm/sun8i-reference-design-tablet.dtsi head/sys/gnu/dts/arm/sun8i-v3s-licheepi-zero.dts head/sys/gnu/dts/arm/sun8i-v3s.dtsi head/sys/gnu/dts/arm/sun8i-v40-bananapi-m2-berry.dts head/sys/gnu/dts/arm/sun9i-a80-cubieboard4.dts head/sys/gnu/dts/arm/sun9i-a80-optimus.dts head/sys/gnu/dts/arm/sun9i-a80.dtsi head/sys/gnu/dts/arm/sunxi-bananapi-m2-plus.dtsi head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/arm/sunxi-libretech-all-h3-cc.dtsi head/sys/gnu/dts/arm/tegra124-apalis-emc.dtsi head/sys/gnu/dts/arm/tegra124-apalis-eval.dts head/sys/gnu/dts/arm/tegra124-apalis-v1.2-eval.dts head/sys/gnu/dts/arm/tegra124-apalis-v1.2.dtsi head/sys/gnu/dts/arm/tegra124-apalis.dtsi head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts head/sys/gnu/dts/arm/tegra124-nyan.dtsi head/sys/gnu/dts/arm/tegra124-venice2.dts head/sys/gnu/dts/arm/tegra30.dtsi head/sys/gnu/dts/arm/tny_a9260.dts head/sys/gnu/dts/arm/tny_a9260_common.dtsi head/sys/gnu/dts/arm/tny_a9263.dts head/sys/gnu/dts/arm/tny_a9g20.dts head/sys/gnu/dts/arm/tps6507x.dtsi head/sys/gnu/dts/arm/tps65217.dtsi head/sys/gnu/dts/arm/tps65910.dtsi head/sys/gnu/dts/arm/twl4030.dtsi head/sys/gnu/dts/arm/twl4030_omap3.dtsi head/sys/gnu/dts/arm/twl6030.dtsi head/sys/gnu/dts/arm/twl6030_omap4.dtsi head/sys/gnu/dts/arm/usb_a9260.dts head/sys/gnu/dts/arm/usb_a9260_common.dtsi head/sys/gnu/dts/arm/usb_a9263.dts head/sys/gnu/dts/arm/usb_a9g20-dab-mmx.dtsi head/sys/gnu/dts/arm/usb_a9g20.dts head/sys/gnu/dts/arm/usb_a9g20_common.dtsi head/sys/gnu/dts/arm/usb_a9g20_lpw.dts head/sys/gnu/dts/arm/vf610-cosmic.dts head/sys/gnu/dts/arm/vf610-pinfunc.h head/sys/gnu/dts/arm/vf610-zii-cfu1.dts head/sys/gnu/dts/arm/vf610-zii-dev-rev-b.dts head/sys/gnu/dts/arm/vf610-zii-dev-rev-c.dts head/sys/gnu/dts/arm/vf610-zii-dev.dtsi head/sys/gnu/dts/arm/vf610-zii-scu4-aib.dts head/sys/gnu/dts/arm/vf610-zii-ssmb-dtu.dts (contents, props changed) head/sys/gnu/dts/arm/vf610-zii-ssmb-spu3.dts head/sys/gnu/dts/arm/vt8500-bv07.dts head/sys/gnu/dts/arm/vt8500.dtsi head/sys/gnu/dts/arm/wm8505-ref.dts head/sys/gnu/dts/arm/wm8505.dtsi head/sys/gnu/dts/arm/wm8650-mid.dts head/sys/gnu/dts/arm/wm8650.dtsi head/sys/gnu/dts/arm/wm8750-apc8750.dts head/sys/gnu/dts/arm/wm8750.dtsi head/sys/gnu/dts/arm/wm8850-w70v2.dts head/sys/gnu/dts/arm/wm8850.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-a64-amarula-relic.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-bananapi-m64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pinebook.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-a64-teres-i.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo-plus2.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo2.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-pc2.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-prime.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus2.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h5.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi head/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi head/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts head/sys/gnu/dts/arm64/amlogic/meson-g12a-u200.dts head/sys/gnu/dts/arm64/amlogic/meson-g12a-x96-max.dts (contents, props changed) head/sys/gnu/dts/arm64/amlogic/meson-g12a.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-phicomm-n1.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-nexbox-a1.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm.dtsi head/sys/gnu/dts/arm64/apm/apm-merlin.dts head/sys/gnu/dts/arm64/apm/apm-mustang.dts head/sys/gnu/dts/arm64/apm/apm-shadowcat.dtsi head/sys/gnu/dts/arm64/apm/apm-storm.dtsi head/sys/gnu/dts/arm64/bitmain/bm1880-sophon-edge.dts (contents, props changed) head/sys/gnu/dts/arm64/bitmain/bm1880.dtsi (contents, props changed) head/sys/gnu/dts/arm64/cavium/thunder2-99xx.dts head/sys/gnu/dts/arm64/cavium/thunder2-99xx.dtsi head/sys/gnu/dts/arm64/exynos/exynos5433-tm2-common.dtsi head/sys/gnu/dts/arm64/exynos/exynos5433-tm2.dts head/sys/gnu/dts/arm64/exynos/exynos5433.dtsi head/sys/gnu/dts/arm64/exynos/exynos7.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-oxalis.dts (contents, props changed) head/sys/gnu/dts/arm64/freescale/fsl-ls1012a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-qds.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-rdb.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1043a-rdb.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1043a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1046a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-qds.dts head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-rdb.dts head/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi head/sys/gnu/dts/arm64/freescale/imx8mq-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mq.dtsi head/sys/gnu/dts/arm64/freescale/imx8qxp-mek.dts (contents, props changed) head/sys/gnu/dts/arm64/freescale/imx8qxp.dtsi (contents, props changed) head/sys/gnu/dts/arm64/hisilicon/hi3660.dtsi head/sys/gnu/dts/arm64/hisilicon/hi3670-hikey970.dts head/sys/gnu/dts/arm64/hisilicon/hi3670.dtsi head/sys/gnu/dts/arm64/hisilicon/hi6220-coresight.dtsi head/sys/gnu/dts/arm64/hisilicon/hikey970-pinctrl.dtsi head/sys/gnu/dts/arm64/hisilicon/hip05-d02.dts head/sys/gnu/dts/arm64/hisilicon/hip05.dtsi head/sys/gnu/dts/arm64/hisilicon/hip06-d03.dts head/sys/gnu/dts/arm64/hisilicon/hip06.dtsi head/sys/gnu/dts/arm64/hisilicon/hip07-d05.dts head/sys/gnu/dts/arm64/hisilicon/hip07.dtsi head/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts head/sys/gnu/dts/arm64/mediatek/mt2712-pinfunc.h head/sys/gnu/dts/arm64/mediatek/mt2712e.dtsi head/sys/gnu/dts/arm64/mediatek/mt6755-evb.dts head/sys/gnu/dts/arm64/mediatek/mt6795-evb.dts head/sys/gnu/dts/arm64/mediatek/mt6797-evb.dts head/sys/gnu/dts/arm64/mediatek/mt8173-evb.dts head/sys/gnu/dts/arm64/mediatek/mt8173-pinfunc.h head/sys/gnu/dts/arm64/mediatek/mt8173.dtsi head/sys/gnu/dts/arm64/nvidia/tegra186-p2771-0000.dts head/sys/gnu/dts/arm64/nvidia/tegra186-p3310.dtsi head/sys/gnu/dts/arm64/nvidia/tegra186.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194-p2972-0000.dts head/sys/gnu/dts/arm64/nvidia/tegra210-p2180.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p2371-2180.dts head/sys/gnu/dts/arm64/nvidia/tegra210-p2597.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p2894.dtsi (contents, props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-smaug.dts head/sys/gnu/dts/arm64/nvidia/tegra210.dtsi head/sys/gnu/dts/arm64/qcom/apq8016-sbc.dts head/sys/gnu/dts/arm64/qcom/apq8016-sbc.dtsi head/sys/gnu/dts/arm64/qcom/apq8096-db820c-pins.dtsi head/sys/gnu/dts/arm64/qcom/apq8096-db820c-pmic-pins.dtsi head/sys/gnu/dts/arm64/qcom/apq8096-db820c.dts head/sys/gnu/dts/arm64/qcom/apq8096-db820c.dtsi head/sys/gnu/dts/arm64/qcom/ipq8074-hk01.dts head/sys/gnu/dts/arm64/qcom/ipq8074.dtsi head/sys/gnu/dts/arm64/qcom/msm8916-mtp.dts head/sys/gnu/dts/arm64/qcom/msm8916-mtp.dtsi head/sys/gnu/dts/arm64/qcom/msm8916-pins.dtsi head/sys/gnu/dts/arm64/qcom/msm8916.dtsi head/sys/gnu/dts/arm64/qcom/msm8992-bullhead-rev-101.dts head/sys/gnu/dts/arm64/qcom/msm8992-pins.dtsi head/sys/gnu/dts/arm64/qcom/msm8992.dtsi head/sys/gnu/dts/arm64/qcom/msm8994-angler-rev-101.dts head/sys/gnu/dts/arm64/qcom/msm8994-pins.dtsi head/sys/gnu/dts/arm64/qcom/msm8994-smd-rpm.dtsi head/sys/gnu/dts/arm64/qcom/msm8994.dtsi head/sys/gnu/dts/arm64/qcom/msm8996-mtp.dts head/sys/gnu/dts/arm64/qcom/msm8996-mtp.dtsi head/sys/gnu/dts/arm64/qcom/msm8996-pins.dtsi head/sys/gnu/dts/arm64/qcom/msm8996.dtsi head/sys/gnu/dts/arm64/qcom/msm8998-mtp.dtsi head/sys/gnu/dts/arm64/qcom/msm8998.dtsi head/sys/gnu/dts/arm64/qcom/pm8005.dtsi head/sys/gnu/dts/arm64/qcom/pm8998.dtsi head/sys/gnu/dts/arm64/qcom/pmi8994.dtsi head/sys/gnu/dts/arm64/qcom/pmi8998.dtsi head/sys/gnu/dts/arm64/qcom/pms405.dtsi head/sys/gnu/dts/arm64/qcom/qcs404-evb-1000.dts head/sys/gnu/dts/arm64/qcom/qcs404-evb-4000.dts head/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi head/sys/gnu/dts/arm64/qcom/qcs404.dtsi head/sys/gnu/dts/arm64/qcom/sdm845-mtp.dts head/sys/gnu/dts/arm64/qcom/sdm845.dtsi head/sys/gnu/dts/arm64/renesas/cat875.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi head/sys/gnu/dts/arm64/renesas/r8a774c0-cat874.dts (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a774c0.dtsi (contents, props changed) head/sys/gnu/dts/arm64/renesas/r8a7795.dtsi head/sys/gnu/dts/arm64/renesas/r8a7796-salvator-x.dts head/sys/gnu/dts/arm64/renesas/r8a7796-salvator-xs.dts head/sys/gnu/dts/arm64/renesas/r8a7796.dtsi head/sys/gnu/dts/arm64/renesas/r8a77965.dtsi head/sys/gnu/dts/arm64/renesas/r8a77980.dtsi head/sys/gnu/dts/arm64/renesas/r8a77990-ebisu.dts head/sys/gnu/dts/arm64/renesas/r8a77990.dtsi head/sys/gnu/dts/arm64/renesas/r8a77995-draak.dts head/sys/gnu/dts/arm64/renesas/salvator-common.dtsi head/sys/gnu/dts/arm64/rockchip/px30-evb.dts head/sys/gnu/dts/arm64/rockchip/rk3328-evb.dts head/sys/gnu/dts/arm64/rockchip/rk3328-roc-cc.dts head/sys/gnu/dts/arm64/rockchip/rk3328-rock64.dts head/sys/gnu/dts/arm64/rockchip/rk3328.dtsi head/sys/gnu/dts/arm64/rockchip/rk3368-evb.dtsi head/sys/gnu/dts/arm64/rockchip/rk3368-geekbox.dts head/sys/gnu/dts/arm64/rockchip/rk3368-lion-haikou.dts head/sys/gnu/dts/arm64/rockchip/rk3368-lion.dtsi head/sys/gnu/dts/arm64/rockchip/rk3368-orion-r68-meta.dts head/sys/gnu/dts/arm64/rockchip/rk3368-px5-evb.dts head/sys/gnu/dts/arm64/rockchip/rk3368-r88.dts head/sys/gnu/dts/arm64/rockchip/rk3368.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-evb.dts head/sys/gnu/dts/arm64/rockchip/rk3399-ficus.dts head/sys/gnu/dts/arm64/rockchip/rk3399-gru-bob.dts head/sys/gnu/dts/arm64/rockchip/rk3399-gru-chromebook.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-gru-kevin.dts head/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-gru.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-nanopc-t4.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-nanopi4.dtsi (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-puma-haikou.dts head/sys/gnu/dts/arm64/rockchip/rk3399-puma.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-rock-pi-4.dts (contents, props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts head/sys/gnu/dts/arm64/rockchip/rk3399-sapphire.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399.dtsi head/sys/gnu/dts/arm64/sprd/whale2.dtsi head/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm016-dc2.dts head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-revA.dts head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-revB.dts head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu104-revA.dts head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu106-revA.dts head/sys/gnu/dts/arm64/xilinx/zynqmp-zcu111-revA.dts head/sys/gnu/dts/include/dt-bindings/arm/ux500_pm_domains.h head/sys/gnu/dts/include/dt-bindings/clock/alphascale,asm9260.h head/sys/gnu/dts/include/dt-bindings/clock/am3.h head/sys/gnu/dts/include/dt-bindings/clock/am4.h head/sys/gnu/dts/include/dt-bindings/clock/at91.h head/sys/gnu/dts/include/dt-bindings/clock/ath79-clk.h head/sys/gnu/dts/include/dt-bindings/clock/axg-audio-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/axis,artpec6-clkctrl.h head/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h head/sys/gnu/dts/include/dt-bindings/clock/dm814.h head/sys/gnu/dts/include/dt-bindings/clock/dm816.h head/sys/gnu/dts/include/dt-bindings/clock/dra7.h head/sys/gnu/dts/include/dt-bindings/clock/exynos5410.h head/sys/gnu/dts/include/dt-bindings/clock/g12a-aoclkc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/g12a-clkc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/hi3516cv300-clock.h head/sys/gnu/dts/include/dt-bindings/clock/hi3519-clock.h head/sys/gnu/dts/include/dt-bindings/clock/hi3620-clock.h head/sys/gnu/dts/include/dt-bindings/clock/hi3660-clock.h head/sys/gnu/dts/include/dt-bindings/clock/hi6220-clock.h head/sys/gnu/dts/include/dt-bindings/clock/hip04-clock.h head/sys/gnu/dts/include/dt-bindings/clock/histb-clock.h head/sys/gnu/dts/include/dt-bindings/clock/hix5hd2-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx1-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx21-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx27-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx5-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx6ul-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx7d-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx7ulp-clock.h head/sys/gnu/dts/include/dt-bindings/clock/jz4725b-cgu.h head/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h head/sys/gnu/dts/include/dt-bindings/clock/maxim,max77620.h head/sys/gnu/dts/include/dt-bindings/clock/maxim,max9485.h head/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/microchip,pic32-clock.h head/sys/gnu/dts/include/dt-bindings/clock/mt2701-clk.h head/sys/gnu/dts/include/dt-bindings/clock/mt2712-clk.h head/sys/gnu/dts/include/dt-bindings/clock/mt6797-clk.h head/sys/gnu/dts/include/dt-bindings/clock/mt7622-clk.h head/sys/gnu/dts/include/dt-bindings/clock/mt8135-clk.h head/sys/gnu/dts/include/dt-bindings/clock/mt8173-clk.h head/sys/gnu/dts/include/dt-bindings/clock/omap4.h head/sys/gnu/dts/include/dt-bindings/clock/omap5.h head/sys/gnu/dts/include/dt-bindings/clock/oxsemi,ox810se.h head/sys/gnu/dts/include/dt-bindings/clock/oxsemi,ox820.h head/sys/gnu/dts/include/dt-bindings/clock/pistachio-clk.h head/sys/gnu/dts/include/dt-bindings/clock/pxa-clock.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq8074.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-mdm9615.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8660.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8916.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8994.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8996.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8998.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-qcs404.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-ipq806x.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-mdm9615.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8996.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmcc.h head/sys/gnu/dts/include/dt-bindings/clock/r8a73a4-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7740-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7778-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7779-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7790-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7791-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7792-clock.h head/sys/gnu/dts/include/dt-bindings/clock/rk3036-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3066a-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3128-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3228-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3288-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3328-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3368-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3399-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rv1108-cru.h head/sys/gnu/dts/include/dt-bindings/clock/s5pv210-audss.h head/sys/gnu/dts/include/dt-bindings/clock/s5pv210.h head/sys/gnu/dts/include/dt-bindings/clock/sh73a0-clock.h head/sys/gnu/dts/include/dt-bindings/clock/sifive-fu540-prci.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/stm32fx-clock.h head/sys/gnu/dts/include/dt-bindings/clock/sun5i-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/vf610-clock.h head/sys/gnu/dts/include/dt-bindings/clock/zx296702-clock.h head/sys/gnu/dts/include/dt-bindings/clock/zx296718-clock.h head/sys/gnu/dts/include/dt-bindings/dma/at91.h head/sys/gnu/dts/include/dt-bindings/dma/nbpfaxi.h head/sys/gnu/dts/include/dt-bindings/firmware/imx/rsrc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/gpio/meson-gxbb-gpio.h head/sys/gnu/dts/include/dt-bindings/gpio/meson-gxl-gpio.h head/sys/gnu/dts/include/dt-bindings/gpio/meson8-gpio.h head/sys/gnu/dts/include/dt-bindings/gpio/meson8b-gpio.h head/sys/gnu/dts/include/dt-bindings/i2c/i2c.h head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h head/sys/gnu/dts/include/dt-bindings/input/ti-drv260x.h head/sys/gnu/dts/include/dt-bindings/interrupt-controller/irq-st.h head/sys/gnu/dts/include/dt-bindings/media/omap3-isp.h head/sys/gnu/dts/include/dt-bindings/media/tvp5150.h head/sys/gnu/dts/include/dt-bindings/memory/mt2701-larb-port.h head/sys/gnu/dts/include/dt-bindings/memory/mt8173-larb-port.h head/sys/gnu/dts/include/dt-bindings/mfd/arizona.h head/sys/gnu/dts/include/dt-bindings/mfd/atmel-flexcom.h head/sys/gnu/dts/include/dt-bindings/mips/lantiq_rcu_gphy.h head/sys/gnu/dts/include/dt-bindings/net/ti-dp83867.h head/sys/gnu/dts/include/dt-bindings/phy/phy-pistachio-usb.h head/sys/gnu/dts/include/dt-bindings/phy/phy.h head/sys/gnu/dts/include/dt-bindings/pinctrl/am33xx.h head/sys/gnu/dts/include/dt-bindings/pinctrl/at91.h head/sys/gnu/dts/include/dt-bindings/pinctrl/dra.h head/sys/gnu/dts/include/dt-bindings/pinctrl/mt65xx.h head/sys/gnu/dts/include/dt-bindings/pinctrl/nomadik.h head/sys/gnu/dts/include/dt-bindings/pinctrl/omap.h head/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra.h head/sys/gnu/dts/include/dt-bindings/pinctrl/rockchip.h head/sys/gnu/dts/include/dt-bindings/pinctrl/stm32-pinfunc.h head/sys/gnu/dts/include/dt-bindings/power/imx7-power.h head/sys/gnu/dts/include/dt-bindings/power/mt2701-power.h head/sys/gnu/dts/include/dt-bindings/power/mt2712-power.h head/sys/gnu/dts/include/dt-bindings/power/mt7622-power.h head/sys/gnu/dts/include/dt-bindings/power/r8a7743-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7745-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7779-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7790-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7791-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7792-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7793-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7794-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7795-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a7796-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a77965-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a77970-sysc.h head/sys/gnu/dts/include/dt-bindings/power/r8a77995-sysc.h head/sys/gnu/dts/include/dt-bindings/power/tegra186-powergate.h head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-a10.h head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-a10sr.h head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-s10.h head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr.h head/sys/gnu/dts/include/dt-bindings/reset/imx7-reset.h head/sys/gnu/dts/include/dt-bindings/reset/mt2701-resets.h head/sys/gnu/dts/include/dt-bindings/reset/mt7622-reset.h head/sys/gnu/dts/include/dt-bindings/reset/mt8135-resets.h head/sys/gnu/dts/include/dt-bindings/reset/mt8173-resets.h head/sys/gnu/dts/include/dt-bindings/reset/oxsemi,ox810se.h head/sys/gnu/dts/include/dt-bindings/reset/oxsemi,ox820.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-ipq806x.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-mdm9615.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8660.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8916.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-apq8084.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8960.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8974.h head/sys/gnu/dts/include/dt-bindings/reset/sun5i-ccu.h head/sys/gnu/dts/include/dt-bindings/reset/tegra186-reset.h head/sys/gnu/dts/include/dt-bindings/reset/ti-syscon.h head/sys/gnu/dts/include/dt-bindings/soc/qcom,gsbi.h head/sys/gnu/dts/include/dt-bindings/soc/zte,pm_domains.h head/sys/gnu/dts/include/dt-bindings/sound/cs42l42.h head/sys/gnu/dts/include/dt-bindings/spmi/spmi.h head/sys/gnu/dts/include/dt-bindings/thermal/tegra124-soctherm.h head/sys/gnu/dts/include/dt-bindings/thermal/thermal.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/arm/am335x-guardian.dts (props changed) head/sys/gnu/dts/arm/am3874-iceboard.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-inspur-on5263m5.dts (props changed) head/sys/gnu/dts/arm/bcm2837-rpi-3-a-plus.dts (props changed) head/sys/gnu/dts/arm/imx6-logicpd-som.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-yapp4-common.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-yapp4-draco.dts (props changed) head/sys/gnu/dts/arm/imx6dl-yapp4-hydra.dts (props changed) head/sys/gnu/dts/arm/imx6dl-yapp4-ursa.dts (props changed) head/sys/gnu/dts/arm/imx6sll-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx6ul-phytec-pcl063.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-phytec-peb-eval-01.dtsi (props changed) head/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin-full.dts (props changed) head/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin.dtsi (props changed) head/sys/gnu/dts/arm/lpc4357-myd-lpc4357.dts (props changed) head/sys/gnu/dts/arm/milbeaut-m10v-evb.dts (props changed) head/sys/gnu/dts/arm/milbeaut-m10v.dtsi (props changed) head/sys/gnu/dts/arm/r7s9210-rza2mevb.dts (props changed) head/sys/gnu/dts/arm/r7s9210.dtsi (props changed) head/sys/gnu/dts/arm/socfpga_cyclone5_chameleon96.dts (props changed) head/sys/gnu/dts/arm64/ (props changed) head/sys/gnu/dts/arm64/arm/fvp-base-revc.dts (props changed) head/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard-rs2.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-3-a-plus.dts (props changed) head/sys/gnu/dts/arm64/freescale/imx8mm-pinfunc.h (props changed) head/sys/gnu/dts/arm64/intel/socfpga_agilex.dtsi (props changed) head/sys/gnu/dts/arm64/intel/socfpga_agilex_socdk.dts (props changed) head/sys/gnu/dts/arm64/marvell/armada-3720-uDPU.dts (props changed) head/sys/gnu/dts/arm64/nvidia/tegra210-p2894-0050-a08.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a774c0-ek874.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-nanopi-m4.dts (props changed) head/sys/gnu/dts/include/ (props changed) head/sys/gnu/dts/include/dt-bindings/clk/lochnagar.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/actions,s500-cmu.h (props changed) head/sys/gnu/dts/include/dt-bindings/clock/imx8mm-clock.h (props changed) head/sys/gnu/dts/include/dt-bindings/iio/adc/ingenic,adc.h (props changed) head/sys/gnu/dts/include/dt-bindings/iio/temperature/thermocouple.h (props changed) head/sys/gnu/dts/include/dt-bindings/interconnect/qcom,sdm845.h (props changed) head/sys/gnu/dts/include/dt-bindings/mfd/st,stpmic1.h (props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/lochnagar.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/qcom-rpmpd.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/xlnx-zynqmp-power.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-g12a-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/g12a-aoclkc.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/imx8mq-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/xlnx-zynqmp-resets.h (props changed) head/sys/gnu/dts/include/dt-bindings/soc/bcm2835-pm.h (props changed) Modified: head/sys/gnu/dts/arm/aks-cdu.dts ============================================================================== --- head/sys/gnu/dts/arm/aks-cdu.dts Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/aks-cdu.dts Sat Sep 28 22:54:56 2019 (r352858) @@ -1,10 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * aks-cdu.dts - Device Tree file for AK signal CDU * * Copyright (C) 2012 AK signal Brno a.s. * 2012 Jiri Prchal - * - * Licensed under GPLv2 or later. */ /dts-v1/; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /* @@ -23,14 +20,14 @@ &am33xx_pinmux { uart1_pins: pinmux_uart1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x980, PIN_INPUT | MUX_MODE0) /* uart1_rxd */ - AM33XX_IOPAD(0x984, PIN_INPUT | MUX_MODE0) /* uart1_txd */ - AM33XX_IOPAD(0x978, PIN_INPUT_PULLDOWN | MUX_MODE0) /* uart1_ctsn */ - AM33XX_IOPAD(0x97c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_rtsn */ - AM33XX_IOPAD(0x8e0, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* lcd_vsync.gpio2[22] DTR */ - AM33XX_IOPAD(0x8e4, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_hsync.gpio2[23] DSR */ - AM33XX_IOPAD(0x8e8, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_pclk.gpio2[24] DCD */ - AM33XX_IOPAD(0x8ec, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_ac_bias_en.gpio2[25] RI */ + AM33XX_PADCONF(AM335X_PIN_UART1_RXD, PIN_INPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_TXD, PIN_INPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_RTSN, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_VSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* lcd_vsync.gpio2[22] DTR */ + AM33XX_PADCONF(AM335X_PIN_LCD_HSYNC, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_hsync.gpio2[23] DSR */ + AM33XX_PADCONF(AM335X_PIN_LCD_PCLK, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_pclk.gpio2[24] DCD */ + AM33XX_PADCONF(AM335X_PIN_LCD_AC_BIAS_EN, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_ac_bias_en.gpio2[25] RI */ >; }; }; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /* @@ -23,35 +20,35 @@ &am33xx_pinmux { tca6416_pins: pinmux_tca6416_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x9b4, PIN_INPUT_PULLUP | MUX_MODE7) /* xdma_event_intr1.gpio0[20] tca6416 stuff */ + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR1, PIN_INPUT_PULLUP, MUX_MODE7) /* xdma_event_intr1.gpio0[20] tca6416 stuff */ >; }; uart1_pins: pinmux_uart1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x980, PIN_INPUT | MUX_MODE0) /* uart1_rxd */ - AM33XX_IOPAD(0x984, PIN_INPUT | MUX_MODE0) /* uart1_txd */ - AM33XX_IOPAD(0x978, PIN_INPUT_PULLDOWN | MUX_MODE0) /* uart1_ctsn */ - AM33XX_IOPAD(0x97c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_rtsn */ - AM33XX_IOPAD(0x8e0, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* lcd_vsync.gpio2[22] DTR */ - AM33XX_IOPAD(0x8e4, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_hsync.gpio2[23] DSR */ - AM33XX_IOPAD(0x8e8, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_pclk.gpio2[24] DCD */ - AM33XX_IOPAD(0x8ec, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_ac_bias_en.gpio2[25] RI */ + AM33XX_PADCONF(AM335X_PIN_UART1_RXD, PIN_INPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_TXD, PIN_INPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_RTSN, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_VSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* lcd_vsync.gpio2[22] DTR */ + AM33XX_PADCONF(AM335X_PIN_LCD_HSYNC, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_hsync.gpio2[23] DSR */ + AM33XX_PADCONF(AM335X_PIN_LCD_PCLK, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_pclk.gpio2[24] DCD */ + AM33XX_PADCONF(AM335X_PIN_LCD_AC_BIAS_EN, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_ac_bias_en.gpio2[25] RI */ >; }; uart2_pins: pinmux_uart2_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE1) /* spi0_sclk.uart2_rxd_mux3 */ - AM33XX_IOPAD(0x954, PIN_OUTPUT | MUX_MODE1) /* spi0_d0.uart2_txd_mux3 */ - AM33XX_IOPAD(0x988, PIN_INPUT_PULLDOWN | MUX_MODE2) /* i2c0_sda.uart2_ctsn_mux0 */ - AM33XX_IOPAD(0x98c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* i2c0_scl.uart2_rtsn_mux0 */ - AM33XX_IOPAD(0x830, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad12.gpio1[12] DTR */ - AM33XX_IOPAD(0x834, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad13.gpio1[13] DSR */ - AM33XX_IOPAD(0x838, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad14.gpio1[14] DCD */ - AM33XX_IOPAD(0x83c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad15.gpio1[15] RI */ + AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT, MUX_MODE1) /* spi0_sclk.uart2_rxd_mux3 */ + AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_OUTPUT, MUX_MODE1) /* spi0_d0.uart2_txd_mux3 */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SDA, PIN_INPUT_PULLDOWN, MUX_MODE2) /* i2c0_sda.uart2_ctsn_mux0 */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SCL, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* i2c0_scl.uart2_rtsn_mux0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD12, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gpmc_ad12.gpio1[12] DTR */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD13, PIN_INPUT_PULLDOWN, MUX_MODE7) /* gpmc_ad13.gpio1[13] DSR */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD14, PIN_INPUT_PULLDOWN, MUX_MODE7) /* gpmc_ad14.gpio1[14] DCD */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD15, PIN_INPUT_PULLDOWN, MUX_MODE7) /* gpmc_ad15.gpio1[15] RI */ - AM33XX_IOPAD(0x9a0, PIN_INPUT_PULLUP | MUX_MODE7) /* mcasp0_aclkr.gpio3[18], INPUT_PULLDOWN | MODE7 */ + AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKR, PIN_INPUT_PULLUP, MUX_MODE7) /* mcasp0_aclkr.gpio3[18], INPUT_PULLDOWN | MODE7 */ >; }; }; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /* @@ -23,43 +20,43 @@ &am33xx_pinmux { tca6416_pins: pinmux_tca6416_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x9b4, PIN_INPUT_PULLUP | MUX_MODE7) /* xdma_event_intr1.gpio0[20] tca6416 stuff */ + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR1, PIN_INPUT_PULLUP, MUX_MODE7) /* xdma_event_intr1.gpio0[20] tca6416 stuff */ >; }; dcan1_pins: pinmux_dcan1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x968, PIN_OUTPUT | MUX_MODE2) /* uart0_ctsn.dcan1_tx_mux0 */ - AM33XX_IOPAD(0x96c, PIN_INPUT | MUX_MODE2) /* uart0_rtsn.dcan1_rx_mux0 */ + AM33XX_PADCONF(AM335X_PIN_UART0_CTSN, PIN_OUTPUT, MUX_MODE2) /* uart0_ctsn.dcan1_tx_mux0 */ + AM33XX_PADCONF(AM335X_PIN_UART0_RTSN, PIN_INPUT, MUX_MODE2) /* uart0_rtsn.dcan1_rx_mux0 */ >; }; uart1_pins: pinmux_uart1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x980, PIN_INPUT | MUX_MODE0) /* uart1_rxd */ - AM33XX_IOPAD(0x984, PIN_INPUT | MUX_MODE0) /* uart1_txd */ - AM33XX_IOPAD(0x978, PIN_INPUT_PULLDOWN | MUX_MODE0) /* uart1_ctsn */ - AM33XX_IOPAD(0x97c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_rtsn */ - AM33XX_IOPAD(0x8e0, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* lcd_vsync.gpio2[22] DTR */ - AM33XX_IOPAD(0x8e4, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_hsync.gpio2[23] DSR */ - AM33XX_IOPAD(0x8e8, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_pclk.gpio2[24] DCD */ - AM33XX_IOPAD(0x8ec, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_ac_bias_en.gpio2[25] RI */ + AM33XX_PADCONF(AM335X_PIN_UART1_RXD, PIN_INPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_TXD, PIN_INPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_RTSN, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_VSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* lcd_vsync.gpio2[22] DTR */ + AM33XX_PADCONF(AM335X_PIN_LCD_HSYNC, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_hsync.gpio2[23] DSR */ + AM33XX_PADCONF(AM335X_PIN_LCD_PCLK, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_pclk.gpio2[24] DCD */ + AM33XX_PADCONF(AM335X_PIN_LCD_AC_BIAS_EN, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_ac_bias_en.gpio2[25] RI */ >; }; uart2_pins: pinmux_uart2_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE1) /* spi0_sclk.uart2_rxd_mux3 */ - AM33XX_IOPAD(0x954, PIN_OUTPUT | MUX_MODE1) /* spi0_d0.uart2_txd_mux3 */ - AM33XX_IOPAD(0x988, PIN_INPUT_PULLDOWN | MUX_MODE2) /* i2c0_sda.uart2_ctsn_mux0 */ - AM33XX_IOPAD(0x98c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* i2c0_scl.uart2_rtsn_mux0 */ - AM33XX_IOPAD(0x830, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad12.gpio1[12] DTR */ - AM33XX_IOPAD(0x834, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad13.gpio1[13] DSR */ - AM33XX_IOPAD(0x838, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad14.gpio1[14] DCD */ - AM33XX_IOPAD(0x83c, PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad15.gpio1[15] RI */ + AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT, MUX_MODE1) /* spi0_sclk.uart2_rxd_mux3 */ + AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_OUTPUT, MUX_MODE1) /* spi0_d0.uart2_txd_mux3 */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SDA, PIN_INPUT_PULLDOWN, MUX_MODE2) /* i2c0_sda.uart2_ctsn_mux0 */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SCL, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* i2c0_scl.uart2_rtsn_mux0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD12, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gpmc_ad12.gpio1[12] DTR */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD13, PIN_INPUT_PULLDOWN, MUX_MODE7) /* gpmc_ad13.gpio1[13] DSR */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD14, PIN_INPUT_PULLDOWN, MUX_MODE7) /* gpmc_ad14.gpio1[14] DCD */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD15, PIN_INPUT_PULLDOWN, MUX_MODE7) /* gpmc_ad15.gpio1[15] RI */ - AM33XX_IOPAD(0x9a0, PIN_INPUT_PULLUP | MUX_MODE7) /* mcasp0_aclkr.gpio3[18], INPUT_PULLDOWN | MODE7 */ + AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKR, PIN_INPUT_PULLUP, MUX_MODE7) /* mcasp0_aclkr.gpio3[18], INPUT_PULLDOWN | MODE7 */ >; }; Modified: head/sys/gnu/dts/arm/am335x-baltos-leds.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-leds.dtsi Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-baltos-leds.dtsi Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /* @@ -42,9 +39,9 @@ &am33xx_pinmux { user_leds: pinmux_user_leds { pinctrl-single,pins = < - AM33XX_IOPAD(0x908, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* mii1_col.gpio3_0 PWR LED */ - AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* mii1_txd3.gpio0_16 WLAN LED */ - AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* mii1_txd2.gpio0_17 APP LED */ + AM33XX_PADCONF(AM335X_PIN_MII1_COL, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* mii1_col.gpio3_0 PWR LED */ + AM33XX_PADCONF(AM335X_PIN_MII1_TXD3, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* mii1_txd3.gpio0_16 WLAN LED */ + AM33XX_PADCONF(AM335X_PIN_MII1_TXD2, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* mii1_txd2.gpio0_17 APP LED */ >; }; }; Modified: head/sys/gnu/dts/arm/am335x-baltos.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos.dtsi Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-baltos.dtsi Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /* @@ -53,130 +50,130 @@ &am33xx_pinmux { mmc2_pins: pinmux_mmc2_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x820, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad8.mmc1_dat0_mux0 */ - AM33XX_IOPAD(0x824, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad9.mmc1_dat1_mux0 */ - AM33XX_IOPAD(0x828, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad10.mmc1_dat2_mux0 */ - AM33XX_IOPAD(0x82c, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_ad11.mmc1_dat3_mux0 */ - AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk_mux0 */ - AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd_mux0 */ - AM33XX_IOPAD(0x9e4, PIN_INPUT_PULLUP | MUX_MODE7) /* emu0.gpio3[7] */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD8, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_ad8.mmc1_dat0_mux0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD9, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_ad9.mmc1_dat1_mux0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD10, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_ad10.mmc1_dat2_mux0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD11, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_ad11.mmc1_dat3_mux0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_CSN1, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_csn1.mmc1_clk_mux0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_CSN2, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_csn2.mmc1_cmd_mux0 */ + AM33XX_PADCONF(AM335X_PIN_EMU0, PIN_INPUT_PULLUP, MUX_MODE7) /* emu0.gpio3[7] */ >; }; wl12xx_gpio: pinmux_wl12xx_gpio { pinctrl-single,pins = < - AM33XX_IOPAD(0x9e8, PIN_OUTPUT_PULLUP | MUX_MODE7) /* emu1.gpio3[8] */ + AM33XX_PADCONF(AM335X_PIN_EMU1, PIN_OUTPUT_PULLUP, MUX_MODE7) /* emu1.gpio3[8] */ >; }; tps65910_pins: pinmux_tps65910_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x878, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_ben1.gpio1[28] */ + AM33XX_PADCONF(AM335X_PIN_GPMC_BEN1, PIN_INPUT_PULLUP, MUX_MODE7) /* gpmc_ben1.gpio1[28] */ >; }; i2c1_pins: pinmux_i2c1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x958, PIN_INPUT | MUX_MODE2) /* spi0_d1.i2c1_sda_mux3 */ - AM33XX_IOPAD(0x95c, PIN_INPUT | MUX_MODE2) /* spi0_cs0.i2c1_scl_mux3 */ + AM33XX_PADCONF(AM335X_PIN_SPI0_D1, PIN_INPUT, MUX_MODE2) /* spi0_d1.i2c1_sda_mux3 */ + AM33XX_PADCONF(AM335X_PIN_SPI0_CS0, PIN_INPUT, MUX_MODE2) /* spi0_cs0.i2c1_scl_mux3 */ >; }; uart0_pins: pinmux_uart0_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ - AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ + AM33XX_PADCONF(AM335X_PIN_UART0_RXD, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART0_TXD, PIN_OUTPUT_PULLDOWN, MUX_MODE0) >; }; cpsw_default: cpsw_default { pinctrl-single,pins = < /* Slave 1 */ - AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_crs.rmii1_crs_dv */ - AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_tx_en.rmii1_txen */ - AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd1.rmii1_txd1 */ - AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd0.rmii1_txd0 */ - AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd1.rmii1_rxd1 */ - AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd0.rmii1_rxd0 */ - AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii1_ref_clk.rmii1_refclk */ + AM33XX_PADCONF(AM335X_PIN_MII1_CRS, PIN_INPUT_PULLDOWN, MUX_MODE1) /* mii1_crs.rmii1_crs_dv */ + AM33XX_PADCONF(AM335X_PIN_MII1_TX_EN, PIN_OUTPUT_PULLDOWN, MUX_MODE1) /* mii1_tx_en.rmii1_txen */ + AM33XX_PADCONF(AM335X_PIN_MII1_TXD1, PIN_OUTPUT_PULLDOWN, MUX_MODE1) /* mii1_txd1.rmii1_txd1 */ + AM33XX_PADCONF(AM335X_PIN_MII1_TXD0, PIN_OUTPUT_PULLDOWN, MUX_MODE1) /* mii1_txd0.rmii1_txd0 */ + AM33XX_PADCONF(AM335X_PIN_MII1_RXD1, PIN_INPUT_PULLDOWN, MUX_MODE1) /* mii1_rxd1.rmii1_rxd1 */ + AM33XX_PADCONF(AM335X_PIN_MII1_RXD0, PIN_INPUT_PULLDOWN, MUX_MODE1) /* mii1_rxd0.rmii1_rxd0 */ + AM33XX_PADCONF(AM335X_PIN_RMII1_REF_CLK, PIN_INPUT_PULLDOWN, MUX_MODE0) /* rmii1_ref_clk.rmii1_refclk */ /* Slave 2 */ - AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a0.rgmii2_tctl */ - AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a1.rgmii2_rctl */ - AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a2.rgmii2_td3 */ - AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a3.rgmii2_td2 */ - AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a4.rgmii2_td1 */ - AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a5.rgmii2_td0 */ - AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a6.rgmii2_tclk */ - AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a7.rgmii2_rclk */ - AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a8.rgmii2_rd3 */ - AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a9.rgmii2_rd2 */ - AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a10.rgmii2_rd1 */ - AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a11.rgmii2_rd0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A0, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* gpmc_a0.rgmii2_tctl */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A1, PIN_INPUT_PULLDOWN, MUX_MODE2) /* gpmc_a1.rgmii2_rctl */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A2, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* gpmc_a2.rgmii2_td3 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A3, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* gpmc_a3.rgmii2_td2 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A4, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* gpmc_a4.rgmii2_td1 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A5, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* gpmc_a5.rgmii2_td0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A6, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* gpmc_a6.rgmii2_tclk */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A7, PIN_INPUT_PULLDOWN, MUX_MODE2) /* gpmc_a7.rgmii2_rclk */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A8, PIN_INPUT_PULLDOWN, MUX_MODE2) /* gpmc_a8.rgmii2_rd3 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A9, PIN_INPUT_PULLDOWN, MUX_MODE2) /* gpmc_a9.rgmii2_rd2 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A10, PIN_INPUT_PULLDOWN, MUX_MODE2) /* gpmc_a10.rgmii2_rd1 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A11, PIN_INPUT_PULLDOWN, MUX_MODE2) /* gpmc_a11.rgmii2_rd0 */ >; }; cpsw_sleep: cpsw_sleep { pinctrl-single,pins = < /* Slave 1 reset value */ - AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_CRS, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_TX_EN, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD1, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD0, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD1, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD0, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_RMII1_REF_CLK, PIN_INPUT_PULLDOWN, MUX_MODE7) /* Slave 2 reset value*/ - AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A0, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A1, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A2, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A3, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A4, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A5, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A6, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A7, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A8, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A9, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A10, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_GPMC_A11, PIN_INPUT_PULLDOWN, MUX_MODE7) >; }; davinci_mdio_default: davinci_mdio_default { pinctrl-single,pins = < /* MDIO */ - AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ - AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ + AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLUP | SLEWCTRL_FAST, MUX_MODE0) /* mdio_data.mdio_data */ + AM33XX_PADCONF(AM335X_PIN_MDC, PIN_OUTPUT_PULLUP, MUX_MODE0) /* mdio_clk.mdio_clk */ >; }; davinci_mdio_sleep: davinci_mdio_sleep { pinctrl-single,pins = < /* MDIO reset value */ - AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MDC, PIN_INPUT_PULLDOWN, MUX_MODE7) >; }; nandflash_pins_s0: nandflash_pins_s0 { pinctrl-single,pins = < - AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */ - AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad1.gpmc_ad1 */ - AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad2.gpmc_ad2 */ - AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad3.gpmc_ad3 */ - AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */ - AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */ - AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */ - AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */ - AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */ - AM33XX_IOPAD(0x874, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_30 */ - AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */ - AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */ - AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */ - AM33XX_IOPAD(0x898, PIN_OUTPUT | MUX_MODE0) /* gpmc_wen.gpmc_wen */ - AM33XX_IOPAD(0x89c, PIN_OUTPUT | MUX_MODE0) /* gpmc_be0n_cle.gpmc_be0n_cle */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD0, PIN_INPUT_PULLUP, MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD1, PIN_INPUT_PULLUP, MUX_MODE0) /* gpmc_ad1.gpmc_ad1 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD2, PIN_INPUT_PULLUP, MUX_MODE0) /* gpmc_ad2.gpmc_ad2 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD3, PIN_INPUT_PULLUP, MUX_MODE0) /* gpmc_ad3.gpmc_ad3 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD4, PIN_INPUT_PULLUP, MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD5, PIN_INPUT_PULLUP, MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD6, PIN_INPUT_PULLUP, MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD7, PIN_INPUT_PULLUP, MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_WAIT0, PIN_INPUT_PULLUP, MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_WPN, PIN_INPUT_PULLUP, MUX_MODE7) /* gpmc_wpn.gpio0_30 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_CSN0, PIN_OUTPUT, MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_ADVN_ALE, PIN_OUTPUT, MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */ + AM33XX_PADCONF(AM335X_PIN_GPMC_OEN_REN, PIN_OUTPUT, MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */ + AM33XX_PADCONF(AM335X_PIN_GPMC_WEN, PIN_OUTPUT, MUX_MODE0) /* gpmc_wen.gpmc_wen */ + AM33XX_PADCONF(AM335X_PIN_GPMC_BEN0_CLE, PIN_OUTPUT, MUX_MODE0) /* gpmc_be0n_cle.gpmc_be0n_cle */ >; }; }; Modified: head/sys/gnu/dts/arm/am335x-base0033.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-base0033.dts Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-base0033.dts Sat Sep 28 22:54:56 2019 (r352858) @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * am335x-base0033.dts - Device Tree file for IGEP AQUILA EXPANSION * * Copyright (C) 2013 ISEE 2007 SL - http://www.isee.biz - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include "am335x-igep0033.dtsi" @@ -46,39 +43,39 @@ &am33xx_pinmux { nxp_hdmi_pins: pinmux_nxp_hdmi_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ - AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0) /* lcd_data0 */ - AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0) /* lcd_data1 */ - AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0) /* lcd_data2 */ - AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0) /* lcd_data3 */ - AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0) /* lcd_data4 */ - AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0) /* lcd_data5 */ - AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0) /* lcd_data6 */ - AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0) /* lcd_data7 */ - AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0) /* lcd_data8 */ - AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0) /* lcd_data9 */ - AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0) /* lcd_data10 */ - AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0) /* lcd_data11 */ - AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0) /* lcd_data12 */ - AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0) /* lcd_data13 */ - AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0) /* lcd_data14 */ - AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0) /* lcd_data15 */ - AM33XX_IOPAD(0x8e0, PIN_OUTPUT | MUX_MODE0) /* lcd_vsync */ - AM33XX_IOPAD(0x8e4, PIN_OUTPUT | MUX_MODE0) /* lcd_hsync */ - AM33XX_IOPAD(0x8e8, PIN_OUTPUT | MUX_MODE0) /* lcd_pclk */ - AM33XX_IOPAD(0x8ec, PIN_OUTPUT | MUX_MODE0) /* lcd_ac_bias_en */ + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT, MUX_MODE3) /* xdma_event_intr0.clkout1 */ + AM33XX_PADCONF(AM335X_PIN_LCD_DATA0, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA1, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA2, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA3, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA4, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA5, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA6, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA7, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA8, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA9, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA10, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA11, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA12, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA13, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA14, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA15, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_VSYNC, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_HSYNC, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_PCLK, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_AC_BIAS_EN, PIN_OUTPUT, MUX_MODE0) >; }; nxp_hdmi_off_pins: pinmux_nxp_hdmi_off_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE3) /* xdma_event_intr0.clkout1 */ + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT, MUX_MODE3) /* xdma_event_intr0.clkout1 */ >; }; leds_base_pins: pinmux_leds_base_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */ - AM33XX_IOPAD(0x888, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn3.gpio2_0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A5, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gpmc_a5.gpio1_21 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_CSN3, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gpmc_csn3.gpio2_0 */ >; }; }; Modified: head/sys/gnu/dts/arm/am335x-bone-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-bone-common.dtsi Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-bone-common.dtsi Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ / { @@ -71,118 +68,118 @@ user_leds_s0: user_leds_s0 { pinctrl-single,pins = < - AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a5.gpio1_21 */ - AM33XX_IOPAD(0x858, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a6.gpio1_22 */ - AM33XX_IOPAD(0x85c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a7.gpio1_23 */ - AM33XX_IOPAD(0x860, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a8.gpio1_24 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A5, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gpmc_a5.gpio1_21 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A6, PIN_OUTPUT_PULLUP, MUX_MODE7) /* gpmc_a6.gpio1_22 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A7, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gpmc_a7.gpio1_23 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A8, PIN_OUTPUT_PULLUP, MUX_MODE7) /* gpmc_a8.gpio1_24 */ >; }; i2c0_pins: pinmux_i2c0_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */ - AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SDA, PIN_INPUT_PULLUP, MUX_MODE0) /* i2c0_sda.i2c0_sda */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SCL, PIN_INPUT_PULLUP, MUX_MODE0) /* i2c0_scl.i2c0_scl */ >; }; i2c2_pins: pinmux_i2c2_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_ctsn.i2c2_sda */ - AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_rtsn.i2c2_scl */ + AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLUP, MUX_MODE3) /* uart1_ctsn.i2c2_sda */ + AM33XX_PADCONF(AM335X_PIN_UART1_RTSN, PIN_INPUT_PULLUP, MUX_MODE3) /* uart1_rtsn.i2c2_scl */ >; }; uart0_pins: pinmux_uart0_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ - AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ + AM33XX_PADCONF(AM335X_PIN_UART0_RXD, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART0_TXD, PIN_OUTPUT_PULLDOWN, MUX_MODE0) >; }; clkout2_pin: pinmux_clkout2_pin { pinctrl-single,pins = < - AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr1.clkout2 */ + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR1, PIN_OUTPUT_PULLDOWN, MUX_MODE3) /* xdma_event_intr1.clkout2 */ >; }; cpsw_default: cpsw_default { pinctrl-single,pins = < /* Slave 1 */ - AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.mii1_rxerr */ - AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.mii1_txen */ - AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */ - AM33XX_IOPAD(0x91c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd3.mii1_txd3 */ - AM33XX_IOPAD(0x920, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd2.mii1_txd2 */ - AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd1.mii1_txd1 */ - AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txd0.mii1_txd0 */ - AM33XX_IOPAD(0x92c, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_txclk.mii1_txclk */ - AM33XX_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxclk.mii1_rxclk */ - AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd3.mii1_rxd3 */ - AM33XX_IOPAD(0x938, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd2.mii1_rxd2 */ - AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd1.mii1_rxd1 */ - AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxd0.mii1_rxd0 */ + AM33XX_PADCONF(AM335X_PIN_MII1_RX_ER, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_TX_EN, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_RX_DV, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD3, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD2, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD1, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD0, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_TX_CLK, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_RX_CLK, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD3, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD2, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD1, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD0, PIN_INPUT_PULLUP, MUX_MODE0) >; }; cpsw_sleep: cpsw_sleep { pinctrl-single,pins = < /* Slave 1 reset value */ - AM33XX_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x91c, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x920, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x924, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x928, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x92c, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x930, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x934, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x938, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x93c, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x940, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_RX_ER, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_TX_EN, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_RX_DV, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD3, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD2, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD1, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_TXD0, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_TX_CLK, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_RX_CLK, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD3, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD2, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD1, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MII1_RXD0, PIN_INPUT_PULLDOWN, MUX_MODE7) >; }; davinci_mdio_default: davinci_mdio_default { pinctrl-single,pins = < /* MDIO */ - AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ - AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ + AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLUP | SLEWCTRL_FAST, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MDC, PIN_OUTPUT_PULLUP, MUX_MODE0) >; }; davinci_mdio_sleep: davinci_mdio_sleep { pinctrl-single,pins = < /* MDIO reset value */ - AM33XX_IOPAD(0x948, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x94c, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLDOWN, MUX_MODE7) + AM33XX_PADCONF(AM335X_PIN_MDC, PIN_INPUT_PULLDOWN, MUX_MODE7) >; }; mmc1_pins: pinmux_mmc1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spio0_cs1.gpio0_6 */ - AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0.mmc0_dat0 */ - AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1.mmc0_dat1 */ - AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2.mmc0_dat2 */ - AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3.mmc0_dat3 */ - AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd.mmc0_cmd */ - AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk.mmc0_clk */ + AM33XX_PADCONF(AM335X_PIN_SPI0_CS1, PIN_INPUT, MUX_MODE7) /* spio0_cs1.gpio0_6 */ + AM33XX_PADCONF(AM335X_PIN_MMC0_DAT0, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_DAT1, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_DAT2, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_DAT3, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_CMD, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_CLK, PIN_INPUT_PULLUP, MUX_MODE0) >; }; emmc_pins: pinmux_emmc_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */ - AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */ - AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */ - AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */ - AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */ - AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */ - AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */ - AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */ - AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */ - AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_CSN1, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_csn1.mmc1_clk */ + AM33XX_PADCONF(AM335X_PIN_GPMC_CSN2, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_csn2.mmc1_cmd */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD0, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD1, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD2, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD3, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD4, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD5, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD6, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD7, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */ >; }; }; Modified: head/sys/gnu/dts/arm/am335x-bone.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-bone.dts Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-bone.dts Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /dts-v1/; Modified: head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include @@ -30,43 +27,43 @@ &am33xx_pinmux { nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr0 */ - AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0) /* lcd_data0.lcd_data0 */ - AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0) /* lcd_data1.lcd_data1 */ - AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0) /* lcd_data2.lcd_data2 */ - AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0) /* lcd_data3.lcd_data3 */ - AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0) /* lcd_data4.lcd_data4 */ - AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0) /* lcd_data5.lcd_data5 */ - AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0) /* lcd_data6.lcd_data6 */ - AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0) /* lcd_data7.lcd_data7 */ - AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0) /* lcd_data8.lcd_data8 */ - AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0) /* lcd_data9.lcd_data9 */ - AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0) /* lcd_data10.lcd_data10 */ - AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0) /* lcd_data11.lcd_data11 */ - AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0) /* lcd_data12.lcd_data12 */ - AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0) /* lcd_data13.lcd_data13 */ - AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0) /* lcd_data14.lcd_data14 */ - AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0) /* lcd_data15.lcd_data15 */ - AM33XX_IOPAD(0x8e0, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_vsync.lcd_vsync */ - AM33XX_IOPAD(0x8e4, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_hsync.lcd_hsync */ - AM33XX_IOPAD(0x8e8, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_pclk.lcd_pclk */ - AM33XX_IOPAD(0x8ec, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_ac_bias_en.lcd_ac_bias_en */ + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT_PULLDOWN, MUX_MODE3) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA0, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA1, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA2, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA3, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA4, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA5, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA6, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA7, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA8, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA9, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA10, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA11, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA12, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA13, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA14, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_DATA15, PIN_OUTPUT, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_VSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_HSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_PCLK, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_LCD_AC_BIAS_EN, PIN_OUTPUT_PULLDOWN, MUX_MODE0) >; }; nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr0 */ + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT_PULLDOWN, MUX_MODE3) >; }; mcasp0_pins: mcasp0_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x9ac, PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_ahcklx.mcasp0_ahclkx */ - AM33XX_IOPAD(0x99c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2*/ - AM33XX_IOPAD(0x994, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */ - AM33XX_IOPAD(0x990, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */ - AM33XX_IOPAD(0x86c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.GPIO1_27 */ + AM33XX_PADCONF(AM335X_PIN_MCASP0_AHCLKX, PIN_INPUT_PULLUP, MUX_MODE0) /* mcasp0_ahcklx.mcasp0_ahclkx */ + AM33XX_PADCONF(AM335X_PIN_MCASP0_AHCLKR, PIN_OUTPUT_PULLDOWN, MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2*/ + AM33XX_PADCONF(AM335X_PIN_MCASP0_FSX, PIN_OUTPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKX, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_GPMC_A11, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gpmc_a11.GPIO1_27 */ >; }; }; Modified: head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /dts-v1/; @@ -32,35 +29,35 @@ &am33xx_pinmux { bt_pins: pinmux_bt_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gmii1_txd0.gpio0_28 - BT_EN */ + AM33XX_PADCONF(AM335X_PIN_MII1_TXD0, PIN_OUTPUT_PULLUP, MUX_MODE7) /* gmii1_txd0.gpio0_28 - BT_EN */ >; }; mmc3_pins: pinmux_mmc3_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE6 ) /* (L15) gmii1_rxd1.mmc2_clk */ - AM33XX_IOPAD(0x914, PIN_INPUT_PULLUP | MUX_MODE6 ) /* (J16) gmii1_txen.mmc2_cmd */ - AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE5 ) /* (J17) gmii1_rxdv.mmc2_dat0 */ - AM33XX_IOPAD(0x91c, PIN_INPUT_PULLUP | MUX_MODE5 ) /* (J18) gmii1_txd3.mmc2_dat1 */ - AM33XX_IOPAD(0x920, PIN_INPUT_PULLUP | MUX_MODE5 ) /* (K15) gmii1_txd2.mmc2_dat2 */ - AM33XX_IOPAD(0x908, PIN_INPUT_PULLUP | MUX_MODE5 ) /* (H16) gmii1_col.mmc2_dat3 */ + AM33XX_PADCONF(AM335X_PIN_MII1_RXD1, PIN_INPUT_PULLUP, MUX_MODE6 ) /* (L15) gmii1_rxd1.mmc2_clk */ + AM33XX_PADCONF(AM335X_PIN_MII1_TX_EN, PIN_INPUT_PULLUP, MUX_MODE6 ) /* (J16) gmii1_txen.mmc2_cmd */ + AM33XX_PADCONF(AM335X_PIN_MII1_RX_DV, PIN_INPUT_PULLUP, MUX_MODE5 ) /* (J17) gmii1_rxdv.mmc2_dat0 */ + AM33XX_PADCONF(AM335X_PIN_MII1_TXD3, PIN_INPUT_PULLUP, MUX_MODE5 ) /* (J18) gmii1_txd3.mmc2_dat1 */ + AM33XX_PADCONF(AM335X_PIN_MII1_TXD2, PIN_INPUT_PULLUP, MUX_MODE5 ) /* (K15) gmii1_txd2.mmc2_dat2 */ + AM33XX_PADCONF(AM335X_PIN_MII1_COL, PIN_INPUT_PULLUP, MUX_MODE5 ) /* (H16) gmii1_col.mmc2_dat3 */ >; }; uart3_pins: pinmux_uart3_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE1) /* gmii1_rxd3.uart3_rxd */ - AM33XX_IOPAD(0x938, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* gmii1_rxd2.uart3_txd */ - AM33XX_IOPAD(0x948, PIN_INPUT | MUX_MODE3) /* mdio_data.uart3_ctsn */ - AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* mdio_clk.uart3_rtsn */ + AM33XX_PADCONF(AM335X_PIN_MII1_RXD3, PIN_INPUT_PULLUP, MUX_MODE1) /* gmii1_rxd3.uart3_rxd */ + AM33XX_PADCONF(AM335X_PIN_MII1_RXD2, PIN_OUTPUT_PULLDOWN, MUX_MODE1) /* gmii1_rxd2.uart3_txd */ + AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT, MUX_MODE3) /* mdio_data.uart3_ctsn */ + AM33XX_PADCONF(AM335X_PIN_MDC, PIN_OUTPUT_PULLDOWN, MUX_MODE3) /* mdio_clk.uart3_rtsn */ >; }; wl18xx_pins: pinmux_wl18xx_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gmii1_txclk.gpio3_9 WL_EN */ - AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE7) /* rmii1_refclk.gpio0_29 WL_IRQ */ - AM33XX_IOPAD(0x930, PIN_OUTPUT_PULLUP | MUX_MODE7) /* gmii1_rxclk.gpio3_10 LS_BUF_EN */ + AM33XX_PADCONF(AM335X_PIN_MII1_TX_CLK, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* gmii1_txclk.gpio3_9 WL_EN */ + AM33XX_PADCONF(AM335X_PIN_RMII1_REF_CLK, PIN_INPUT_PULLDOWN, MUX_MODE7) /* rmii1_refclk.gpio0_29 WL_IRQ */ + AM33XX_PADCONF(AM335X_PIN_MII1_RX_CLK, PIN_OUTPUT_PULLUP, MUX_MODE7) /* gmii1_rxclk.gpio3_10 LS_BUF_EN */ >; }; }; Modified: head/sys/gnu/dts/arm/am335x-boneblack.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack.dts Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-boneblack.dts Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /dts-v1/; Modified: head/sys/gnu/dts/arm/am335x-boneblue.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblue.dts Sat Sep 28 22:38:47 2019 (r352857) +++ head/sys/gnu/dts/arm/am335x-boneblue.dts Sat Sep 28 22:54:56 2019 (r352858) @@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /dts-v1/; @@ -130,135 +127,135 @@ &am33xx_pinmux { user_leds_s0: user_leds_s0 { pinctrl-single,pins = < - AM33XX_IOPAD(0x854, PIN_OUTPUT | MUX_MODE7) /* (V15) gpmc_a5.gpio1[21] - USR_LED_0 */ - AM33XX_IOPAD(0x858, PIN_OUTPUT | MUX_MODE7) /* (U15) gpmc_a6.gpio1[22] - USR_LED_1 */ - AM33XX_IOPAD(0x85c, PIN_OUTPUT | MUX_MODE7) /* (T15) gpmc_a7.gpio1[23] - USR_LED_2 */ - AM33XX_IOPAD(0x860, PIN_OUTPUT | MUX_MODE7) /* (V16) gpmc_a8.gpio1[24] - USR_LED_3 */ - AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE7) /* (A15) xdma_event_intr0.gpio0[19] - WIFI_LED */ - AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE7) /* (R7) gpmc_advn_ale.gpio2[2] - P8.7, LED_RED, GP1_PIN_5 */ - AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE7) /* (T7) gpmc_oen_ren.gpio2[3] - P8.8, LED_GREEN, GP1_PIN_6 */ - AM33XX_IOPAD(0x82c, PIN_OUTPUT | MUX_MODE7) /* (U12) gpmc_ad11.gpio0[27] - P8.17, BATT_LED_1 */ - AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE7) /* (T5) lcd_data15.gpio0[11] - P8.32, BATT_LED_2 */ - AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE7) /* (V6) gpmc_csn0.gpio1[29] - P8.26, BATT_LED_3 */ - AM33XX_IOPAD(0x828, PIN_OUTPUT | MUX_MODE7) /* (T11) gpmc_ad10.gpio0[26] - P8.14, BATT_LED_4 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A5, PIN_OUTPUT, MUX_MODE7) /* (V15) gpmc_a5.gpio1[21] - USR_LED_0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A6, PIN_OUTPUT, MUX_MODE7) /* (U15) gpmc_a6.gpio1[22] - USR_LED_1 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A7, PIN_OUTPUT, MUX_MODE7) /* (T15) gpmc_a7.gpio1[23] - USR_LED_2 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A8, PIN_OUTPUT, MUX_MODE7) /* (V16) gpmc_a8.gpio1[24] - USR_LED_3 */ + AM33XX_PADCONF(AM335X_PIN_XDMA_EVENT_INTR0, PIN_OUTPUT, MUX_MODE7) /* (A15) xdma_event_intr0.gpio0[19] - WIFI_LED */ + AM33XX_PADCONF(AM335X_PIN_GPMC_ADVN_ALE, PIN_OUTPUT, MUX_MODE7) /* (R7) gpmc_advn_ale.gpio2[2] - P8.7, LED_RED, GP1_PIN_5 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_OEN_REN, PIN_OUTPUT, MUX_MODE7) /* (T7) gpmc_oen_ren.gpio2[3] - P8.8, LED_GREEN, GP1_PIN_6 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD11, PIN_OUTPUT, MUX_MODE7) /* (U12) gpmc_ad11.gpio0[27] - P8.17, BATT_LED_1 */ + AM33XX_PADCONF(AM335X_PIN_LCD_DATA15, PIN_OUTPUT, MUX_MODE7) /* (T5) lcd_data15.gpio0[11] - P8.32, BATT_LED_2 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_CSN0, PIN_OUTPUT, MUX_MODE7) /* (V6) gpmc_csn0.gpio1[29] - P8.26, BATT_LED_3 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD10, PIN_OUTPUT, MUX_MODE7) /* (T11) gpmc_ad10.gpio0[26] - P8.14, BATT_LED_4 */ >; }; i2c0_pins: pinmux_i2c0_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* (C17) I2C0_SDA.I2C0_SDA */ - AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* (C16) I2C0_SCL.I2C0_SCL */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SDA, PIN_INPUT_PULLUP, MUX_MODE0) /* (C17) I2C0_SDA.I2C0_SDA */ + AM33XX_PADCONF(AM335X_PIN_I2C0_SCL, PIN_INPUT_PULLUP, MUX_MODE0) /* (C16) I2C0_SCL.I2C0_SCL */ >; }; i2c2_pins: pinmux_i2c2_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3) /* (D18) uart1_ctsn.I2C2_SDA */ - AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3) /* (D17) uart1_rtsn.I2C2_SCL */ + AM33XX_PADCONF(AM335X_PIN_UART1_CTSN, PIN_INPUT_PULLUP, MUX_MODE3) /* (D18) uart1_ctsn.I2C2_SDA */ + AM33XX_PADCONF(AM335X_PIN_UART1_RTSN, PIN_INPUT_PULLUP, MUX_MODE3) /* (D17) uart1_rtsn.I2C2_SCL */ >; }; /* UT0 */ uart0_pins: pinmux_uart0_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* (E15) uart0_rxd.uart0_rxd */ - AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (E16) uart0_txd.uart0_txd */ + AM33XX_PADCONF(AM335X_PIN_UART0_RXD, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART0_TXD, PIN_OUTPUT_PULLDOWN, MUX_MODE0) >; }; /* UT1 */ uart1_pins: pinmux_uart1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* (D16) uart1_rxd.uart1_rxd */ - AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (D15) uart1_txd.uart1_txd */ + AM33XX_PADCONF(AM335X_PIN_UART1_RXD, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_TXD, PIN_OUTPUT_PULLDOWN, MUX_MODE0) >; }; /* GPS */ uart2_pins: pinmux_uart2_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE1) /* (A17) spi0_sclk.uart2_rxd */ - AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* (B17) spi0_d0.uart2_txd */ + AM33XX_PADCONF(AM335X_PIN_SPI0_SCLK, PIN_INPUT_PULLUP, MUX_MODE1) /* (A17) spi0_sclk.uart2_rxd */ + AM33XX_PADCONF(AM335X_PIN_SPI0_D0, PIN_OUTPUT_PULLDOWN, MUX_MODE1) /* (B17) spi0_d0.uart2_txd */ >; }; /* DSM2 */ uart4_pins: pinmux_uart4_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x870, PIN_INPUT_PULLUP | MUX_MODE6) /* (T17) gpmc_wait0.uart4_rxd */ + AM33XX_PADCONF(AM335X_PIN_GPMC_WAIT0, PIN_INPUT_PULLUP, MUX_MODE6) /* (T17) gpmc_wait0.uart4_rxd */ >; }; /* UT5 */ uart5_pins: pinmux_uart5_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x8C4, PIN_INPUT_PULLUP | MUX_MODE4) /* (U2) lcd_data9.uart5_rxd */ - AM33XX_IOPAD(0x8C0, PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* (U1) lcd_data8.uart5_txd */ + AM33XX_PADCONF(AM335X_PIN_LCD_DATA9, PIN_INPUT_PULLUP, MUX_MODE4) /* (U2) lcd_data9.uart5_rxd */ + AM33XX_PADCONF(AM335X_PIN_LCD_DATA8, PIN_OUTPUT_PULLDOWN, MUX_MODE4) /* (U1) lcd_data8.uart5_txd */ >; }; mmc1_pins: pinmux_mmc1_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* (C15) spi0_cs1.gpio0[6] */ + AM33XX_PADCONF(AM335X_PIN_SPI0_CS1, PIN_INPUT, MUX_MODE7) /* (C15) spi0_cs1.gpio0[6] */ >; }; mmc2_pins: pinmux_mmc2_pins { pinctrl-single,pins = < - AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* (U9) gpmc_csn1.mmc1_clk */ - AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* (V9) gpmc_csn2.mmc1_cmd */ - AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* (U7) gpmc_ad0.mmc1_dat0 */ - AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* (V7) gpmc_ad1.mmc1_dat1 */ - AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* (R8) gpmc_ad2.mmc1_dat2 */ - AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* (T8) gpmc_ad3.mmc1_dat3 */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Sep 28 23:01:24 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 067A4132432; Sat, 28 Sep 2019 23:01:24 +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 46gkg76SKFz3DGq; Sat, 28 Sep 2019 23:01:23 +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 C115E88D8; Sat, 28 Sep 2019 23:01:23 +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 x8SN1NTu044024; Sat, 28 Sep 2019 23:01:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SN1NQ0044023; Sat, 28 Sep 2019 23:01:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909282301.x8SN1NQ0044023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 28 Sep 2019 23:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352859 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 352859 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: Sat, 28 Sep 2019 23:01:24 -0000 Author: manu Date: Sat Sep 28 23:01:23 2019 New Revision: 352859 URL: https://svnweb.freebsd.org/changeset/base/352859 Log: arm: allwinner: Add pll_mipi to the files Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sat Sep 28 22:54:56 2019 (r352858) +++ head/sys/arm/allwinner/files.allwinner Sat Sep 28 23:01:23 2019 (r352859) @@ -37,6 +37,7 @@ arm/allwinner/aw_gmacclk.c standard arm/allwinner/clkng/aw_ccung.c standard arm/allwinner/clkng/aw_clk_frac.c standard arm/allwinner/clkng/aw_clk_m.c standard +arm/allwinner/clkng/aw_clk_mipi.c standard arm/allwinner/clkng/aw_clk_nkmp.c standard arm/allwinner/clkng/aw_clk_nm.c standard arm/allwinner/clkng/aw_clk_prediv_mux.c standard From owner-svn-src-head@freebsd.org Sat Sep 28 23:08: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 3D086132522; Sat, 28 Sep 2019 23:08:25 +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 46gkqF1TtNz3Dgh; Sat, 28 Sep 2019 23:08:25 +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 118F58A3D; Sat, 28 Sep 2019 23:08:25 +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 x8SN8PZZ045553; Sat, 28 Sep 2019 23:08:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8SN8JKb045520; Sat, 28 Sep 2019 23:08:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201909282308.x8SN8JKb045520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 28 Sep 2019 23:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352860 - in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/broadcom/stingray arm64/exynos arm64/freescale arm64/hisilicon arm64/marvell arm64/mediatek... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/broadcom/stingray arm64/exynos arm64/freescale arm64/hisilicon arm64/marvell arm64/mediatek arm64/nvidia arm64/qcom ... X-SVN-Commit-Revision: 352860 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: Sat, 28 Sep 2019 23:08:25 -0000 Author: manu Date: Sat Sep 28 23:08:19 2019 New Revision: 352860 URL: https://svnweb.freebsd.org/changeset/base/352860 Log: Import DTS files from Linux 5.3 Added: - copied unchanged from r352856, vendor/device-tree/dist/src/arm/am335x-regor-rdk.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/am335x-regor.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-yamp.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-inspur-fp5280g2.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-lenovo-hr630.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-microsoft-olympus.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-swift.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-vesnin.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/ibm-power9-dual.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/imx6dl-kontron-samx6i.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/imx6q-kontron-samx6i.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/imx6qdl-kontron-samx6i.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/imx7d-meerkat96.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/logicpd-torpedo-37xx-devkit-28.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/ls1021a-tsn.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157a-avenger96.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157xaa-pinctrl.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157xab-pinctrl.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157xac-pinctrl.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157xad-pinctrl.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-odroid-n2.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/broadcom/stingray/stingray-usb.dtsi head/sys/gnu/dts/arm64/freescale/imx8mn-pinfunc.h - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/freescale/imx8mn-pinfunc.h - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/freescale/imx8mq-librem5-devkit.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/hisilicon/hi3660-coresight.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/mediatek/mt8183-evb.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/mediatek/mt8183.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-cheza-r1.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-cheza-r2.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-cheza-r3.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-cheza.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-db845c.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/renesas/hihope-common.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/renesas/hihope-rzg2-ex.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/renesas/r8a774a1-hihope-rzg2m-ex.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/renesas/r8a774a1-hihope-rzg2m.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-hugsun-x99.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-khadas-edge-captain.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-khadas-edge-v.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-khadas-edge.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-khadas-edge.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399pro.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/ti/k3-j721e-common-proc-board.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/ti/k3-j721e-main.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/ti/k3-j721e-mcu-wakeup.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/ti/k3-j721e-som-p0.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/ti/k3-j721e.dtsi - copied unchanged from r352856, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gpucc-msm8998.h - copied unchanged from r352856, vendor/device-tree/dist/include/dt-bindings/power/qcom-aoss-qmp.h - copied unchanged from r352856, vendor/device-tree/dist/include/dt-bindings/reset/bitmain,bm1880-reset.h - copied unchanged from r352856, vendor/device-tree/dist/include/dt-bindings/sound/madera.h - copied unchanged from r352856, vendor/device-tree/dist/include/dt-bindings/sound/meson-g12a-tohdmitx.h Directory Properties: head/sys/gnu/dts/arm/am335x-regor-rdk.dts (props changed) head/sys/gnu/dts/arm/am335x-regor.dtsi (props changed) head/sys/gnu/dts/arm/aspeed-bmc-facebook-yamp.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-inspur-fp5280g2.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-lenovo-hr630.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-microsoft-olympus.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-opp-swift.dts (props changed) head/sys/gnu/dts/arm/aspeed-bmc-opp-vesnin.dts (props changed) head/sys/gnu/dts/arm/ibm-power9-dual.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-kontron-samx6i.dtsi (props changed) head/sys/gnu/dts/arm/imx6q-kontron-samx6i.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-kontron-samx6i.dtsi (props changed) head/sys/gnu/dts/arm/imx7d-meerkat96.dts (props changed) head/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit-28.dts (props changed) head/sys/gnu/dts/arm/ls1021a-tsn.dts (props changed) head/sys/gnu/dts/arm/stm32mp157a-avenger96.dts (props changed) head/sys/gnu/dts/arm/stm32mp157xaa-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32mp157xab-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32mp157xac-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32mp157xad-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm64/amlogic/meson-g12b-odroid-n2.dts (props changed) head/sys/gnu/dts/arm64/amlogic/meson-g12b.dtsi (props changed) head/sys/gnu/dts/arm64/broadcom/stingray/stingray-usb.dtsi (props changed) head/sys/gnu/dts/arm64/freescale/imx8mq-librem5-devkit.dts (props changed) head/sys/gnu/dts/arm64/hisilicon/hi3660-coresight.dtsi (props changed) head/sys/gnu/dts/arm64/mediatek/mt8183-evb.dts (props changed) head/sys/gnu/dts/arm64/mediatek/mt8183.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/sdm845-cheza-r1.dts (props changed) head/sys/gnu/dts/arm64/qcom/sdm845-cheza-r2.dts (props changed) head/sys/gnu/dts/arm64/qcom/sdm845-cheza-r3.dts (props changed) head/sys/gnu/dts/arm64/qcom/sdm845-cheza.dtsi (props changed) head/sys/gnu/dts/arm64/qcom/sdm845-db845c.dts (props changed) head/sys/gnu/dts/arm64/renesas/hihope-common.dtsi (props changed) head/sys/gnu/dts/arm64/renesas/hihope-rzg2-ex.dtsi (props changed) head/sys/gnu/dts/arm64/renesas/r8a774a1-hihope-rzg2m-ex.dts (props changed) head/sys/gnu/dts/arm64/renesas/r8a774a1-hihope-rzg2m.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-hugsun-x99.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-khadas-edge-captain.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-khadas-edge-v.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-khadas-edge.dts (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399-khadas-edge.dtsi (props changed) head/sys/gnu/dts/arm64/rockchip/rk3399pro.dtsi (props changed) head/sys/gnu/dts/arm64/ti/k3-j721e-common-proc-board.dts (props changed) head/sys/gnu/dts/arm64/ti/k3-j721e-main.dtsi (props changed) head/sys/gnu/dts/arm64/ti/k3-j721e-mcu-wakeup.dtsi (props changed) head/sys/gnu/dts/arm64/ti/k3-j721e-som-p0.dtsi (props changed) head/sys/gnu/dts/arm64/ti/k3-j721e.dtsi (props changed) head/sys/gnu/dts/include/dt-bindings/clock/qcom,gpucc-msm8998.h (props changed) head/sys/gnu/dts/include/dt-bindings/power/qcom-aoss-qmp.h (props changed) head/sys/gnu/dts/include/dt-bindings/reset/bitmain,bm1880-reset.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/madera.h (props changed) head/sys/gnu/dts/include/dt-bindings/sound/meson-g12a-tohdmitx.h (props changed) Modified: head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts head/sys/gnu/dts/arm/am335x-pcm-953.dtsi head/sys/gnu/dts/arm/am335x-phycore-rdk.dts head/sys/gnu/dts/arm/am335x-phycore-som.dtsi head/sys/gnu/dts/arm/am335x-wega-rdk.dts head/sys/gnu/dts/arm/am335x-wega.dtsi head/sys/gnu/dts/arm/am33xx-l4.dtsi head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-l4.dtsi head/sys/gnu/dts/arm/am571x-idk.dts head/sys/gnu/dts/arm/am572x-idk.dts head/sys/gnu/dts/arm/am574x-idk.dts head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi head/sys/gnu/dts/arm/am57xx-beagle-x15-revb1.dts head/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts head/sys/gnu/dts/arm/arm-realview-eb.dtsi head/sys/gnu/dts/arm/arm-realview-pb1176.dts head/sys/gnu/dts/arm/arm-realview-pb11mp.dts head/sys/gnu/dts/arm/arm-realview-pbx.dtsi head/sys/gnu/dts/arm/armada-370-netgear-rn104.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-lanyang.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts head/sys/gnu/dts/arm/aspeed-bmc-quanta-q71l.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-wb50n.dtsi head/sys/gnu/dts/arm/at91sam9261ek.dts head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/bcm-cygnus-clock.dtsi head/sys/gnu/dts/arm/bcm-cygnus.dtsi head/sys/gnu/dts/arm/bcm-nsp.dtsi head/sys/gnu/dts/arm/bcm11351.dtsi head/sys/gnu/dts/arm/bcm21664-garnet.dts head/sys/gnu/dts/arm/bcm21664.dtsi head/sys/gnu/dts/arm/bcm23550-sparrow.dts head/sys/gnu/dts/arm/bcm23550.dtsi head/sys/gnu/dts/arm/bcm28155-ap.dts head/sys/gnu/dts/arm/bcm283x.dtsi head/sys/gnu/dts/arm/bcm4708-asus-rt-ac56u.dts head/sys/gnu/dts/arm/bcm4708-asus-rt-ac68u.dts head/sys/gnu/dts/arm/bcm4708-buffalo-wzr-1750dhp.dts head/sys/gnu/dts/arm/bcm4708-linksys-ea6300-v1.dts head/sys/gnu/dts/arm/bcm4708-linksys-ea6500-v2.dts head/sys/gnu/dts/arm/bcm4708-luxul-xap-1510.dts head/sys/gnu/dts/arm/bcm4708-luxul-xwc-1000.dts head/sys/gnu/dts/arm/bcm4708-netgear-r6250.dts head/sys/gnu/dts/arm/bcm4708-netgear-r6300-v2.dts head/sys/gnu/dts/arm/bcm4708-smartrg-sr400ac.dts head/sys/gnu/dts/arm/bcm47081-asus-rt-n18u.dts head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-600dhp2.dts head/sys/gnu/dts/arm/bcm47081-buffalo-wzr-900dhp.dts head/sys/gnu/dts/arm/bcm47081-luxul-xap-1410.dts head/sys/gnu/dts/arm/bcm47081-luxul-xwr-1200.dts head/sys/gnu/dts/arm/bcm47081-tplink-archer-c5-v2.dts head/sys/gnu/dts/arm/bcm47094-dlink-dir-885l.dts head/sys/gnu/dts/arm/bcm47094-linksys-panamera.dts head/sys/gnu/dts/arm/bcm47094-luxul-abr-4500.dts head/sys/gnu/dts/arm/bcm47094-luxul-xap-1610.dts head/sys/gnu/dts/arm/bcm47094-luxul-xbr-4500.dts head/sys/gnu/dts/arm/bcm47094-luxul-xwr-3100.dts head/sys/gnu/dts/arm/bcm47094-luxul-xwr-3150-v1.dts head/sys/gnu/dts/arm/bcm47094-netgear-r8500.dts head/sys/gnu/dts/arm/bcm47094-phicomm-k3.dts head/sys/gnu/dts/arm/bcm47189-luxul-xap-1440.dts head/sys/gnu/dts/arm/bcm47189-luxul-xap-810.dts head/sys/gnu/dts/arm/bcm47189-tenda-ac9.dts head/sys/gnu/dts/arm/bcm5301x.dtsi head/sys/gnu/dts/arm/bcm53573.dtsi head/sys/gnu/dts/arm/bcm63138.dtsi head/sys/gnu/dts/arm/bcm7445-bcm97445svmb.dts head/sys/gnu/dts/arm/bcm7445.dtsi head/sys/gnu/dts/arm/bcm911360_entphn.dts head/sys/gnu/dts/arm/bcm947189acdbmr.dts head/sys/gnu/dts/arm/bcm953012er.dts head/sys/gnu/dts/arm/bcm953012k.dts head/sys/gnu/dts/arm/bcm958522er.dts head/sys/gnu/dts/arm/bcm958525er.dts head/sys/gnu/dts/arm/bcm958525xmc.dts head/sys/gnu/dts/arm/bcm958622hr.dts head/sys/gnu/dts/arm/bcm958623hr.dts head/sys/gnu/dts/arm/bcm958625hr.dts head/sys/gnu/dts/arm/bcm958625k.dts head/sys/gnu/dts/arm/bcm963138dvt.dts head/sys/gnu/dts/arm/bcm988312hr.dts head/sys/gnu/dts/arm/da850-evm.dts head/sys/gnu/dts/arm/da850-lcdk.dts head/sys/gnu/dts/arm/da850-lego-ev3.dts head/sys/gnu/dts/arm/da850.dtsi head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7-l4.dtsi head/sys/gnu/dts/arm/dra74x-mmc-iodelay.dtsi head/sys/gnu/dts/arm/emev2-kzm9d.dts head/sys/gnu/dts/arm/exynos3250-artik5.dtsi head/sys/gnu/dts/arm/exynos3250-monk.dts head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-origen.dts head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4210.dtsi head/sys/gnu/dts/arm/exynos4412-galaxy-s3.dtsi head/sys/gnu/dts/arm/exynos4412-itop-scp-core.dtsi head/sys/gnu/dts/arm/exynos4412-midas.dtsi head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-prime.dtsi head/sys/gnu/dts/arm/exynos4412.dtsi head/sys/gnu/dts/arm/exynos5410-odroidxu.dts head/sys/gnu/dts/arm/exynos5410.dtsi head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi head/sys/gnu/dts/arm/exynos54xx.dtsi head/sys/gnu/dts/arm/gemini-dlink-dir-685.dts head/sys/gnu/dts/arm/hip04.dtsi head/sys/gnu/dts/arm/imx53-m53menlo.dts head/sys/gnu/dts/arm/imx53-smd.dts head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6sl-evk.dts head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sll-evk.dts head/sys/gnu/dts/arm/imx6sll.dtsi head/sys/gnu/dts/arm/imx6sx-sdb-reva.dts head/sys/gnu/dts/arm/imx6sx-sdb.dts head/sys/gnu/dts/arm/imx6sx-udoo-neo-basic.dts head/sys/gnu/dts/arm/imx6sx-udoo-neo-extended.dts head/sys/gnu/dts/arm/imx6sx-udoo-neo-full.dts head/sys/gnu/dts/arm/imx6sx-udoo-neo.dtsi head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-14x14-evk.dtsi head/sys/gnu/dts/arm/imx6ul-geam.dts head/sys/gnu/dts/arm/imx6ul-isiot.dtsi head/sys/gnu/dts/arm/imx6ul-pico-hobbit.dts head/sys/gnu/dts/arm/imx6ul-pico-pi.dts head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx6ull-colibri-eval-v3.dtsi head/sys/gnu/dts/arm/imx6ull-colibri.dtsi head/sys/gnu/dts/arm/imx6ull.dtsi head/sys/gnu/dts/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7d-zii-rpu2.dts head/sys/gnu/dts/arm/imx7d.dtsi head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/imx7ulp-evk.dts head/sys/gnu/dts/arm/imx7ulp.dtsi head/sys/gnu/dts/arm/integrator.dtsi head/sys/gnu/dts/arm/iwg20d-q7-common.dtsi head/sys/gnu/dts/arm/meson.dtsi head/sys/gnu/dts/arm/meson6-atv1200.dts head/sys/gnu/dts/arm/meson6.dtsi head/sys/gnu/dts/arm/meson8-minix-neo-x8.dts head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/meson8b-ec100.dts head/sys/gnu/dts/arm/meson8b-mxq.dts head/sys/gnu/dts/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/meson8m2-mxiii-plus.dts head/sys/gnu/dts/arm/meson8m2.dtsi head/sys/gnu/dts/arm/omap4-l4.dtsi head/sys/gnu/dts/arm/pxa300-raumfeld-common.dtsi head/sys/gnu/dts/arm/pxa300-raumfeld-controller.dts head/sys/gnu/dts/arm/pxa300-raumfeld-speaker-one.dts head/sys/gnu/dts/arm/pxa3xx.dtsi head/sys/gnu/dts/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8974-fairphone-fp2.dts head/sys/gnu/dts/arm/qcom-msm8974-lge-nexus5-hammerhead.dts head/sys/gnu/dts/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/r7s72100-genmai.dts head/sys/gnu/dts/arm/r7s72100-rskrza1.dts head/sys/gnu/dts/arm/r7s72100.dtsi head/sys/gnu/dts/arm/r7s9210-rza2mevb.dts head/sys/gnu/dts/arm/r7s9210.dtsi head/sys/gnu/dts/arm/r8a73a4-ape6evm.dts head/sys/gnu/dts/arm/r8a7740-armadillo800eva.dts head/sys/gnu/dts/arm/r8a7743-sk-rzg1m.dts head/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm.dts head/sys/gnu/dts/arm/r8a7745-sk-rzg1e.dts head/sys/gnu/dts/arm/r8a77470-iwg23s-sbc.dts head/sys/gnu/dts/arm/r8a7778-bockw.dts head/sys/gnu/dts/arm/r8a7779-marzen.dts head/sys/gnu/dts/arm/r8a7790-lager.dts head/sys/gnu/dts/arm/r8a7790-stout.dts head/sys/gnu/dts/arm/r8a7791-koelsch.dts head/sys/gnu/dts/arm/r8a7791-porter.dts head/sys/gnu/dts/arm/r8a7792-blanche.dts head/sys/gnu/dts/arm/r8a7792-wheat.dts head/sys/gnu/dts/arm/r8a7792.dtsi head/sys/gnu/dts/arm/r8a7793-gose.dts head/sys/gnu/dts/arm/r8a7794-alt.dts head/sys/gnu/dts/arm/r8a7794-silk.dts head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-veyron-chromebook.dtsi head/sys/gnu/dts/arm/rk3288-veyron-jaq.dts head/sys/gnu/dts/arm/rk3288-veyron-jerry.dts head/sys/gnu/dts/arm/rk3288-veyron-mickey.dts head/sys/gnu/dts/arm/rk3288-veyron-minnie.dts head/sys/gnu/dts/arm/rk3288-veyron-pinky.dts head/sys/gnu/dts/arm/rk3288-veyron-speedy.dts head/sys/gnu/dts/arm/rk3288-veyron.dtsi head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sh73a0-kzm9g.dts head/sys/gnu/dts/arm/socfpga_arria10.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk.dtsi head/sys/gnu/dts/arm/stm32746g-eval.dts head/sys/gnu/dts/arm/stm32mp157-pinctrl.dtsi head/sys/gnu/dts/arm/stm32mp157a-dk1.dts head/sys/gnu/dts/arm/stm32mp157c-ed1.dts head/sys/gnu/dts/arm/stm32mp157c-ev1.dts head/sys/gnu/dts/arm/stm32mp157c.dtsi head/sys/gnu/dts/arm/sun5i-gr8-evb.dts head/sys/gnu/dts/arm/sun6i-a31.dtsi head/sys/gnu/dts/arm/sun7i-a20-icnova-swac.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts head/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-bananapi-m2-zero.dts head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts head/sys/gnu/dts/arm/sun8i-h3-beelink-x2.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts head/sys/gnu/dts/arm/sun8i-r40-bananapi-m2-ultra.dts head/sys/gnu/dts/arm/sun8i-r40.dtsi head/sys/gnu/dts/arm/sun8i-v3s.dtsi head/sys/gnu/dts/arm/sun8i-v40-bananapi-m2-berry.dts head/sys/gnu/dts/arm/sunxi-bananapi-m2-plus-v1.2.dtsi head/sys/gnu/dts/arm/uniphier-ld4-ref.dts head/sys/gnu/dts/arm/uniphier-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pro5.dtsi head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/uniphier-sld8-ref.dts head/sys/gnu/dts/arm/uniphier-sld8.dtsi head/sys/gnu/dts/arm/versatile-ab.dts head/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm/vexpress-v2m.dtsi head/sys/gnu/dts/arm/vexpress-v2p-ca15_a7.dts head/sys/gnu/dts/arm/vf610-bk4.dts head/sys/gnu/dts/arm/vf610-zii-dev.dtsi head/sys/gnu/dts/arm64/allwinner/axp803.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-a64-amarula-relic.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-bananapi-m64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-nanopi-a64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-oceanic-5205-5inmfd.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-orangepi-win.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64-teres-i.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo-plus2.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi head/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi head/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts head/sys/gnu/dts/arm64/amlogic/meson-axg-s400.dts head/sys/gnu/dts/arm64/amlogic/meson-axg.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12a-sei510.dts head/sys/gnu/dts/arm64/amlogic/meson-g12a-u200.dts head/sys/gnu/dts/arm64/amlogic/meson-g12a-x96-max.dts head/sys/gnu/dts/arm64/amlogic/meson-g12a.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gx-p23x-q20x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gx.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nanopi-k2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nexbox-a95x.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-odroidc2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-p200.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-p20x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-p241.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-p230.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxm-khadas-vim2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-nexbox-a1.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-q200.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-rbox-pro.dts head/sys/gnu/dts/arm64/arm/juno-base.dtsi head/sys/gnu/dts/arm64/arm/juno-cs-r1r2.dtsi head/sys/gnu/dts/arm64/arm/juno-motherboard.dtsi head/sys/gnu/dts/arm64/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm64/broadcom/stingray/stingray.dtsi head/sys/gnu/dts/arm64/exynos/exynos5433-tm2-common.dtsi head/sys/gnu/dts/arm64/exynos/exynos5433.dtsi head/sys/gnu/dts/arm64/exynos/exynos7-espresso.dts head/sys/gnu/dts/arm64/exynos/exynos7.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-qds.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-rdb.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1088a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls208xa.dtsi head/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi head/sys/gnu/dts/arm64/freescale/imx8mm-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mm-pinfunc.h head/sys/gnu/dts/arm64/freescale/imx8mm.dtsi head/sys/gnu/dts/arm64/freescale/imx8mq-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mq.dtsi head/sys/gnu/dts/arm64/freescale/imx8qxp.dtsi head/sys/gnu/dts/arm64/hisilicon/hi3660.dtsi head/sys/gnu/dts/arm64/hisilicon/hi6220-coresight.dtsi head/sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dts head/sys/gnu/dts/arm64/marvell/armada-7040-db.dts head/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts head/sys/gnu/dts/arm64/marvell/armada-8040-db.dts head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dtsi head/sys/gnu/dts/arm64/marvell/armada-ap806-dual.dtsi head/sys/gnu/dts/arm64/marvell/armada-ap806-quad.dtsi head/sys/gnu/dts/arm64/marvell/armada-ap806.dtsi head/sys/gnu/dts/arm64/marvell/armada-cp110.dtsi head/sys/gnu/dts/arm64/mediatek/mt7622.dtsi head/sys/gnu/dts/arm64/nvidia/tegra186-p2771-0000.dts head/sys/gnu/dts/arm64/nvidia/tegra186-p3310.dtsi head/sys/gnu/dts/arm64/nvidia/tegra186.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194-p2972-0000.dts head/sys/gnu/dts/arm64/nvidia/tegra194.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p2180.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p2371-2180.dts head/sys/gnu/dts/arm64/nvidia/tegra210-p3450-0000.dts head/sys/gnu/dts/arm64/nvidia/tegra210.dtsi head/sys/gnu/dts/arm64/qcom/msm8916.dtsi head/sys/gnu/dts/arm64/qcom/msm8996.dtsi head/sys/gnu/dts/arm64/qcom/msm8998-mtp.dtsi head/sys/gnu/dts/arm64/qcom/msm8998.dtsi head/sys/gnu/dts/arm64/qcom/pm8998.dtsi head/sys/gnu/dts/arm64/qcom/pms405.dtsi head/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi head/sys/gnu/dts/arm64/qcom/qcs404.dtsi head/sys/gnu/dts/arm64/qcom/sdm845-mtp.dts head/sys/gnu/dts/arm64/qcom/sdm845.dtsi head/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi head/sys/gnu/dts/arm64/renesas/r8a774c0-cat874.dts head/sys/gnu/dts/arm64/renesas/r8a774c0.dtsi head/sys/gnu/dts/arm64/renesas/r8a7795.dtsi head/sys/gnu/dts/arm64/renesas/r8a7796.dtsi head/sys/gnu/dts/arm64/renesas/r8a77965.dtsi head/sys/gnu/dts/arm64/renesas/r8a77970-eagle.dts head/sys/gnu/dts/arm64/renesas/r8a77990-ebisu.dts head/sys/gnu/dts/arm64/renesas/r8a77990.dtsi head/sys/gnu/dts/arm64/renesas/r8a77995-draak.dts head/sys/gnu/dts/arm64/renesas/r8a77995.dtsi head/sys/gnu/dts/arm64/renesas/salvator-common.dtsi head/sys/gnu/dts/arm64/renesas/ulcb-kf.dtsi head/sys/gnu/dts/arm64/renesas/ulcb.dtsi head/sys/gnu/dts/arm64/rockchip/rk3328-roc-cc.dts head/sys/gnu/dts/arm64/rockchip/rk3328.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-ficus.dts head/sys/gnu/dts/arm64/rockchip/rk3399-rock-pi-4.dts head/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dts head/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts head/sys/gnu/dts/arm64/rockchip/rk3399-sapphire.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-ld11-global.dts head/sys/gnu/dts/arm64/socionext/uniphier-ld11.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-ld20.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-pxs3-ref.dts head/sys/gnu/dts/arm64/socionext/uniphier-pxs3.dtsi head/sys/gnu/dts/arm64/sprd/sc9836.dtsi head/sys/gnu/dts/arm64/sprd/sc9860.dtsi head/sys/gnu/dts/arm64/sprd/whale2.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-main.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi head/sys/gnu/dts/arm64/ti/k3-am65.dtsi head/sys/gnu/dts/arm64/ti/k3-am654-base-board.dts head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h head/sys/gnu/dts/include/dt-bindings/clock/exynos5420.h head/sys/gnu/dts/include/dt-bindings/clock/g12a-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/imx8mm-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx8mq-clock.h head/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/mt8516-clk.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-qcs404.h head/sys/gnu/dts/include/dt-bindings/clock/rk3228-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3328-cru.h head/sys/gnu/dts/include/dt-bindings/clock/stratix10-clock.h head/sys/gnu/dts/include/dt-bindings/gpio/tegra186-gpio.h head/sys/gnu/dts/include/dt-bindings/net/ti-dp83867.h head/sys/gnu/dts/include/dt-bindings/power/qcom-rpmpd.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/arm64/ (props changed) head/sys/gnu/dts/include/ (props changed) Modified: head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -30,6 +30,12 @@ AM33XX_PADCONF(AM335X_PIN_LCD_AC_BIAS_EN, PIN_INPUT_PULLDOWN, MUX_MODE7) /* lcd_ac_bias_en.gpio2[25] RI */ >; }; + + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_GPMC_AD15, PIN_INPUT, MUX_MODE7) /* MMC1 CD */ + >; + }; }; &uart1 { @@ -65,7 +71,13 @@ }; &cpsw_emac1 { - phy-mode = "rgmii-txid"; + phy-mode = "rgmii-id"; dual_emac_res_vlan = <2>; phy-handle = <&phy1>; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + cd-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; }; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -51,6 +51,12 @@ AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKR, PIN_INPUT_PULLUP, MUX_MODE7) /* mcasp0_aclkr.gpio3[18], INPUT_PULLDOWN | MODE7 */ >; }; + + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_MII1_RXD3, PIN_INPUT, MUX_MODE7) /* MMC1 CD */ + >; + }; }; &uart1 { @@ -107,7 +113,13 @@ }; &cpsw_emac1 { - phy-mode = "rgmii-txid"; + phy-mode = "rgmii-id"; dual_emac_res_vlan = <2>; phy-handle = <&phy1>; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + cd-gpios = <&gpio2 18 GPIO_ACTIVE_LOW>; }; Modified: head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -60,6 +60,11 @@ >; }; + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_MII1_RXD3, PIN_INPUT, MUX_MODE7) /* MMC1 CD */ + >; + }; }; &uart1 { @@ -125,7 +130,7 @@ }; &cpsw_emac1 { - phy-mode = "rgmii-txid"; + phy-mode = "rgmii-id"; dual_emac_res_vlan = <2>; phy-handle = <&phy1>; }; @@ -135,4 +140,10 @@ pinctrl-0 = <&dcan1_pins>; status = "okay"; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + cd-gpios = <&gpio2 18 GPIO_ACTIVE_LOW>; }; Modified: head/sys/gnu/dts/arm/am335x-pcm-953.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-pcm-953.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am335x-pcm-953.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -36,15 +36,13 @@ pinctrl-names = "default"; pinctrl-0 = <&user_leds_pins>; - green { - label = "green:user"; + user-led0 { gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; linux,default-trigger = "gpio"; default-state = "on"; }; - yellow { - label = "yellow:user"; + user-led1 { gpios = <&gpio1 31 GPIO_ACTIVE_LOW>; linux,default-trigger = "gpio"; default-state = "on"; @@ -135,22 +133,6 @@ &davinci_mdio { phy1: ethernet-phy@2 { reg = <2>; - - /* Register 260 (104h) – RGMII Clock and Control Pad Skew */ - rxc-skew-ps = <1400>; - rxdv-skew-ps = <0>; - txc-skew-ps = <1400>; - txen-skew-ps = <0>; - /* Register 261 (105h) – RGMII RX Data Pad Skew */ - rxd3-skew-ps = <0>; - rxd2-skew-ps = <0>; - rxd1-skew-ps = <0>; - rxd0-skew-ps = <0>; - /* Register 262 (106h) – RGMII TX Data Pad Skew */ - txd3-skew-ps = <0>; - txd2-skew-ps = <0>; - txd1-skew-ps = <0>; - txd0-skew-ps = <0>; }; }; Modified: head/sys/gnu/dts/arm/am335x-phycore-rdk.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-phycore-rdk.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am335x-phycore-rdk.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -10,6 +10,10 @@ #include "am335x-pcm-953.dtsi" /* SoM */ +&gpmc { + status = "okay"; +}; + &i2c_eeprom { status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-phycore-som.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -27,17 +27,13 @@ reg = <0x80000000 0x10000000>; /* 256 MB */ }; - regulators { - compatible = "simple-bus"; - - vcc5v: fixedregulator0 { - compatible = "regulator-fixed"; - regulator-name = "vcc5v"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - regulator-boot-on; - regulator-always-on; - }; + vcc5v: fixedregulator0 { + compatible = "regulator-fixed"; + regulator-name = "vcc5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + regulator-always-on; }; }; @@ -50,6 +46,33 @@ status = "okay"; }; +/* EMMC */ +&am33xx_pinmux { + emmc_pins: pinmux_emmc_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_GPMC_CSN1, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_csn1.mmc1_clk */ + AM33XX_PADCONF(AM335X_PIN_GPMC_CSN2, PIN_INPUT_PULLUP, MUX_MODE2) /* gpmc_csn2.mmc1_cmd */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD0, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD1, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD2, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD3, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD4, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD5, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD6, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD7, PIN_INPUT_PULLUP, MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */ + >; + }; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&emmc_pins>; + vmmc-supply = <&vmmc_reg>; + bus-width = <8>; + ti,non-removable; + status = "disabled"; +}; + /* Ethernet */ &am33xx_pinmux { ethernet0_pins: pinmux_ethernet0 { @@ -164,7 +187,7 @@ }; &gpmc { - status = "okay"; + status = "disabled"; pinctrl-names = "default"; pinctrl-0 = <&nandflash_pins>; ranges = <0 0 0x08000000 0x1000000>; /* CS0: NAND */ Copied: head/sys/gnu/dts/arm/am335x-regor-rdk.dts (from r352856, vendor/device-tree/dist/src/arm/am335x-regor-rdk.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am335x-regor-rdk.dts Sat Sep 28 23:08:19 2019 (r352860, copy of r352856, vendor/device-tree/dist/src/arm/am335x-regor-rdk.dts) @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 Phytec Messtechnik GmbH + * Author: Teresa Remmet + * + */ + +/dts-v1/; + +#include "am335x-phycore-som.dtsi" +#include "am335x-regor.dtsi" + +/* SoM */ +&gpmc { + status = "okay"; +}; + +&i2c_eeprom { + status = "okay"; +}; + +&serial_flash { + status = "okay"; +}; Copied: head/sys/gnu/dts/arm/am335x-regor.dtsi (from r352856, vendor/device-tree/dist/src/arm/am335x-regor.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am335x-regor.dtsi Sat Sep 28 23:08:19 2019 (r352860, copy of r352856, vendor/device-tree/dist/src/arm/am335x-regor.dtsi) @@ -0,0 +1,223 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 Phytec Messtechnik GmbH + * Author: Teresa Remmet + * + */ + +/ { + model = "Phytec AM335x phyBOARD-REGOR"; + compatible = "phytec,am335x-regor", "phytec,am335x-phycore-som", "ti,am33xx"; + + vcc3v3: fixedregulator@1 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + /* User IO */ + user_leds: user_leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&user_leds_pins>; + + run_stop-led { + gpios = <&gpio2 22 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "gpio"; + default-state = "off"; + }; + + error-led { + gpios = <&gpio3 15 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "gpio"; + default-state = "off"; + }; + }; +}; + +/* User Leds */ +&am33xx_pinmux { + user_leds_pins: pinmux_user_leds { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_LCD_VSYNC, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* lcd_hsync.gpio2_22 */ + AM33XX_PADCONF(AM335X_PIN_MCASP0_FSX, PIN_OUTPUT_PULLDOWN, MUX_MODE7) /* mcasp0_fsx.gpio3_15 */ + >; + }; +}; + +/* CAN Busses */ +&am33xx_pinmux { + dcan1_pins: pinmux_dcan1 { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_UART0_CTSN, PIN_OUTPUT_PULLUP, MUX_MODE2) /* uart0_ctsn.d_can1_tx */ + AM33XX_PADCONF(AM335X_PIN_UART0_RTSN, PIN_INPUT_PULLUP, MUX_MODE2) /* uart0_rtsn.d_can1_rx */ + >; + }; +}; + +&dcan1 { + pinctrl-names = "default"; + pinctrl-0 = <&dcan1_pins>; + status = "okay"; +}; + +/* Ethernet */ +&am33xx_pinmux { + ethernet1_pins: pinmux_ethernet1 { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_GPMC_A0, PIN_OUTPUT, MUX_MODE1) /* gpmc_a0.mii2_txen */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A1, PIN_INPUT_PULLDOWN, MUX_MODE1) /* gpmc_a1.mii2_rxdv */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A2, PIN_OUTPUT, MUX_MODE1) /* gpmc_a2.mii2_txd3 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A3, PIN_OUTPUT, MUX_MODE1) /* gpmc_a3.mii2_txd2 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A4, PIN_OUTPUT, MUX_MODE1) /* gpmc_a4.mii2_txd1 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A5, PIN_OUTPUT, MUX_MODE1) /* gpmc_a5.mii2_txd0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A6, PIN_INPUT_PULLDOWN, MUX_MODE1) /* gpmc_a6.mii2_txclk */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A7, PIN_INPUT_PULLDOWN, MUX_MODE1) /* gpmc_a7.mii2_rxclk */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A8, PIN_INPUT_PULLDOWN, MUX_MODE1) /* gpmc_a8.mii2_rxd3 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A9, PIN_INPUT_PULLDOWN, MUX_MODE1) /* gpmc_a9.mii2_rxd2 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A10, PIN_INPUT_PULLDOWN, MUX_MODE1) /* gpmc_a10.mii2_rxd1 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_A11, PIN_INPUT_PULLDOWN, MUX_MODE1) /* gpmc_a11.mii2_rxd0 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_WPN, PIN_INPUT_PULLDOWN, MUX_MODE1) /* gpmc_wpn.mii2_rxerr */ + AM33XX_PADCONF(AM335X_PIN_GPMC_BEN1, PIN_INPUT_PULLDOWN, MUX_MODE1) /* gpmc_ben1.mii2_col */ + >; + }; +}; + +&cpsw_emac1 { + phy-handle = <&phy1>; + phy-mode = "mii"; + dual_emac_res_vlan = <2>; +}; + +&davinci_mdio { + phy1: ethernet-phy@1 { + reg = <1>; + }; +}; + +&mac { + slaves = <2>; + pinctrl-names = "default"; + pinctrl-0 = <ðernet0_pins ðernet1_pins>; + dual_emac = <1>; +}; + +/* GPIOs */ +&am33xx_pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&user_gpios_pins>; + + user_gpios_pins: pinmux_user_gpios { + pinctrl-single,pins = < + /* DIGIN 1-4 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD11, PIN_INPUT, MUX_MODE7) /* gpmc_ad11.gpio0_27 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD10, PIN_INPUT, MUX_MODE7) /* gpmc_ad10.gpio0_26 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD9, PIN_INPUT, MUX_MODE7) /* gpmc_ad9.gpio0_23 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD8, PIN_INPUT, MUX_MODE7) /* gpmc_ad8.gpio0_22 */ + /* DIGOUT 1-4 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD15, PIN_OUTPUT, MUX_MODE7) /* gpmc_ad15.gpio1_15 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD14, PIN_OUTPUT, MUX_MODE7) /* gpmc_ad14.gpio1_14 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD13, PIN_OUTPUT, MUX_MODE7) /* gpmc_ad13.gpio1_13 */ + AM33XX_PADCONF(AM335X_PIN_GPMC_AD12, PIN_OUTPUT, MUX_MODE7) /* gpmc_ad12.gpio1_12 */ + >; + }; +}; + +/* MMC */ +&am33xx_pinmux { + mmc1_pins: pinmux_mmc1 { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_MMC0_DAT3, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_DAT2, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_DAT1, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_DAT0, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_CLK, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_MMC0_CMD, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_SPI0_CS1, PIN_INPUT_PULLUP, MUX_MODE7) /* spi0_cs1.mmc0_sdcd */ + >; + }; +}; + +&mmc1 { + vmmc-supply = <&vcc3v3>; + bus-width = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +/* RTC */ +&i2c_rtc { + status = "okay"; +}; + +/* UARTs */ +&am33xx_pinmux { + uart0_pins: pinmux_uart0 { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_UART0_RXD, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART0_TXD, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + >; + }; + + uart2_pins: pinmux_uart2 { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_MII1_TX_CLK, PIN_INPUT_PULLUP, MUX_MODE1) /* mii1_tx_clk.uart2_rxd */ + AM33XX_PADCONF(AM335X_PIN_MII1_RX_CLK, PIN_OUTPUT_PULLDOWN, MUX_MODE1) /* mii1_rx_clk.uart2_txd */ + >; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + status = "okay"; +}; + +/* RS485 - UART1 */ +&am33xx_pinmux { + uart1_rs485_pins: pinmux_uart1_rs485_pins { + pinctrl-single,pins = < + AM33XX_PADCONF(AM335X_PIN_UART1_RXD, PIN_INPUT_PULLUP, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_TXD, PIN_OUTPUT_PULLDOWN, MUX_MODE0) + AM33XX_PADCONF(AM335X_PIN_UART1_RTSN, PIN_OUTPUT_PULLUP, MUX_MODE0) + >; + }; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_rs485_pins>; + status = "okay"; + linux,rs485-enabled-at-boot-time; +}; + +/* USB */ +&cppi41dma { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; Modified: head/sys/gnu/dts/arm/am335x-wega-rdk.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-wega-rdk.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am335x-wega-rdk.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -10,6 +10,10 @@ #include "am335x-wega.dtsi" /* SoM */ +&gpmc { + status = "okay"; +}; + &i2c_eeprom { status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-wega.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-wega.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am335x-wega.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -12,16 +12,12 @@ compatible = "ti,da830-evm-audio"; }; - regulators { - compatible = "simple-bus"; - - vcc3v3: fixedregulator1 { - compatible = "regulator-fixed"; - regulator-name = "vcc3v3"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - }; + vcc3v3: fixedregulator1 { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; }; }; Modified: head/sys/gnu/dts/arm/am33xx-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx-l4.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am33xx-l4.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -934,7 +934,7 @@ uart1: serial@0 { compatible = "ti,am3352-uart", "ti,omap3-uart"; clock-frequency = <48000000>; - reg = <0x0 0x2000>; + reg = <0x0 0x1000>; interrupts = <73>; status = "disabled"; dmas = <&edma 28 0>, <&edma 29 0>; @@ -966,7 +966,7 @@ uart2: serial@0 { compatible = "ti,am3352-uart", "ti,omap3-uart"; clock-frequency = <48000000>; - reg = <0x0 0x2000>; + reg = <0x0 0x1000>; interrupts = <74>; status = "disabled"; dmas = <&edma 30 0>, <&edma 31 0>; @@ -1614,7 +1614,7 @@ uart3: serial@0 { compatible = "ti,am3352-uart", "ti,omap3-uart"; clock-frequency = <48000000>; - reg = <0x0 0x2000>; + reg = <0x0 0x1000>; interrupts = <44>; status = "disabled"; }; @@ -1644,7 +1644,7 @@ uart4: serial@0 { compatible = "ti,am3352-uart", "ti,omap3-uart"; clock-frequency = <48000000>; - reg = <0x0 0x2000>; + reg = <0x0 0x1000>; interrupts = <45>; status = "disabled"; }; @@ -1674,7 +1674,7 @@ uart5: serial@0 { compatible = "ti,am3352-uart", "ti,omap3-uart"; clock-frequency = <48000000>; - reg = <0x0 0x2000>; + reg = <0x0 0x1000>; interrupts = <46>; status = "disabled"; }; @@ -1758,6 +1758,8 @@ target-module@cc000 { /* 0x481cc000, ap 60 46.0 */ compatible = "ti,sysc-omap4", "ti,sysc"; + reg = <0xcc020 0x4>; + reg-names = "rev"; ti,hwmods = "d_can0"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ clocks = <&l4ls_clkctrl AM3_L4LS_D_CAN0_CLKCTRL 0>, @@ -1780,6 +1782,8 @@ target-module@d0000 { /* 0x481d0000, ap 62 42.0 */ compatible = "ti,sysc-omap4", "ti,sysc"; + reg = <0xd0020 0x4>; + reg-names = "rev"; ti,hwmods = "d_can1"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ clocks = <&l4ls_clkctrl AM3_L4LS_D_CAN1_CLKCTRL 0>, Modified: head/sys/gnu/dts/arm/am33xx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am33xx.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -234,13 +234,33 @@ interrupt-names = "edma3_tcerrint"; }; - mmc3: mmc@47810000 { - compatible = "ti,omap4-hsmmc"; + target-module@47810000 { + compatible = "ti,sysc-omap2", "ti,sysc"; ti,hwmods = "mmc3"; - ti,needs-special-reset; - interrupts = <29>; - reg = <0x47810000 0x1000>; - status = "disabled"; + reg = <0x478102fc 0x4>, + <0x47810110 0x4>, + <0x47810114 0x4>; + reg-names = "rev", "sysc", "syss"; + ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY | + SYSC_OMAP2_ENAWAKEUP | + SYSC_OMAP2_SOFTRESET | + SYSC_OMAP2_AUTOIDLE)>; + ti,sysc-sidle = , + , + ; + ti,syss-mask = <1>; + clocks = <&l3s_clkctrl AM3_L3S_MMC3_CLKCTRL 0>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x47810000 0x1000>; + + mmc3: mmc@0 { + compatible = "ti,omap4-hsmmc"; + ti,needs-special-reset; + interrupts = <29>; + reg = <0x0 0x1000>; + }; }; usb: usb@47400000 { Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am4372.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -228,13 +228,33 @@ interrupt-names = "edma3_tcerrint"; }; - mmc3: mmc@47810000 { - compatible = "ti,omap4-hsmmc"; - reg = <0x47810000 0x1000>; + target-module@47810000 { + compatible = "ti,sysc-omap2", "ti,sysc"; ti,hwmods = "mmc3"; - ti,needs-special-reset; - interrupts = ; - status = "disabled"; + reg = <0x478102fc 0x4>, + <0x47810110 0x4>, + <0x47810114 0x4>; + reg-names = "rev", "sysc", "syss"; + ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY | + SYSC_OMAP2_ENAWAKEUP | + SYSC_OMAP2_SOFTRESET | + SYSC_OMAP2_AUTOIDLE)>; + ti,sysc-sidle = , + , + ; + ti,syss-mask = <1>; + clocks = <&l3s_clkctrl AM4_L3S_MMC3_CLKCTRL 0>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x47810000 0x1000>; + + mmc3: mmc@0 { + compatible = "ti,omap4-hsmmc"; + ti,needs-special-reset; + interrupts = ; + reg = <0x0 0x1000>; + }; }; sham: sham@53100000 { Modified: head/sys/gnu/dts/arm/am437x-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am437x-l4.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am437x-l4.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -1574,6 +1574,8 @@ target-module@cc000 { /* 0x481cc000, ap 50 46.0 */ compatible = "ti,sysc-omap4", "ti,sysc"; + reg = <0xcc020 0x4>; + reg-names = "rev"; ti,hwmods = "d_can0"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>; @@ -1593,6 +1595,8 @@ target-module@d0000 { /* 0x481d0000, ap 52 3a.0 */ compatible = "ti,sysc-omap4", "ti,sysc"; + reg = <0xd0020 0x4>; + reg-names = "rev"; ti,hwmods = "d_can1"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>; Modified: head/sys/gnu/dts/arm/am571x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am571x-idk.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am571x-idk.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -175,14 +175,9 @@ }; &mmc1 { - pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-names = "default", "hs"; pinctrl-0 = <&mmc1_pins_default_no_clk_pu>; pinctrl-1 = <&mmc1_pins_hs>; - pinctrl-2 = <&mmc1_pins_sdr12>; - pinctrl-3 = <&mmc1_pins_sdr25>; - pinctrl-4 = <&mmc1_pins_sdr50>; - pinctrl-5 = <&mmc1_pins_ddr50_rev20 &mmc1_iodelay_ddr50_conf>; - pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev20_conf>; }; &mmc2 { Modified: head/sys/gnu/dts/arm/am572x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am572x-idk.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am572x-idk.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -16,14 +16,9 @@ }; &mmc1 { - pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-names = "default", "hs"; pinctrl-0 = <&mmc1_pins_default_no_clk_pu>; pinctrl-1 = <&mmc1_pins_hs>; - pinctrl-2 = <&mmc1_pins_sdr12>; - pinctrl-3 = <&mmc1_pins_sdr25>; - pinctrl-4 = <&mmc1_pins_sdr50>; - pinctrl-5 = <&mmc1_pins_ddr50 &mmc1_iodelay_ddr_rev20_conf>; - pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev20_conf>; }; &mmc2 { Modified: head/sys/gnu/dts/arm/am574x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am574x-idk.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am574x-idk.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -24,14 +24,9 @@ }; &mmc1 { - pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-names = "default", "hs"; pinctrl-0 = <&mmc1_pins_default_no_clk_pu>; pinctrl-1 = <&mmc1_pins_hs>; - pinctrl-2 = <&mmc1_pins_default>; - pinctrl-3 = <&mmc1_pins_hs>; - pinctrl-4 = <&mmc1_pins_sdr50>; - pinctrl-5 = <&mmc1_pins_ddr50 &mmc1_iodelay_ddr_conf>; - pinctrl-6 = <&mmc1_pins_ddr50 &mmc1_iodelay_sdr104_conf>; }; &mmc2 { Modified: head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -379,7 +379,7 @@ }; }; -&gpio7 { +&gpio7_target { ti,no-reset-on-init; ti,no-idle-on-init; }; @@ -430,6 +430,7 @@ bus-width = <4>; cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */ + no-1-8-v; }; &mmc2 { Modified: head/sys/gnu/dts/arm/am57xx-beagle-x15-revb1.dts ============================================================================== --- head/sys/gnu/dts/arm/am57xx-beagle-x15-revb1.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am57xx-beagle-x15-revb1.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -16,14 +16,9 @@ }; &mmc1 { - pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-names = "default", "hs"; pinctrl-0 = <&mmc1_pins_default>; pinctrl-1 = <&mmc1_pins_hs>; - pinctrl-2 = <&mmc1_pins_sdr12>; - pinctrl-3 = <&mmc1_pins_sdr25>; - pinctrl-4 = <&mmc1_pins_sdr50>; - pinctrl-5 = <&mmc1_pins_ddr50 &mmc1_iodelay_ddr_rev11_conf>; - pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev11_conf>; vmmc-supply = <&vdd_3v3>; vqmmc-supply = <&ldo1_reg>; }; Modified: head/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts ============================================================================== --- head/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -16,14 +16,9 @@ }; &mmc1 { - pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-names = "default", "hs"; pinctrl-0 = <&mmc1_pins_default>; pinctrl-1 = <&mmc1_pins_hs>; - pinctrl-2 = <&mmc1_pins_sdr12>; - pinctrl-3 = <&mmc1_pins_sdr25>; - pinctrl-4 = <&mmc1_pins_sdr50>; - pinctrl-5 = <&mmc1_pins_ddr50 &mmc1_iodelay_ddr_rev20_conf>; - pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev20_conf>; vmmc-supply = <&vdd_3v3>; vqmmc-supply = <&ldo1_reg>; }; Modified: head/sys/gnu/dts/arm/arm-realview-eb.dtsi ============================================================================== --- head/sys/gnu/dts/arm/arm-realview-eb.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/arm-realview-eb.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -119,6 +119,9 @@ compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x40000000 0x04000000>; bank-width = <4>; + partitions { + compatible = "arm,arm-firmware-suite"; + }; }; flash1@44000000 { @@ -126,6 +129,9 @@ compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x44000000 0x04000000>; bank-width = <4>; + partitions { + compatible = "arm,arm-firmware-suite"; + }; }; /* SMSC LAN91C111 ethernet with PHY and EEPROM */ Modified: head/sys/gnu/dts/arm/arm-realview-pb1176.dts ============================================================================== --- head/sys/gnu/dts/arm/arm-realview-pb1176.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/arm-realview-pb1176.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -120,12 +120,18 @@ compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x30000000 0x4000000>; bank-width = <4>; + partitions { + compatible = "arm,arm-firmware-suite"; + }; }; fpga_flash@38000000 { compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x38000000 0x800000>; bank-width = <4>; + partitions { + compatible = "arm,arm-firmware-suite"; + }; }; /* Modified: head/sys/gnu/dts/arm/arm-realview-pb11mp.dts ============================================================================== --- head/sys/gnu/dts/arm/arm-realview-pb11mp.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/arm-realview-pb11mp.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -235,6 +235,9 @@ compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x40000000 0x04000000>; bank-width = <4>; + partitions { + compatible = "arm,arm-firmware-suite"; + }; }; flash1@44000000 { @@ -242,6 +245,9 @@ compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x44000000 0x04000000>; bank-width = <4>; + partitions { + compatible = "arm,arm-firmware-suite"; + }; }; bridge { Modified: head/sys/gnu/dts/arm/arm-realview-pbx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/arm-realview-pbx.dtsi Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/arm-realview-pbx.dtsi Sat Sep 28 23:08:19 2019 (r352860) @@ -134,6 +134,9 @@ compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x40000000 0x04000000>; bank-width = <4>; + partitions { + compatible = "arm,arm-firmware-suite"; + }; }; flash1@44000000 { @@ -141,6 +144,9 @@ compatible = "arm,versatile-flash", "cfi-flash"; reg = <0x44000000 0x04000000>; bank-width = <4>; + partitions { + compatible = "arm,arm-firmware-suite"; + }; }; /* SMSC 9118 ethernet with PHY and EEPROM */ Modified: head/sys/gnu/dts/arm/armada-370-netgear-rn104.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-370-netgear-rn104.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/armada-370-netgear-rn104.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -143,6 +143,20 @@ }; }; + auxdisplay { + compatible = "hit,hd44780"; + data-gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>, + <&gpio1 26 GPIO_ACTIVE_HIGH>, + <&gpio1 27 GPIO_ACTIVE_HIGH>, + <&gpio1 29 GPIO_ACTIVE_HIGH>; + enable-gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>; + rs-gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>; + rw-gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; + backlight-gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; + display-height-chars = <2>; + display-width-chars = <16>; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-0 = <&backup_button_pin Modified: head/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts ============================================================================== --- head/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts Sat Sep 28 23:01:23 2019 (r352859) +++ head/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts Sat Sep 28 23:08:19 2019 (r352860) @@ -372,3 +372,11 @@ &adc { status = "okay"; }; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; Copied: head/sys/gnu/dts/arm/aspeed-bmc-facebook-yamp.dts (from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-yamp.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/aspeed-bmc-facebook-yamp.dts Sat Sep 28 23:08:19 2019 (r352860, copy of r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-yamp.dts) @@ -0,0 +1,160 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2018 Facebook Inc. +/dts-v1/; + +#include "aspeed-g5.dtsi" + +/ { + model = "Facebook YAMP 100 BMC"; + compatible = "facebook,yamp-bmc", "aspeed,ast2500"; + + aliases { + /* + * Override the default uart aliases to avoid breaking + * the legacy applications. + */ + serial0 = &uart5; + serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; + }; + + chosen { + stdout-path = &uart5; + bootargs = "console=ttyS0,9600n8 root=/dev/ram rw"; + }; + + memory@80000000 { + reg = <0x80000000 0x20000000>; + }; +}; + +&pinctrl { + aspeed,external-nodes = <&gfx &lhc>; +}; + +/* + * Update reset type to "system" (full chip) to fix warm reboot hang issue + * when reset type is set to default ("soc", gated by reset mask registers). + */ +&wdt1 { + status = "okay"; + aspeed,reset-type = "system"; +}; + +/* + * wdt2 is not used by Yamp. + */ +&wdt2 { + status = "disabled"; +}; + +&fmc { + status = "okay"; + flash@0 { + status = "okay"; + m25p,fast-read; + label = "bmc"; +#include "facebook-bmc-flash-layout.dtsi" + }; +}; + +&uart1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd1_default + &pinctrl_rxd1_default>; +}; + +&uart2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd2_default + &pinctrl_rxd2_default>; +}; + +&uart3 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd3_default + &pinctrl_rxd3_default>; +}; + +&uart5 { + status = "okay"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***