svn commit: r309478 - head/share/mk
Author: bdrewery Date: Sat Dec 3 05:29:35 2016 New Revision: 309478 URL: https://svnweb.freebsd.org/changeset/base/309478 Log: DIRDEPS_BUILD: Fix '/' in group names creating a bad cookie. This is reworking the change in r296585 but to still properly install the files. This limits the change to only the DIRDEPS_BUILD logic for what it considers the name of the staging set, which is what the cookie name is based off of. Sponsored by: Dell EMC Isilon MFC after:1 week Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.files.mk head/share/mk/bsd.incs.mk Modified: head/share/mk/bsd.confs.mk == --- head/share/mk/bsd.confs.mk Sat Dec 3 05:29:31 2016(r309477) +++ head/share/mk/bsd.confs.mk Sat Dec 3 05:29:35 2016(r309478) @@ -24,8 +24,8 @@ ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${CONFMODE} ${group}DIR?= ${CONFDIR} -STAGE_SETS+= ${group} -STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SETS+= ${group:C,[/*],_,g} +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} _${group}CONFS= .for cnf in ${${group}} Modified: head/share/mk/bsd.files.mk == --- head/share/mk/bsd.files.mk Sat Dec 3 05:29:31 2016(r309477) +++ head/share/mk/bsd.files.mk Sat Dec 3 05:29:35 2016(r309478) @@ -28,8 +28,8 @@ ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${SHAREMODE} ${group}DIR?= ${BINDIR} -STAGE_SETS+= ${group} -STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SETS+= ${group:C,[/*],_,g} +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} .if defined(NO_ROOT) .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*} Modified: head/share/mk/bsd.incs.mk == --- head/share/mk/bsd.incs.mk Sat Dec 3 05:29:31 2016(r309477) +++ head/share/mk/bsd.incs.mk Sat Dec 3 05:29:35 2016(r309478) @@ -33,9 +33,9 @@ ${group}OWN?= ${BINOWN} ${group}GRP?= ${BINGRP} ${group}MODE?= ${NOBINMODE} ${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}} -STAGE_SETS+= ${group} -STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} +STAGE_SETS+= ${group:C,[/*],_,g} +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SYMLINKS_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP} _${group}INCS= .for header in ${${group}} ___ 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-unsubscr...@freebsd.org"
svn commit: r309476 - head/include
Author: bdrewery Date: Sat Dec 3 05:29:12 2016 New Revision: 309476 URL: https://svnweb.freebsd.org/changeset/base/309476 Log: Create the /usr/lib/include symlink as relative. This ugly code is done to avoid assuming LIBDIR is 2 components deep. Reported by: jhb Modified: head/include/Makefile Modified: head/include/Makefile == --- head/include/Makefile Sat Dec 3 03:59:24 2016(r309475) +++ head/include/Makefile Sat Dec 3 05:29:12 2016(r309476) @@ -108,7 +108,7 @@ NEWVERS_SH= ${SYSDIR}/conf/newvers.sh PARAM_H= ${SYSDIR}/sys/param.h MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh -SYMLINKS+= ${INCLUDEDIR} ${LIBDIR}/include +SYMLINKS+= ${LIBDIR:C,[^/]+,..,g:C,^/,,}${INCLUDEDIR} ${LIBDIR}/include osreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH} env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \ ___ 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-unsubscr...@freebsd.org"
svn commit: r309477 - head/share/mk
Author: bdrewery Date: Sat Dec 3 05:29:31 2016 New Revision: 309477 URL: https://svnweb.freebsd.org/changeset/base/309477 Log: Revert r296585. This broke installing dtrace test files. It was poorly tested. Reported by: markj Pointyhat to: bdrewery MFC after:1 week Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.files.mk head/share/mk/bsd.incs.mk Modified: head/share/mk/bsd.confs.mk == --- head/share/mk/bsd.confs.mk Sat Dec 3 05:29:12 2016(r309476) +++ head/share/mk/bsd.confs.mk Sat Dec 3 05:29:31 2016(r309477) @@ -6,10 +6,8 @@ CONFGROUPS?= CONFS -_CONFGROUPS= ${CONFGROUPS:C,[/*],_,g} - .if !target(buildconfig) -.for group in ${_CONFGROUPS} +.for group in ${CONFGROUPS} buildconfig: ${${group}} .endfor .endif @@ -19,7 +17,7 @@ all: buildconfig .endif .if !target(installconfig) -.for group in ${_CONFGROUPS} +.for group in ${CONFGROUPS} .if defined(${group}) && !empty(${group}) ${group}OWN?= ${SHAREOWN} Modified: head/share/mk/bsd.files.mk == --- head/share/mk/bsd.files.mk Sat Dec 3 05:29:12 2016(r309476) +++ head/share/mk/bsd.files.mk Sat Dec 3 05:29:31 2016(r309477) @@ -9,9 +9,7 @@ : FILESGROUPS?= FILES -_FILESGROUPS= ${FILESGROUPS:C,[/*],_,g:u} - -.for group in ${_FILESGROUPS} +.for group in ${FILESGROUPS} # Add in foo.yes and remove duplicates from all the groups ${${group}}:= ${${group}} ${${group}.yes} ${${group}}:= ${${group}:O:u} @@ -22,7 +20,7 @@ buildfiles: ${${group}} all: buildfiles .endif -.for group in ${_FILESGROUPS} +.for group in ${FILESGROUPS} .if defined(${group}) && !empty(${group}) installfiles: installfiles-${group} Modified: head/share/mk/bsd.incs.mk == --- head/share/mk/bsd.incs.mk Sat Dec 3 05:29:12 2016(r309476) +++ head/share/mk/bsd.incs.mk Sat Dec 3 05:29:31 2016(r309477) @@ -8,8 +8,6 @@ INCSGROUPS?= INCS -_INCSGROUPS= ${INCSGROUPS:C,[/*],_,g} - .if defined(NO_ROOT) .if !defined(TAGS) || ! ${TAGS:Mpackage=*} TAGS+= package=${PACKAGE:Uruntime} @@ -18,7 +16,7 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif .if !target(buildincludes) -.for group in ${_INCSGROUPS} +.for group in ${INCSGROUPS} buildincludes: ${${group}} .endfor .endif @@ -28,7 +26,7 @@ all: buildincludes .endif .if !target(installincludes) -.for group in ${_INCSGROUPS} +.for group in ${INCSGROUPS} .if defined(${group}) && !empty(${group}) ${group}OWN?= ${BINOWN} ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi
On Thu, Dec 1, 2016 at 4:20 PM, Kenneth D. Merrywrote: > Author: ken > Date: Thu Dec 1 22:20:27 2016 > New Revision: 309374 > URL: https://svnweb.freebsd.org/changeset/base/309374 > > Log: > Add SCSI REPORT TIMESTAMP and SET TIMESTAMP support. > > This adds support to camcontrol(8) and libcam(3) for getting and setting > the time on SCSI protocol drives. This is more commonly found on tape > drives, but is a SPC (SCSI Primary Commands) command, and may be found > on any device that speaks SCSI. > > The new camcontrol timestamp subcommand allows getting the current device > time or setting the time to the current system time or any arbitrary time. > > sbin/camcontrol/Makefile: > Add timestamp.c. > > sbin/camcontrol/camcontrol.8: > Document the new timestamp subcommand. > > sbin/camcontrol/camcontrol.c: > Add the timestamp subcommand to camcontrol. > > sbin/camcontrol/camcontrol.h: > Add the timestamp() function prototype. > > sbin/camcontrol/timestamp.c: > Timestamp setting and reporting functionality. > > sys/cam/scsi/scsi_all.c: > Add two new CCB building functions, scsi_set_timestamp() and > scsi_report_timestamp(). Also, add a new helper function, > scsi_create_timestamp(). > > sys/cam/scsi/scsi_all.h: > Add CDB and parameter data for the the set and report timestamp > commands. > > Add function declarations for the new CCB building and helper > functions. > > Submitted by: Sam Klopsch > Sponsored by: Spectra Logic > MFC After:2 weeks > > Added: > head/sbin/camcontrol/timestamp.c (contents, props changed) > Modified: > head/sbin/camcontrol/Makefile > head/sbin/camcontrol/camcontrol.8 > head/sbin/camcontrol/camcontrol.c > head/sbin/camcontrol/camcontrol.h > head/sys/cam/scsi/scsi_all.c > head/sys/cam/scsi/scsi_all.h > > Modified: head/sbin/camcontrol/Makefile > ... > +timestamp(struct cam_device *device, int argc, char **argv, char > *combinedopt, > + int retry_count, int timeout, int verbosemode __unused) > +{ > + int c; > + uint64_t ts; > + char *format_string = NULL; > + char *timestamp_string = NULL; > + int action = -1; > + int error = 0; > + int single_arg = 0; > + int do_utc = 0; > + > + if (action == TIMESTAMP_REPORT) { > + error = report_timestamp(device, , retry_count, > + timeout); > + if (error != 0) { > + goto bailout; > + } else if (strcmp(format_string, MIL) == 0) { > + printf("Timestamp in milliseconds: %ju\n", > + (uintmax_t)ts); > + } else { > + char temp_timestamp_string[100]; > + time_t time_var = ts / 1000; Hi, FWIW: Building -CURRENT on mips.mips (w/ freebsd-wifi-build), mips-gcc gets upset at the above line with the following error: /wifi-build/src/sbin/camcontrol/timestamp.c: In function 'timestamp': /wifi-build/src/sbin/camcontrol/timestamp.c:459:25: error: 'ts' may be used uninitialized in this function [-Werror=maybe-uninitialized] time_t time_var = ts / 1000; I understand that this is a bogus error because at this point it pretty much *has* to be set by the report_timestamp call just prior, but is there a clean way to trick GCC into agreeing, or is it just a matter of explicitly initializing it to 0 before the report_timestamp call? Thanks, Kyle Evans ___ 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-unsubscr...@freebsd.org"
svn commit: r309474 - head/contrib/netbsd-tests/lib/libc/gen
Author: ngie Date: Sat Dec 3 03:56:20 2016 New Revision: 309474 URL: https://svnweb.freebsd.org/changeset/base/309474 Log: Don't build :strvis_locale if VIS_NOLOCALE is undefined The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower in conditionally running the test instead of backporting the newer version of libc-vis MFC after:now Modified: head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_vis.c == --- head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Sat Dec 3 03:15:09 2016(r309473) +++ head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Sat Dec 3 03:56:20 2016(r309474) @@ -144,6 +144,9 @@ ATF_TC_BODY(strunvis_hex, tc) } } +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ ATF_TC(strvis_locale); ATF_TC_HEAD(strvis_locale, tc) { @@ -172,6 +175,9 @@ ATF_TC_BODY(strvis_locale, tc) setlocale(LC_CTYPE, ol); free(ol); } +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ ATF_TP_ADD_TCS(tp) { @@ -180,7 +186,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strvis_null); ATF_TP_ADD_TC(tp, strvis_empty); ATF_TP_ADD_TC(tp, strunvis_hex); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ ATF_TP_ADD_TC(tp, strvis_locale); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ return atf_no_error(); } ___ 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-unsubscr...@freebsd.org"
svn commit: r309472 - head/contrib/netbsd-tests/games
Author: ngie Date: Sat Dec 3 03:13:32 2016 New Revision: 309472 URL: https://svnweb.freebsd.org/changeset/base/309472 Log: Restore pathing for factor(1), which unnecessarily diverged in r278616 factor lives in /usr/games/, not /usr/bin, in NetBSD. The correct way to handle this is do on-the-fly manipulation of the test script via ATF_TESTS_SH_SED_, not by modify the pathing directly in the test script. This is being done to resolve an unnecessary conflict made when pulling back ^/head@r309469 (contrib/netbsd-tests update) to ^/stable/10. No functional change MFC after:now Modified: head/contrib/netbsd-tests/games/t_factor.sh Modified: head/contrib/netbsd-tests/games/t_factor.sh == --- head/contrib/netbsd-tests/games/t_factor.sh Sat Dec 3 03:05:44 2016 (r309471) +++ head/contrib/netbsd-tests/games/t_factor.sh Sat Dec 3 03:13:32 2016 (r309472) @@ -37,7 +37,7 @@ expect() { atf_test_case overflow1 overflow1_head() { atf_set "descr" "Tests for overflow conditions" - atf_set "require.progs" "/usr/bin/factor" + atf_set "require.progs" "/usr/games/factor" } overflow1_body() { expect '8675309' '8675309: 8675309' @@ -56,7 +56,7 @@ atf_test_case loop1 loop1_head() { atf_set "descr" "Tests some cases that once locked the program" \ "in an infinite loop" - atf_set "require.progs" "/usr/bin/factor" + atf_set "require.progs" "/usr/games/factor" } loop1_body() { expect '2147483647111311' '2147483647111311: 3 3 3 131 607148331103' ___ 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-unsubscr...@freebsd.org"
svn commit: r309467 - head/sys/dev/ath
Author: adrian Date: Sat Dec 3 02:47:41 2016 New Revision: 309467 URL: https://svnweb.freebsd.org/changeset/base/309467 Log: [ath] use the correct AMPDU frame limit for the given node, rather than the global config. This is important in hostap, ibss, (11s at some magical future date, etc) where different nodes may have smaller limits. Oops! MFC after:1 week Relnotes: Yes Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c == --- head/sys/dev/ath/if_ath_tx_ht.c Sat Dec 3 02:47:16 2016 (r309466) +++ head/sys/dev/ath/if_ath_tx_ht.c Sat Dec 3 02:47:41 2016 (r309467) @@ -529,6 +529,29 @@ ath_compute_num_delims(struct ath_softc } /* + * XXX TODO: put into net80211 + */ +static int +ath_rx_ampdu_to_byte(char a) +{ + switch (a) { + case IEEE80211_HTCAP_MAXRXAMPDU_16K: + return 16384; + break; + case IEEE80211_HTCAP_MAXRXAMPDU_32K: + return 32768; + break; + case IEEE80211_HTCAP_MAXRXAMPDU_64K: + return 65536; + break; + case IEEE80211_HTCAP_MAXRXAMPDU_8K: + default: + return 8192; + break; + } +} + +/* * Fetch the aggregation limit. * * It's the lowest of the four rate series 4ms frame length. @@ -540,6 +563,8 @@ static int ath_get_aggr_limit(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf) { + struct ieee80211vap *vap = ni->ni_vap; + #defineMS(_v, _f) (((_v) & _f) >> _f##_S) int amin = ATH_AGGR_MAXSIZE; int i; @@ -548,25 +573,15 @@ ath_get_aggr_limit(struct ath_softc *sc, if (sc->sc_aggr_limit > 0 && sc->sc_aggr_limit < ATH_AGGR_MAXSIZE) amin = sc->sc_aggr_limit; + /* Check the vap configured transmit limit */ + amin = MIN(amin, ath_rx_ampdu_to_byte(vap->iv_ampdu_limit)); + /* * Check the HTCAP field for the maximum size the node has * negotiated. If it's smaller than what we have, cap it there. */ - switch (MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU)) { - case IEEE80211_HTCAP_MAXRXAMPDU_16K: - amin = MIN(amin, 16384); - break; - case IEEE80211_HTCAP_MAXRXAMPDU_32K: - amin = MIN(amin, 32768); - break; - case IEEE80211_HTCAP_MAXRXAMPDU_64K: - amin = MIN(amin, 65536); - break; - case IEEE80211_HTCAP_MAXRXAMPDU_8K: - default: - amin = MIN(amin, 8192); - break; - } + amin = MIN(amin, ath_rx_ampdu_to_byte(MS(ni->ni_htparam, + IEEE80211_HTCAP_MAXRXAMPDU))); for (i = 0; i < ATH_RC_NUM; i++) { if (bf->bf_state.bfs_rc[i].tries == 0) ___ 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-unsubscr...@freebsd.org"
svn commit: r309465 - head/sys/net80211
Author: adrian Date: Sat Dec 3 02:45:18 2016 New Revision: 309465 URL: https://svnweb.freebsd.org/changeset/base/309465 Log: [net80211] prepare for 11ac aware NICs that want to know per-vdev channel and centre frequencies. * ic_freq is the centre of the primary channel, not the centre of the HT40/HT80/etc channel. Add a method to access that. * Add a method to access the centre of the primary channel, including knowing the centre of the 5/10/20/40/80, versus the primary channel. Ie, it's the centre of the 40, 80, 160MHz channel. * Add a method to access the centre frequency of the secondary 80MHz channel - we don't support VHT yet, but when we do. * Add methods to access the current channel and the per-dev desired channel. Ideally drivers that do full offload with a per-vap channel configuration should use the vap channel, NOT ic_curchan. Non-offload drivers that require net80211 to change the channel should be accessing ic_curchan. Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c == --- head/sys/net80211/ieee80211.c Sat Dec 3 02:24:15 2016 (r309464) +++ head/sys/net80211/ieee80211.c Sat Dec 3 02:45:18 2016 (r309465) @@ -1170,6 +1170,53 @@ ieee80211_add_channel_ht40(struct ieee80 } /* + * Fetch the center frequency for the primary channel. + */ +uint32_t +ieee80211_get_channel_center_freq(const struct ieee80211_channel *c) +{ + + return (c->ic_freq); +} + +/* + * Fetch the center frequency for the primary BAND channel. + * + * For 5, 10, 20MHz channels it'll be the normally configured channel + * frequency. + * + * For 40MHz, 80MHz, 160Mhz channels it'll the the centre of the + * wide channel, not the centre of the primary channel (that's ic_freq). + * + * For 80+80MHz channels this will be the centre of the primary + * 80MHz channel; the secondary 80MHz channel will be center_freq2(). + */ + +uint32_t +ieee80211_get_channel_center_freq1(const struct ieee80211_channel *c) +{ + + if (IEEE80211_IS_CHAN_HT40U(c)) { + return (c->ic_freq + 10); + } + if (IEEE80211_IS_CHAN_HT40D(c)) { + return (c->ic_freq - 10); + } + + return (c->ic_freq); +} + +/* + * For now, no 80+80 support; this is zero. + */ +uint32_t +ieee80211_get_channel_center_freq2(const struct ieee80211_channel *c) +{ + + return (0); +} + +/* * Adds channels into specified channel list (ieee[] array must be sorted). * Channels are already sorted. */ Modified: head/sys/net80211/ieee80211_var.h == --- head/sys/net80211/ieee80211_var.h Sat Dec 3 02:24:15 2016 (r309464) +++ head/sys/net80211/ieee80211_var.h Sat Dec 3 02:45:18 2016 (r309465) @@ -668,6 +668,9 @@ int ieee80211_add_channel(struct ieee802 uint8_t, uint16_t, int8_t, uint32_t, const uint8_t[]); intieee80211_add_channel_ht40(struct ieee80211_channel[], int, int *, uint8_t, int8_t, uint32_t); +uint32_t ieee80211_get_channel_center_freq(const struct ieee80211_channel *); +uint32_t ieee80211_get_channel_center_freq1(const struct ieee80211_channel *); +uint32_t ieee80211_get_channel_center_freq2(const struct ieee80211_channel *); intieee80211_add_channel_list_2ghz(struct ieee80211_channel[], int, int *, const uint8_t[], int, const uint8_t[], int); intieee80211_add_channel_list_5ghz(struct ieee80211_channel[], int, int *, @@ -684,6 +687,10 @@ uint32_t ieee80211_mac_hash(const struct const uint8_t addr[IEEE80211_ADDR_LEN]); char ieee80211_channel_type_char(const struct ieee80211_channel *c); +#defineieee80211_get_current_channel(_ic) ((_ic)->ic_curchan) +#defineieee80211_get_home_channel(_ic) ((_ic)->ic_bsschan) +#defineieee80211_get_vap_desired_channel(_iv) ((_iv)->iv_des_chan) + void ieee80211_radiotap_attach(struct ieee80211com *, struct ieee80211_radiotap_header *th, int tlen, uint32_t tx_radiotap, ___ 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-unsubscr...@freebsd.org"
svn commit: r309464 - head/tests/sys/acl
Author: ngie Date: Sat Dec 3 02:24:15 2016 New Revision: 309464 URL: https://svnweb.freebsd.org/changeset/base/309464 Log: Expect 01:main to fail Changes were made to ZFS in the past year with respect to how ACLs are handled, causing failures in this test. Mark it TODO so (hopefully) someone more knowledgeable (like mav or trasz) will fix the code or the test. PR: 212323 Modified: head/tests/sys/acl/01.sh Modified: head/tests/sys/acl/01.sh == --- head/tests/sys/acl/01.shSat Dec 3 02:17:50 2016(r309463) +++ head/tests/sys/acl/01.shSat Dec 3 02:24:15 2016(r309464) @@ -81,7 +81,7 @@ perl $TESTDIR/run $TESTDIR/tools-nfs4-ps if [ $? -eq 0 ]; then echo "ok 3" else - echo "not ok 3" + echo "not ok 3 # TODO: fails due to ACL changes in ZFS; bug 212323" fi echo "ok 4" ___ 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-unsubscr...@freebsd.org"
svn commit: r309463 - head/tests/sys/kern
Author: ngie Date: Sat Dec 3 02:17:50 2016 New Revision: 309463 URL: https://svnweb.freebsd.org/changeset/base/309463 Log: Expect :coredump_phnum to fail The number of program headers on my system (GENERIC-NODEBUG) don't match the expected (hardcoded) number in the test PR: 215019 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 Sat Dec 3 02:09:23 2016 (r309462) +++ head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 02:17:50 2016 (r309463) @@ -39,6 +39,8 @@ coredump_phnum_head() } coredump_phnum_body() { + atf_expect_fail "the value parsed doesn't always match the value obtained on the running system; bug # 215019" + # Set up core dumping cat > coredump_phnum_restore_state.sh <<-EOF #!/bin/sh ___ 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-unsubscr...@freebsd.org"
svn commit: r309462 - head/tests/sys/kern
Author: ngie Date: Sat Dec 3 02:09:23 2016 New Revision: 309462 URL: https://svnweb.freebsd.org/changeset/base/309462 Log: Fix test coredump_phnum_test:coredump_phnum require.config specification The requirement is set via `atf_set "require.config" "allow_sysctl_side_effects"', not `atf_set "require.config" "allow_sysctl_side_effects"' X-MFC with: r308177 Pointyhat to: cmeyer 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 Sat Dec 3 01:55:38 2016 (r309461) +++ head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 02:09:23 2016 (r309462) @@ -32,8 +32,8 @@ atf_test_case coredump_phnum cleanup coredump_phnum_head() { - atf_set "allow_sysctl_side_effects" "1" atf_set "descr" "More than 65534 segments" + atf_set "require.config" "allow_sysctl_side_effects" atf_set "require.progs" "readelf procstat" atf_set "require.user" "root" } ___ 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-unsubscr...@freebsd.org"
svn commit: r309461 - head/sys/dev/etherswitch
Author: loos Date: Sat Dec 3 01:55:38 2016 New Revision: 309461 URL: https://svnweb.freebsd.org/changeset/base/309461 Log: Allow simultaneous access to switch device, there is no reason to prevent it. Remove bogus wrappers and use the kernel defaults. While here, use DEVMETHOD_END. Obtained from:pfSense MFC after:2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/etherswitch.c Modified: head/sys/dev/etherswitch/etherswitch.c == --- head/sys/dev/etherswitch/etherswitch.c Sat Dec 3 01:14:21 2016 (r309460) +++ head/sys/dev/etherswitch/etherswitch.c Sat Dec 3 01:55:38 2016 (r309461) @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -45,19 +44,11 @@ #include "etherswitch_if.h" -#define BUFSIZE 1024 - struct etherswitch_softc { device_t sc_dev; - int sc_count; - struct cdev *sc_devnode; - struct sx sc_lock; }; -#defineSWITCH_LOCK(sc) sx_xlock(&(sc)->sc_lock) -#defineSWITCH_UNLOCK(sc) sx_xunlock(&(sc)->sc_lock) - static int etherswitch_probe(device_t); static int etherswitch_attach(device_t); static int etherswitch_detach(device_t); @@ -72,7 +63,7 @@ static device_method_t etherswitch_metho DEVMETHOD(device_attach,etherswitch_attach), DEVMETHOD(device_detach,etherswitch_detach), - { 0, 0 } + DEVMETHOD_END }; driver_t etherswitch_driver = { @@ -81,19 +72,11 @@ driver_t etherswitch_driver = { sizeof(struct etherswitch_softc), }; -static d_open_tetherswitchopen; -static d_close_t etherswitchclose; -static d_write_t etherswitchwrite; -static d_read_tetherswitchread; static d_ioctl_t etherswitchioctl; static struct cdevsw etherswitch_cdevsw = { .d_version =D_VERSION, .d_flags = D_TRACKCLOSE, - .d_open = etherswitchopen, - .d_close = etherswitchclose, - .d_read = etherswitchread, - .d_write = etherswitchwrite, .d_ioctl = etherswitchioctl, .d_name = "etherswitch", }; @@ -119,13 +102,11 @@ etherswitch_attach(device_t dev) struct etherswitch_softc *sc = (struct etherswitch_softc *)device_get_softc(dev); sc->sc_dev = dev; - sx_init(>sc_lock, "etherswitch"); sc->sc_devnode = make_dev(_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "etherswitch%d", device_get_unit(dev)); if (sc->sc_devnode == NULL) { device_printf(dev, "failed to create character device\n"); - sx_destroy(>sc_lock); return (ENXIO); } sc->sc_devnode->si_drv1 = sc; @@ -140,61 +121,11 @@ etherswitch_detach(device_t dev) if (sc->sc_devnode) destroy_dev(sc->sc_devnode); - sx_destroy(>sc_lock); - - return (0); -} - -static int -etherswitchopen(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct etherswitch_softc *sc = dev->si_drv1; - - SWITCH_LOCK(sc); - if (sc->sc_count > 0) { - SWITCH_UNLOCK(sc); - return (EBUSY); - } - - sc->sc_count++; - SWITCH_UNLOCK(sc); - - return (0); -} - -static int -etherswitchclose(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct etherswitch_softc *sc = dev->si_drv1; - - SWITCH_LOCK(sc); - if (sc->sc_count == 0) { - SWITCH_UNLOCK(sc); - return (EINVAL); - } - - sc->sc_count--; - - if (sc->sc_count < 0) - panic("%s: etherswitch_count < 0!", __func__); - SWITCH_UNLOCK(sc); return (0); } static int -etherswitchwrite(struct cdev *dev, struct uio * uio, int ioflag) -{ - return (EINVAL); -} - -static int -etherswitchread(struct cdev *dev, struct uio * uio, int ioflag) -{ - return (EINVAL); -} - -static int etherswitchioctl(struct cdev *cdev, u_long cmd, caddr_t data, int flags, struct thread *td) { struct etherswitch_softc *sc = cdev->si_drv1; ___ 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-unsubscr...@freebsd.org"
svn commit: r309460 - in head: lib/libc/sys share/man/man3 sys/kern
Author: vangyzen Date: Sat Dec 3 01:14:21 2016 New Revision: 309460 URL: https://svnweb.freebsd.org/changeset/base/309460 Log: thr_set_name(): silently truncate the given name as needed Instead of failing with ENAMETOOLONG, which is swallowed by pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1 bytes. This is more likely what the user wants, and saves the caller from truncating it before the call (which was the only recourse). Polish pthread_set_name_np(3) and add a .Xr to thr_set_name(2) so the user might find the documentation for this behavior. Reviewed by: jilles MFC after:3 days Sponsored by: Dell EMC Modified: head/lib/libc/sys/thr_set_name.2 head/share/man/man3/pthread_set_name_np.3 head/sys/kern/kern_thr.c Modified: head/lib/libc/sys/thr_set_name.2 == --- head/lib/libc/sys/thr_set_name.2Sat Dec 3 01:10:45 2016 (r309459) +++ head/lib/libc/sys/thr_set_name.2Sat Dec 3 01:14:21 2016 (r309460) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2016 +.Dd December 2, 2016 .Dt THR_SET_NAME 2 .Os .Sh NAME @@ -43,37 +43,34 @@ .Sh DESCRIPTION The .Fn thr_set_name -sets the user-visible name for the kernel thread with the identifier +system call sets the user-visible name for the thread with the identifier .Va id -in the current process, to the NUL-terminated string +in the current process to the NUL-terminated string .Va name . +The name will be silently truncated to fit into a buffer of +.Dv MAXCOMLEN + 1 +bytes. The thread name can be seen in the output of the .Xr ps 1 and .Xr top 1 commands, in the kernel debuggers and kernel tracing facility outputs, -also in userland debuggers and program core files, as notes. +and in userland debuggers and program core files, as notes. .Sh RETURN VALUES If successful, .Fn thr_set_name -will return zero, otherwise \-1 is returned, and +returns zero; otherwise, \-1 is returned, and .Va errno is set to indicate the error. .Sh ERRORS The .Fn thr_set_name -operation may return the following errors: +system call may return the following errors: .Bl -tag -width Er .It Bq Er EFAULT The memory pointed to by the .Fa name argument is not valid. -.It Bq Er ENAMETOOLONG -The string pointed to by the -.Fa name -argument exceeds -.Dv MAXCOMLEN + 1 -bytes in length. .It Bq Er ESRCH The thread with the identifier .Fa id @@ -92,6 +89,6 @@ does not exist in the current process. .Xr ktr 9 .Sh STANDARDS The -.Fn thr_new -system call is non-standard and is used by +.Fn thr_set_name +system call is non-standard and is used by the .Lb libthr . Modified: head/share/man/man3/pthread_set_name_np.3 == --- head/share/man/man3/pthread_set_name_np.3 Sat Dec 3 01:10:45 2016 (r309459) +++ head/share/man/man3/pthread_set_name_np.3 Sat Dec 3 01:14:21 2016 (r309460) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd December 2, 2016 .Dt PTHREAD_SET_NAME_NP 3 .Os .Sh NAME @@ -35,18 +35,19 @@ .Sh SYNOPSIS .In pthread_np.h .Ft void -.Fn pthread_set_name_np "pthread_t tid" "const char *name" +.Fn pthread_set_name_np "pthread_t thread" "const char *name" .Sh DESCRIPTION The .Fn pthread_set_name_np -function sets internal name for thread specified by -.Fa tid -argument to string value specified by +function applies a copy of the given .Fa name -argument. +to the given +.Fa thread . .Sh ERRORS Because of the debugging nature of this function, all errors that may appear inside are silently ignored. +.Sh SEE ALSO +.Xr thr_set_name 2 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phan...@freebsd.org . Modified: head/sys/kern/kern_thr.c == --- head/sys/kern/kern_thr.cSat Dec 3 01:10:45 2016(r309459) +++ head/sys/kern/kern_thr.cSat Dec 3 01:14:21 2016(r309460) @@ -578,8 +578,11 @@ sys_thr_set_name(struct thread *td, stru error = 0; name[0] = '\0'; if (uap->name != NULL) { - error = copyinstr(uap->name, name, sizeof(name), - NULL); + error = copyinstr(uap->name, name, sizeof(name), NULL); + if (error == ENAMETOOLONG) { + error = copyin(uap->name, name, sizeof(name) - 1); + name[sizeof(name) - 1] = '\0'; + } if (error) return (error); } ___ 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-unsubscr...@freebsd.org"
svn commit: r309451 - head/usr.bin/indent
Author: pfg Date: Sat Dec 3 00:24:34 2016 New Revision: 309451 URL: https://svnweb.freebsd.org/changeset/base/309451 Log: Document undocumented indent(1) options badp/nbadp, bs/nbs, and lc. Submitted by: Piotr Stefaniak Differential Revision:https://reviews.freebsd.org/D8690 Modified: head/usr.bin/indent/indent.1 Modified: head/usr.bin/indent/indent.1 == --- head/usr.bin/indent/indent.1Sat Dec 3 00:18:38 2016 (r309450) +++ head/usr.bin/indent/indent.1Sat Dec 3 00:24:34 2016 (r309451) @@ -30,7 +30,7 @@ .\"@(#)indent.18.1 (Berkeley) 7/1/93 .\" $FreeBSD$ .\" -.Dd August 3, 2016 +.Dd December 2, 2016 .Dt INDENT 1 .Os .Sh NAME @@ -41,6 +41,7 @@ .Op Ar input-file Op Ar output-file .Op Fl bacc | Fl nbacc .Op Fl bad | Fl nbad +.Op Fl badp | Fl nbadp .Op Fl bap | Fl nbap .Bk -words .Op Fl ei | Fl ei @@ -50,6 +51,7 @@ .Op Fl \ | Fl nbc .Op Fl \ .Op Fl \ +.Op Fl bs | Fl nbs .Op Fl c Ns Ar n .Op Fl \ Ns Ar n .Bk -words @@ -143,6 +145,14 @@ is specified, a blank line is forced aft declarations. Default: .Fl nbad . +.It Fl badp , nbadp +This is vaguely similar to +.Fl bad +, except that it only applies to the first set of declarations +in a procedure (just after the first `{') and it causes a blank +line to be generated even if there are no declarations. +The default is +.Fl nbadp. .It Fl bap , nbap If .Fl bap @@ -182,6 +192,10 @@ if (...) { code } .Ed +.It Fl bs , nbs +Whether a blank should always be inserted after sizeof. +The default is +.Fl nbs. .It Fl c Ns Ar n The column in which comments on code start. The default is 33. @@ -324,6 +338,10 @@ The default is .It Fl l Ns Ar n Maximum length of an output line. The default is 78. +.It Fl lc Ns Ar n +Maximum length of an output line in a block comment. +The default is 0, which means to limit block comment lines in accordance with +.Fl l. .It Fl \ Ns Ar n Specifies the indentation, in character positions, of local variable names ___ 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-unsubscr...@freebsd.org"
svn commit: r309439 - head/sys/fs/ext2fs
Author: pfg Date: Fri Dec 2 19:47:23 2016 New Revision: 309439 URL: https://svnweb.freebsd.org/changeset/base/309439 Log: ext2fs: renumber the license clauses to avoid skipping #3. This is to keep consistency with other files, and help license-checking utilities determine the number of clauses that apply. No functional change. Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_mount.h head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/fs.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_alloc.c == --- head/sys/fs/ext2fs/ext2_alloc.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_alloc.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_balloc.c == --- head/sys/fs/ext2fs/ext2_balloc.cFri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_balloc.cFri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_bmap.c == --- head/sys/fs/ext2fs/ext2_bmap.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_bmap.c Fri Dec 2 19:47:23 2016 (r309439) @@ -15,7 +15,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_extern.h == --- head/sys/fs/ext2fs/ext2_extern.hFri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_extern.hFri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_inode.c == --- head/sys/fs/ext2fs/ext2_inode.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_inode.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_lookup.c == --- head/sys/fs/ext2fs/ext2_lookup.cFri Dec 2
svn commit: r309425 - head/sys/kern
Author: mjg Date: Fri Dec 2 18:03:15 2016 New Revision: 309425 URL: https://svnweb.freebsd.org/changeset/base/309425 Log: vfs: provide fake locking primitives for the crossmp vnode Since the vnode is only expected to be shared locked, we can save a little overhead by only pretending we are locking in the first place. Reviewed by: kib Tested by:pho Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c == --- head/sys/kern/vfs_lookup.c Fri Dec 2 17:08:27 2016(r309424) +++ head/sys/kern/vfs_lookup.c Fri Dec 2 18:03:15 2016(r309425) @@ -79,6 +79,64 @@ uma_zone_t namei_zone; /* Placeholder vnode for mp traversal. */ static struct vnode *vp_crossmp; +static int +crossmp_vop_islocked(struct vop_islocked_args *ap) +{ + + return (LK_SHARED); +} + +static int +crossmp_vop_lock1(struct vop_lock1_args *ap) +{ + struct vnode *vp; + struct lock *lk; + const char *file; + int flags, line; + + vp = ap->a_vp; + lk = vp->v_vnlock; + flags = ap->a_flags; + file = ap->a_file; + line = ap->a_line; + + if ((flags & LK_SHARED) == 0) + panic("invalid lock request for crossmp"); + + WITNESS_CHECKORDER(>lock_object, LOP_NEWORDER, file, line, + flags & LK_INTERLOCK ? _MTX(vp)->lock_object : NULL); + WITNESS_LOCK(>lock_object, 0, file, line); + if ((flags & LK_INTERLOCK) != 0) + VI_UNLOCK(vp); + LOCK_LOG_LOCK("SLOCK", >lock_object, 0, 0, ap->a_file, line); + return (0); +} + +static int +crossmp_vop_unlock(struct vop_unlock_args *ap) +{ + struct vnode *vp; + struct lock *lk; + int flags; + + vp = ap->a_vp; + lk = vp->v_vnlock; + flags = ap->a_flags; + + if ((flags & LK_INTERLOCK) != 0) + VI_UNLOCK(vp); + WITNESS_UNLOCK(>lock_object, 0, LOCK_FILE, LOCK_LINE); + LOCK_LOG_LOCK("SUNLOCK", >lock_object, 0, 0, LOCK_FILE, + LOCK_LINE); + return (0); +} + +static struct vop_vector crossmp_vnodeops = { + .vop_islocked = crossmp_vop_islocked, + .vop_lock1 =crossmp_vop_lock1, + .vop_unlock = crossmp_vop_unlock, +}; + struct nameicap_tracker { struct vnode *dp; TAILQ_ENTRY(nameicap_tracker) nm_link; @@ -95,10 +153,7 @@ nameiinit(void *dummy __unused) UMA_ALIGN_PTR, 0); nt_zone = uma_zcreate("rentr", sizeof(struct nameicap_tracker), NULL, NULL, NULL, NULL, sizeof(void *), 0); - getnewvnode("crossmp", NULL, _vnodeops, _crossmp); - vn_lock(vp_crossmp, LK_EXCLUSIVE); - VN_LOCK_ASHARE(vp_crossmp); - VOP_UNLOCK(vp_crossmp, 0); + getnewvnode("crossmp", NULL, _vnodeops, _crossmp); } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL); ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r309035 - in head/lib/libpathconv: . tests
On Sat, Dec 03, 2016 at 12:00:01AM +0800, Julian Elischer wrote: > On 28/11/2016 4:43 AM, Jilles Tjoelker wrote: > > On Wed, Nov 23, 2016 at 07:57:52AM +, Julian Elischer wrote: > >> Author: julian > >> Date: Wed Nov 23 07:57:52 2016 > >> New Revision: 309035 > >> URL: https://svnweb.freebsd.org/changeset/base/309035 > >> Log: > >>This little BSD licensed library has been kicking around for years. > >>It allows one to trivially convert an absolute path to a relative path > >>and the reverse. The test programs themselves are very useful in scripts > >>but the real use comes shortly with the -r and -a arguments to ln. > >>These are sometimes known as the --relative and --absolute flags and > >>can force a symlink to be relative when you only have an absolue path. > >>Another place these are sometimes used is to add -a and -r args to > >> 'realpath'. > >>Incredibly useful in Makefiles. > >>I was going to just add the files in with 'ln' but a library makes more > >> sense. > >>The test programs may come out in their own right some day for > >> scripting. > >>released under a BSD 2-clause: > >> * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. > >> * Copyright (c) 1999 Tama Communications Corporation. All rights > >> reserved. > >>The test directry does not conform to any framework. > >>Not connected to build. > >>doc people may want to play with the manual pages. > >>Obtained from: https://www.tamacom.com/pathconvert.html Shigio > >> Yamaguchi. > >>MFC after: 1 month > >>Relnotes: yes > >>Sponsored by: Panzura, Tama Communications Corporation > > Consider making this a static-only library or a part of an existing > > library such as libc or libutil, since the overhead of a shared object > > is rather big compared to the amount of code here. > > yeah I was thinking of making it part of libc but libc is already > such a kitchen sink and there are only two planned users. > ln and realpath. > A static library is one idea for sure. (or even just a .o). Note that libutil was mentioned, which is the kitchen sink both by design and by purpose. > > The actual real target for this is the build itself. Currently we are > making > lots of symlinks that should be relative but we only really have > absolute information. > This allows symlink -sr to dynamically generate the correct relative > symlink, > given absolute args. > e.g. /usr/lib/libm.so -> /lib/libm.so.5 should really be > ../../lib/libm.so.5 > so that when it is read from outside a jail it still refers to the > right place. > > I'm waiting for a gap in my work schedule to get ln and realpath > changes in place. > > > > > > > Thanks for not linking this to the build right away. > > > ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r309351 - head/etc/defaults
On Fri, Dec 2, 2016 at 9:18 AM, John Baldwinwrote: > On Thursday, December 01, 2016 02:41:41 PM Warner Losh wrote: >> On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara >> wrote: >> > On 12/01/16 at 04:35P, Warner Losh wrote: >> >> Author: imp >> >> Date: Thu Dec 1 04:35:43 2016 >> >> New Revision: 309351 >> >> URL: https://svnweb.freebsd.org/changeset/base/309351 >> >> >> >> Log: >> >> Revert the 'performance' setting to 'NONE' from C2. >> > >> > Just a note that this commit reverts r282110. >> >> Yea, it's good for laptops, bad for servers. At least there's some >> Intel CPUs that this causes corruption with USB. That's being sorted >> out, but until that's done we need to fail more safe for our primary >> market. > > It's also good for some servers as you need some cores in C-states > to get the maximum Turbo Boost on other cores (though that may have > been more true for earlier generations of i7 CPUs than more recent > generations). Once the corruption issues are solved, we can and should put this back. Adrian is working on that. Warner ___ 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-unsubscr...@freebsd.org"
svn commit: r309419 - head/usr.bin/indent
Author: pfg Date: Fri Dec 2 16:42:45 2016 New Revision: 309419 URL: https://svnweb.freebsd.org/changeset/base/309419 Log: indent(1): Avoid out-of-bound accesses of array ps.p_stack. Submitted by: Piotr Stefaniak Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c == --- head/usr.bin/indent/parse.c Fri Dec 2 16:41:08 2016(r309418) +++ head/usr.bin/indent/parse.c Fri Dec 2 16:42:45 2016(r309419) @@ -172,7 +172,7 @@ parse(int tk) /* tk: the code for the co case rbrace: /* scanned a } */ /* stack should have or */ - if (ps.p_stack[ps.tos - 1] == lbrace) { + if (ps.tos > 0 && ps.p_stack[ps.tos - 1] == lbrace) { ps.ind_level = ps.i_l_follow = ps.il[--ps.tos]; ps.p_stack[ps.tos] = stmt; } ___ 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-unsubscr...@freebsd.org"
svn commit: r309418 - head/usr.bin/indent
Author: pfg Date: Fri Dec 2 16:41:08 2016 New Revision: 309418 URL: https://svnweb.freebsd.org/changeset/base/309418 Log: indent(1): Avoid out-of-bound accesses of arrays. ps.paren_indents: When ps.paren_level was 0, this was accessing paren_indents[-1]. in_buffer: This fragment checks if "*/" was read, but there's no guarantee that there is more than one byte in the array (actually, this happens frequently for the "{" in things like "int main(void) {"). Submitted by: Piotr Stefaniak Modified: head/usr.bin/indent/io.c Modified: head/usr.bin/indent/io.c == --- head/usr.bin/indent/io.cFri Dec 2 16:32:14 2016(r309417) +++ head/usr.bin/indent/io.cFri Dec 2 16:41:08 2016(r309418) @@ -278,7 +278,8 @@ inhibit_newline: *(e_com = s_com = combuf + 1) = '\0'; ps.ind_level = ps.i_l_follow; ps.paren_level = ps.p_l_follow; -paren_target = -ps.paren_indents[ps.paren_level - 1]; +if (ps.paren_level > 0) + paren_target = -ps.paren_indents[ps.paren_level - 1]; not_first_line = 1; } @@ -371,7 +372,7 @@ fill_buffer(void) } buf_ptr = in_buffer; buf_end = p; -if (p[-2] == '/' && p[-3] == '*') { +if (p - in_buffer > 2 && p[-2] == '/' && p[-3] == '*') { if (in_buffer[3] == 'I' && strncmp(in_buffer, "/**INDENT**", 11) == 0) fill_buffer(); /* flush indent error message */ else { ___ 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-unsubscr...@freebsd.org"
svn commit: r309417 - head/usr.bin/indent
Author: pfg Date: Fri Dec 2 16:32:14 2016 New Revision: 309417 URL: https://svnweb.freebsd.org/changeset/base/309417 Log: indent(1): Remove an extra newline added in a previous commit. It doesn't math the remaining of the case statement. Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c == --- head/usr.bin/indent/parse.c Fri Dec 2 16:29:30 2016(r309416) +++ head/usr.bin/indent/parse.c Fri Dec 2 16:32:14 2016(r309417) @@ -100,7 +100,6 @@ parse(int tk) /* tk: the code for the co * in case of a long "if-else-if ... else-if" sequence. */ ps.i_l_follow = ps.il[ps.tos--]; - /* the rest is the same as for dolit and forstmt */ case dolit:/* 'do' */ case forstmt: /* for (...) */ ___ 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-unsubscr...@freebsd.org"
svn commit: r309416 - head/sys/vm
Author: alc Date: Fri Dec 2 16:29:30 2016 New Revision: 309416 URL: https://svnweb.freebsd.org/changeset/base/309416 Log: Eliminate a stale comment; vm_radix_prealloc() was replaced in r254141. MFC after:3 days Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c == --- head/sys/vm/vm_radix.c Fri Dec 2 16:28:18 2016(r309415) +++ head/sys/vm/vm_radix.c Fri Dec 2 16:29:30 2016(r309416) @@ -308,8 +308,6 @@ SYSINIT(vm_radix_reserve_kva, SI_SUB_KME /* * Initialize the UMA slab zone. - * Until vm_radix_prealloc() is called, the zone will be served by the - * UMA boot-time pre-allocated pool of pages. */ void vm_radix_init(void) ___ 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-unsubscr...@freebsd.org"
svn commit: r309415 - head/usr.bin/indent
Author: pfg Date: Fri Dec 2 16:28:18 2016 New Revision: 309415 URL: https://svnweb.freebsd.org/changeset/base/309415 Log: indent(1): Optimize parser stack usage. When special else-if processing is enabled (-ei), we can assume "else if" and "if" to be equivalent for indentation purposes. This reduction saves a lot of stack space in case of a long "if-else-if ... else-if" sequence; with this change, Postgres/src/bin/psql/tab-complete.c as of 9.6beta3 requires minimum of the stack length to be 31 instead of 444. Submitted by: Piotr Sephaniak Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c == --- head/usr.bin/indent/parse.c Fri Dec 2 15:38:34 2016(r309414) +++ head/usr.bin/indent/parse.c Fri Dec 2 16:28:18 2016(r309415) @@ -94,7 +94,13 @@ parse(int tk) /* tk: the code for the co case ifstmt: /* scanned if (...) */ if (ps.p_stack[ps.tos] == elsehead && ps.else_if) /* "else if ..." */ - ps.i_l_follow = ps.il[ps.tos]; + /* +* Note that the stack pointer here is decremented, effectively +* reducing "else if" to "if". This saves a lot of stack space +* in case of a long "if-else-if ... else-if" sequence. +*/ + ps.i_l_follow = ps.il[ps.tos--]; + /* the rest is the same as for dolit and forstmt */ case dolit:/* 'do' */ case forstmt: /* for (...) */ ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r309351 - head/etc/defaults
On Thursday, December 01, 2016 02:41:41 PM Warner Losh wrote: > On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara >wrote: > > On 12/01/16 at 04:35P, Warner Losh wrote: > >> Author: imp > >> Date: Thu Dec 1 04:35:43 2016 > >> New Revision: 309351 > >> URL: https://svnweb.freebsd.org/changeset/base/309351 > >> > >> Log: > >> Revert the 'performance' setting to 'NONE' from C2. > > > > Just a note that this commit reverts r282110. > > Yea, it's good for laptops, bad for servers. At least there's some > Intel CPUs that this causes corruption with USB. That's being sorted > out, but until that's done we need to fail more safe for our primary > market. It's also good for some servers as you need some cores in C-states to get the maximum Turbo Boost on other cores (though that may have been more true for earlier generations of i7 CPUs than more recent generations). -- John Baldwin ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r309035 - in head/lib/libpathconv: . tests
On 28/11/2016 4:43 AM, Jilles Tjoelker wrote: On Wed, Nov 23, 2016 at 07:57:52AM +, Julian Elischer wrote: Author: julian Date: Wed Nov 23 07:57:52 2016 New Revision: 309035 URL: https://svnweb.freebsd.org/changeset/base/309035 Log: This little BSD licensed library has been kicking around for years. It allows one to trivially convert an absolute path to a relative path and the reverse. The test programs themselves are very useful in scripts but the real use comes shortly with the -r and -a arguments to ln. These are sometimes known as the --relative and --absolute flags and can force a symlink to be relative when you only have an absolue path. Another place these are sometimes used is to add -a and -r args to 'realpath'. Incredibly useful in Makefiles. I was going to just add the files in with 'ln' but a library makes more sense. The test programs may come out in their own right some day for scripting. released under a BSD 2-clause: * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. * Copyright (c) 1999 Tama Communications Corporation. All rights reserved. The test directry does not conform to any framework. Not connected to build. doc people may want to play with the manual pages. Obtained from: https://www.tamacom.com/pathconvert.html Shigio Yamaguchi. MFC after: 1 month Relnotes: yes Sponsored by: Panzura, Tama Communications Corporation Consider making this a static-only library or a part of an existing library such as libc or libutil, since the overhead of a shared object is rather big compared to the amount of code here. yeah I was thinking of making it part of libc but libc is already such a kitchen sink and there are only two planned users. ln and realpath. A static library is one idea for sure. (or even just a .o). The actual real target for this is the build itself. Currently we are making lots of symlinks that should be relative but we only really have absolute information. This allows symlink -sr to dynamically generate the correct relative symlink, given absolute args. e.g. /usr/lib/libm.so -> /lib/libm.so.5 should really be ../../lib/libm.so.5 so that when it is read from outside a jail it still refers to the right place. I'm waiting for a gap in my work schedule to get ln and realpath changes in place. Thanks for not linking this to the build right away. ___ 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-unsubscr...@freebsd.org"
svn commit: r309414 - head/sys/sys
Author: rstone Date: Fri Dec 2 15:38:34 2016 New Revision: 309414 URL: https://svnweb.freebsd.org/changeset/base/309414 Log: Revert r309372 The bug intended to be fixed by r309372 was already addressed by r296178, so revert my change. Reported by: seph Modified: head/sys/sys/buf_ring.h Modified: head/sys/sys/buf_ring.h == --- head/sys/sys/buf_ring.h Fri Dec 2 14:44:45 2016(r309413) +++ head/sys/sys/buf_ring.h Fri Dec 2 15:38:34 2016(r309414) @@ -67,13 +67,11 @@ buf_ring_enqueue(struct buf_ring *br, vo uint32_t prod_head, prod_next, cons_tail; #ifdef DEBUG_BUFRING int i; - if (br->br_cons_head != br->br_prod_head) { - for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != br->br_prod_head; - i = ((i + 1) & br->br_cons_mask)) - if(br->br_ring[i] == buf) - panic("buf=%p already enqueue at %d prod=%d cons=%d", - buf, i, br->br_prod_tail, br->br_cons_tail); - } + for (i = br->br_cons_head; i != br->br_prod_head; +i = ((i + 1) & br->br_cons_mask)) + if(br->br_ring[i] == buf) + panic("buf=%p already enqueue at %d prod=%d cons=%d", + buf, i, br->br_prod_tail, br->br_cons_tail); #endif critical_enter(); do { ___ 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-unsubscr...@freebsd.org"
svn commit: r309412 - in head: . sys/boot sys/boot/efi/boot1 sys/boot/i386/boot2 sys/boot/i386/pxeldr sys/boot/i386/zfsboot sys/boot/pc98/boot0.5 sys/boot/pc98/boot2 sys/boot/pc98/pc98boot sys/boot...
Author: imp Date: Fri Dec 2 14:44:38 2016 New Revision: 309412 URL: https://svnweb.freebsd.org/changeset/base/309412 Log: dd is currently a bootstrap tool. It really doesn't have any business being a bootstrap tool. However, for reproducible build output, FreeBSD added dd status=none because it was otherwise difficult to suppress the status information, but retain any errors that might happen. There's no real reason that dd has to be a build tool, other than we use status=none unconditional. Remove dd from a bootstrap tool entirely by only using status=none when available. This may also help efforts to build the system on non-FreeBSD hosts as well. Differential Revision: https://reviews.freebsd.org/D8605 Modified: head/Makefile.inc1 head/sys/boot/Makefile.inc head/sys/boot/efi/boot1/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/pxeldr/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/pc98/boot0.5/Makefile head/sys/boot/pc98/boot2/Makefile head/sys/boot/pc98/pc98boot/Makefile head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/boot/sparc64/boot1/Makefile Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Fri Dec 2 14:23:26 2016(r309411) +++ head/Makefile.inc1 Fri Dec 2 14:44:38 2016(r309412) @@ -1631,11 +1631,6 @@ ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libne _cat= bin/cat .endif -# r264059 support for status= -.if ${BOOTSTRAPPING} < 1100017 -_dd= bin/dd -.endif - # r277259 crunchide: Correct 64-bit section header offset # r281674 crunchide: always include both 32- and 64-bit ELF support .if ${BOOTSTRAPPING} < 1100078 @@ -1718,7 +1713,6 @@ bootstrap-tools: .PHONY ${_groff} \ ${_dtc} \ ${_cat} \ -${_dd} \ ${_kbdcontrol} \ usr.bin/lorder \ ${_libopenbsd} \ Modified: head/sys/boot/Makefile.inc == --- head/sys/boot/Makefile.inc Fri Dec 2 14:23:26 2016(r309411) +++ head/sys/boot/Makefile.inc Fri Dec 2 14:44:38 2016(r309412) @@ -15,3 +15,10 @@ CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none .endif + +# The boot loader build uses dd status=none, where possible, for reproducible +# build output (since performance varies from run to run). Trouble is that +# option was recently (10.3) added to FreeBSD and is non-standard. Only use it +# when this test succeeds rather than require dd to be a bootstrap tool. +DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true +DD=dd ${DD_NOSTATUS} Modified: head/sys/boot/efi/boot1/Makefile == --- head/sys/boot/efi/boot1/MakefileFri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/efi/boot1/MakefileFri Dec 2 14:44:38 2016 (r309412) @@ -124,8 +124,7 @@ boot1.efifat: boot1.efi uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 - dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc \ - status=none + ${DD} if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc CLEANFILES= boot1.efi boot1.efifat Modified: head/sys/boot/i386/boot2/Makefile == --- head/sys/boot/i386/boot2/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/i386/boot2/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -72,14 +72,14 @@ CLEANFILES+=boot2 boot2.ld boot2.ldr bo boot2: boot2.ld @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync status=none + ${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ -o ${.TARGET} -P 1 boot2.bin boot2.ldr: - dd if=/dev/zero of=${.TARGET} bs=512 count=1 status=none + ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1 boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} Modified: head/sys/boot/i386/pxeldr/Makefile == --- head/sys/boot/i386/pxeldr/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/i386/pxeldr/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp ${BOOT}: ${LDR} ${LOADER} cat ${LDR} ${LOADER} > ${.TARGET}.tmp - dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync status=none + ${DD} if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync rm ${.TARGET}.tmp LDFLAGS+=${LDFLAGS_BIN} Modified: head/sys/boot/i386/zfsboot/Makefile
svn commit: r309413 - head/sbin/nvmecontrol
Author: imp Date: Fri Dec 2 14:44:45 2016 New Revision: 309413 URL: https://svnweb.freebsd.org/changeset/base/309413 Log: Flag the vendor specific pages as such. This allows different decoding for the same page number as different vendors encode vendor specific pages differently. Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c == --- head/sbin/nvmecontrol/logpage.c Fri Dec 2 14:44:38 2016 (r309412) +++ head/sbin/nvmecontrol/logpage.c Fri Dec 2 14:44:45 2016 (r309413) @@ -793,23 +793,23 @@ print_hgst_info_log(void *buf, uint32_t */ static struct logpage_function { uint8_t log_page; + const char *vendor; print_fn_t print_fn; size_t size; } logfuncs[] = { - {NVME_LOG_ERROR,print_log_error, + {NVME_LOG_ERROR,NULL, print_log_error, 0}, - {NVME_LOG_HEALTH_INFORMATION, print_log_health, + {NVME_LOG_HEALTH_INFORMATION, NULL, print_log_health, sizeof(struct nvme_health_information_page)}, - {NVME_LOG_FIRMWARE_SLOT,print_log_firmware, + {NVME_LOG_FIRMWARE_SLOT,NULL, print_log_firmware, sizeof(struct nvme_firmware_page)}, - {INTEL_LOG_TEMP_STATS, print_intel_temp_stats, + {INTEL_LOG_TEMP_STATS, "intel", print_intel_temp_stats, sizeof(struct intel_log_temp_stats)}, - {INTEL_LOG_ADD_SMART, print_intel_add_smart, + {INTEL_LOG_ADD_SMART, "intel", print_intel_add_smart, DEFAULT_SIZE}, - {HGST_INFO_LOG, print_hgst_info_log, + {HGST_INFO_LOG, "hgst", print_hgst_info_log, DEFAULT_SIZE}, - {0, NULL, -0}, + {0, NULL, NULL,0}, }; static void @@ -830,11 +830,12 @@ logpage(int argc, char *argv[]) charcname[64]; uint32_tsize; void*buf; + const char *vendor = NULL; struct logpage_function *f; struct nvme_controller_data cdata; print_fn_t print_fn; - while ((ch = getopt(argc, argv, "p:x")) != -1) { + while ((ch = getopt(argc, argv, "p:xv:")) != -1) { switch (ch) { case 'p': /* TODO: Add human-readable ASCII page IDs */ @@ -850,6 +851,9 @@ logpage(int argc, char *argv[]) case 'x': hexflag = true; break; + case 'v': + vendor = optarg; + break; } } @@ -893,18 +897,21 @@ logpage(int argc, char *argv[]) size = DEFAULT_SIZE; if (!hexflag) { /* -* See if there is a pretty print function for the -* specified log page. If one isn't found, we -* just revert to the default (print_hex). +* See if there is a pretty print function for the specified log +* page. If one isn't found, we just revert to the default +* (print_hex). If there was a vendor specified bt the user, and +* the page is vendor specific, don't match the print function +* unless the vendors match. */ - f = logfuncs; - while (f->log_page > 0) { - if (log_page == f->log_page) { - print_fn = f->print_fn; - size = f->size; - break; - } - f++; + for (f = logfuncs; f->log_page > 0; f++) { + if (f->vendor != NULL && vendor != NULL && + strcmp(f->vendor, vendor) != 0) + continue; + if (log_page != f->log_page) + continue; + print_fn = f->print_fn; + size = f->size; + break; } } ___ 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-unsubscr...@freebsd.org"
svn commit: r309411 - in head/libexec/rtld-elf: . aarch64 riscv sparc64
Author: emaste Date: Fri Dec 2 14:23:26 2016 New Revision: 309411 URL: https://svnweb.freebsd.org/changeset/base/309411 Log: Retire long-broken/unused static rtld support rtld-elf has some vestigial support for building as a static executable. r45501 introduced a partial implementation with a prescient note that it "might never be enabled." r153515 introduced ELF symbol versioning support, and removed part of the unused build infrastructure for static rtld. GNU ld populates rela relocation addends and GOT entries with the same values, and rtld's run-time dynamic executable check relied on this. Alternate toolchains may not populate the GOT entries, which caused RTLD_IS_DYNAMIC to return false. Simplify rtld by just removing the unused check. If we want to restore static rtld support later on we ought to introduce a build-time #ifdef flag. PR: 214972 Reviewed by: kan MFC after:1 month Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D8687 Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h head/libexec/rtld-elf/riscv/rtld_machdep.h head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/sparc64/rtld_machdep.h Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h == --- head/libexec/rtld-elf/aarch64/rtld_machdep.hFri Dec 2 11:32:11 2016(r309410) +++ head/libexec/rtld-elf/aarch64/rtld_machdep.hFri Dec 2 14:23:26 2016(r309411) @@ -45,7 +45,6 @@ struct Struct_Obj_Entry; asm volatile("adr %0, _DYNAMIC" : "="(_dynamic_addr)); \ (const Elf_Dyn *)_dynamic_addr; \ }) -#defineRTLD_IS_DYNAMIC() (1) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, Modified: head/libexec/rtld-elf/riscv/rtld_machdep.h == --- head/libexec/rtld-elf/riscv/rtld_machdep.h Fri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/riscv/rtld_machdep.h Fri Dec 2 14:23:26 2016 (r309411) @@ -52,7 +52,6 @@ uint64_t set_gp(struct Struct_Obj_Entry __asm __volatile("lla %0, _DYNAMIC" : "=r"(_dynamic_addr)); \ (const Elf_Dyn *)_dynamic_addr; \ }) -#define RTLD_IS_DYNAMIC() (1) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, Modified: head/libexec/rtld-elf/rtld.c == --- head/libexec/rtld-elf/rtld.cFri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/rtld.cFri Dec 2 14:23:26 2016 (r309411) @@ -200,9 +200,6 @@ Elf_Sym sym_zero; /* For resolving unde extern Elf_Dyn _DYNAMIC; #pragma weak _DYNAMIC -#ifndef RTLD_IS_DYNAMIC -#defineRTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) -#endif int dlclose(void *) __exported; char *dlerror(void) __exported; @@ -1920,22 +1917,20 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * #ifdef PIC objtmp.relocbase = mapbase; #endif -if (RTLD_IS_DYNAMIC()) { - objtmp.dynamic = rtld_dynamic(); - digest_dynamic1(, 1, _rpath, _soname, _runpath); - assert(objtmp.needed == NULL); + +objtmp.dynamic = rtld_dynamic(); +digest_dynamic1(, 1, _rpath, _soname, _runpath); +assert(objtmp.needed == NULL); #if !defined(__mips__) - /* MIPS has a bogus DT_TEXTREL. */ - assert(!objtmp.textrel); +/* MIPS has a bogus DT_TEXTREL. */ +assert(!objtmp.textrel); #endif +/* + * Temporarily put the dynamic linker entry into the object list, so + * that symbols can be found. + */ +relocate_objects(, true, , 0, NULL); - /* -* Temporarily put the dynamic linker entry into the object list, so -* that symbols can be found. -*/ - - relocate_objects(, true, , 0, NULL); -} ehdr = (Elf_Ehdr *)mapbase; objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff); objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]); Modified: head/libexec/rtld-elf/sparc64/rtld_machdep.h == --- head/libexec/rtld-elf/sparc64/rtld_machdep.hFri Dec 2 11:32:11 2016(r309410) +++ head/libexec/rtld-elf/sparc64/rtld_machdep.hFri Dec 2 14:23:26 2016(r309411) @@ -37,7 +37,6 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ Elf_Dyn *rtld_dynamic_addr(void); #definertld_dynamic(obj) rtld_dynamic_addr() -#defineRTLD_IS_DYNAMIC() (rtld_dynamic_addr() != NULL) Elf_Addr reloc_jmpslot(Elf_Addr *, Elf_Addr, const struct
svn commit: r309410 - head/share/man/man4
Author: n_hibma Date: Fri Dec 2 11:32:11 2016 New Revision: 309410 URL: https://svnweb.freebsd.org/changeset/base/309410 Log: Fix man page: - It should say 'read' in the I2CREAD section. - last in the struct indicates the last command in a sequence, not the reverse. Reviewed by: imp MFC after:3 days Modified: head/share/man/man4/iic.4 Modified: head/share/man/man4/iic.4 == --- head/share/man/man4/iic.4 Fri Dec 2 11:30:21 2016(r309409) +++ head/share/man/man4/iic.4 Fri Dec 2 11:32:11 2016(r309410) @@ -104,7 +104,8 @@ element is the number of bytes to write. The .Va last element is a boolean flag. -It is non-zero when additional write commands will follow. +It must be zero when additional read commands will follow, or non-zero if this +is the last command. The .Va buf element is a pointer to the data to write to the bus. @@ -120,11 +121,12 @@ The element is ignored. The .Va count -element is the number of bytes to write. +element is the number of bytes to read. The .Va last element is a boolean flag. -It is non-zero when additional write commands will follow. +It must be zero when additional read commands will follow, or non-zero if this +is the last command. The .Va buf element is a pointer to where to store the data read from the bus. ___ 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-unsubscr...@freebsd.org"
svn commit: r309409 - head/usr.sbin/i2c
Author: n_hibma Date: Fri Dec 2 11:30:21 2016 New Revision: 309409 URL: https://svnweb.freebsd.org/changeset/base/309409 Log: More typos in strings. Submitted by: bde MFC after:3 days Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c == --- head/usr.sbin/i2c/i2c.c Fri Dec 2 10:47:10 2016(r309408) +++ head/usr.sbin/i2c/i2c.c Fri Dec 2 11:30:21 2016(r309409) @@ -413,7 +413,7 @@ err1: cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, ); if (error == -1) - fprintf(stderr, "error sending stop condtion\n"); + fprintf(stderr, "error sending stop condition\n"); err2: if (err_msg) fprintf(stderr, "%s\n", err_msg); @@ -466,7 +466,7 @@ i2c_read(char *dev, struct options i2c_o cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, ); if (error == -1) { - err_msg = "error sending stop condtion"; + err_msg = "error sending stop condition"; goto err2; } } @@ -491,7 +491,7 @@ i2c_read(char *dev, struct options i2c_o } error = ioctl(fd, I2CSTOP, ); if (error == -1) { - err_msg = "error sending stop condtion"; + err_msg = "error sending stop condition"; goto err2; } @@ -510,7 +510,7 @@ err1: cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, ); if (error == -1) - fprintf(stderr, "error sending stop condtion\n"); + fprintf(stderr, "error sending stop condition\n"); err2: if (err_msg) fprintf(stderr, "%s\n", err_msg); ___ 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-unsubscr...@freebsd.org"
svn commit: r309408 - in head: share/man/man4 sys/netgraph
Author: julian Date: Fri Dec 2 10:47:10 2016 New Revision: 309408 URL: https://svnweb.freebsd.org/changeset/base/309408 Log: Changes to allow the patching of packets with an offset (and other changes.. see man page) PR: 206185 Submitted by: Dmitry VaginMFC after: 1 week Relnotes: yes (also ng_checksum node) Modified: head/share/man/man4/ng_patch.4 head/sys/netgraph/ng_patch.c head/sys/netgraph/ng_patch.h Modified: head/share/man/man4/ng_patch.4 == --- head/share/man/man4/ng_patch.4 Fri Dec 2 09:51:12 2016 (r309407) +++ head/share/man/man4/ng_patch.4 Fri Dec 2 10:47:10 2016 (r309408) @@ -1,5 +1,6 @@ .\" Copyright (c) 2010 Maxim Ignatenko .\" Copyright (c) 2010 Vadim Goncharov +.\" Copyright (c) 2015 Dmitry Vagin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd November 17, 2015 .Dt NG_PATCH 4 .Os .Sh NAME @@ -47,33 +48,52 @@ A negation operation is the one exceptio and second operand (the .Va value ) is not used. -There may be several modification operations, they are all applied -to a packet sequentially in order they were specified by user. -Data payload of packet is viewed as array of bytes, with zero offset -corresponding to the very first byte of packet headers, and +If there is more than one modification operation, they are applied +to packets sequentially in the order they were specified by the user. +The data payload of a packet is viewed as an array of bytes, with a zero offset +corresponding to the very first byte of packet headers, and the .Va length bytes beginning from .Va offset -are taken as a single integer in network byte order. +as a single integer in network byte order. An additional offset can be optionally +requested at configuration time to account for packet type. .Sh HOOKS This node type has two hooks: .Bl -tag -width ".Va out" .It Va in Packets received on this hook are modified according to rules specified -in config and then forwarded to +in the configuration and then forwarded to the .Ar out -hook, if it exists and connected. +hook, if it exists. Otherwise they are reflected back to the .Ar in hook. .It Va out -Packets received on this hook are forwarded to +Packets received on this hook are forwarded to the .Ar in hook without any changes. .El .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo +.It Dv NGM_PATCH_SETDLT Pq Ic setdlt +Sets the data link type on the +.Va in +hook (to help calculate relative offset). Currently, supported types are +.Cm DLT_RAW +(raw IP datagrams , no offset applied, the default) and +.Cm DLT_EN10MB +(Ethernet). DLT_ definitions can be found in +.In net/bpf.h . +If you want to work on the link layer header you must use no additional offset by specifying +.Cm DLT_RAW . +If +.Cm EN10MB +is specified, then the optional additional offset will take into account the Ethernet header and a QinQ header if present. +.It Dv NGM_PATCH_GETDLT Pq Ic getdlt +This control message returns the data link type of the +.Va in +hook. .It Dv NGM_PATCH_SETCONFIG Pq Ic setconfig This command sets the sequence of modify operations that will be applied to incoming data on a hook. @@ -82,10 +102,10 @@ The following must be supplied as an argument: .Bd -literal -offset 4n struct ng_patch_op { - uint64_tvalue; uint32_toffset; uint16_tlength; /* 1,2,4 or 8 bytes */ uint16_tmode; + uint64_tvalue; }; /* Patching modes */ #define NG_PATCH_MODE_SET 1 @@ -103,6 +123,7 @@ struct ng_patch_op { struct ng_patch_config { uint32_tcount; uint32_tcsum_flags; + uint32_trelative_offset; struct ng_patch_op ops[]; }; .Ed @@ -116,14 +137,14 @@ The .Nm node does not do any checksum correction by itself. .It Dv NGM_PATCH_GETCONFIG Pq Ic getconfig -This control message obtains current set of modify operations, -returned as +This control message returns the current set of modify operations, +in the form of a .Vt "struct ng_patch_config" . .It Dv NGM_PATCH_GET_STATS Pq Ic getstats -Returns node statistics as a +Returns the node's statistics as a .Vt "struct ng_patch_stats" . .It Dv NGM_PATCH_CLR_STATS Pq Ic clrstats -Clear node statistics. +Clears the node's statistics. .It Dv NGM_PATCH_GETCLR_STATS Pq Ic getclrstats This command is identical to .Dv NGM_PATCH_GET_STATS , @@ -134,19 +155,20 @@ This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, or when all hooks have been disconnected. .Sh EXAMPLES -The +This .Nm -node allows to modify TTL and TOS/DSCP fields in IP packets. -Suppose you
svn commit: r309407 - head/share/man/man4
Author: julian Date: Fri Dec 2 09:51:12 2016 New Revision: 309407 URL: https://svnweb.freebsd.org/changeset/base/309407 Log: A little light wordsmithing only. Sponsored by: FreeBSD Modified: head/share/man/man4/ng_checksum.4 Modified: head/share/man/man4/ng_checksum.4 == --- head/share/man/man4/ng_checksum.4 Fri Dec 2 09:41:54 2016 (r309406) +++ head/share/man/man4/ng_checksum.4 Fri Dec 2 09:51:12 2016 (r309407) @@ -29,26 +29,26 @@ .Os .Sh NAME .Nm ng_checksum -.Nd IP checksum node type +.Nd reconstructing IP checksums node type .Sh SYNOPSIS .In netgraph/ng_checksum.h .Sh DESCRIPTION The .Nm checksum -node can calculate and prepare for calculation in hardware -IPv4 header, TCP, UDP checksum. +node can calculate, or prepare for calculation in hardware, +IPv4 header, TCP and UDP checksums. .Sh HOOKS This node type has two hooks: .Bl -tag -width ".Va out" .It Va in Packets received on this hook are processed according to settings specified -in config and then forwarded to +in config and then forwarded to the .Ar out -hook, if it exists and connected. Otherwise they are reflected back to the +hook, if it exists and is connected. Otherwise they are reflected back to the .Ar in hook. .It Va out -Packets received on this hook are forwarded to +Packets received on this hook are forwarded to the .Ar in hook without any changes. .El @@ -56,13 +56,13 @@ hook without any changes. This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_CHECKSUM_SETDLT Pq Ic setdlt -Sets data link type on the +Sets the data link type on the .Va in hook. Currently, supported types are .Cm DLT_RAW (raw IP datagrams) and .Cm DLT_EN10MB -(Ethernet). DLT_ definitions can be found in +(Ethernet). DLT_ definitions can be found in the .In net/bpf.h header. Currently used values are .Cm DLT_EN10MB @@ -70,11 +70,11 @@ header. Currently used values are .Cm DLT_RAW = 12. .It Dv NGM_CHECKSUM_GETDLT Pq Ic getdlt -This control message obtains data link type on the +This control message obtains the data link type on the .Va in hook. .It Dv NGM_CHECKSUM_SETCONFIG Pq Ic setconfig -Sets node configuration. The following +Sets the node configuration. The following .Vt "struct ng_checksum_config" must be supplied as an argument: .Bd -literal -offset 4n @@ -87,23 +87,24 @@ struct ng_checksum_config { The .Va csum_flags can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 -(other values are ignored) for instructing node need calculate the corresponding checksum. +(other values are ignored) for instructing the node to calculate the corresponding checksum. .Pp The .Va csum_offload -can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 -(other values are ignored) for instructing node what checksum can calculate in hardware. +value can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 +(other values are ignored) for instructing the node what checksums should be requested from the hardware. .Pp -Also processed any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 sets before on mbuf. +The node also takes into account any combination of +CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 already +flagged on the mbuf. .It Dv NGM_CHECKSUM_GETCONFIG Pq Ic getconfig -This control message obtains current node configuration, -returned as +This control message obtains the current node configuration returned as a .Vt "struct ng_checksum_config" . .It Dv NGM_CHECKSUM_GET_STATS Pq Ic getstats Returns node statistics as a .Vt "struct ng_checksum_stats" . .It Dv NGM_CHECKSUM_CLR_STATS Pq Ic clrstats -Clear node statistics. +Clear the node statistics. .It Dv NGM_CHECKSUM_GETCLR_STATS Pq Ic getclrstats This command is identical to .Dv NGM_CHECKSUM_GET_STATS , @@ -118,14 +119,15 @@ control message, or when all hooks have script: .Bd -literal -offset 4n /usr/sbin/ngctl -f- <<-SEQ - msg checksum-1: "setdlt 1" - ngctl msg checksum-1: "setconfig { csum_flags=0 csum_offload=6 }" + msg checksum-1: setdlt 1 + msg checksum-1: setconfig { csum_flags=0 csum_offload=6 } +SEQ .Ed .Pp -Set data link type to +Set the data link type to .Cm DLT_EN10MB -(Ethernet), not set additional checksum flags, set hardware -can calculate CSUM_IP_UDP|CSUM_IP_TCP. +(Ethernet), do not set additional checksum flags +and request that the hardware calculate CSUM_IP_UDP|CSUM_IP_TCP. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_patch 4 , ___ 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-unsubscr...@freebsd.org"
svn commit: r309406 - head/sys/dev/mlx5/mlx5_en
Author: hselasky Date: Fri Dec 2 09:41:54 2016 New Revision: 309406 URL: https://svnweb.freebsd.org/changeset/base/309406 Log: Remove useless NULL checks. NULL is not returned when allocating memory passing the M_WAITOK flag. Submitted by: trasz @ Differential Revision: https://reviews.freebsd.org/D5772 Sponsored by: Mellanox Technologies MFC after:1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c == --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Fri Dec 2 09:30:13 2016(r309405) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Fri Dec 2 09:41:54 2016(r309406) @@ -854,8 +854,6 @@ mlx5e_create_main_flow_table(struct mlx5 u8 *dmac; g = malloc(9 * sizeof(*g), M_MLX5EN, M_WAITOK | M_ZERO); - if (g == NULL) - return (-ENOMEM); g[0].log_sz = 2; g[0].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; @@ -939,8 +937,6 @@ mlx5e_create_vlan_flow_table(struct mlx5 struct mlx5_flow_table_group *g; g = malloc(2 * sizeof(*g), M_MLX5EN, M_WAITOK | M_ZERO); - if (g == NULL) - return (-ENOMEM); g[0].log_sz = 12; g[0].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c == --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cFri Dec 2 09:30:13 2016 (r309405) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cFri Dec 2 09:41:54 2016 (r309406) @@ -656,10 +656,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, goto err_rq_wq_destroy; rq->mbuf = malloc(wq_sz * sizeof(rq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); - if (rq->mbuf == NULL) { - err = -ENOMEM; - goto err_lro_init; - } for (i = 0; i != wq_sz; i++) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(>wq, i); uint32_t byte_count = rq->wqe_sz - MLX5E_NET_IP_ALIGN; @@ -686,7 +682,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, err_rq_mbuf_free: free(rq->mbuf, M_MLX5EN); -err_lro_init: tcp_lro_free(>lro); err_rq_wq_destroy: mlx5_wq_destroy(>wq_ctrl); @@ -897,8 +892,6 @@ mlx5e_alloc_sq_db(struct mlx5e_sq *sq) int x; sq->mbuf = malloc(wq_sz * sizeof(sq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); - if (sq->mbuf == NULL) - return (-ENOMEM); /* Create DMA descriptor MAPs */ for (x = 0; x != wq_sz; x++) { @@ -1486,9 +1479,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr int err; c = malloc(sizeof(*c), M_MLX5EN, M_WAITOK | M_ZERO); - if (c == NULL) - return (-ENOMEM); - c->priv = priv; c->ix = ix; c->cpu = 0; @@ -1699,8 +1689,6 @@ mlx5e_open_channels(struct mlx5e_priv *p priv->channel = malloc(priv->params.num_channels * sizeof(struct mlx5e_channel *), M_MLX5EN, M_WAITOK | M_ZERO); - if (priv->channel == NULL) - return (-ENOMEM); mlx5e_build_channel_param(priv, ); for (i = 0; i < priv->params.num_channels; i++) { @@ -2879,10 +2867,6 @@ mlx5e_create_ifp(struct mlx5_core_dev *m return (NULL); } priv = malloc(sizeof(*priv), M_MLX5EN, M_WAITOK | M_ZERO); - if (priv == NULL) { - mlx5_core_err(mdev, "malloc() failed\n"); - return (NULL); - } mlx5e_priv_mtx_init(priv); ifp = priv->ifp = if_alloc(IFT_ETHER); ___ 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-unsubscr...@freebsd.org"
svn commit: r309405 - head/contrib/libarchive/libarchive
Author: mm Date: Fri Dec 2 09:30:13 2016 New Revision: 309405 URL: https://svnweb.freebsd.org/changeset/base/309405 Log: MFV r309403: Sync libarchive with vendor. Vendor bugfixes: Fix for heap-buffer-overflow in archive_le16dec() Fix for heap-buffer-overflow in uudecode_bidder_bid() Reworked fix for compatibility with archives created by Perl Archive::Tar MFC after:1 week Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c head/contrib/libarchive/libarchive/archive_read_support_format_cab.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c == --- head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Fri Dec 2 09:29:22 2016(r309404) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Fri Dec 2 09:30:13 2016(r309405) @@ -312,6 +312,7 @@ uudecode_bidder_bid(struct archive_read_ avail -= len; if (l == 6) { + /* "begin " */ if (!uuchar[*b]) return (0); /* Get a length of decoded bytes. */ @@ -352,8 +353,8 @@ uudecode_bidder_bid(struct archive_read_ b += nl; if (avail && uuchar[*b]) return (firstline+30); - } - if (l == 13) { + } else if (l == 13) { + /* "begin-base64 " */ while (len-nl > 0) { if (!base64[*b++]) return (0); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cab.c == --- head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Fri Dec 2 09:29:22 2016(r309404) +++ head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Fri Dec 2 09:30:13 2016(r309405) @@ -645,12 +645,13 @@ cab_read_header(struct archive_read *a) cab = (struct cab *)(a->format->data); if (cab->found_header == 0 && p[0] == 'M' && p[1] == 'Z') { - /* This is an executable? Must be self-extracting... */ + /* This is an executable? Must be self-extracting... */ err = cab_skip_sfx(a); if (err < ARCHIVE_WARN) return (err); - if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL) + /* Re-read header after processing the SFX. */ + if ((p = __archive_read_ahead(a, 42, NULL)) == NULL) return (truncated_error(a)); } Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c == --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Fri Dec 2 09:29:22 2016(r309404) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Fri Dec 2 09:30:13 2016(r309405) @@ -297,58 +297,50 @@ archive_read_format_tar_cleanup(struct a /* * Validate number field * - * Flags: - * 1 - allow double \0 at field end + * This has to be pretty lenient in order to accomodate the enormous + * variety of tar writers in the world: + * = POSIX ustar requires octal values with leading zeros and + *specific termination on fields + * = Many writers use different termination (in particular, libarchive + *omits terminator bytes to squeeze one or two more digits) + * = Many writers pad with space and omit leading zeros + * = GNU tar and star write base-256 values if numbers are too + *big to be represented in octal + * + * This should tolerate all variants in use. It will reject a field + * where the writer just left garbage after a trailing NUL. */ static int -validate_number_field(const char* p_field, size_t i_size, int flags) +validate_number_field(const char* p_field, size_t i_size) { unsigned char marker = (unsigned char)p_field[0]; - /* octal? */ - if ((marker >= '0' && marker <= '7') || marker == ' ') { + if (marker == 128 || marker == 255 || marker == 0) { + /* Base-256 marker, there's nothing we can check. */ + return 1; + } else { + /* Must be octal */ size_t i = 0; - int octal_found = 0; - for (i = 0; i < i_size; ++i) { - switch (p_field[i]) - { - case ' ': - /* skip any leading spaces and trailing space */ - if (octal_found == 0 || i == i_size - 1) { - continue;
svn commit: r309404 - head/sys/netgraph
Author: hselasky Date: Fri Dec 2 09:29:22 2016 New Revision: 309404 URL: https://svnweb.freebsd.org/changeset/base/309404 Log: Fix return value from ng_uncallout(). callout_stop() recently started returning -1 when the callout is already stopped, which is not handled by the netgraph code. Properly filter the return value. Netgraph callers only want to know if the callout was cancelled and not draining or already stopped. Discussed with: julian, glebius MFC after:2 weeks Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c == --- head/sys/netgraph/ng_base.c Fri Dec 2 09:26:51 2016(r309403) +++ head/sys/netgraph/ng_base.c Fri Dec 2 09:29:22 2016(r309404) @@ -3825,7 +3825,11 @@ ng_uncallout(struct callout *c, node_p n } c->c_arg = NULL; - return (rval); + /* +* Callers only want to know if the callout was cancelled and +* not draining or stopped. +*/ + return (rval > 0); } /* ___ 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-unsubscr...@freebsd.org"
svn commit: r309400 - head/sys/dev/acpica
Author: hselasky Date: Fri Dec 2 08:21:08 2016 New Revision: 309400 URL: https://svnweb.freebsd.org/changeset/base/309400 Log: Fix for endless recursion in the ACPI GPE handler during boot. When handling a GPE ACPI interrupt object the EcSpaceHandler() function can be called which checks the EC_EVENT_SCI bit and then recurse on the EcGpeQueryHandler() function. If there are multiple GPE events pending the EC_EVENT_SCI bit will be set at the next call to EcSpaceHandler() causing it to recurse again via the EcGpeQueryHandler() function. This leads to a slow never ending recursion during boot which prevents proper system startup, because the EC_EVENT_SCI bit never gets cleared in this scenario. The behaviour is reproducible with the ALASKA AMI in combination with a newer Skylake based mainboard in the following way: Enter BIOS and adjust the clock one hour forward. Save and exit the BIOS. System fails to boot due to the above mentioned bug in EcGpeQueryHandler() which was observed recursing multiple times. This patch adds a simple recursion guard to the EcGpeQueryHandler() function and also also adds logic to detect if new GPE events occurred during the execution of EcGpeQueryHandler() and then loop on this function instead of recursing. Reviewed by: jhb MFC after:2 weeks Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c == --- head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:15:52 2016 (r309399) +++ head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:21:08 2016 (r309400) @@ -613,16 +613,14 @@ EcCheckStatus(struct acpi_ec_softc *sc, } static void -EcGpeQueryHandler(void *Context) +EcGpeQueryHandlerSub(struct acpi_ec_softc *sc) { -struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; UINT8 Data; ACPI_STATUSStatus; intretry; char qxx[5]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); -KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); /* Serialize user access with EcSpaceHandler(). */ Status = EcLock(sc); @@ -647,7 +645,6 @@ EcGpeQueryHandler(void *Context) EC_EVENT_INPUT_BUFFER_EMPTY))) break; } -sc->ec_sci_pend = FALSE; if (ACPI_FAILURE(Status)) { EcUnlock(sc); device_printf(sc->ec_dev, "GPE query failed: %s\n", @@ -678,6 +675,29 @@ EcGpeQueryHandler(void *Context) } } +static void +EcGpeQueryHandler(void *Context) +{ +struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; +int pending; + +KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); + +do { + /* Read the current pending count */ + pending = atomic_load_acq_int(>ec_sci_pend); + + /* Call GPE handler function */ + EcGpeQueryHandlerSub(sc); + + /* +* Try to reset the pending count to zero. If this fails we +* know another GPE event has occurred while handling the +* current GPE event and need to loop. +*/ +} while (!atomic_cmpset_int(>ec_sci_pend, pending, 0)); +} + /* * The GPE handler is called when IBE/OBF or SCI events occur. We are * called from an unknown lock context. @@ -706,13 +726,14 @@ EcGpeHandler(ACPI_HANDLE GpeDevice, UINT * It will run the query and _Qxx method later, under the lock. */ EcStatus = EC_GET_CSR(sc); -if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { +if ((EcStatus & EC_EVENT_SCI) && + atomic_fetchadd_int(>ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec gpe queueing query handler"); Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); - if (ACPI_SUCCESS(Status)) - sc->ec_sci_pend = TRUE; - else + if (ACPI_FAILURE(Status)) { printf("EcGpeHandler: queuing GPE query handler failed\n"); + atomic_store_rel_int(>ec_sci_pend, 0); + } } return (ACPI_REENABLE_GPE); } @@ -759,7 +780,8 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY * we call it directly here since our thread taskq is not active yet. */ if (cold || rebooting || sc->ec_suspending) { - if ((EC_GET_CSR(sc) & EC_EVENT_SCI)) { + if ((EC_GET_CSR(sc) & EC_EVENT_SCI) && + atomic_fetchadd_int(>ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec running gpe handler directly"); EcGpeQueryHandler(sc); } ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r309372 - head/sys/sys
peek_clear_sc is added to address the issue you mentioned. IMHO, this commit weakens the proper assertion. On Fri, Dec 2, 2016 at 5:08 AM, Ryan Stonewrote: > Author: rstone > Date: Thu Dec 1 21:08:42 2016 > New Revision: 309372 > URL: https://svnweb.freebsd.org/changeset/base/309372 > > Log: > Fix a false positive in a buf_ring assert > > buf_ring contains an assert that checks whether an item being > enqueued already exists on the ring. There is a subtle bug in > this assert. An item can be returned by a peek() function and > freed, and then the consumer thread can be preempted before > calling advance(). If this happens the item appears to still be > on the queue, but another thread may allocate the item from the > free pool and wind up trying to enqueue it again, causing the > assert to trigger incorrectly. > > Fix this by skipping the head of the consumer's portion of the > ring, as this index is what will be returned by peek(). > > Sponsored by: Dell EMC Isilon > MFC After:1 week > Differential Revision:https://reviews.freebsd.org/D8685 > Reviewed by: hselasky > > Modified: > head/sys/sys/buf_ring.h > > Modified: head/sys/sys/buf_ring.h > == > --- head/sys/sys/buf_ring.h Thu Dec 1 20:36:48 2016(r309371) > +++ head/sys/sys/buf_ring.h Thu Dec 1 21:08:42 2016(r309372) > @@ -67,11 +67,13 @@ buf_ring_enqueue(struct buf_ring *br, vo > uint32_t prod_head, prod_next, cons_tail; > #ifdef DEBUG_BUFRING > int i; > - for (i = br->br_cons_head; i != br->br_prod_head; > -i = ((i + 1) & br->br_cons_mask)) > - if(br->br_ring[i] == buf) > - panic("buf=%p already enqueue at %d prod=%d cons=%d", > - buf, i, br->br_prod_tail, br->br_cons_tail); > + if (br->br_cons_head != br->br_prod_head) { > + for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != > br->br_prod_head; > + i = ((i + 1) & br->br_cons_mask)) > + if(br->br_ring[i] == buf) > + panic("buf=%p already enqueue at %d prod=%d > cons=%d", > + buf, i, br->br_prod_tail, > br->br_cons_tail); > + } > #endif > critical_enter(); > do { > ___ > svn-src-...@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org" -- Tomorrow Will Never Die ___ 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-unsubscr...@freebsd.org"
svn commit: r309397 - head/sys/netinet
Author: tuexen Date: Fri Dec 2 08:02:31 2016 New Revision: 309397 URL: https://svnweb.freebsd.org/changeset/base/309397 Log: Fix the handling of TCP FIN-segments in the CLOSED state When a TCP segment with the FIN bit set was received in the CLOSED state, a TCP RST-ACK-segment is sent. When computing SEG.ACK for this, the FIN counts as one byte. This accounting was missing and is fixed by this patch. Reviewed by: hiren MFC after:1 month Sponsored by: Netflix, Inc. Differential Revision:https://svn.freebsd.org/base/head Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c == --- head/sys/netinet/tcp_input.cFri Dec 2 06:27:54 2016 (r309396) +++ head/sys/netinet/tcp_input.cFri Dec 2 08:02:31 2016 (r309397) @@ -3357,6 +3357,8 @@ tcp_dropwithreset(struct mbuf *m, struct } else { if (th->th_flags & TH_SYN) tlen++; + if (th->th_flags & TH_FIN) + tlen++; tcp_respond(tp, mtod(m, void *), th, m, th->th_seq+tlen, (tcp_seq)0, TH_RST|TH_ACK); } ___ 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-unsubscr...@freebsd.org"