svn commit: r281798 - head/lib/libc/iconv
Author: pfg Date: Mon Apr 20 22:09:50 2015 New Revision: 281798 URL: https://svnweb.freebsd.org/changeset/base/281798 Log: Fix improbable memory leak in _citrus_prop_read_str(). Found by: Clang Static Analyzer Modified: head/lib/libc/iconv/citrus_prop.c Modified: head/lib/libc/iconv/citrus_prop.c == --- head/lib/libc/iconv/citrus_prop.c Mon Apr 20 22:08:11 2015 (r281797) +++ head/lib/libc/iconv/citrus_prop.c Mon Apr 20 22:09:50 2015 (r281798) @@ -293,8 +293,10 @@ done: } _memstream_ungetc(ms, ch); errnum = _citrus_prop_read_character_common(ms, ch); - if (errnum != 0) + if (errnum != 0) { + free(s); return (errnum); + } s[n] = ch; ++n, --m; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281802 - in head/release: . arm64 tools
Author: gjb Date: Tue Apr 21 00:48:35 2015 New Revision: 281802 URL: https://svnweb.freebsd.org/changeset/base/281802 Log: Merge the following from ^/projects/release-arm64 to allow building FreeBSD/arm64 VM images and memstick.img installation medium: r281786, r281788, r281792: r281786: Add support for building arm64/aarch64 virtual machine images. r281788: Copy amd64/make-memstick.sh to arm64/make-memstick.sh for aarch64 memory stick images. Although arm64 does not yet have USB support, the memstick image should be bootable with certain virtualization tools, such as qemu. r281792: Add a buildenv_setup() prototype, intended to be overridden as needed. For example, the arm64/aarch64 build needs devel/aarch64-binutils, so buildenv_setup() in the release.conf for this architecture handles the installation of the port before buildworld/buildkernel. Sponsored by: The FreeBSD Foundation Added: head/release/arm64/ - copied from r281788, projects/release-arm64/release/arm64/ Modified: head/release/release.conf.sample head/release/release.sh head/release/tools/vmimage.subr Directory Properties: head/ (props changed) Modified: head/release/release.conf.sample == --- head/release/release.conf.sampleTue Apr 21 00:08:37 2015 (r281801) +++ head/release/release.conf.sampleTue Apr 21 00:48:35 2015 (r281802) @@ -7,6 +7,7 @@ ## defined in release.sh. #load_chroot_env() { } #load_target_env() { } +#buildenv_setup() { } ## Set the directory within which the release will be built. CHROOTDIR=/scratch Modified: head/release/release.sh == --- head/release/release.sh Tue Apr 21 00:08:37 2015(r281801) +++ head/release/release.sh Tue Apr 21 00:48:35 2015(r281802) @@ -42,6 +42,7 @@ export PATH # Prototypes that can be redefined per-chroot or per-target. load_chroot_env() { } load_target_env() { } +buildenv_setup() { } # The directory within which the release will be built. CHROOTDIR=/scratch @@ -279,6 +280,7 @@ if [ -d ${CHROOTDIR}/usr/ports ]; then fi fi +buildenv_setup load_target_env eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel Modified: head/release/tools/vmimage.subr == --- head/release/tools/vmimage.subr Tue Apr 21 00:08:37 2015 (r281801) +++ head/release/tools/vmimage.subr Tue Apr 21 00:48:35 2015 (r281802) @@ -29,6 +29,13 @@ write_partition_layout() { -p freebsd-ufs/rootfs:=${VMBASE} \ -o ${VMIMAGE} ;; + arm64:aarch64) + mkimg -s gpt \ + -p efi/efiboot:=${BOOTFILES}/efi/boot1/boot1.efifat \ + ${SWAPOPT} \ + -p freebsd-ufs/rootfs:=${VMBASE} \ + -o ${VMIMAGE} + ;; powerpc:powerpc*) mkimg -s apm \ -p apple-boot/bootfs:=${BOOTFILES}/powerpc/boot1.chrp/boot1.hfs \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281791 - head/tools/build
Author: bdrewery Date: Mon Apr 20 20:51:19 2015 New Revision: 281791 URL: https://svnweb.freebsd.org/changeset/base/281791 Log: - Speedup significantly by not using subshells for data already fetched. Ran against /usr/local/sbin/pkg: Before: 25.12 real12.41 user33.14 sys After: 0.53 real 0.49 user 0.13 sys - Exit with 1 if any missing or unresolved symbol is detected. - Add option '-U' to skip looking up unresolved symbols. - Don't consider provided weak objects as unresolved (nm V). Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/check-links.sh Modified: head/tools/build/check-links.sh == --- head/tools/build/check-links.sh Mon Apr 20 20:45:10 2015 (r281790) +++ head/tools/build/check-links.sh Mon Apr 20 20:51:19 2015 (r281791) @@ -1,6 +1,15 @@ #!/bin/sh # $FreeBSD$ +ret=0 +CHECK_UNRESOLVED=1 +while getopts U flag; do + case ${flag} in + U) CHECK_UNRESOLVED=0 ;; + esac +done +shift $((OPTIND-1)) + mime=$(file -L --mime-type $1) case $mime in *application/x-executable);; @@ -8,30 +17,74 @@ case $mime in *) echo Not an elf file 2 ; exit 1;; esac +# Gather all symbols from the target +unresolved_symbols=$(nm -D -u --format=posix $1 | awk '$2 == U {print $1}' | tr '\n' ' ') +ldd_libs=$(ldd $1 | awk '{print $1 : $3}') + +libkey() { + libkey=lib_symbols_$1 + patterns=[.+,-] + replacement=_ + while :; do + case ${libkey} in + *${patterns}*) + libkey=${libkey%%${patterns}*}${replacement}${libkey#*${patterns}} + ;; + *) + break + ;; + esac + done + return 0 +} + # Check for useful libs -list_libs= +list_libs= +resolved_symbols= for lib in $(readelf -d $1 | awk '$2 ~ /\(?NEEDED\)?/ { sub(/\[/,,$NF); sub(/\]/,,$NF); print $NF }'); do echo -n checking if $lib is needed: - libpath=$(ldd $1 | awk -v lib=$lib '$1 == lib { print $3 }') - list_libs=$list_libs $libpath - foundone=0 - for fct in $(nm -D $libpath | awk '$2 == R || $2 == D || $2 == T || $2 == W || $2 == B { print $3 }'); do - nm -D $1 | awk -v s=$fct '$1 == U $2 == s { found=1 ; exit } END { if (found != 1) { exit 1 } }' foundone=1 break + for libpair in ${ldd_libs}; do + case ${libpair} in + ${lib}:*) libpath=${libpair#*:} break ;; + esac done - if [ $foundone -eq 1 ]; then - echo -n yes... - nm -D $1 | awk -v s=$fct '$1 == U $2 == s { print $2 ; exit }' + list_libs=$list_libs $lib + foundone= + lib_symbols=$(nm -D --defined-only --format=posix ${libpath} | awk '$2 ~ /R|D|T|W|B|V/ {print $1}' | tr '\n' ' ') + if [ ${CHECK_UNRESOLVED} -eq 1 ]; then + # Save the global symbols for this lib + libkey ${lib} + setvar ${libkey} ${lib_symbols} + fi + for fct in ${lib_symbols}; do + case ${unresolved_symbols} in + *\ ${fct}\ *) foundone=${fct} break ;; + esac + done + if [ -n ${foundone} ]; then + echo yes... ${foundone} else echo no + ret=1 fi done -for sym in $(nm -D $1 | awk '$1 == U { print $2 }'); do - found=0 - for l in ${list_libs} ; do - nm -D $l | awk -v s=$sym '($2 == R || $2 == D || $2 == T || $2 == W || $2 == B) $3 == s { found=1 ; exit } END { if (found != 1) { exit 1 } }' found=1 break +if [ ${CHECK_UNRESOLVED} -eq 1 ]; then + for sym in ${unresolved_symbols}; do + found=0 + for lib in ${list_libs}; do + libkey ${lib} + eval lib_symbols=\\${${libkey}}\ + # lib_symbols now contains symbols for the lib. + case ${lib_symbols} in + *\ ${sym}\ *) found=1 break ;; + esac + done + if [ $found -eq 0 ]; then + echo Unresolved symbol $sym + ret=1 + fi done - if [ $found -eq 0 ]; then - echo Unresolved symbol $sym - fi -done +fi + +exit ${ret} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281795 - head/sys/cam/scsi
Author: pfg Date: Mon Apr 20 21:44:55 2015 New Revision: 281795 URL: https://svnweb.freebsd.org/changeset/base/281795 Log: scsi_parse_transportid_rdma(): fix mismatch in memoty access size. Independently found by Coverity and gcc49. CID: 1230006 Reviewed by: ken MFC after:5 days Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c == --- head/sys/cam/scsi/scsi_all.cMon Apr 20 21:27:25 2015 (r281794) +++ head/sys/cam/scsi/scsi_all.cMon Apr 20 21:44:55 2015 (r281795) @@ -6039,7 +6039,7 @@ scsi_parse_transportid_rdma(char *id_str goto bailout; } *alloc_len = sizeof(*rdma); - bzero(rdma, sizeof(rdma)); + bzero(rdma, *alloc_len); rdma-format_protocol = SCSI_PROTO_RDMA | SCSI_TRN_RDMA_FORMAT_DEFAULT; bcopy(rdma_id, rdma-initiator_port_id, SCSI_TRN_RDMA_PORT_LEN); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281790 - head/tools/build
Author: bdrewery Date: Mon Apr 20 20:45:10 2015 New Revision: 281790 URL: https://svnweb.freebsd.org/changeset/base/281790 Log: Fix indentation to use tabs Modified: head/tools/build/check-links.sh Modified: head/tools/build/check-links.sh == --- head/tools/build/check-links.sh Mon Apr 20 20:33:22 2015 (r281789) +++ head/tools/build/check-links.sh Mon Apr 20 20:45:10 2015 (r281790) @@ -11,27 +11,27 @@ esac # Check for useful libs list_libs= for lib in $(readelf -d $1 | awk '$2 ~ /\(?NEEDED\)?/ { sub(/\[/,,$NF); sub(/\]/,,$NF); print $NF }'); do -echo -n checking if $lib is needed: -libpath=$(ldd $1 | awk -v lib=$lib '$1 == lib { print $3 }') -list_libs=$list_libs $libpath -foundone=0 -for fct in $(nm -D $libpath | awk '$2 == R || $2 == D || $2 == T || $2 == W || $2 == B { print $3 }'); do -nm -D $1 | awk -v s=$fct '$1 == U $2 == s { found=1 ; exit } END { if (found != 1) { exit 1 } }' foundone=1 break -done -if [ $foundone -eq 1 ]; then -echo -n yes... -nm -D $1 | awk -v s=$fct '$1 == U $2 == s { print $2 ; exit }' -else -echo no -fi + echo -n checking if $lib is needed: + libpath=$(ldd $1 | awk -v lib=$lib '$1 == lib { print $3 }') + list_libs=$list_libs $libpath + foundone=0 + for fct in $(nm -D $libpath | awk '$2 == R || $2 == D || $2 == T || $2 == W || $2 == B { print $3 }'); do + nm -D $1 | awk -v s=$fct '$1 == U $2 == s { found=1 ; exit } END { if (found != 1) { exit 1 } }' foundone=1 break + done + if [ $foundone -eq 1 ]; then + echo -n yes... + nm -D $1 | awk -v s=$fct '$1 == U $2 == s { print $2 ; exit }' + else + echo no + fi done for sym in $(nm -D $1 | awk '$1 == U { print $2 }'); do -found=0 -for l in ${list_libs} ; do -nm -D $l | awk -v s=$sym '($2 == R || $2 == D || $2 == T || $2 == W || $2 == B) $3 == s { found=1 ; exit } END { if (found != 1) { exit 1 } }' found=1 break -done -if [ $found -eq 0 ]; then -echo Unresolved symbol $sym -fi + found=0 + for l in ${list_libs} ; do + nm -D $l | awk -v s=$sym '($2 == R || $2 == D || $2 == T || $2 == W || $2 == B) $3 == s { found=1 ; exit } END { if (found != 1) { exit 1 } }' found=1 break + done + if [ $found -eq 0 ]; then + echo Unresolved symbol $sym + fi done ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281793 - in head: lib/libmt lib/libpmc share/man/man4
Author: joel (doc committer) Date: Mon Apr 20 21:19:26 2015 New Revision: 281793 URL: https://svnweb.freebsd.org/changeset/base/281793 Log: Minor mdoc fixes. Modified: head/lib/libmt/mt.3 head/lib/libpmc/pmc.haswellxeon.3 head/share/man/man4/ata.4 Modified: head/lib/libmt/mt.3 == --- head/lib/libmt/mt.3 Mon Apr 20 20:52:20 2015(r281792) +++ head/lib/libmt/mt.3 Mon Apr 20 21:19:26 2015(r281793) @@ -35,7 +35,6 @@ .Dt MT 3 .Os .Sh NAME -.Nm .Nm mt_start_element , .Nm mt_end_element , .Nm mt_char_handler , Modified: head/lib/libpmc/pmc.haswellxeon.3 == --- head/lib/libpmc/pmc.haswellxeon.3 Mon Apr 20 20:52:20 2015 (r281792) +++ head/lib/libpmc/pmc.haswellxeon.3 Mon Apr 20 21:19:26 2015 (r281793) @@ -25,7 +25,7 @@ .\ .\ $FreeBSD$ .\ -.Dd 21 November, 2014 +.Dd November 21, 2014 .Dt PMC.HASWELLXEON 3 .Os .Sh NAME Modified: head/share/man/man4/ata.4 == --- head/share/man/man4/ata.4 Mon Apr 20 20:52:20 2015(r281792) +++ head/share/man/man4/ata.4 Mon Apr 20 21:19:26 2015(r281793) @@ -99,6 +99,7 @@ Interface Power Management is disabled. This is the default value. .It 1 The device is allowed to initiate a PM state change; the host is passive. +.El .It Va hint.ata. Ns Ar X Ns Va .dev Ns Ar X Ns Va .sata_rev limits the initial SATA revision (speed) for the specified device on the specified channel. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281789 - head
Author: eadler Date: Mon Apr 20 20:33:22 2015 New Revision: 281789 URL: https://svnweb.freebsd.org/changeset/base/281789 Log: phabricator related changes: - don't lint either contrib or crypto: these are both externally written directories - add additional linters for spelling (check common typos like teh - the) - chmod linter checks for executible bit on bad files - merge-conflict checks for merge conflict tokens then may have been resolved incorrectly - filename checks for back characters in filenames - json for json syntax correctness - remove history.immutable: it is meaningless on subversion, and causes workflow problems when trying to use git. It it set to 'true' by default with hg Modified: head/.arcconfig head/.arclint Modified: head/.arcconfig == --- head/.arcconfig Mon Apr 20 20:13:02 2015(r281788) +++ head/.arcconfig Mon Apr 20 20:33:22 2015(r281789) @@ -1,5 +1,4 @@ { project.name: S, - phabricator.uri : https://reviews.freebsd.org/;, - history.immutable : true + phabricator.uri : https://reviews.freebsd.org/; } Modified: head/.arclint == --- head/.arclint Mon Apr 20 20:13:02 2015(r281788) +++ head/.arclint Mon Apr 20 20:33:22 2015(r281789) @@ -1,9 +1,25 @@ { + exclude: (contrib|crypto), linters: { python: { type: pep8, - exclude: (contrib), include: (\\.py$) +}, +spelling: { + type: spelling +}, +chmod: { + type: chmod +}, +merge-conflict: { + type: merge-conflict +}, +filename: { + type: filename +}, +json: { + type: json, + include: (\\.arclint|\\.json$) } } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281799 - in head/sys: arm/conf modules/dtb/allwinner
Author: loos Date: Mon Apr 20 22:12:19 2015 New Revision: 281799 URL: https://svnweb.freebsd.org/changeset/base/281799 Log: Build and install the DTB for all the supported AllWinner SoCs. We will need them when we start booting using ubldr. Added: head/sys/modules/dtb/allwinner/ head/sys/modules/dtb/allwinner/Makefile (contents, props changed) Modified: head/sys/arm/conf/CUBIEBOARD head/sys/arm/conf/CUBIEBOARD2 Modified: head/sys/arm/conf/CUBIEBOARD == --- head/sys/arm/conf/CUBIEBOARDMon Apr 20 22:09:50 2015 (r281798) +++ head/sys/arm/conf/CUBIEBOARDMon Apr 20 22:12:19 2015 (r281799) @@ -139,4 +139,4 @@ device miibus optionsFDT # Configure using FDT/DTB data optionsFDT_DTB_STATIC makeoptionsFDT_DTS_FILE=cubieboard.dts - +makeoptionsMODULES_EXTRA=dtb/allwinner Modified: head/sys/arm/conf/CUBIEBOARD2 == --- head/sys/arm/conf/CUBIEBOARD2 Mon Apr 20 22:09:50 2015 (r281798) +++ head/sys/arm/conf/CUBIEBOARD2 Mon Apr 20 22:12:19 2015 (r281799) @@ -140,4 +140,4 @@ device miibus optionsFDT # Configure using FDT/DTB data optionsFDT_DTB_STATIC makeoptionsFDT_DTS_FILE=cubieboard2.dts - +makeoptionsMODULES_EXTRA=dtb/allwinner Added: head/sys/modules/dtb/allwinner/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/dtb/allwinner/Makefile Mon Apr 20 22:12:19 2015 (r281799) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# All the dts files for allwinner systems we support. +DTS= \ + cubieboard.dts \ + cubieboard2.dts + +.include bsd.dtb.mk ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281800 - head/usr.bin/patch
Author: pfg Date: Mon Apr 20 22:15:18 2015 New Revision: 281800 URL: https://svnweb.freebsd.org/changeset/base/281800 Log: patch(1): small include changes. Mostly to match OpenBSD, no functional change. Obtained from:OpenBSD Modified: head/usr.bin/patch/inp.c head/usr.bin/patch/pch.c head/usr.bin/patch/util.c Modified: head/usr.bin/patch/inp.c == --- head/usr.bin/patch/inp.cMon Apr 20 22:12:19 2015(r281799) +++ head/usr.bin/patch/inp.cMon Apr 20 22:15:18 2015(r281800) @@ -34,8 +34,8 @@ #include ctype.h #include libgen.h -#include limits.h #include stddef.h +#include stdint.h #include stdio.h #include stdlib.h #include string.h Modified: head/usr.bin/patch/pch.c == --- head/usr.bin/patch/pch.cMon Apr 20 22:12:19 2015(r281799) +++ head/usr.bin/patch/pch.cMon Apr 20 22:15:18 2015(r281800) @@ -34,6 +34,7 @@ #include ctype.h #include libgen.h #include limits.h +#include stdint.h #include stdio.h #include stdlib.h #include string.h Modified: head/usr.bin/patch/util.c == --- head/usr.bin/patch/util.c Mon Apr 20 22:12:19 2015(r281799) +++ head/usr.bin/patch/util.c Mon Apr 20 22:15:18 2015(r281800) @@ -27,13 +27,13 @@ * $FreeBSD$ */ -#include sys/param.h #include sys/stat.h #include ctype.h #include errno.h #include fcntl.h #include libgen.h +#include limits.h #include paths.h #include signal.h #include stdarg.h @@ -96,7 +96,7 @@ int backup_file(const char *orig) { struct stat filestat; - charbakname[MAXPATHLEN], *s, *simplename; + charbakname[PATH_MAX], *s, *simplename; dev_t orig_device; ino_t orig_inode; @@ -406,7 +406,7 @@ fetchname(const char *at, bool *exists, char * checked_in(char *file) { - char*filebase, *filedir, tmpbuf[MAXPATHLEN]; + char*filebase, *filedir, tmpbuf[PATH_MAX]; struct stat filestat; filebase = basename(file); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281797 - head/sys/net
Author: markj Date: Mon Apr 20 22:08:11 2015 New Revision: 281797 URL: https://svnweb.freebsd.org/changeset/base/281797 Log: Move the definition of struct bpf_if to bpf.c. A couple of fields are still exposed via struct bpf_if_ext so that bpf_peers_present() can be inlined into its callers. However, this change eliminates some type duplication in the resulting CTF container, since otherwise ctfmerge(1) propagates the duplication through all types that contain a struct bpf_if. Differential Revision:https://reviews.freebsd.org/D2319 Reviewed by: melifaro, rpaulo Modified: head/sys/net/bpf.c head/sys/net/bpf.h Modified: head/sys/net/bpf.c == --- head/sys/net/bpf.c Mon Apr 20 21:45:38 2015(r281796) +++ head/sys/net/bpf.c Mon Apr 20 22:08:11 2015(r281797) @@ -69,7 +69,6 @@ __FBSDID($FreeBSD$); #include net/if.h #include net/if_var.h -#defineBPF_INTERNAL #include net/bpf.h #include net/bpf_buffer.h #ifdef BPF_JITTER @@ -90,6 +89,20 @@ __FBSDID($FreeBSD$); MALLOC_DEFINE(M_BPF, BPF, BPF data); +struct bpf_if { +#definebif_nextbif_ext.bif_next +#definebif_dlist bif_ext.bif_dlist + struct bpf_if_ext bif_ext; /* public members */ + u_int bif_dlt;/* link layer type */ + u_int bif_hdrlen; /* length of link header */ + struct ifnet*bif_ifp; /* corresponding interface */ + struct rwlock bif_lock; /* interface lock */ + LIST_HEAD(, bpf_d) bif_wlist; /* writer-only list */ + int bif_flags; /* Interface flags */ +}; + +CTASSERT(offsetof(struct bpf_if, bif_ext) == 0); + #if defined(DEV_BPF) || defined(NETGRAPH_BPF) #define PRINET 26 /* interruptible */ @@ -1892,7 +1905,7 @@ bpf_setif(struct bpf_d *d, struct ifreq /* Check if interface is not being detached from BPF */ BPFIF_RLOCK(bp); - if (bp-flags BPFIF_FLAG_DYING) { + if (bp-bif_flags BPFIF_FLAG_DYING) { BPFIF_RUNLOCK(bp); return (ENXIO); } @@ -2561,7 +2574,7 @@ bpfdetach(struct ifnet *ifp) * Mark bp as detached to restrict new consumers. */ BPFIF_WLOCK(bp); - bp-flags |= BPFIF_FLAG_DYING; + bp-bif_flags |= BPFIF_FLAG_DYING; BPFIF_WUNLOCK(bp); CTR4(KTR_NET, %s: sheduling free for encap %d (%p) for if %p, Modified: head/sys/net/bpf.h == --- head/sys/net/bpf.h Mon Apr 20 21:45:38 2015(r281796) +++ head/sys/net/bpf.h Mon Apr 20 22:08:11 2015(r281797) @@ -1451,21 +1451,14 @@ SYSCTL_DECL(_net_bpf); /* * Descriptor associated with each attached hardware interface. - * FIXME: this structure is exposed to external callers to speed up - * bpf_peers_present() call. However we cover all fields not needed by - * this function via BPF_INTERNAL define + * Part of this structure is exposed to external callers to speed up + * bpf_peers_present() calls. */ -struct bpf_if { +struct bpf_if; + +struct bpf_if_ext { LIST_ENTRY(bpf_if) bif_next; /* list of all interfaces */ LIST_HEAD(, bpf_d) bif_dlist; /* descriptor list */ -#ifdef BPF_INTERNAL - u_int bif_dlt; /* link layer type */ - u_int bif_hdrlen; /* length of link header */ - struct ifnet *bif_ifp; /* corresponding interface */ - struct rwlock bif_lock; /* interface lock */ - LIST_HEAD(, bpf_d) bif_wlist; /* writer-only list */ - int flags; /* Interface flags */ -#endif }; voidbpf_bufheld(struct bpf_d *d); @@ -1483,8 +1476,10 @@ u_int bpf_filter(const struct bpf_insn static __inline int bpf_peers_present(struct bpf_if *bpf) { + struct bpf_if_ext *ext; - if (!LIST_EMPTY(bpf-bif_dlist)) + ext = (struct bpf_if_ext *)bpf; + if (!LIST_EMPTY(ext-bif_dlist)) return (1); return (0); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281810 - head/tools/build
Author: bdrewery Date: Tue Apr 21 03:06:58 2015 New Revision: 281810 URL: https://svnweb.freebsd.org/changeset/base/281810 Log: Revert r281805 for now as it breaks due to spaces in output Modified: head/tools/build/check-links.sh Modified: head/tools/build/check-links.sh == --- head/tools/build/check-links.sh Tue Apr 21 02:49:44 2015 (r281809) +++ head/tools/build/check-links.sh Tue Apr 21 03:06:58 2015 (r281810) @@ -3,10 +3,8 @@ ret=0 CHECK_UNRESOLVED=1 -DEMANGLE= -while getopts DU flag; do +while getopts U flag; do case ${flag} in - D) DEMANGLE=-C ;; U) CHECK_UNRESOLVED=0 ;; esac done @@ -20,7 +18,7 @@ case $mime in esac # Gather all symbols from the target -unresolved_symbols=$(nm ${DEMANGLE} -D -u --format=posix $1 | awk '$2 == U {print $1}' | tr '\n' ' ') +unresolved_symbols=$(nm -D -u --format=posix $1 | awk '$2 == U {print $1}' | tr '\n' ' ') ldd_libs=$(ldd $(realpath $1) | awk '{print $1 : $3}') libkey() { @@ -52,7 +50,7 @@ for lib in $(readelf -d $1 | awk '$2 ~ / done list_libs=$list_libs $lib foundone= - lib_symbols=$(nm ${DEMANGLE} -D --defined-only --format=posix ${libpath} | awk '$2 ~ /R|D|T|W|B|V/ {print $1}' | tr '\n' ' ') + lib_symbols=$(nm -D --defined-only --format=posix ${libpath} | awk '$2 ~ /R|D|T|W|B|V/ {print $1}' | tr '\n' ' ') if [ ${CHECK_UNRESOLVED} -eq 1 ]; then # Save the global symbols for this lib libkey ${lib} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281813 - head/tools/build
Author: bdrewery Date: Tue Apr 21 05:10:18 2015 New Revision: 281813 URL: https://svnweb.freebsd.org/changeset/base/281813 Log: Support libraries linked by path. Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/check-links.sh Modified: head/tools/build/check-links.sh == --- head/tools/build/check-links.sh Tue Apr 21 04:40:38 2015 (r281812) +++ head/tools/build/check-links.sh Tue Apr 21 05:10:18 2015 (r281813) @@ -3,7 +3,7 @@ libkey() { libkey=lib_symbols_$1 - patterns=[.+,-] + patterns=[.+,/-] replacement=_ while :; do case ${libkey} in @@ -44,11 +44,15 @@ list_libs= resolved_symbols= for lib in $(readelf -d $1 | awk '$2 ~ /\(?NEEDED\)?/ { sub(/\[/,,$NF); sub(/\]/,,$NF); print $NF }'); do echo -n checking if $lib is needed: - for libpair in ${ldd_libs}; do - case ${libpair} in - ${lib}:*) libpath=${libpair#*:} break ;; - esac - done + if [ -n ${lib##/*} ]; then + for libpair in ${ldd_libs}; do + case ${libpair} in + ${lib}:*) libpath=${libpair#*:} break ;; + esac + done + else + libpath=${lib} + fi list_libs=$list_libs $lib foundone= lib_symbols=$(nm -D --defined-only --format=posix ${libpath} | awk '$2 ~ /C|R|D|T|W|B|V/ {print $1}' | tr '\n' ' ') ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281809 - head/release/tools
Author: gjb Date: Tue Apr 21 02:49:44 2015 New Revision: 281809 URL: https://svnweb.freebsd.org/changeset/base/281809 Log: Simplify variable expansion in attempt to fix the vm-image build. Sponsored by: The FreeBSD Foundation Modified: head/release/tools/vmimage.subr Modified: head/release/tools/vmimage.subr == --- head/release/tools/vmimage.subr Tue Apr 21 02:02:25 2015 (r281808) +++ head/release/tools/vmimage.subr Tue Apr 21 02:49:44 2015 (r281809) @@ -14,9 +14,9 @@ write_partition_layout() { SWAPOPT=-p freebsd-swap/swapfs::1G fi - _OBJDIR=$(make -C ${WORLDDIR} -V .OBJDIR) - if [ -d ${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH} ]; then - BOOTFILES=${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}/usr/src/sys/boot + _OBJDIR=$(make -C ${WORLDDIR} -V .OBJDIR | tr -d '/usr/src') + if [ -d ${_OBJDIR}/${TARGET}.${TARGET_ARCH} ]; then + BOOTFILES=${_OBJDIR}/${TARGET}.${TARGET_ARCH}/usr/src/sys/boot else BOOTFILES=${_OBJDIR}/usr/src/sys/boot fi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281806 - in head: contrib/wpa contrib/wpa/hostapd contrib/wpa/hs20 contrib/wpa/patches contrib/wpa/src/ap contrib/wpa/src/common contrib/wpa/src/crypto contrib/wpa/src/drivers contrib/...
Author: rpaulo Date: Tue Apr 21 01:45:11 2015 New Revision: 281806 URL: https://svnweb.freebsd.org/changeset/base/281806 Log: Merge wpa_supplicant/hostapd 2.4. Major changes are: SAE, Suite B, RFC 7268, EAP-PKE, ACS, and tons of bug fixes. Relnotes: yes Added: head/contrib/wpa/CONTRIBUTIONS - copied unchanged from r281682, vendor/wpa/dist/CONTRIBUTIONS head/contrib/wpa/hostapd/hapd_module_tests.c - copied unchanged from r281682, vendor/wpa/dist/hostapd/hapd_module_tests.c head/contrib/wpa/hostapd/wps-ap-nfc.py - copied unchanged from r281682, vendor/wpa/dist/hostapd/wps-ap-nfc.py head/contrib/wpa/hs20/ - copied from r281682, vendor/wpa/dist/hs20/ head/contrib/wpa/patches/openssl-0.9.8za-tls-extensions.patch - copied unchanged from r281682, vendor/wpa/dist/patches/openssl-0.9.8za-tls-extensions.patch head/contrib/wpa/src/ap/acs.c - copied unchanged from r281682, vendor/wpa/dist/src/ap/acs.c head/contrib/wpa/src/ap/acs.h - copied unchanged from r281682, vendor/wpa/dist/src/ap/acs.h head/contrib/wpa/src/ap/bss_load.c - copied unchanged from r281682, vendor/wpa/dist/src/ap/bss_load.c head/contrib/wpa/src/ap/bss_load.h - copied unchanged from r281682, vendor/wpa/dist/src/ap/bss_load.h head/contrib/wpa/src/ap/dfs.c - copied unchanged from r281682, vendor/wpa/dist/src/ap/dfs.c head/contrib/wpa/src/ap/dfs.h - copied unchanged from r281682, vendor/wpa/dist/src/ap/dfs.h head/contrib/wpa/src/ap/dhcp_snoop.c - copied unchanged from r281682, vendor/wpa/dist/src/ap/dhcp_snoop.c head/contrib/wpa/src/ap/dhcp_snoop.h - copied unchanged from r281682, vendor/wpa/dist/src/ap/dhcp_snoop.h head/contrib/wpa/src/ap/ndisc_snoop.c - copied unchanged from r281682, vendor/wpa/dist/src/ap/ndisc_snoop.c head/contrib/wpa/src/ap/ndisc_snoop.h - copied unchanged from r281682, vendor/wpa/dist/src/ap/ndisc_snoop.h head/contrib/wpa/src/ap/x_snoop.c - copied unchanged from r281682, vendor/wpa/dist/src/ap/x_snoop.c head/contrib/wpa/src/ap/x_snoop.h - copied unchanged from r281682, vendor/wpa/dist/src/ap/x_snoop.h head/contrib/wpa/src/common/common_module_tests.c - copied unchanged from r281682, vendor/wpa/dist/src/common/common_module_tests.c head/contrib/wpa/src/common/hw_features_common.c - copied unchanged from r281682, vendor/wpa/dist/src/common/hw_features_common.c head/contrib/wpa/src/common/hw_features_common.h - copied unchanged from r281682, vendor/wpa/dist/src/common/hw_features_common.h head/contrib/wpa/src/common/ieee802_1x_defs.h - copied unchanged from r281682, vendor/wpa/dist/src/common/ieee802_1x_defs.h head/contrib/wpa/src/common/qca-vendor-attr.h - copied unchanged from r281682, vendor/wpa/dist/src/common/qca-vendor-attr.h head/contrib/wpa/src/common/qca-vendor.h - copied unchanged from r281682, vendor/wpa/dist/src/common/qca-vendor.h head/contrib/wpa/src/common/sae.c - copied unchanged from r281682, vendor/wpa/dist/src/common/sae.c head/contrib/wpa/src/common/sae.h - copied unchanged from r281682, vendor/wpa/dist/src/common/sae.h head/contrib/wpa/src/common/tnc.h - copied unchanged from r281682, vendor/wpa/dist/src/common/tnc.h head/contrib/wpa/src/common/wpa_helpers.c - copied unchanged from r281682, vendor/wpa/dist/src/common/wpa_helpers.c head/contrib/wpa/src/common/wpa_helpers.h - copied unchanged from r281682, vendor/wpa/dist/src/common/wpa_helpers.h head/contrib/wpa/src/crypto/aes-siv.c - copied unchanged from r281682, vendor/wpa/dist/src/crypto/aes-siv.c head/contrib/wpa/src/crypto/aes_siv.h - copied unchanged from r281682, vendor/wpa/dist/src/crypto/aes_siv.h head/contrib/wpa/src/crypto/crypto_module_tests.c - copied unchanged from r281682, vendor/wpa/dist/src/crypto/crypto_module_tests.c head/contrib/wpa/src/crypto/sha256-kdf.c - copied unchanged from r281682, vendor/wpa/dist/src/crypto/sha256-kdf.c head/contrib/wpa/src/crypto/sha384.h - copied unchanged from r281682, vendor/wpa/dist/src/crypto/sha384.h head/contrib/wpa/src/drivers/driver_macsec_qca.c - copied unchanged from r281682, vendor/wpa/dist/src/drivers/driver_macsec_qca.c head/contrib/wpa/src/drivers/driver_nl80211.h - copied unchanged from r281682, vendor/wpa/dist/src/drivers/driver_nl80211.h head/contrib/wpa/src/drivers/driver_nl80211_android.c - copied unchanged from r281682, vendor/wpa/dist/src/drivers/driver_nl80211_android.c head/contrib/wpa/src/drivers/driver_nl80211_capa.c - copied unchanged from r281682, vendor/wpa/dist/src/drivers/driver_nl80211_capa.c head/contrib/wpa/src/drivers/driver_nl80211_event.c - copied unchanged from r281682, vendor/wpa/dist/src/drivers/driver_nl80211_event.c head/contrib/wpa/src/drivers/driver_nl80211_monitor.c - copied unchanged from r281682, vendor/wpa/dist/src/drivers/driver_nl80211_monitor.c
svn commit: r281807 - head/usr.sbin/wpa
Author: rpaulo Date: Tue Apr 21 02:00:37 2015 New Revision: 281807 URL: https://svnweb.freebsd.org/changeset/base/281807 Log: Fix wpa/hostapd build without OpenSSL. Modified: head/usr.sbin/wpa/Makefile.crypto Modified: head/usr.sbin/wpa/Makefile.crypto == --- head/usr.sbin/wpa/Makefile.crypto Tue Apr 21 01:45:11 2015 (r281806) +++ head/usr.sbin/wpa/Makefile.crypto Tue Apr 21 02:00:37 2015 (r281807) @@ -53,7 +53,8 @@ SRCS+=tls_openssl.c .endif .if defined(CONFIG_INTERNAL_AES) -SRCS+= aes-internal.c \ +SRCS+= aes-unwrap.c aes-wrap.c \ + aes-internal.c \ aes-internal-dec.c \ aes-internal-enc.c .endif @@ -92,7 +93,7 @@ SRCS+=md4-internal.c .endif .if defined(CONFIG_INTERNAL_MD5) -SRCS+= md5-internal.c +SRCS+= md5.c md5-internal.c .endif .if defined(NEED_FIPS186_2_PRF) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281805 - head/tools/build
Author: bdrewery Date: Tue Apr 21 01:37:14 2015 New Revision: 281805 URL: https://svnweb.freebsd.org/changeset/base/281805 Log: Support demangling C++ symbols with -D flag. Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/check-links.sh Modified: head/tools/build/check-links.sh == --- head/tools/build/check-links.sh Tue Apr 21 01:09:53 2015 (r281804) +++ head/tools/build/check-links.sh Tue Apr 21 01:37:14 2015 (r281805) @@ -3,8 +3,10 @@ ret=0 CHECK_UNRESOLVED=1 -while getopts U flag; do +DEMANGLE= +while getopts DU flag; do case ${flag} in + D) DEMANGLE=-C ;; U) CHECK_UNRESOLVED=0 ;; esac done @@ -18,7 +20,7 @@ case $mime in esac # Gather all symbols from the target -unresolved_symbols=$(nm -D -u --format=posix $1 | awk '$2 == U {print $1}' | tr '\n' ' ') +unresolved_symbols=$(nm ${DEMANGLE} -D -u --format=posix $1 | awk '$2 == U {print $1}' | tr '\n' ' ') ldd_libs=$(ldd $1 | awk '{print $1 : $3}') libkey() { @@ -50,7 +52,7 @@ for lib in $(readelf -d $1 | awk '$2 ~ / done list_libs=$list_libs $lib foundone= - lib_symbols=$(nm -D --defined-only --format=posix ${libpath} | awk '$2 ~ /R|D|T|W|B|V/ {print $1}' | tr '\n' ' ') + lib_symbols=$(nm ${DEMANGLE} -D --defined-only --format=posix ${libpath} | awk '$2 ~ /R|D|T|W|B|V/ {print $1}' | tr '\n' ' ') if [ ${CHECK_UNRESOLVED} -eq 1 ]; then # Save the global symbols for this lib libkey ${lib} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281808 - head/tools/build
Author: bdrewery Date: Tue Apr 21 02:02:25 2015 New Revision: 281808 URL: https://svnweb.freebsd.org/changeset/base/281808 Log: Pass full path to ldd(1) so it works on files in cwd. Modified: head/tools/build/check-links.sh Modified: head/tools/build/check-links.sh == --- head/tools/build/check-links.sh Tue Apr 21 02:00:37 2015 (r281807) +++ head/tools/build/check-links.sh Tue Apr 21 02:02:25 2015 (r281808) @@ -21,7 +21,7 @@ esac # Gather all symbols from the target unresolved_symbols=$(nm ${DEMANGLE} -D -u --format=posix $1 | awk '$2 == U {print $1}' | tr '\n' ' ') -ldd_libs=$(ldd $1 | awk '{print $1 : $3}') +ldd_libs=$(ldd $(realpath $1) | awk '{print $1 : $3}') libkey() { libkey=lib_symbols_$1 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281812 - in head: contrib/bmake contrib/bmake/PSD.doc contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests
Author: sjg Date: Tue Apr 21 04:40:38 2015 New Revision: 281812 URL: https://svnweb.freebsd.org/changeset/base/281812 Log: Merge bmake-20150418 PR: 199486 Added: head/contrib/bmake/mk/cython.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/mk/cython.mk head/contrib/bmake/mk/manifest.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/mk/manifest.mk head/contrib/bmake/mk/mkopt.sh - copied unchanged from r281761, vendor/NetBSD/bmake/dist/mk/mkopt.sh head/contrib/bmake/mk/whats.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/mk/whats.mk head/contrib/bmake/unit-tests/comment.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/comment.exp head/contrib/bmake/unit-tests/comment.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/comment.mk head/contrib/bmake/unit-tests/cond1.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/cond1.exp head/contrib/bmake/unit-tests/cond1.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/cond1.mk head/contrib/bmake/unit-tests/doterror.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/doterror.exp head/contrib/bmake/unit-tests/doterror.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/doterror.mk head/contrib/bmake/unit-tests/dotwait.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/dotwait.exp head/contrib/bmake/unit-tests/dotwait.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/dotwait.mk head/contrib/bmake/unit-tests/error.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/error.exp head/contrib/bmake/unit-tests/error.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/error.mk head/contrib/bmake/unit-tests/escape.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/escape.exp head/contrib/bmake/unit-tests/escape.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/escape.mk head/contrib/bmake/unit-tests/export-all.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/export-all.exp head/contrib/bmake/unit-tests/export-all.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/export-all.mk head/contrib/bmake/unit-tests/export-env.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/export-env.exp head/contrib/bmake/unit-tests/export-env.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/export-env.mk head/contrib/bmake/unit-tests/export.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/export.exp head/contrib/bmake/unit-tests/export.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/export.mk head/contrib/bmake/unit-tests/forloop.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/forloop.exp head/contrib/bmake/unit-tests/forloop.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/forloop.mk head/contrib/bmake/unit-tests/forsubst.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/forsubst.exp head/contrib/bmake/unit-tests/forsubst.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/forsubst.mk head/contrib/bmake/unit-tests/hash.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/hash.exp head/contrib/bmake/unit-tests/hash.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/hash.mk head/contrib/bmake/unit-tests/impsrc.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/impsrc.exp head/contrib/bmake/unit-tests/impsrc.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/impsrc.mk head/contrib/bmake/unit-tests/misc.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/misc.exp head/contrib/bmake/unit-tests/misc.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/misc.mk head/contrib/bmake/unit-tests/moderrs.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/moderrs.exp head/contrib/bmake/unit-tests/moderrs.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/moderrs.mk head/contrib/bmake/unit-tests/modmatch.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/modmatch.exp head/contrib/bmake/unit-tests/modmatch.mk - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/modmatch.mk head/contrib/bmake/unit-tests/modmisc.exp - copied unchanged from r281761, vendor/NetBSD/bmake/dist/unit-tests/modmisc.exp head/contrib/bmake/unit-tests/modmisc.mk - copied unchanged from r281761,
svn commit: r281811 - head/tools/build
Author: bdrewery Date: Tue Apr 21 03:29:03 2015 New Revision: 281811 URL: https://svnweb.freebsd.org/changeset/base/281811 Log: - For executables search for matching (B) global uninitialized BSS symbols from linked libraries. Only do this for BSS symbols that have a size which avoids __bss_start. Without this some libraries would be considered unneeded even though they were providing a B symbol. - Add in the symbols from crt1.o to cover a handful of common unresolved symbols. - Consider (C) common data symbols as provided by libraries/crt1. - Move libkey() function to more appropriate place. Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/check-links.sh Modified: head/tools/build/check-links.sh == --- head/tools/build/check-links.sh Tue Apr 21 03:06:58 2015 (r281810) +++ head/tools/build/check-links.sh Tue Apr 21 03:29:03 2015 (r281811) @@ -1,6 +1,23 @@ #!/bin/sh # $FreeBSD$ +libkey() { + libkey=lib_symbols_$1 + patterns=[.+,-] + replacement=_ + while :; do + case ${libkey} in + *${patterns}*) + libkey=${libkey%%${patterns}*}${replacement}${libkey#*${patterns}} + ;; + *) + break + ;; + esac + done + return 0 +} + ret=0 CHECK_UNRESOLVED=1 while getopts U flag; do @@ -11,33 +28,17 @@ done shift $((OPTIND-1)) mime=$(file -L --mime-type $1) +isbin=0 case $mime in -*application/x-executable);; +*application/x-executable) isbin=1 ;; *application/x-sharedlib);; *) echo Not an elf file 2 ; exit 1;; esac # Gather all symbols from the target -unresolved_symbols=$(nm -D -u --format=posix $1 | awk '$2 == U {print $1}' | tr '\n' ' ') +unresolved_symbols=$(nm -D --format=posix $1 | awk -v isbin=${isbin} '$2 == U || ($2 == B $4 != isbin == 1) {print $1}' | tr '\n' ' ') ldd_libs=$(ldd $(realpath $1) | awk '{print $1 : $3}') -libkey() { - libkey=lib_symbols_$1 - patterns=[.+,-] - replacement=_ - while :; do - case ${libkey} in - *${patterns}*) - libkey=${libkey%%${patterns}*}${replacement}${libkey#*${patterns}} - ;; - *) - break - ;; - esac - done - return 0 -} - # Check for useful libs list_libs= resolved_symbols= @@ -50,11 +51,11 @@ for lib in $(readelf -d $1 | awk '$2 ~ / done list_libs=$list_libs $lib foundone= - lib_symbols=$(nm -D --defined-only --format=posix ${libpath} | awk '$2 ~ /R|D|T|W|B|V/ {print $1}' | tr '\n' ' ') + lib_symbols=$(nm -D --defined-only --format=posix ${libpath} | awk '$2 ~ /C|R|D|T|W|B|V/ {print $1}' | tr '\n' ' ') if [ ${CHECK_UNRESOLVED} -eq 1 ]; then # Save the global symbols for this lib libkey ${lib} - setvar ${libkey} ${lib_symbols} + setvar ${libkey} ${lib_symbols} fi for fct in ${lib_symbols}; do case ${unresolved_symbols} in @@ -70,6 +71,14 @@ for lib in $(readelf -d $1 | awk '$2 ~ / done if [ ${CHECK_UNRESOLVED} -eq 1 ]; then + # Add in crt1 symbols + list_libs=${list_libs} crt1.o + lib_symbols=$(nm --defined-only --format=posix /usr/lib/crt1.o | awk '$2 ~ /C|R|D|T|W|B|V/ {print $1}' | tr '\n' ' ') + # Save the global symbols for this lib + libkey crt1.o + setvar ${libkey} ${lib_symbols} + + # No search libs for all symbols and report missing ones. for sym in ${unresolved_symbols}; do found=0 for lib in ${list_libs}; do ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281814 - head/tools/build
Author: bdrewery Date: Tue Apr 21 05:41:56 2015 New Revision: 281814 URL: https://svnweb.freebsd.org/changeset/base/281814 Log: Tweak BSS symbol handling from r281811 to not consider them unresolved Modified: head/tools/build/check-links.sh Modified: head/tools/build/check-links.sh == --- head/tools/build/check-links.sh Tue Apr 21 05:10:18 2015 (r281813) +++ head/tools/build/check-links.sh Tue Apr 21 05:41:56 2015 (r281814) @@ -36,7 +36,8 @@ case $mime in esac # Gather all symbols from the target -unresolved_symbols=$(nm -D --format=posix $1 | awk -v isbin=${isbin} '$2 == U || ($2 == B $4 != isbin == 1) {print $1}' | tr '\n' ' ') +unresolved_symbols=$(nm -u -D --format=posix $1 | awk '$2 == U {print $1}' | tr '\n' ' ') +[ ${isbin} -eq 1 ] bss_symbols=$(nm -D --format=posix $1 | awk '$2 == B $4 != {print $1}' | tr '\n' ' ') ldd_libs=$(ldd $(realpath $1) | awk '{print $1 : $3}') # Check for useful libs @@ -62,7 +63,7 @@ for lib in $(readelf -d $1 | awk '$2 ~ / setvar ${libkey} ${lib_symbols} fi for fct in ${lib_symbols}; do - case ${unresolved_symbols} in + case ${unresolved_symbols} ${bss_symbols} in *\ ${fct}\ *) foundone=${fct} break ;; esac done ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r281758 - head/bin/ed
On Mon, 20 Apr 2015, Eitan Adler wrote: On 19 April 2015 at 21:23, Bruce Evans b...@optusnet.com.au wrote: On Mon, 20 Apr 2015, Eitan Adler wrote: ... --- head/bin/ed/glbl.c Mon Apr 20 00:24:32 2015(r281757) +++ head/bin/ed/glbl.c Mon Apr 20 02:07:57 2015(r281758) @@ -60,7 +60,7 @@ build_active_list(int isgcmd) return ERR; if (isbinary) NUL_TO_NEWLINE(s, lp-len); - if (!regexec(pat, s, 0, NULL, 0) == isgcmd + if (!(regexec(pat, s, 0, NULL, 0) == isgcmd) set_active_node(lp) 0) return ERR; } How can this be right? !(a == b) is an obfuscated way of writing a != b. bah! How does something like the following look? Sorry, not good. I don't like stdbool. Here using it just enlarges and unportablize the code. Index: ed.h === --- ed.h(revision 281759) +++ ed.h(working copy) @@ -33,6 +33,7 @@ #include limits.h #include regex.h #include signal.h +#include stdbool.h #include stdio.h #include stdlib.h #include string.h ed already has bad style, with *.h included in ed.h... @@ -191,7 +192,7 @@ int put_des_char(int, FILE *); void add_line_node(line_t *); int append_lines(long); int apply_subst_template(const char *, regmatch_t *, int, int); -int build_active_list(int); +int build_active_list(bool); It would be impossible to even declare a function that uses bool in a header without increasing the pollution. Actually, this is easy in C99 and only difficult to do portably. _Bool is standard in C99, so the include is only needed for portability to systems that have stdbool.h but not _Bool, or if you want to spell _Bool as bool in C99. The header (and program) otherwise doesn't use many fancy types. int cbc_decode(unsigned char *, FILE *); int cbc_encode(unsigned char *, int, FILE *); int check_addr_range(long, long); It does use FILE. That requires the stdio.h pollution. Index: glbl.c === --- glbl.c(revision 281759) +++ glbl.c(working copy) @@ -60,7 +60,7 @@ int return ERR; if (isbinary) NUL_TO_NEWLINE(s, lp-len); -if (!(regexec(pat, s, 0, NULL, 0) == isgcmd) +if ((!regexec(pat, s, 0, NULL, 0)) == isgcmd set_active_node(lp) 0) return ERR; } This still has the obfuscation of using ! on a non-boolean, and then needs excessive parentheses to defeat the compiler warning about (a side effect of) this. Parentheses are needed for syntactical reasons in the non-obfuscated version: if ((regexec(pat, s, 0, NULL, 0) == 0) == isgcmd This depends on the value of isgcmd being 0 or 1. It obviously is, but we have to examine all the callers (just 1) to see this. The bool declaration lets the compiler ensure this. You can ensure it directly replacing isgcmd by (isgcmd != 0). Maybe I wouldn't object to using bool if you rewrote ed to use it in all places that use booleans. ed doesn't seem to have many such places. It uses the variable int gflag a lot. gflag contains 5 flags. These are essentially packed booleans. It would be silly to use booleans for the easy case of 1 truth value while continuing to use ints for more complicated cases, but I think that if you translate the complicated cases to use booleans then they would be even more complicated. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r280279 - head/sys/sys
On Mon, Apr 13, 2015 at 04:04:45PM -0400, Jung-uk Kim wrote: Please try the attached patch. Jung-uk Kim -BEGIN PGP SIGNATURE- Version: GnuPG v2 iQEcBAEBCAAGBQJVLCFZAAoJEHyflib82/FGOp0H/1+Jr+cKUn/MnV5O5SghPw9f XzTM4+BV9BcWabLRjFe1LR065SfLDXqKLuU4h5lmVSlXQaxElAXxaMeyO3mrMzR4 Sb1xr0rf+ZfUARJeEJWI65Wpn+gEH+7XxXAIAetYGMwwclBOBgbZIoDXITnCaUFa /pi3zQIey8EzbvlzhQcffLDV8oF4f8HNEMoSxMRtOiZNNPu/8ECnyGeHZhOd++kh pwZNsSbcCw3RXMheuErTpKPrJSEXgMNmWG3G00aP7L8IjcObgOqMUQt+8eT8Ge8B tEv40kgm2G/OG2akONh4/6bX3hyodW3IHcb6AYhqZogiDIqd/eXD4jDup/kkVxU= =1Ca9 -END PGP SIGNATURE- Index: sys/amd64/amd64/pmap.c === --- sys/amd64/amd64/pmap.c(revision 281496) +++ sys/amd64/amd64/pmap.c(working copy) @@ -412,7 +412,7 @@ static caddr_t crashdumpmap; static void free_pv_chunk(struct pv_chunk *pc); static void free_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); -static int popcnt_pc_map_elem_pq(uint64_t elem); +static int popcnt_pc_map(uint64_t *pc_map); static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); static void reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp); @@ -2979,7 +2979,7 @@ retry: } /* - * Returns the number of one bits within the given PV chunk map element. + * Returns the number of one bits within the given PV chunk map. * * The erratas for Intel processors state that POPCNT Instruction May * Take Longer to Execute Than Expected. It is believed that the @@ -2994,12 +2994,21 @@ retry: * 5th Gen Core: BDM85 */ static int -popcnt_pc_map_elem_pq(uint64_t elem) +popcnt_pc_map(uint64_t *pc_map) { - u_long result; + u_long count, result; + int field; - __asm __volatile(xorl %k0,%k0;popcntq %1,%0 - : =r (result) : rm (elem)); + result = 0; + if ((cpu_feature2 CPUID2_POPCNT) != 0) + for (field = 0; field _NPCM; field++) { + __asm __volatile(xorl %k0, %k0; popcntq %1, %0 + : =r (count) : m (pc_map[field])); + result += count; + } + else + for (field = 0; field _NPCM; field++) + result += bitcount64(pc_map[field]); return (result); } @@ -3031,15 +3040,7 @@ reserve_pv_entries(pmap_t pmap, int needed, struct retry: avail = 0; TAILQ_FOREACH(pc, pmap-pm_pvchunk, pc_list) { - if ((cpu_feature2 CPUID2_POPCNT) == 0) { - free = bitcount64(pc-pc_map[0]); - free += bitcount64(pc-pc_map[1]); - free += bitcount64(pc-pc_map[2]); - } else { - free = popcnt_pc_map_elem_pq(pc-pc_map[0]); - free += popcnt_pc_map_elem_pq(pc-pc_map[1]); - free += popcnt_pc_map_elem_pq(pc-pc_map[2]); - } + free = popcnt_pc_map(pc-pc_map); if (free == 0) break; avail += free; Yes, this worked for me the same way as for you, the argument is taken directly from memory, without temporary spill. Is this due to silly inliner ? Whatever the reason is, I think a comment should be added noting the subtlety. Otherwise, looks fine. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281763 - head/lib/libc/gen
Author: kib Date: Mon Apr 20 09:07:12 2015 New Revision: 281763 URL: https://svnweb.freebsd.org/changeset/base/281763 Log: Remove code to support the top of the stack layout for FreeBSD 1.x/2.x kernel, but keep explanation of the old ps_strings structure to make it clear what sanity check tries to accomplish. Noted by: Oliver Pinter oliver.pin...@hardenedbsd.org Sponsored by: The FreeBSD Foundation MFC after:2 weeks Modified: head/lib/libc/gen/setproctitle.c Modified: head/lib/libc/gen/setproctitle.c == --- head/lib/libc/gen/setproctitle.cMon Apr 20 08:25:55 2015 (r281762) +++ head/lib/libc/gen/setproctitle.cMon Apr 20 09:07:12 2015 (r281763) @@ -42,9 +42,10 @@ __FBSDID($FreeBSD$); * 1: old_ps_strings at the very top of the stack. * 2: old_ps_strings at SPARE_USRSPACE below the top of the stack. * 3: ps_strings at the very top of the stack. - * This attempts to support a kernel built in the #2 and #3 era. - */ - + * We only support a kernel providing #3 style ps_strings. + * + * For historical purposes, a definition of the old ps_strings structure + * and location is preserved below: struct old_ps_strings { char*old_ps_argvstr; int old_ps_nargvstr; @@ -53,6 +54,7 @@ struct old_ps_strings { }; #defineOLD_PS_STRINGS ((struct old_ps_strings *) \ (USRSTACK - SPARE_USRSPACE - sizeof(struct old_ps_strings))) + */ #include stdarg.h @@ -136,41 +138,38 @@ setproctitle(const char *fmt, ...) ps_strings = (struct ps_strings *)ul_ps_strings; } - /* PS_STRINGS points to zeroed memory on a style #2 kernel */ - if (ps_strings-ps_argvstr) { - /* style #3 */ - if (oargc == -1) { - /* Record our original args */ - oargc = ps_strings-ps_nargvstr; - oargv = ps_strings-ps_argvstr; - for (i = len = 0; i oargc; i++) { - /* -* The program may have scribbled into its -* argv array, e.g., to remove some arguments. -* If that has happened, break out before -* trying to call strlen on a NULL pointer. -*/ - if (oargv[i] == NULL) { - oargc = i; - break; - } - snprintf(obuf + len, SPT_BUFSIZE - len, %s%s, - len ? : , oargv[i]); - if (len) - len++; - len += strlen(oargv[i]); - if (len = SPT_BUFSIZE) - break; + /* +* PS_STRINGS points to zeroed memory on a style #2 kernel. +* Should not happen. +*/ + if (ps_strings-ps_argvstr == NULL) + return; + + /* style #3 */ + if (oargc == -1) { + /* Record our original args */ + oargc = ps_strings-ps_nargvstr; + oargv = ps_strings-ps_argvstr; + for (i = len = 0; i oargc; i++) { + /* +* The program may have scribbled into its +* argv array, e.g., to remove some arguments. +* If that has happened, break out before +* trying to call strlen on a NULL pointer. +*/ + if (oargv[i] == NULL) { + oargc = i; + break; } + snprintf(obuf + len, SPT_BUFSIZE - len, %s%s, + len != 0 ? : , oargv[i]); + if (len != 0) + len++; + len += strlen(oargv[i]); + if (len = SPT_BUFSIZE) + break; } - ps_strings-ps_nargvstr = nargc; - ps_strings-ps_argvstr = nargvp; - } else { - /* style #2 - we can only restore our first arg :-( */ - if (*obuf == '\0') - strncpy(obuf, OLD_PS_STRINGS-old_ps_argvstr, - SPT_BUFSIZE - 1); - OLD_PS_STRINGS-old_ps_nargvstr = 1; - OLD_PS_STRINGS-old_ps_argvstr = nargvp[0]; } + ps_strings-ps_nargvstr = nargc; + ps_strings-ps_argvstr = nargvp; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to
svn commit: r281765 - head/sys/net
Author: mav Date: Mon Apr 20 10:44:46 2015 New Revision: 281765 URL: https://svnweb.freebsd.org/changeset/base/281765 Log: Activate write-only optimization if bpf device opened with O_WRONLY. dhclient opens bpf as write-only to send packets. It never reads received packets from that descriptor, but processing them in kernel takes time. Especially much time takes packet timestamping on systems with expensive timecounter, such as bhyve guest, where network speed dropped in half. MFC after:2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c == --- head/sys/net/bpf.c Mon Apr 20 10:29:42 2015(r281764) +++ head/sys/net/bpf.c Mon Apr 20 10:44:46 2015(r281765) @@ -601,7 +601,7 @@ bpf_attachd(struct bpf_d *d, struct bpf_ * Save sysctl value to protect from sysctl change * between reads */ - op_w = V_bpf_optimize_writers; + op_w = V_bpf_optimize_writers || d-bd_writer; if (d-bd_bif != NULL) bpf_detachd_locked(d); @@ -864,6 +864,8 @@ bpfopen(struct cdev *dev, int flags, int * particular buffer method. */ bpf_buffer_init(d); + if ((flags FREAD) == 0) + d-bd_writer = 2; d-bd_hbuf_in_use = 0; d-bd_bufmode = BPF_BUFMODE_BUFFER; d-bd_sig = SIGIO; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281762 - in head/sys: amd64/amd64 i386/i386
Author: kib Date: Mon Apr 20 08:25:55 2015 New Revision: 281762 URL: https://svnweb.freebsd.org/changeset/base/281762 Log: Remove duplicate definitions of MWAIT_CX hints. Identical defines in specialreg.h are enough. Discussed with: mav Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c == --- head/sys/amd64/amd64/machdep.c Mon Apr 20 03:46:52 2015 (r281761) +++ head/sys/amd64/amd64/machdep.c Mon Apr 20 08:25:55 2015 (r281762) @@ -730,15 +730,6 @@ cpu_idle_hlt(sbintime_t sbt) *state = STATE_RUNNING; } -/* - * MWAIT cpu power states. Lower 4 bits are sub-states. - */ -#defineMWAIT_C00xf0 -#defineMWAIT_C10x00 -#defineMWAIT_C20x10 -#defineMWAIT_C30x20 -#defineMWAIT_C40x30 - static void cpu_idle_mwait(sbintime_t sbt) { Modified: head/sys/i386/i386/machdep.c == --- head/sys/i386/i386/machdep.cMon Apr 20 03:46:52 2015 (r281761) +++ head/sys/i386/i386/machdep.cMon Apr 20 08:25:55 2015 (r281762) @@ -1361,15 +1361,6 @@ cpu_idle_hlt(sbintime_t sbt) } #endif -/* - * MWAIT cpu power states. Lower 4 bits are sub-states. - */ -#defineMWAIT_C00xf0 -#defineMWAIT_C10x00 -#defineMWAIT_C20x10 -#defineMWAIT_C30x20 -#defineMWAIT_C40x30 - static void cpu_idle_mwait(sbintime_t sbt) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281764 - head/usr.sbin/bhyve
Author: mav Date: Mon Apr 20 10:29:42 2015 New Revision: 281764 URL: https://svnweb.freebsd.org/changeset/base/281764 Log: Disable RX/TX queues notifications when not needed. This reduces CPU load and doubles iperf throughput, reaching 2-3Gbit/s. MFC after:2 weeks Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c == --- head/usr.sbin/bhyve/pci_virtio_net.cMon Apr 20 09:07:12 2015 (r281763) +++ head/usr.sbin/bhyve/pci_virtio_net.cMon Apr 20 10:29:42 2015 (r281764) @@ -393,6 +393,7 @@ pci_vtnet_ping_rxq(void *vsc, struct vqu */ if (sc-vsc_rx_ready == 0) { sc-vsc_rx_ready = 1; + vq-vq_used-vu_flags |= VRING_USED_F_NO_NOTIFY; } } @@ -438,6 +439,7 @@ pci_vtnet_ping_txq(void *vsc, struct vqu /* Signal the tx thread for processing */ pthread_mutex_lock(sc-tx_mtx); + vq-vq_used-vu_flags |= VRING_USED_F_NO_NOTIFY; if (sc-tx_in_progress == 0) pthread_cond_signal(sc-tx_cond); pthread_mutex_unlock(sc-tx_mtx); @@ -466,6 +468,7 @@ pci_vtnet_tx_thread(void *param) for (;;) { /* note - tx mutex is locked here */ do { + vq-vq_used-vu_flags = ~VRING_USED_F_NO_NOTIFY; if (sc-resetting) have_work = 0; else @@ -478,6 +481,7 @@ pci_vtnet_tx_thread(void *param) assert(error == 0); } } while (!have_work); + vq-vq_used-vu_flags |= VRING_USED_F_NO_NOTIFY; sc-tx_in_progress = 1; pthread_mutex_unlock(sc-tx_mtx); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r280279 - head/sys/sys
On Mon, 20 Apr 2015, Konstantin Belousov wrote: On Mon, Apr 13, 2015 at 04:04:45PM -0400, Jung-uk Kim wrote: Please try the attached patch. Index: sys/amd64/amd64/pmap.c === --- sys/amd64/amd64/pmap.c (revision 281496) +++ sys/amd64/amd64/pmap.c (working copy) @@ -412,7 +412,7 @@ static caddr_t crashdumpmap; static voidfree_pv_chunk(struct pv_chunk *pc); static voidfree_pv_entry(pmap_t pmap, pv_entry_t pv); static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp); -static int popcnt_pc_map_elem_pq(uint64_t elem); +static int popcnt_pc_map(uint64_t *pc_map); static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); static voidreserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp); @@ -2979,7 +2979,7 @@ retry: } /* - * Returns the number of one bits within the given PV chunk map element. + * Returns the number of one bits within the given PV chunk map. * * The erratas for Intel processors state that POPCNT Instruction May * Take Longer to Execute Than Expected. It is believed that the @@ -2994,12 +2994,21 @@ retry: * 5th Gen Core: BDM85 */ static int -popcnt_pc_map_elem_pq(uint64_t elem) +popcnt_pc_map(uint64_t *pc_map) { - u_long result; + u_long count, result; + int field; - __asm __volatile(xorl %k0,%k0;popcntq %1,%0 - : =r (result) : rm (elem)); + result = 0; + if ((cpu_feature2 CPUID2_POPCNT) != 0) + for (field = 0; field _NPCM; field++) { + __asm __volatile(xorl %k0, %k0; popcntq %1, %0 + : =r (count) : m (pc_map[field])); + result += count; + } + else + for (field = 0; field _NPCM; field++) + result += bitcount64(pc_map[field]); return (result); } @@ -3031,15 +3040,7 @@ reserve_pv_entries(pmap_t pmap, int needed, struct retry: avail = 0; TAILQ_FOREACH(pc, pmap-pm_pvchunk, pc_list) { - if ((cpu_feature2 CPUID2_POPCNT) == 0) { - free = bitcount64(pc-pc_map[0]); - free += bitcount64(pc-pc_map[1]); - free += bitcount64(pc-pc_map[2]); - } else { - free = popcnt_pc_map_elem_pq(pc-pc_map[0]); - free += popcnt_pc_map_elem_pq(pc-pc_map[1]); - free += popcnt_pc_map_elem_pq(pc-pc_map[2]); - } + free = popcnt_pc_map(pc-pc_map); if (free == 0) break; avail += free; Yes, this worked for me the same way as for you, the argument is taken directly from memory, without temporary spill. Is this due to silly inliner ? Whatever the reason is, I think a comment should be added noting the subtlety. Otherwise, looks fine. Erm, this looks silly. It apparently works by making things too complicated for the compiler to optimize (where one of the optimizations actually gives pessimal spills). Its main changes are: - change the constraint from rm to m. This alone is not enough to get the compiler to use the natural memory operands without a trip through a register - un-unroll a loop. This alone makes no difference in my simpler test environment. The compiler un-un-unrolls. (The compiler also inlines all the static function whether asked to or not. gcc shouldn't do this inlining for the 3 calls, and gcc -fno-inline-functions-called-once would never do it. clang is missing support for -fno-inline-functions- called-once, and gcc48 vanished with a recent upgrade on freefall, so I couldn't test this case easily. -fno-inline-functions-called-once should be the default for kernels. - some other changes apparently confused clang into doing the right thing. It works better to change the constraint to r: X #include sys/types.h X X static __inline u_long X popcntq(u_long mask) X { X u_long result; X X __asm __volatile(xorl %k0,%k0; popcntq %1,%0 : X =r (result) : r (mask)); X return (result); X } X X u_long x[3]; X X int X test(void) X { X return (popcntq(x[0]) + popcntq(x[1]) + popcntq(x[2])); X } X ... X .cfi_startproc X # BB#0: # %entry X pushq %rbp X .Ltmp0: X .cfi_def_cfa_offset 16 X .Ltmp1: X .cfi_offset %rbp, -16 X movq%rsp, %rbp X .Ltmp2: X .cfi_def_cfa_register %rbp X movqx(%rip), %rax X #APP X xorl%ecx, %ecx X popcntq %rax, %rcx X #NO_APP X movqx+8(%rip), %rax X #APP X xorl%edx, %edx X popcntq %rax, %rdx X #NO_APP X addl%ecx, %edx X movqx+16(%rip), %rcx X #APP X xorl%eax, %eax X popcntq %rcx, %rax X #NO_APP X addl%edx,
svn commit: r281766 - head/usr.sbin/bhyve
Author: mav Date: Mon Apr 20 14:23:18 2015 New Revision: 281766 URL: https://svnweb.freebsd.org/changeset/base/281766 Log: Report link as up only if we managed to open tap device. It would be cool to report tap device status, but it has no such API. MFC after:2 weeks Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c == --- head/usr.sbin/bhyve/pci_virtio_net.cMon Apr 20 10:44:46 2015 (r281765) +++ head/usr.sbin/bhyve/pci_virtio_net.cMon Apr 20 14:23:18 2015 (r281766) @@ -644,8 +644,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_NETWORK); pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_NET); - /* link always up */ - sc-vsc_config.status = 1; + /* Link is up if we managed to open tap device. */ + sc-vsc_config.status = (sc-vsc_tapfd = 0); /* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */ if (vi_intr_init(sc-vsc_vs, 1, fbsdrun_virtio_msix())) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281767 - head/usr.sbin/bhyve
Author: mav Date: Mon Apr 20 14:55:01 2015 New Revision: 281767 URL: https://svnweb.freebsd.org/changeset/base/281767 Log: Report link as up if tap device is not specified (black hole). MFC after:2 weeks Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c == --- head/usr.sbin/bhyve/pci_virtio_net.cMon Apr 20 14:23:18 2015 (r281766) +++ head/usr.sbin/bhyve/pci_virtio_net.cMon Apr 20 14:55:01 2015 (r281767) @@ -645,7 +645,7 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_NET); /* Link is up if we managed to open tap device. */ - sc-vsc_config.status = (sc-vsc_tapfd = 0); + sc-vsc_config.status = (opts == NULL || sc-vsc_tapfd = 0); /* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */ if (vi_intr_init(sc-vsc_vs, 1, fbsdrun_virtio_msix())) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r280279 - head/sys/sys
On Tue, 21 Apr 2015, Bruce Evans wrote: On Mon, 20 Apr 2015, Konstantin Belousov wrote: On Mon, Apr 13, 2015 at 04:04:45PM -0400, Jung-uk Kim wrote: Please try the attached patch. ... - __asm __volatile(xorl %k0,%k0;popcntq %1,%0 - : =r (result) : rm (elem)); ... + __asm __volatile(xorl %k0, %k0; popcntq %1, %0 + : =r (count) : m (pc_map[field])); ... Yes, this worked for me the same way as for you, the argument is taken directly from memory, without temporary spill. Is this due to silly inliner ? Whatever the reason is, I think a comment should be added noting the subtlety. Otherwise, looks fine. Erm, this looks silly. It apparently works by making things too complicated for the compiler to optimize (where one of the optimizations actually gives pessimal spills). Its main changes are: ... It works better to change the constraint to r: It's even sillier than that. The problem is not limited to this function. clang seems to prefer memory whenever you use the rm constraint. The silliest case is when you have a chain of simple asm functions. Say the original popcntq (without the xorl): return (popcntq(popcntq(popcntq(popcntq(popcntq(x)); gcc compiles this to 5 sequential popcntq instructions, but clang spills the results of the first 4. This is an old bug. clang does this on FreeBSD[9-11]. cc does this on FreeBSD[10-11] (not on FreeBSD-9 since cc = gcc there. Asms should always use rm if m works. Ones in cpufunc.h always do except for lidt(), lldt() and ltr(). These 3 are fixed in my version. So cpufunc.h almost always asks for the pessimization. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281774 - head/sys/dev/xen/netfront
Author: araujo (ports committer) Date: Mon Apr 20 17:30:13 2015 New Revision: 281774 URL: https://svnweb.freebsd.org/changeset/base/281774 Log: Remove unused variable. Differential Revision:D2333 Reviewed by: royger Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c == --- head/sys/dev/xen/netfront/netfront.cMon Apr 20 17:24:39 2015 (r281773) +++ head/sys/dev/xen/netfront/netfront.cMon Apr 20 17:30:13 2015 (r281774) @@ -1472,7 +1472,6 @@ xn_assemble_tx_request(struct netfront_i struct ifnet *ifp; struct mbuf *m; u_int nfrags; - netif_extra_info_t *extra; int otherend_id; ifp = sc-xn_ifp; @@ -1546,7 +1545,6 @@ xn_assemble_tx_request(struct netfront_i * of fragments or hit the end of the mbuf chain. */ m = m_head; - extra = NULL; otherend_id = xenbus_get_otherend_id(sc-xbdev); for (m = m_head; m; m = m-m_next) { netif_tx_request_t *tx; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281780 - head/usr.sbin/sysrc
Author: dteske Date: Mon Apr 20 17:46:09 2015 New Revision: 281780 URL: https://svnweb.freebsd.org/changeset/base/281780 Log: Update usage statement to align with post-r279624 functionality. MFC after:3 days X-MFC-to: stable/10 stable/9 Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc == --- head/usr.sbin/sysrc/sysrc Mon Apr 20 17:43:55 2015(r281779) +++ head/usr.sbin/sysrc/sysrc Mon Apr 20 17:46:09 2015(r281780) @@ -80,7 +80,7 @@ die() # usage() { - f_err Usage: %s [OPTIONS] name[[+]=value] ...\n $pgm + f_err Usage: %s [OPTIONS] name[[+|-]=value] ...\n $pgm f_err Try \`%s --help' for more information.\n $pgm die } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281775 - head/contrib/llvm/lib/MC/MCParser
Author: dim Date: Mon Apr 20 17:36:35 2015 New Revision: 281775 URL: https://svnweb.freebsd.org/changeset/base/281775 Log: Pull in r229911 from upstream llvm trunk (by Benjamin Kramer): MC: Allow multiple comma-separated expressions on the .uleb128 directive. For compatiblity with GNU as. Binutils documents this as '.uleb128 expressions'. Subtle, isn't it? Reported by: sbruno PR: 199554 MFC after:3 days Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Modified: head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp == --- head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Mon Apr 20 17:30:13 2015(r281774) +++ head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp Mon Apr 20 17:36:35 2015(r281775) @@ -3636,21 +3636,27 @@ bool AsmParser::parseDirectiveSpace(Stri } /// parseDirectiveLEB128 -/// ::= (.sleb128 | .uleb128) expression +/// ::= (.sleb128 | .uleb128) [ expression (, expression)* ] bool AsmParser::parseDirectiveLEB128(bool Signed) { checkForValidSection(); const MCExpr *Value; - if (parseExpression(Value)) -return true; + for (;;) { +if (parseExpression(Value)) + return true; - if (getLexer().isNot(AsmToken::EndOfStatement)) -return TokError(unexpected token in directive); +if (Signed) + getStreamer().EmitSLEB128Value(Value); +else + getStreamer().EmitULEB128Value(Value); - if (Signed) -getStreamer().EmitSLEB128Value(Value); - else -getStreamer().EmitULEB128Value(Value); +if (getLexer().is(AsmToken::EndOfStatement)) + break; + +if (getLexer().isNot(AsmToken::Comma)) + return TokError(unexpected token in directive); +Lex(); + } return false; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r281721 - head/sys/sys
On Mon, 20 Apr 2015, John Baldwin wrote: On Sunday, April 19, 2015 12:33:22 AM Justin Hibbits wrote: Log: Fix the build. Commit the last part of e500 PMC. ... @@ -136,6 +138,7 @@ enum pmc_cputype { __PMC_CLASS(MIPS74K)/* MIPS 74K */ \ __PMC_CLASS(PPC7450)/* Motorola MPC7450 class */\ __PMC_CLASS(PPC970) /* IBM PowerPC 970 class */ \ + __PMC_CLASS(E500) /* Freescale e500 class */ \ __PMC_CLASS(SOFT) /* Software events */ Note that each time a PMC_CLASS is added, the ABI for pmccontrol -L breaks since the enum value of the SOFT class changes. We should perhaps fix the value of SOFT to make this less painful (just as we fix the values for PMC_CPU so that those don't change). Enums should never be used in ABIs, since their size can be anything large enough. They also cause namespace problems. The whole enum declaration must be exposed in any header that uses an enum type. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281769 - head/sys/geom/uncompress
Author: pfg Date: Mon Apr 20 16:31:27 2015 New Revision: 281769 URL: https://svnweb.freebsd.org/changeset/base/281769 Log: g_uncompress_taste: prevent a double free. Found by: Clang Static Analyzer MFC after:1 week Modified: head/sys/geom/uncompress/g_uncompress.c Modified: head/sys/geom/uncompress/g_uncompress.c == --- head/sys/geom/uncompress/g_uncompress.c Mon Apr 20 16:23:59 2015 (r281768) +++ head/sys/geom/uncompress/g_uncompress.c Mon Apr 20 16:31:27 2015 (r281769) @@ -571,6 +571,7 @@ g_uncompress_taste(struct g_class *mp, s (buf+sizeof(struct cloop_header)))[i]); } free(buf, M_GEOM); + buf = NULL; DPRINTF((%s: done reading offsets\n, gp-name)); mtx_init(sc-last_mtx, geom_uncompress cache, NULL, MTX_DEF); sc-last_blk = -1; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281777 - head/contrib/llvm/patches
Author: dim Date: Mon Apr 20 17:37:37 2015 New Revision: 281777 URL: https://svnweb.freebsd.org/changeset/base/281777 Log: Add llvm patch corresponding to r281775. Added: head/contrib/llvm/patches/patch-13-llvm-r229911-uleb128-commas.diff Added: head/contrib/llvm/patches/patch-13-llvm-r229911-uleb128-commas.diff == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/patches/patch-13-llvm-r229911-uleb128-commas.diff Mon Apr 20 17:37:37 2015(r281777) @@ -0,0 +1,77 @@ +Pull in r229911 from upstream llvm trunk (by Benjamin Kramer): + + MC: Allow multiple comma-separated expressions on the .uleb128 directive. + + For compatiblity with GNU as. Binutils documents this as + '.uleb128 expressions'. Subtle, isn't it? + +Introduced here: http://svnweb.freebsd.org/changeset/base/281775 + +Index: lib/MC/MCParser/AsmParser.cpp +=== +--- lib/MC/MCParser/AsmParser.cpp lib/MC/MCParser/AsmParser.cpp +@@ -3636,22 +3636,28 @@ bool AsmParser::parseDirectiveSpace(StringRef IDVa + } + + /// parseDirectiveLEB128 +-/// ::= (.sleb128 | .uleb128) expression ++/// ::= (.sleb128 | .uleb128) [ expression (, expression)* ] + bool AsmParser::parseDirectiveLEB128(bool Signed) { + checkForValidSection(); + const MCExpr *Value; + +- if (parseExpression(Value)) +-return true; ++ for (;;) { ++if (parseExpression(Value)) ++ return true; + +- if (getLexer().isNot(AsmToken::EndOfStatement)) +-return TokError(unexpected token in directive); ++if (Signed) ++ getStreamer().EmitSLEB128Value(Value); ++else ++ getStreamer().EmitULEB128Value(Value); + +- if (Signed) +-getStreamer().EmitSLEB128Value(Value); +- else +-getStreamer().EmitULEB128Value(Value); ++if (getLexer().is(AsmToken::EndOfStatement)) ++ break; + ++if (getLexer().isNot(AsmToken::Comma)) ++ return TokError(unexpected token in directive); ++Lex(); ++ } ++ + return false; + } + +Index: test/MC/ELF/uleb.s +=== +--- test/MC/ELF/uleb.s test/MC/ELF/uleb.s +@@ -11,16 +11,17 @@ foo: + .uleb128128 + .uleb12816383 + .uleb12816384 ++.uleb128 23, 42 + + // ELF_32: Name: .text + // ELF_32: SectionData ( +-// ELF_32: : 00017F80 01FF7F80 8001 ++// ELF_32: : 00017F80 01FF7F80 8001172A + // ELF_32: ) + // ELF_64: Name: .text + // ELF_64: SectionData ( +-// ELF_64: : 00017F80 01FF7F80 8001 ++// ELF_64: : 00017F80 01FF7F80 8001172A + // ELF_64: ) + // MACHO_32: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +-// MACHO_32: ('_section_data', '00017f80 01ff7f80 8001') ++// MACHO_32: ('_section_data', '00017f80 01ff7f80 8001172a') + // MACHO_64: ('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') +-// MACHO_64: ('_section_data', '00017f80 01ff7f80 8001') ++// MACHO_64: ('_section_data', '00017f80 01ff7f80 8001172a') ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281779 - head/usr.sbin/vidcontrol
Author: emaste Date: Mon Apr 20 17:43:55 2015 New Revision: 281779 URL: https://svnweb.freebsd.org/changeset/base/281779 Log: vidcontrol: skip invalid video modes returned by vt(4) vt(4) has a stub CONS_MODEINFO ioctl that does not provide any data but returns success. This needs to be fixed in the kernel, but address it in vidcontrol(1) as well in case it's run on an older kernel. Reviewed by: bde Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c == --- head/usr.sbin/vidcontrol/vidcontrol.c Mon Apr 20 17:43:36 2015 (r281778) +++ head/usr.sbin/vidcontrol/vidcontrol.c Mon Apr 20 17:43:55 2015 (r281779) @@ -1085,12 +1085,16 @@ show_mode_info(void) printf(--- ---\n); + memset(_info, 0, sizeof(_info)); for (mode = 0; mode = M_VESA_MODE_MAX; ++mode) { _info.vi_mode = mode; if (ioctl(0, CONS_MODEINFO, _info)) continue; if (_info.vi_mode != mode) continue; + if (_info.vi_width == 0 _info.vi_height == 0 + _info.vi_cwidth == 0 _info.vi_cheight == 0) + continue; printf(%3d (0x%03x), mode, mode); printf( 0x%08x, _info.vi_flags); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281770 - head/sys/fs/nfsclient
Author: pfg Date: Mon Apr 20 16:40:13 2015 New Revision: 281770 URL: https://svnweb.freebsd.org/changeset/base/281770 Log: Prevent a double free. This is similar to r281756 so set the ptr NULL after free as a safety belt against future changes. Obtained from:HardenedBSD (b2e77ced9ae213d358b44d98f552d9ae4636ecac) Submitted by: Oliver Pinter Revewed by: rmacklem Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c == --- head/sys/fs/nfsclient/nfs_clrpcops.cMon Apr 20 16:31:27 2015 (r281769) +++ head/sys/fs/nfsclient/nfs_clrpcops.cMon Apr 20 16:40:13 2015 (r281770) @@ -537,8 +537,10 @@ nfsrpc_openrpc(struct nfsmount *nmp, vno (void) nfs_catnap(PZERO, ret, nfs_open2); } while (ret == NFSERR_DELAY); if (ret) { - if (ndp != NULL) + if (ndp != NULL) { FREE((caddr_t)ndp, M_NFSCLDELEG); + ndp = NULL; + } if (ret == NFSERR_STALECLIENTID || ret == NFSERR_STALEDONTRECOVER || ret == NFSERR_BADSESSION) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281771 - head/sys/vm
Author: alc Date: Mon Apr 20 16:48:21 2015 New Revision: 281771 URL: https://svnweb.freebsd.org/changeset/base/281771 Log: Eliminate an unused variable. MFC after:1 week Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Mon Apr 20 16:40:13 2015(r281770) +++ head/sys/vm/uma_core.c Mon Apr 20 16:48:21 2015(r281771) @@ -307,9 +307,8 @@ bucket_init(void) { struct uma_bucket_zone *ubz; int size; - int i; - for (i = 0, ubz = bucket_zones[0]; ubz-ubz_entries != 0; ubz++) { + for (ubz = bucket_zones[0]; ubz-ubz_entries != 0; ubz++) { size = roundup(sizeof(struct uma_bucket), sizeof(void *)); size += sizeof(void *) * ubz-ubz_entries; ubz-ubz_zone = uma_zcreate(ubz-ubz_name, size, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r281721 - head/sys/sys
(this is why I'm not mfc'ing it.) hwpmc's ABI is not in any way usefully backwards compatible. -adrian ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281772 - head/sys/dev/ixgbe
Author: araujo (ports committer) Date: Mon Apr 20 17:21:15 2015 New Revision: 281772 URL: https://svnweb.freebsd.org/changeset/base/281772 Log: Remove unused variable. Differential Revision:D2331 Reviewed by: erj Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c == --- head/sys/dev/ixgbe/if_ix.c Mon Apr 20 16:48:21 2015(r281771) +++ head/sys/dev/ixgbe/if_ix.c Mon Apr 20 17:21:15 2015(r281772) @@ -1195,10 +1195,8 @@ ixgbe_handle_que(void *context, int pend struct adapter *adapter = que-adapter; struct tx_ring *txr = que-txr; struct ifnet*ifp = adapter-ifp; - boolmore; if (ifp-if_drv_flags IFF_DRV_RUNNING) { - more = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r281721 - head/sys/sys
On Sunday, April 19, 2015 12:33:22 AM Justin Hibbits wrote: Author: jhibbits Date: Sun Apr 19 00:33:21 2015 New Revision: 281721 URL: https://svnweb.freebsd.org/changeset/base/281721 Log: Fix the build. Commit the last part of e500 PMC. Pointy hat to: jhibbits Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h == --- head/sys/sys/pmc.hSun Apr 19 00:29:02 2015(r281720) +++ head/sys/sys/pmc.hSun Apr 19 00:33:21 2015(r281721) @@ -102,6 +102,8 @@ __PMC_CPU(MIPS_OCTEON, 0x201, Cavium Octeon)\ __PMC_CPU(MIPS_74K, 0x202, MIPS 74K) \ __PMC_CPU(PPC_7450, 0x300, PowerPC MPC7450) \ + __PMC_CPU(PPC_E500, 0x340, PowerPC e500 Core)\ + __PMC_CPU(PPC_MPC85XX, 0x340, Freescale PowerPC MPC85XX)\ __PMC_CPU(PPC_970, 0x380, IBM PowerPC 970) \ __PMC_CPU(GENERIC, 0x400, Generic) @@ -136,6 +138,7 @@ enum pmc_cputype { __PMC_CLASS(MIPS74K)/* MIPS 74K */ \ __PMC_CLASS(PPC7450)/* Motorola MPC7450 class */\ __PMC_CLASS(PPC970) /* IBM PowerPC 970 class */ \ + __PMC_CLASS(E500) /* Freescale e500 class */ \ __PMC_CLASS(SOFT) /* Software events */ Note that each time a PMC_CLASS is added, the ABI for pmccontrol -L breaks since the enum value of the SOFT class changes. We should perhaps fix the value of SOFT to make this less painful (just as we fix the values for PMC_CPU so that those don't change). -- John Baldwin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r281721 - head/sys/sys
On Mon, Apr 20, 2015 at 9:19 AM, Bruce Evans b...@optusnet.com.au wrote: On Mon, 20 Apr 2015, John Baldwin wrote: On Sunday, April 19, 2015 12:33:22 AM Justin Hibbits wrote: Log: Fix the build. Commit the last part of e500 PMC. ... @@ -136,6 +138,7 @@ enum pmc_cputype { __PMC_CLASS(MIPS74K)/* MIPS 74K */ \ __PMC_CLASS(PPC7450)/* Motorola MPC7450 class */\ __PMC_CLASS(PPC970) /* IBM PowerPC 970 class */ \ + __PMC_CLASS(E500) /* Freescale e500 class */ \ __PMC_CLASS(SOFT) /* Software events */ Note that each time a PMC_CLASS is added, the ABI for pmccontrol -L breaks since the enum value of the SOFT class changes. We should perhaps fix the value of SOFT to make this less painful (just as we fix the values for PMC_CPU so that those don't change). Enums should never be used in ABIs, since their size can be anything large enough. They also cause namespace problems. The whole enum declaration must be exposed in any header that uses an enum type. Bruce Any change breaks ABI for any architecture listed after anyway (Adrian's MIPS74K broke all PowerPC). Could we not take the same IDs as in pmc_events.h to generate the PM_CLASS IDs? - Justin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281773 - head/sys/dev/ixgbe
Author: araujo (ports committer) Date: Mon Apr 20 17:24:39 2015 New Revision: 281773 URL: https://svnweb.freebsd.org/changeset/base/281773 Log: Add back ixgbe_rxeof, just remove the assignment to more. Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c == --- head/sys/dev/ixgbe/if_ix.c Mon Apr 20 17:21:15 2015(r281772) +++ head/sys/dev/ixgbe/if_ix.c Mon Apr 20 17:24:39 2015(r281773) @@ -1197,6 +1197,7 @@ ixgbe_handle_que(void *context, int pend struct ifnet*ifp = adapter-ifp; if (ifp-if_drv_flags IFF_DRV_RUNNING) { + ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281768 - head/share/man/man3
Author: brooks Date: Mon Apr 20 16:23:59 2015 New Revision: 281768 URL: https://svnweb.freebsd.org/changeset/base/281768 Log: Bump doc date missed in r281605. MFC after:1 day Modified: head/share/man/man3/queue.3 Modified: head/share/man/man3/queue.3 == --- head/share/man/man3/queue.3 Mon Apr 20 14:55:01 2015(r281767) +++ head/share/man/man3/queue.3 Mon Apr 20 16:23:59 2015(r281768) @@ -28,7 +28,7 @@ .\@(#)queue.3 8.2 (Berkeley) 1/24/94 .\ $FreeBSD$ .\ -.Dd June 17, 2013 +.Dd April 16, 2015 .Dt QUEUE 3 .Os .Sh NAME ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281781 - head/usr.sbin/crunch/crunchide
Author: emaste Date: Mon Apr 20 18:30:06 2015 New Revision: 281781 URL: https://svnweb.freebsd.org/changeset/base/281781 Log: crunchide: Remove local EM_* ELF definitions provided by system ELF headers Suggested by: imp (in review D2314) Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c == --- head/usr.sbin/crunch/crunchide/exec_elf32.c Mon Apr 20 17:46:09 2015 (r281780) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Mon Apr 20 18:30:06 2015 (r281781) @@ -178,37 +178,13 @@ ELFNAMEEND(check)(int fd, const char *fn switch (xe16toh(eh.e_machine)) { case EM_386: break; case EM_ALPHA: break; -#ifndef EM_AARCH64 -#defineEM_AARCH64 183 -#endif case EM_AARCH64: break; -#ifndef EM_ARM -#define EM_ARM 40 -#endif case EM_ARM: break; -#ifndef EM_MIPS -#define EM_MIPS8 -#endif -#ifndef EM_MIPS_RS4_BE /* same as EM_MIPS_RS3_LE */ -#define EM_MIPS_RS4_BE 10 -#endif case EM_MIPS: break; case /* EM_MIPS_RS3_LE */ EM_MIPS_RS4_BE: break; -#ifndef EM_PPC -#defineEM_PPC 20 -#endif case EM_PPC: break; -#ifndef EM_PPC64 -#defineEM_PPC6421 -#endif case EM_PPC64: break; -#ifndef EM_SPARCV9 -#defineEM_SPARCV9 43 -#endif case EM_SPARCV9: break; -#ifndef EM_X86_64 -#defineEM_X86_64 62 -#endif case EM_X86_64: break; /*ELFDEFNNAME(MACHDEP_ID_CASES) */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281782 - head/usr.sbin/bhyve
Author: mav Date: Mon Apr 20 19:11:27 2015 New Revision: 281782 URL: https://svnweb.freebsd.org/changeset/base/281782 Log: Don't set bits that should be zero for SATA devices. Old value made Linux think that it is PATA device with SATA bridge. MFC after:2 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c == --- head/usr.sbin/bhyve/pci_ahci.c Mon Apr 20 18:30:06 2015 (r281781) +++ head/usr.sbin/bhyve/pci_ahci.c Mon Apr 20 19:11:27 2015 (r281782) @@ -930,7 +930,6 @@ handle_identify(struct ahci_port *p, int buf[88] = 0x7f; if (p-xfermode ATA_UDMA0) buf[88] |= (1 ((p-xfermode 7) + 8)); - buf[93] = (1 | 1 14); buf[100] = sectors; buf[101] = (sectors 16); buf[102] = (sectors 32); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r281758 - head/bin/ed
On 19 April 2015 at 21:23, Bruce Evans b...@optusnet.com.au wrote: On Mon, 20 Apr 2015, Eitan Adler wrote: Log: ed(1): Fix [-Werror=logical-not-parentheses] /usr/src/bin/ed/glbl.c:64:36: error: logical not is only applied to theleft hand side of comparison [-Werror=logical-not-parentheses] Obtained from: Dragonfly (1fff89cbaeaa43af720a1f23d9c466b756dd8a58) MFC After: 1 month Modified: head/bin/ed/glbl.c Modified: head/bin/ed/glbl.c == --- head/bin/ed/glbl.c Mon Apr 20 00:24:32 2015(r281757) +++ head/bin/ed/glbl.c Mon Apr 20 02:07:57 2015(r281758) @@ -60,7 +60,7 @@ build_active_list(int isgcmd) return ERR; if (isbinary) NUL_TO_NEWLINE(s, lp-len); - if (!regexec(pat, s, 0, NULL, 0) == isgcmd + if (!(regexec(pat, s, 0, NULL, 0) == isgcmd) set_active_node(lp) 0) return ERR; } How can this be right? !(a == b) is an obfuscated way of writing a != b. bah! How does something like the following look? Index: ed.h === --- ed.h(revision 281759) +++ ed.h(working copy) @@ -33,6 +33,7 @@ #include limits.h #include regex.h #include signal.h +#include stdbool.h #include stdio.h #include stdlib.h #include string.h @@ -191,7 +192,7 @@ int put_des_char(int, FILE *); void add_line_node(line_t *); int append_lines(long); int apply_subst_template(const char *, regmatch_t *, int, int); -int build_active_list(int); +int build_active_list(bool); int cbc_decode(unsigned char *, FILE *); int cbc_encode(unsigned char *, int, FILE *); int check_addr_range(long, long); Index: glbl.c === --- glbl.c(revision 281759) +++ glbl.c(working copy) @@ -38,7 +38,7 @@ __FBSDID($FreeBSD$); /* build_active_list: add line matching a pattern to the global-active list */ int -build_active_list(int isgcmd) +build_active_list(bool isgcmd) { pattern_t *pat; line_t *lp; @@ -60,7 +60,7 @@ int return ERR; if (isbinary) NUL_TO_NEWLINE(s, lp-len); -if (!(regexec(pat, s, 0, NULL, 0) == isgcmd) +if ((!regexec(pat, s, 0, NULL, 0)) == isgcmd set_active_node(lp) 0) return ERR; } -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281783 - head/release/tools
Author: gjb Date: Mon Apr 20 19:54:54 2015 New Revision: 281783 URL: https://svnweb.freebsd.org/changeset/base/281783 Log: When building VM disk images, vm_copy_base() uses tar(1) to copy the userland from one md(4)-mounted filesystem to a clean filesystem to prevent remnants of files that were added and removed from resulting in an unclean filesystem. When newfs(8) creates the first filesystem with journaled soft-updates enabled, the /.sujournal file in the new filesystem cannot be overwritten by the /.sujournal in the original filesystem. To avoid this particular error case, do not enable journaled soft-updates when creating the md(4)-backed filesystems, and instead use tunefs(8) to enable journaled soft-updates after the new filesystem is populated in vm_copy_base(). While here, fix a long standing bug where the build environment /boot files were used by mkimg(1) when creating the VM disk images by using the files in .OBJDIR. MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/vmimage.subr Modified: head/release/tools/vmimage.subr == --- head/release/tools/vmimage.subr Mon Apr 20 19:11:27 2015 (r281782) +++ head/release/tools/vmimage.subr Mon Apr 20 19:54:54 2015 (r281783) @@ -14,17 +14,24 @@ write_partition_layout() { SWAPOPT=-p freebsd-swap/swapfs::1G fi + _OBJDIR=$(make -C ${WORLDDIR} -V .OBJDIR) + if [ -d ${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH} ]; then + BOOTFILES=${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}/usr/src/sys/boot + else + BOOTFILES=${_OBJDIR}/usr/src/sys/boot + fi + case ${TARGET}:${TARGET_ARCH} in amd64:amd64 | i386:i386) - mkimg -s gpt -b /boot/pmbr \ - -p freebsd-boot/bootfs:=/boot/gptboot \ + mkimg -s gpt -b ${BOOTFILES}/i386/pmbr/pmbr \ + -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot \ ${SWAPOPT} \ -p freebsd-ufs/rootfs:=${VMBASE} \ -o ${VMIMAGE} ;; powerpc:powerpc*) mkimg -s apm \ - -p apple-boot/bootfs:=/boot/boot1.hfs \ + -p apple-boot/bootfs:=${BOOTFILES}/powerpc/boot1.chrp/boot1.hfs \ ${SWAPOPT} \ -p freebsd-ufs/rootfs:=${VMBASE} \ -o ${VMIMAGE} @@ -63,7 +70,7 @@ vm_create_base() { mkdir -p ${DESTDIR} truncate -s ${VMSIZE} ${VMBASE} mddev=$(mdconfig -f ${VMBASE}) - newfs -j /dev/${mddev} + newfs /dev/${mddev} mount /dev/${mddev} ${DESTDIR} return 0 @@ -83,10 +90,10 @@ vm_copy_base() { truncate -s ${VMSIZE} ${VMBASE}.tmp mkdir -p ${DESTDIR}/new mdnew=$(mdconfig -f ${VMBASE}.tmp) - newfs -j /dev/${mdnew} + newfs /dev/${mdnew} mount /dev/${mdnew} ${DESTDIR}/new - tar -cf- -C ${DESTDIR}/old . | tar -xf- -C ${DESTDIR}/new + tar -cf- -C ${DESTDIR}/old . | tar -xUf- -C ${DESTDIR}/new umount_loop /dev/${mdold} rmdir ${DESTDIR}/old @@ -94,6 +101,7 @@ vm_copy_base() { umount_loop /dev/${mdnew} rmdir ${DESTDIR}/new + tunefs -j enable /dev/${mdnew} mdconfig -d -u ${mdnew} mv ${VMBASE}.tmp ${VMBASE} } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281785 - in head: share/man/man9 sys/kern
Author: vangyzen Date: Mon Apr 20 20:03:26 2015 New Revision: 281785 URL: https://svnweb.freebsd.org/changeset/base/281785 Log: Always send log(9) messages to the message buffer. It is truer to the semantics of logging for messages to *always* go to the message buffer, where they can eventually be collected and, in fact, be put into a log file. This restores the behavior prior to r70239, which seems to have changed it inadvertently. Submitted by: Eric Badger e...@badgerio.us Reviewed by: jhb Approved by: kib (mentor) Obtained from:Dell Inc. MFC after:1 week Modified: head/share/man/man9/printf.9 head/sys/kern/subr_prf.c Modified: head/share/man/man9/printf.9 == --- head/share/man/man9/printf.9Mon Apr 20 20:03:07 2015 (r281784) +++ head/share/man/man9/printf.9Mon Apr 20 20:03:26 2015 (r281785) @@ -67,7 +67,8 @@ The .Fn log function sends the message to the kernel logging facility, using the log level as indicated by -.Fa pri . +.Fa pri , +and to the console if no process is yet reading the log. .Pp Each of these related functions use the .Fa fmt Modified: head/sys/kern/subr_prf.c == --- head/sys/kern/subr_prf.cMon Apr 20 20:03:07 2015(r281784) +++ head/sys/kern/subr_prf.cMon Apr 20 20:03:26 2015(r281785) @@ -295,7 +295,7 @@ log(int level, const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void)_vprintf(level, log_open ? TOLOG : TOCONS, fmt, ap); + (void)_vprintf(level, log_open ? TOLOG : TOCONS | TOLOG, fmt, ap); va_end(ap); msgbuftrigger = 1; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r281787 - head/sbin/dmesg
Author: vangyzen Date: Mon Apr 20 20:07:39 2015 New Revision: 281787 URL: https://svnweb.freebsd.org/changeset/base/281787 Log: dmesg: accommodate message buffer growth between the sysctl calls Allocate 12.5% extra space to avoid ENOMEM when the message buffer is growing steadily. Reported by: Steve Wahl steve_w...@dell.com (and tested) Approved by: kib (mentor) Obtained from:Dell Inc. MFC after:1 week Modified: head/sbin/dmesg/dmesg.c Modified: head/sbin/dmesg/dmesg.c == --- head/sbin/dmesg/dmesg.c Mon Apr 20 20:06:25 2015(r281786) +++ head/sbin/dmesg/dmesg.c Mon Apr 20 20:07:39 2015(r281787) @@ -118,6 +118,9 @@ main(int argc, char *argv[]) */ if (sysctlbyname(kern.msgbuf, NULL, buflen, NULL, 0) == -1) err(1, sysctl kern.msgbuf); + /* Allocate extra room for growth between the sysctl calls. */ + buflen += buflen/8; + /* Allocate more than sysctl sees, for room to append \n\0. */ if ((bp = malloc(buflen + 2)) == NULL) errx(1, malloc failed); if (sysctlbyname(kern.msgbuf, bp, buflen, NULL, 0) == -1) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org