From owner-svn-src-stable-10@FreeBSD.ORG Sun Nov 16 01:29:21 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF0BAFF4; Sun, 16 Nov 2014 01:29:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA487AB; Sun, 16 Nov 2014 01:29:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG1TLGv053068; Sun, 16 Nov 2014 01:29:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG1TJsC053053; Sun, 16 Nov 2014 01:29:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201411160129.sAG1TJsC053053@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 16 Nov 2014 01:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274561 - in stable/10/tools/tools/nanobsd: . dhcpd rescue X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 01:29:21 -0000 Author: imp Date: Sun Nov 16 01:29:18 2014 New Revision: 274561 URL: https://svnweb.freebsd.org/changeset/base/274561 Log: MFC from the last few months: Note: didn't merge r274331 removing gif/faith on purpose. r268246 | mr | use mkimg and build into separate directories r269355 | imp | Fix typo in example script r269362 | imp | use rm -x on 10 and newer r269363 | imp | NANO_OBJ shouldn't end with '/' r269423 | imp | -K to suppress installkernel r269424 | imp | sort usage r269425 | imp | sort switch r269983 | imp | only install bootloader if it exists r269984 | imp | create_diskimage since it never was $ARCH dependent r270162 | imp | Add support for -X which instales cross native tools Added: stable/10/tools/tools/nanobsd/rescue/R32 - copied unchanged from r268246, head/tools/tools/nanobsd/rescue/R32 stable/10/tools/tools/nanobsd/rescue/R64 - copied unchanged from r268246, head/tools/tools/nanobsd/rescue/R64 Modified: stable/10/tools/tools/nanobsd/dhcpd/README stable/10/tools/tools/nanobsd/dhcpd/common stable/10/tools/tools/nanobsd/nanobsd.sh stable/10/tools/tools/nanobsd/rescue/build.sh stable/10/tools/tools/nanobsd/rescue/common stable/10/tools/tools/nanobsd/rescue/merge.sh stable/10/tools/tools/nanobsd/rescue/rescue_amd64.conf stable/10/tools/tools/nanobsd/rescue/rescue_i386.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/nanobsd/dhcpd/README ============================================================================== --- stable/10/tools/tools/nanobsd/dhcpd/README Sun Nov 16 01:18:41 2014 (r274560) +++ stable/10/tools/tools/nanobsd/dhcpd/README Sun Nov 16 01:29:18 2014 (r274561) @@ -9,6 +9,6 @@ and DHCPd. This is a work in progress. Generally, to build this you should cd tools/tools/nanobsd/dhcpd - sudo sh ../nandobsd.sh -C os-base + sudo sh ../nanobsd.sh -C os-base but do be careful if things are interrupted. There may still be bugs lurking that cause your entire FreeBSD tree to disappear. Modified: stable/10/tools/tools/nanobsd/dhcpd/common ============================================================================== --- stable/10/tools/tools/nanobsd/dhcpd/common Sun Nov 16 01:18:41 2014 (r274560) +++ stable/10/tools/tools/nanobsd/dhcpd/common Sun Nov 16 01:29:18 2014 (r274561) @@ -261,11 +261,6 @@ die() exit 1 } -create_amd64_diskimage() -{ - create_i386_diskimage "$*" -} - # Automatically include the packaging port here so it is always first so it # builds the port and adds the package so we can add other packages. add_port ports-mgmt/pkg Modified: stable/10/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- stable/10/tools/tools/nanobsd/nanobsd.sh Sun Nov 16 01:18:41 2014 (r274560) +++ stable/10/tools/tools/nanobsd/nanobsd.sh Sun Nov 16 01:29:18 2014 (r274561) @@ -178,6 +178,15 @@ SRCCONF=${SRCCONF:=/dev/null} # ####################################################################### +# rm doesn't know -x prior to FreeBSD 10, so cope with a variety of build +# hosts for now. +nano_rm ( ) { + case $(uname -r) in + 7*|8*|9*) rm $* ;; + *) rm -x $* ;; + esac +} + # run in the world chroot, errors fatal CR() { @@ -200,9 +209,9 @@ nano_cleanup ( ) ( clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" - if ! rm -xrf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then + if ! nano_rm -rf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then chflags -R noschg ${MAKEOBJDIRPREFIX}/ - rm -xr ${MAKEOBJDIRPREFIX}/ + nano_rm -r ${MAKEOBJDIRPREFIX}/ fi mkdir -p ${MAKEOBJDIRPREFIX} printenv > ${MAKEOBJDIRPREFIX}/_.env @@ -256,17 +265,17 @@ build_kernel ( ) ( clean_world ( ) ( if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then pprint 2 "Clean and create object directory (${NANO_OBJ})" - if ! rm -rxf ${NANO_OBJ}/ > /dev/null 2>&1 ; then + if ! nano_rm -rf ${NANO_OBJ}/ > /dev/null 2>&1 ; then chflags -R noschg ${NANO_OBJ} - rm -xr ${NANO_OBJ}/ + nano_rm -r ${NANO_OBJ}/ fi mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR} printenv > ${NANO_OBJ}/_.env else pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" - if ! rm -rxf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then + if ! nano_rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then chflags -R noschg ${NANO_WORLDDIR} - rm -rxf ${NANO_WORLDDIR}/ + nano_rm -rf ${NANO_WORLDDIR}/ fi mkdir -p ${NANO_WORLDDIR} fi @@ -338,6 +347,18 @@ install_kernel ( ) ( ) > ${NANO_OBJ}/_.ik 2>&1 ) +native_xtools ( ) ( + print 2 "Installing the optimized native build tools for cross env" + pprint 3 "log: ${NANO_OBJ}/_.native_xtools" + + cd ${NANO_SRC} + env TARGET_ARCH=${NANO_ARCH} \ + ${NANO_MAKE} SRCCONF=${SRCCONF} \ + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} native-xtools \ + DESTDIR=${NANO_WORLDDIR} \ + > ${NANO_OBJ}/_.native_xtools 2>&1 +) + run_customize() ( pprint 2 "run customize scripts" @@ -378,7 +399,7 @@ setup_nanobsd ( ) ( cd usr/local/etc find . -print | cpio -dumpl ../../../etc/local cd .. - rm -rf etc + nano_rm -rf etc ln -s ../../etc/local etc ) fi @@ -400,7 +421,7 @@ setup_nanobsd ( ) ( echo "mount -o ro /dev/${NANO_DRIVE}s3" > conf/default/etc/remount # Put /tmp on the /var ramdisk (could be symlink already) - test -d tmp && rmdir tmp || rm -f tmp + test -d tmp && rmdir tmp || nano_rm -f tmp ln -s var/tmp tmp ) > ${NANO_OBJ}/_.dl 2>&1 @@ -478,7 +499,7 @@ populate_data_slice ( ) ( populate_slice "$1" "$2" "$3" "$4" ) -create_i386_diskimage ( ) ( +create_diskimage ( ) ( pprint 2 "build diskimage" pprint 3 "log: ${NANO_OBJ}/_.di" @@ -560,7 +581,7 @@ create_i386_diskimage ( ) ( -y ${NANO_HEADS}` else echo "Creating md backing file..." - rm -f ${IMG} + nano_rm -f ${IMG} dd if=/dev/zero of=${IMG} seek=${NANO_MEDIASIZE} count=0 MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ -y ${NANO_HEADS}` @@ -572,8 +593,14 @@ create_i386_diskimage ( ) ( fdisk ${MD} # XXX: params # XXX: pick up cached boot* files, they may not be in image anymore. - boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} - bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}s1 + if [ -f ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ]; then + boot0cfg -B -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOT0CFG} ${MD} + fi + if [ -f ${NANO_WORLDDIR}/boot/boot ]; then + bsdlabel -w -B -b ${NANO_WORLDDIR}/boot/boot ${MD}s1 + else + bsdlabel -w ${MD}s1 + fi bsdlabel ${MD}s1 # Create first image @@ -634,11 +661,6 @@ create_i386_diskimage ( ) ( ) > ${NANO_OBJ}/_.di 2>&1 ) -# i386 and amd64 are identical for disk images -create_amd64_diskimage ( ) ( - create_i386_diskimage -) - last_orders () ( # Redefine this function with any last orders you may have # after the build completed, for instance to copy the finished @@ -785,7 +807,7 @@ cust_pkg () ( exit 2 fi done - rm -rxf ${NANO_WORLDDIR}/Pkg + nano_rm -rf ${NANO_WORLDDIR}/Pkg ) cust_pkgng () ( @@ -820,7 +842,7 @@ cust_pkgng () ( echo "FAILED: pkg bootstrapping faied" exit 2 fi - rm -f ${NANO_WORLDDIR}/Pkg/pkg-* + nano_rm -f ${NANO_WORLDDIR}/Pkg/pkg-* # Count & report how many we have to install todo=`ls ${NANO_WORLDDIR}/Pkg | /usr/bin/wc -l` @@ -849,7 +871,7 @@ cust_pkgng () ( exit 2 fi done - rm -rxf ${NANO_WORLDDIR}/Pkg + nano_rm -rf ${NANO_WORLDDIR}/Pkg ) ####################################################################### @@ -886,8 +908,10 @@ pprint() ( usage () { ( - echo "Usage: $0 [-bfiknqvw] [-c config_file]" + echo "Usage: $0 [-bfiKknqvw] [-c config_file]" + echo " -K suppress installkernel" echo " -b suppress builds (both kernel and world)" + echo " -c specify config file" echo " -f suppress code slice extraction" echo " -i suppress disk image build" echo " -k suppress buildkernel" @@ -895,7 +919,6 @@ usage () { echo " -q make output more quiet" echo " -v make output more verbose" echo " -w suppress buildworld" - echo " -c specify config file" ) 1>&2 exit 2 } @@ -905,12 +928,14 @@ usage () { do_clean=true do_kernel=true +do_installkernel=true do_world=true do_image=true do_copyout_partition=true +do_native_xtools=false set +e -args=`getopt bc:fhiknqvw $*` +args=`getopt KXbc:fhiknqvw $*` if [ $? -ne 0 ] ; then usage exit 2 @@ -922,12 +947,16 @@ for i do case "$i" in - -b) - do_world=false - do_kernel=false + -K) + do_installkernel=false shift ;; - -k) + -X) + do_native_xtools=true + shift + ;; + -b) + do_world=false do_kernel=false shift ;; @@ -951,6 +980,10 @@ do do_image=false shift ;; + -k) + do_kernel=false + shift + ;; -n) do_clean=false shift @@ -983,7 +1016,7 @@ trap nano_cleanup EXIT ####################################################################### # Setup and Export Internal variables # -test -n "${NANO_OBJ}" || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME}/ +test -n "${NANO_OBJ}" || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME} test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=${NANO_OBJ} test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=${NANO_OBJ} @@ -1073,15 +1106,22 @@ clean_world make_conf_install install_world install_etc +if $do_native_xtools ; then + native_xtools +fi setup_nanobsd_etc -install_kernel +if $do_installkernel ; then + install_kernel +else + pprint 2 "Skipping installkernel (as instructed)" +fi run_customize setup_nanobsd prune_usr run_late_customize if $do_image ; then - create_${NANO_ARCH}_diskimage + create_diskimage else pprint 2 "Skipping image build (as instructed)" fi Copied: stable/10/tools/tools/nanobsd/rescue/R32 (from r268246, head/tools/tools/nanobsd/rescue/R32) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/tools/nanobsd/rescue/R32 Sun Nov 16 01:29:18 2014 (r274561, copy of r268246, head/tools/tools/nanobsd/rescue/R32) @@ -0,0 +1,14 @@ +# +# R32 -- Generic kernel configuration file with modifications for rescue. +# +# $FreeBSD$ + +include GENERIC + +ident R32 + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions MALLOC_DEBUG_MAXZONES Copied: stable/10/tools/tools/nanobsd/rescue/R64 (from r268246, head/tools/tools/nanobsd/rescue/R64) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/tools/nanobsd/rescue/R64 Sun Nov 16 01:29:18 2014 (r274561, copy of r268246, head/tools/tools/nanobsd/rescue/R64) @@ -0,0 +1,14 @@ +# +# R64 -- Generic kernel configuration file with modifications for rescue. +# +# $FreeBSD$ + +include GENERIC + +ident R64 + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions MALLOC_DEBUG_MAXZONES Modified: stable/10/tools/tools/nanobsd/rescue/build.sh ============================================================================== --- stable/10/tools/tools/nanobsd/rescue/build.sh Sun Nov 16 01:18:41 2014 (r274560) +++ stable/10/tools/tools/nanobsd/rescue/build.sh Sun Nov 16 01:29:18 2014 (r274561) @@ -3,6 +3,8 @@ # $FreeBSD$ # +today=`date '+%Y%m%d'` + if [ -z "${1}" -o \! -f "${1}" ]; then echo "Usage: $0 cfg_file [-bhiknw]" echo "-i : skip image build" @@ -15,4 +17,26 @@ fi CFG="${1}" shift; +if [ \! -d /usr/obj/Rescue ]; then + mkdir -p /usr/obj/Rescue +fi + sh ../nanobsd.sh $* -c ${CFG} + +F32="/usr/obj/Rescue/rescue_${today}_x32" +D32="/usr/obj/nanobsd.rescue_i386" +if [ -f "${D32}/_.disk.full" ]; then + mv "${D32}/_.disk.full" "${F32}.img" +fi +if [ -f "${D32}/_.disk.iso" ]; then + mv "${D32}/_.disk.iso" "${F32}.iso" +fi + +F64="/usr/obj/Rescue/rescue_${today}_x64" +D64="/usr/obj/nanobsd.rescue_amd64" +if [ -f "${D64}/_.disk.full" ]; then + mv "${D64}/_.disk.full" "${F64}.img" +fi +if [ -f "${D64}/_.disk.iso" ]; then + mv "${D64}/_.disk.iso" "${F64}.iso" +fi Modified: stable/10/tools/tools/nanobsd/rescue/common ============================================================================== --- stable/10/tools/tools/nanobsd/rescue/common Sun Nov 16 01:18:41 2014 (r274560) +++ stable/10/tools/tools/nanobsd/rescue/common Sun Nov 16 01:29:18 2014 (r274561) @@ -3,7 +3,7 @@ # NANO_TOOLS=`pwd` NANO_PACKAGE_DIR=`pwd`/Pkg -NANO_RAM_TMPVARSIZE=20480 +NANO_RAM_TMPVARSIZE=40960 NANO_PMAKE="make -j 8" NANO_LABEL="rescue" NANO_RAM_TMPVARSIZE=40960 @@ -68,6 +68,7 @@ cust_etc_cfg () ( echo "#ifconfig_fxp0=\"AUTO\"" >> etc/rc.conf echo "#sshd_enable=\"YES\"" >> etc/rc.conf echo "/dev/ufs/${NANO_LABEL}s1a / ufs ro,noatime 0 0" > etc/fstab + echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab echo "tmpfs /boot/zfs tmpfs rw,size=1048576,mode=777 0 0" >> etc/fstab echo "ports:/usr/ports /usr/ports nfs rw,noauto,noatime,bg,soft,intr,nfsv3 0 0" >> etc/fstab # echo "/dev/ad1s1a /scratch ufs rw,noauto,noatime 0 0" >> etc/fstab @@ -100,16 +101,8 @@ last_orders () ( touch conf/default/etc/.keepme touch conf/default/var/.keepme cd .. - mkisofs -quiet -r -J -no-emul-boot \ - -V ${NANO_LABEL} \ - -b boot/cdboot -o _.disk.iso _.w/ + makefs -t cd9660 -o rockridge \ + -o label="${NANO_LABEL}" -o publisher="RMX" \ + -o bootimage="i386;_.w/boot/cdboot" -o no-emul-boot _.disk.iso _.w/ ) ) - -#create_i386_diskimage () { -# #currently not used -#} - -#create_amd64_diskimage () { -# create_i386_diskimage -#} Modified: stable/10/tools/tools/nanobsd/rescue/merge.sh ============================================================================== --- stable/10/tools/tools/nanobsd/rescue/merge.sh Sun Nov 16 01:18:41 2014 (r274560) +++ stable/10/tools/tools/nanobsd/rescue/merge.sh Sun Nov 16 01:29:18 2014 (r274561) @@ -1,18 +1,28 @@ #!/bin/sh # $FreeBSD$ -D1="/usr/obj/nanobsd.rescue_i386" -D2="/usr/obj/nanobsd.rescue_amd64" +today=`date '+%Y%m%d'` -MD=`mdconfig -a -t vnode -f ${D1}/_.disk.full` +I32="/usr/obj/Rescue/rescue_${today}_x32.img" +I64="/usr/obj/Rescue/rescue_${today}_x64.img" +IAL="/usr/obj/Rescue/rescue_${today}_xal.img" +D64="/usr/obj/nanobsd.rescue_amd64" +MNT="/usr/obj/Rescue/_mnt" + +if [ \! -d "$MNT" ]; then + mkdir "$MNT" +fi -dd if=${D2}/_.disk.image of=/dev/${MD}s2 bs=128k +dd if=${I32} of=${IAL} bs=128k +MD=`mdconfig -a -t vnode -f ${IAL}` + +dd if=${D64}/_.disk.image of=/dev/${MD}s2 bs=128k tunefs -L rescues2a /dev/${MD}s2a -mount /dev/${MD}s2a ${D1}/_.mnt +mount /dev/${MD}s2a ${MNT} -sed -i "" -e 's/rescues1/rescues2/' ${D1}/_.mnt/conf/base/etc/fstab -sed -i "" -e 's/rescues1/rescues2/' ${D1}/_.mnt/etc/fstab +sed -i "" -e 's/rescues1/rescues2/' ${MNT}/conf/base/etc/fstab +sed -i "" -e 's/rescues1/rescues2/' ${MNT}/etc/fstab -umount ${D1}/_.mnt +umount ${MNT} mdconfig -d -u ${MD} Modified: stable/10/tools/tools/nanobsd/rescue/rescue_amd64.conf ============================================================================== --- stable/10/tools/tools/nanobsd/rescue/rescue_amd64.conf Sun Nov 16 01:18:41 2014 (r274560) +++ stable/10/tools/tools/nanobsd/rescue/rescue_amd64.conf Sun Nov 16 01:29:18 2014 (r274561) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -NANO_KERNEL=GENERIC +NANO_KERNEL=R64 NANO_ARCH=amd64 TARGET_ARCH=amd64; export TARGET_ARCH #TARGET_CPUTYPE=amd64; export TARGET_CPUTYPE Modified: stable/10/tools/tools/nanobsd/rescue/rescue_i386.conf ============================================================================== --- stable/10/tools/tools/nanobsd/rescue/rescue_i386.conf Sun Nov 16 01:18:41 2014 (r274560) +++ stable/10/tools/tools/nanobsd/rescue/rescue_i386.conf Sun Nov 16 01:29:18 2014 (r274561) @@ -1,7 +1,7 @@ # # $FreeBSD$ # -NANO_KERNEL=GENERIC +NANO_KERNEL=R32 NANO_ARCH=i386 TARGET_ARCH=i386; export TARGET_ARCH #TARGET_CPUTYPE=i386; export TARGET_CPUTYPE From owner-svn-src-stable-10@FreeBSD.ORG Sun Nov 16 01:47:44 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51BFD772; Sun, 16 Nov 2014 01:47:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23E37240; Sun, 16 Nov 2014 01:47:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG1liDl062212; Sun, 16 Nov 2014 01:47:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG1lhKj062210; Sun, 16 Nov 2014 01:47:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201411160147.sAG1lhKj062210@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 16 Nov 2014 01:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274562 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 01:47:44 -0000 Author: mav Date: Sun Nov 16 01:47:43 2014 New Revision: 274562 URL: https://svnweb.freebsd.org/changeset/base/274562 Log: MFC r274333: Handle PREEMPT AND ABORT service action equal to PREEMPT. With command serialization used in CTL, there are no other commands to abort when PREEMPT AND ABORT gets to run, so it is practically equal to PREEMPT. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sun Nov 16 01:29:18 2014 (r274561) +++ stable/10/sys/cam/ctl/ctl.c Sun Nov 16 01:47:43 2014 (r274562) @@ -8691,7 +8691,8 @@ ctl_persistent_reserve_out(struct ctl_sc } break; - case SPRO_PREEMPT: { + case SPRO_PREEMPT: + case SPRO_PRE_ABO: { int nretval; nretval = ctl_pro_preempt(softc, lun, res_key, sa_res_key, type, Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Sun Nov 16 01:29:18 2014 (r274561) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Sun Nov 16 01:47:43 2014 (r274562) @@ -180,7 +180,16 @@ const struct ctl_cmd_entry ctl_cmd_table 10, { 0x04, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 05 PREEMPT AND ABORT */ -{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, +{ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | + CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_OFFLINE | + CTL_CMD_FLAG_OK_ON_SECONDARY | + CTL_FLAG_DATA_OUT | + CTL_CMD_FLAG_ALLOW_ON_PR_RESV, + CTL_LUN_PAT_NONE, + 10, { 0x05, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 06 REGISTER AND IGNORE EXISTING KEY */ {ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | From owner-svn-src-stable-10@FreeBSD.ORG Sun Nov 16 04:02:52 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A83DFEB; Sun, 16 Nov 2014 04:02:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65DC4D4; Sun, 16 Nov 2014 04:02:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAG42qu9026920; Sun, 16 Nov 2014 04:02:52 GMT (envelope-from edwin@FreeBSD.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAG42ols026913; Sun, 16 Nov 2014 04:02:50 GMT (envelope-from edwin@FreeBSD.org) Message-Id: <201411160402.sAG42ols026913@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: edwin set sender to edwin@FreeBSD.org using -f From: Edwin Groothuis Date: Sun, 16 Nov 2014 04:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274563 - stable/10/contrib/tzdata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 04:02:52 -0000 Author: edwin Date: Sun Nov 16 04:02:50 2014 New Revision: 274563 URL: https://svnweb.freebsd.org/changeset/base/274563 Log: MFC of 274559,tzdata2014j Release 2014j - 2014-11-10 17:37:11 -0800 Changes affecting current and future time stamps Turks & Caicos' switch from US eastern time to UTC-4 year-round did not occur on 2014-11-02 at 02:00. It's currently scheduled for 2015-11-01 at 02:00. (Thanks to Chris Walton.) Changes affecting past time stamps Many pre-1989 time stamps have been corrected for Asia/Seoul and Asia/Pyongyang, based on sources for the Korean-language Wikipedia entry for time in Korea. (Thanks to Sanghyuk Jung.) Also, no longer guess that Pyongyang mimicked Seoul time after World War II, as this is politically implausible. Some more zones have been turned into links, when they differed from existing zones only for older time stamps. As usual, these changes affect UTC offsets in pre-1970 time stamps only. Their old contents have been moved to the 'backzone' file. The affected zones are: Africa/Addis_Ababa, Africa/Asmara, Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala, Africa/Mogadishu, Indian/Antananarivo, Indian/Comoro, and Indian/Mayotte. Changes affecting commentary The commentary is less enthusiastic about Shanks as a source, and is more careful to distinguish UT from UTC. Modified: stable/10/contrib/tzdata/africa stable/10/contrib/tzdata/asia stable/10/contrib/tzdata/australasia stable/10/contrib/tzdata/europe stable/10/contrib/tzdata/northamerica stable/10/contrib/tzdata/southamerica Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzdata/africa ============================================================================== --- stable/10/contrib/tzdata/africa Sun Nov 16 01:47:43 2014 (r274562) +++ stable/10/contrib/tzdata/africa Sun Nov 16 04:02:50 2014 (r274563) @@ -6,20 +6,19 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2013-02-21): +# From Paul Eggert (2014-10-31): # -# A good source for time zone historical data outside the U.S. is +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. -# -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # Another source occasionally used is Edward W. Whitman, World Time Differences, # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which @@ -65,7 +64,6 @@ # 3:00 CAST Central Africa Summer Time (no longer used) # 3:00 SAST South Africa Summer Time (no longer used) # 3:00 EAT East Africa Time -# 4:00 EAST East Africa Summer Time (no longer used) # Algeria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -146,9 +144,7 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 1:00 - WAT # Comoros -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Comoro 2:53:04 - LMT 1911 Jul # Moroni, Gran Comoro - 3:00 - EAT +# See Africa/Nairobi. # Democratic Republic of the Congo # See Africa/Lagos for the western part and Africa/Maputo for the eastern. @@ -172,9 +168,7 @@ Link Africa/Abidjan Africa/Sao_Tome # Sà Link Africa/Abidjan Atlantic/St_Helena # St Helena # Djibouti -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul - 3:00 - EAT +# See Africa/Nairobi. ############################################################################### @@ -387,27 +381,8 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct # See Africa/Lagos. # Eritrea -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Asmara 2:35:32 - LMT 1870 - 2:35:32 - AMT 1890 # Asmara Mean Time - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT - 3:00 - EAT - # Ethiopia -# From Paul Eggert (2014-07-31): -# Like the Swahili of Kenya and Tanzania, many Ethiopians keep a -# 12-hour clock starting at our 06:00, so their "8 o'clock" is our -# 02:00 or 14:00. Keep this in mind when you ask the time in Amharic. -# -# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time -# zones between 1870 and 1890, that they merged to 38E50 (2:35:20) in -# 1890, and that they switched to 3:00 on 1936-05-05. Perhaps 38E50 -# was for Adis Dera. Quite likely the Shanks data entries are wrong -# anyway. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Addis_Ababa 2:34:48 - LMT 1870 - 2:35:20 - ADMT 1936 May 5 # Adis Dera MT - 3:00 - EAT +# See Africa/Nairobi. # Gabon # See Africa/Lagos. @@ -451,6 +426,15 @@ Zone Africa/Nairobi 2:27:16 - LMT 1928 J 2:30 - BEAT 1940 2:45 - BEAUT 1960 3:00 - EAT +Link Africa/Nairobi Africa/Addis_Ababa # Ethiopia +Link Africa/Nairobi Africa/Asmara # Eritrea +Link Africa/Nairobi Africa/Dar_es_Salaam # Tanzania +Link Africa/Nairobi Africa/Djibouti +Link Africa/Nairobi Africa/Kampala # Uganda +Link Africa/Nairobi Africa/Mogadishu # Somalia +Link Africa/Nairobi Indian/Antananarivo # Madagascar +Link Africa/Nairobi Indian/Comoro +Link Africa/Nairobi Indian/Mayotte # Lesotho # See Africa/Johannesburg. @@ -528,11 +512,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 2:00 - EET # Madagascar -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Antananarivo 3:10:04 - LMT 1911 Jul - 3:00 - EAT 1954 Feb 27 23:00s - 3:00 1:00 EAST 1954 May 29 23:00s - 3:00 - EAT +# See Africa/Nairobi. # Malawi # See Africa/Maputo. @@ -635,9 +615,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # no information; probably like Indian/Mauritius # Mayotte -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou - 3:00 - EAT +# See Africa/Nairobi. # Morocco # See the 'europe' file for Spanish Morocco (Africa/Ceuta). @@ -1049,11 +1027,7 @@ Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # See Africa/Abidjan. # Somalia -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Mogadishu 3:01:28 - LMT 1893 Nov - 3:00 - EAT 1931 - 2:30 - BEAT 1957 - 3:00 - EAT +# See Africa/Nairobi. # South Africa # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1096,11 +1070,7 @@ Link Africa/Khartoum Africa/Juba # See Africa/Johannesburg. # Tanzania -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Dar_es_Salaam 2:37:08 - LMT 1931 - 3:00 - EAT 1948 - 2:45 - BEAUT 1961 - 3:00 - EAT +# See Africa/Nairobi. # Togo # See Africa/Abidjan. @@ -1206,12 +1176,7 @@ Zone Africa/Tunis 0:40:44 - LMT 1881 May 1:00 Tunisia CE%sT # Uganda -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Africa/Kampala 2:09:40 - LMT 1928 Jul - 3:00 - EAT 1930 - 2:30 - BEAT 1948 - 2:45 - BEAUT 1957 - 3:00 - EAT +# See Africa/Nairobi. # Zambia # Zimbabwe Modified: stable/10/contrib/tzdata/asia ============================================================================== --- stable/10/contrib/tzdata/asia Sun Nov 16 01:47:43 2014 (r274562) +++ stable/10/contrib/tzdata/asia Sun Nov 16 04:02:50 2014 (r274563) @@ -6,20 +6,19 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2013-08-11): +# From Paul Eggert (2014-10-31): # -# A good source for time zone historical data outside the U.S. is +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. -# -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # Another source occasionally used is Edward W. Whitman, World Time Differences, # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which @@ -1663,44 +1662,70 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May # Korea (North and South) # From Annie I. Bang (2006-07-10): -# http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp -# The Ministry of Commerce, Industry and Energy has already -# commissioned a research project [to reintroduce DST] and has said -# the system may begin as early as 2008.... Korea ran a daylight -# saving program from 1949-61 but stopped it during the 1950-53 Korean War. - -# From Shanks & Pottenger: -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule ROK 1960 only - May 15 0:00 1:00 D -Rule ROK 1960 only - Sep 13 0:00 0 S -Rule ROK 1987 1988 - May Sun>=8 0:00 1:00 D -Rule ROK 1987 1988 - Oct Sun>=8 0:00 0 S - -# From Paul Eggert (2014-07-01): -# The following entries are from Shanks & Pottenger, except that I -# guessed that time zone abbreviations through 1945 followed the same +# http://www.koreaherald.com/view.php?ud=200607100012 +# Korea ran a daylight saving program from 1949-61 but stopped it +# during the 1950-53 Korean War. The system was temporarily enforced +# between 1987 and 1988 ... + +# From Sanghyuk Jung (2014-10-29): +# http://mm.icann.org/pipermail/tz/2014-October/021830.html +# According to the Korean Wikipedia +# http://ko.wikipedia.org/wiki/한국_표준시 +# [oldid=12896437 2014-09-04 08:03 UTC] +# DST in Republic of Korea was as follows.... And I checked old +# newspapers in Korean, all articles correspond with data in Wikipedia. +# For example, the article in 1948 (Korean Language) proved that DST +# started at June 1 in that year. For another example, the article in +# 1988 said that DST started at 2:00 AM in that year. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule ROK 1948 only - Jun 1 0:00 1:00 D +Rule ROK 1948 only - Sep 13 0:00 0 S +Rule ROK 1949 only - Apr 3 0:00 1:00 D +Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S +Rule ROK 1950 only - Apr 1 0:00 1:00 D +Rule ROK 1951 only - May 6 0:00 1:00 D +Rule ROK 1955 only - May 5 0:00 1:00 D +Rule ROK 1955 only - Sep 9 0:00 0 S +Rule ROK 1956 only - May 20 0:00 1:00 D +Rule ROK 1956 only - Sep 30 0:00 0 S +Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D +Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S +Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D +Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S + +# From Paul Eggert (2014-10-30): +# The Korean Wikipedia entry gives the following sources for UT offsets: +# +# 1908: Official Journal Article No. 3994 (Edict No. 5) +# 1912: Governor-General of Korea Official Gazette Issue No. 367 +# (Announcement No. 338) +# 1954: Presidential Decree No. 876 (1954-03-17) +# 1961: Law No. 676 (1961-08-07) +# 1987: Law No. 3919 (1986-12-31) +# +# The Wikipedia entry also has confusing information about a change +# to UT+9 in April 1910, but then what would be the point of the later change +# to UT+9 on 1912-01-01? Omit the 1910 change for now. +# +# I guessed that time zone abbreviations through 1945 followed the same # rules as discussed under Taiwan, with nominal switches from JST to KST # when the respective cities were taken over by the Allies after WWII. +# +# For Pyongyang we have no information; guess no changes since World War II. # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Seoul 8:27:52 - LMT 1890 - 8:30 - KST 1904 Dec - 9:00 - JCST 1928 - 8:30 - KST 1932 +Zone Asia/Seoul 8:27:52 - LMT 1908 Apr 1 + 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Sep 8 9:00 - KST 1954 Mar 21 - 8:00 ROK K%sT 1961 Aug 10 - 8:30 - KST 1968 Oct + 8:30 ROK K%sT 1961 Aug 10 9:00 ROK K%sT -Zone Asia/Pyongyang 8:23:00 - LMT 1890 - 8:30 - KST 1904 Dec - 9:00 - JCST 1928 - 8:30 - KST 1932 +Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1 + 8:30 - KST 1912 Jan 1 9:00 - JCST 1937 Oct 1 9:00 - JST 1945 Aug 24 - 9:00 - KST 1954 Mar 21 - 8:00 - KST 1961 Aug 10 9:00 - KST ############################################################################### Modified: stable/10/contrib/tzdata/australasia ============================================================================== --- stable/10/contrib/tzdata/australasia Sun Nov 16 01:47:43 2014 (r274562) +++ stable/10/contrib/tzdata/australasia Sun Nov 16 04:02:50 2014 (r274563) @@ -797,19 +797,19 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2013-02-21): -# A good source for time zone historical data outside the U.S. is +# From Paul Eggert (2014-10-31): +# +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. -# -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # Another source occasionally used is Edward W. Whitman, World Time Differences, # Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which Modified: stable/10/contrib/tzdata/europe ============================================================================== --- stable/10/contrib/tzdata/europe Sun Nov 16 01:47:43 2014 (r274562) +++ stable/10/contrib/tzdata/europe Sun Nov 16 04:02:50 2014 (r274563) @@ -6,16 +6,19 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2014-05-31): -# A good source for time zone historical data outside the U.S. is +# From Paul Eggert (2014-10-31): +# +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). @@ -287,6 +290,14 @@ # "Timeball on the ballast office is down. Dunsink time." # -- James Joyce, Ulysses +# "Countess Markievicz ... claimed that the [1916] abolition of Dublin Mean Time +# was among various actions undertaken by the 'English' government that +# would 'put the whole country into the SF (Sinn Féin) camp'. She claimed +# Irish 'public feeling (was) outraged by forcing of English time on us'." +# -- Parsons M. Dublin lost its time zone - and 25 minutes - after 1916 Rising. +# Irish Times 2014-10-27. +# http://www.irishtimes.com/news/politics/dublin-lost-its-time-zone-and-25-minutes-after-1916-rising-1.1977411 + # From Joseph S. Myers (2005-01-26): # Irish laws are available online at . # These include various relating to legal time, for example: @@ -594,6 +605,7 @@ Rule Russia 1992 only - Sep lastSat 23: Rule Russia 1993 2010 - Mar lastSun 2:00s 1:00 S Rule Russia 1993 1995 - Sep lastSun 2:00s 0 - Rule Russia 1996 2010 - Oct lastSun 2:00s 0 - +# As described below, Russia's 2014 change affects Zone data, not Rule data. # From Alexander Krivenyshev (2011-06-14): # According to Kremlin press service, Russian President Dmitry Medvedev Modified: stable/10/contrib/tzdata/northamerica ============================================================================== --- stable/10/contrib/tzdata/northamerica Sun Nov 16 01:47:43 2014 (r274562) +++ stable/10/contrib/tzdata/northamerica Sun Nov 16 04:02:50 2014 (r274563) @@ -991,19 +991,19 @@ Zone America/Menominee -5:50:27 - LMT 18 ################################################################################ -# From Paul Eggert (2006-03-22): -# A good source for time zone historical data outside the U.S. is +# From Paul Eggert (2014-10-31): +# +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. -# -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # # Other sources occasionally used include: # @@ -3131,13 +3131,17 @@ Zone America/Miquelon -3:44:40 - LMT 191 # From Paul Eggert (2014-08-19): # The 2014-08-13 Cabinet meeting decided to stay on UTC-4 year-round. See: # http://tcweeklynews.com/daylight-savings-time-to-be-maintained-p5353-127.htm -# Model this as a switch from EST/EDT to AST on 2014-11-02 at 02:00. +# Model this as a switch from EST/EDT to AST ... +# From Chris Walton (2014-11-04): +# ... the TCI government appears to have delayed the switch to +# "permanent daylight saving time" by one year.... +# http://tcweeklynews.com/time-change-to-go-ahead-this-november-p5437-127.htm # # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Grand_Turk -4:44:32 - LMT 1890 -5:07:11 - KMT 1912 Feb # Kingston Mean Time -5:00 - EST 1979 - -5:00 US E%sT 2014 Nov 2 2:00 + -5:00 US E%sT 2015 Nov Sun>=1 2:00 -4:00 - AST # British Virgin Is Modified: stable/10/contrib/tzdata/southamerica ============================================================================== --- stable/10/contrib/tzdata/southamerica Sun Nov 16 01:47:43 2014 (r274562) +++ stable/10/contrib/tzdata/southamerica Sun Nov 16 04:02:50 2014 (r274563) @@ -6,23 +6,23 @@ # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2006-03-22): -# A good source for time zone historical data outside the U.S. is +# From Paul Eggert (2014-10-31): +# +# Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), # San Diego: ACS Publications, Inc. (2003). -# -# For data circa 1899, a common source is: -# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. -# http://www.jstor.org/stable/1774359 +# Unfortunately this book contains many errors and cites no sources. # # Gwillim Law writes that a good source # for recent time zone data is the International Air Transport # Association's Standard Schedules Information Manual (IATA SSIM), # published semiannually. Law sent in several helpful summaries -# of the IATA's data after 1990. +# of the IATA's data after 1990. Except where otherwise noted, +# IATA SSIM is the source for entries after 1990. # -# Except where otherwise noted, Shanks & Pottenger is the source for -# entries through 1990, and IATA SSIM is the source for entries afterwards. +# For data circa 1899, a common source is: +# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94. +# http://www.jstor.org/stable/1774359 # # Earlier editions of these tables used the North American style (e.g. ARST and # ARDT for Argentine Standard and Daylight Time), but the following quote From owner-svn-src-stable-10@FreeBSD.ORG Sun Nov 16 23:02:33 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E150680A; Sun, 16 Nov 2014 23:02:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C23E07A4; Sun, 16 Nov 2014 23:02:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGN2Xq6059684; Sun, 16 Nov 2014 23:02:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGN2WRr059677; Sun, 16 Nov 2014 23:02:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411162302.sAGN2WRr059677@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Nov 2014 23:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274606 - in stable/10: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2014 23:02:34 -0000 Author: kib Date: Sun Nov 16 23:02:32 2014 New Revision: 274606 URL: https://svnweb.freebsd.org/changeset/base/274606 Log: MFC r273966: Fix two issues with lockmgr(9) LK_CAN_SHARE() test, related to the exclusive locker starvation. MFC r273986: Fix the build with ADAPTIVE_LOCKMGRS kernel option. Modified: stable/10/share/man/man9/lock.9 stable/10/sys/kern/kern_lock.c stable/10/sys/kern/vfs_lookup.c stable/10/sys/sys/lockmgr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/lock.9 ============================================================================== --- stable/10/share/man/man9/lock.9 Sun Nov 16 21:39:56 2014 (r274605) +++ stable/10/share/man/man9/lock.9 Sun Nov 16 23:02:32 2014 (r274606) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 6, 2013 +.Dd November 2, 2014 .Dt LOCK 9 .Os .Sh NAME @@ -145,7 +145,7 @@ Their arguments are: A pointer to the lock to manipulate. .It Fa flags Flags indicating what action is to be taken. -.Bl -tag -width ".Dv LK_CANRECURSE" +.Bl -tag -width ".Dv LK_NODDLKTREAT" .It Dv LK_SHARED Acquire a shared lock. If an exclusive lock is currently held, @@ -199,6 +199,29 @@ Allow recursion on an exclusive lock. For every lock there must be a release. .It Dv LK_INTERLOCK Unlock the interlock (which should be locked already). +.It Dv LK_NODDLKTREAT +Normally, +.Fn lockmgr +postpones serving further shared requests for shared-locked lock if there is +exclusive waiter, to avoid exclusive lock starvation. +But, if the thread requesting the shared lock already owns a shared lockmgr +lock, the request is granted even in presence of the parallel exclusive lock +request, which is done to avoid deadlocks with recursive shared acquisition. +.Pp +The +.Dv LK_NODDLKTREAT +flag can only be used by code which requests shared non-recursive lock. +The flag allows exclusive requests to preempt the current shared request +even if the current thread owns shared locks. +This is safe since shared lock is guaranteed to not recurse, and is used +when thread is known to held unrelated shared locks, to not cause +unneccessary starvation. An example is +.Dv vp +locking in VFS +.Xr lookup 9 , +when +.Dv dvp +is already locked. .El .It Fa ilk An interlock mutex for controlling group access to the lock. Modified: stable/10/sys/kern/kern_lock.c ============================================================================== --- stable/10/sys/kern/kern_lock.c Sun Nov 16 21:39:56 2014 (r274605) +++ stable/10/sys/kern/kern_lock.c Sun Nov 16 23:02:32 2014 (r274606) @@ -116,10 +116,11 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & } \ } while (0) -#define LK_CAN_SHARE(x) \ - (((x) & LK_SHARE) && (((x) & LK_EXCLUSIVE_WAITERS) == 0 || \ - ((x) & LK_EXCLUSIVE_SPINNERS) == 0 || \ - curthread->td_lk_slocks || (curthread->td_pflags & TDP_DEADLKTREAT))) +#define LK_CAN_SHARE(x, flags) \ + (((x) & LK_SHARE) && \ + (((x) & (LK_EXCLUSIVE_WAITERS | LK_EXCLUSIVE_SPINNERS)) == 0 || \ + (curthread->td_lk_slocks != 0 && !(flags & LK_NODDLKTREAT)) || \ + (curthread->td_pflags & TDP_DEADLKTREAT))) #define LK_TRYOP(x) \ ((x) & LK_NOWAIT) @@ -531,7 +532,7 @@ __lockmgr_args(struct lock *lk, u_int fl * waiters, if we fail to acquire the shared lock * loop back and retry. */ - if (LK_CAN_SHARE(x)) { + if (LK_CAN_SHARE(x, flags)) { if (atomic_cmpset_acq_ptr(&lk->lk_lock, x, x + LK_ONE_SHARER)) break; @@ -615,7 +616,7 @@ __lockmgr_args(struct lock *lk, u_int fl __func__, lk, spintries, i); x = lk->lk_lock; if ((x & LK_SHARE) == 0 || - LK_CAN_SHARE(x) != 0) + LK_CAN_SHARE(x, flags) != 0) break; cpu_spinwait(); } @@ -636,7 +637,7 @@ __lockmgr_args(struct lock *lk, u_int fl * if the lock can be acquired in shared mode, try * again. */ - if (LK_CAN_SHARE(x)) { + if (LK_CAN_SHARE(x, flags)) { sleepq_release(&lk->lock_object); continue; } Modified: stable/10/sys/kern/vfs_lookup.c ============================================================================== --- stable/10/sys/kern/vfs_lookup.c Sun Nov 16 21:39:56 2014 (r274605) +++ stable/10/sys/kern/vfs_lookup.c Sun Nov 16 23:02:32 2014 (r274606) @@ -392,6 +392,7 @@ compute_cn_lkflags(struct mount *mp, int lkflags &= ~LK_SHARED; lkflags |= LK_EXCLUSIVE; } + lkflags |= LK_NODDLKTREAT; return (lkflags); } Modified: stable/10/sys/sys/lockmgr.h ============================================================================== --- stable/10/sys/sys/lockmgr.h Sun Nov 16 21:39:56 2014 (r274605) +++ stable/10/sys/sys/lockmgr.h Sun Nov 16 23:02:32 2014 (r274606) @@ -158,6 +158,7 @@ _lockmgr_args_rw(struct lock *lk, u_int #define LK_RETRY 0x000400 #define LK_SLEEPFAIL 0x000800 #define LK_TIMELOCK 0x001000 +#define LK_NODDLKTREAT 0x002000 /* * Operations for lockmgr(). From owner-svn-src-stable-10@FreeBSD.ORG Mon Nov 17 00:57:34 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98858DDD; Mon, 17 Nov 2014 00:57:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84C8D1E7; Mon, 17 Nov 2014 00:57:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAH0vYV1013121; Mon, 17 Nov 2014 00:57:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAH0vYXQ013120; Mon, 17 Nov 2014 00:57:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411170057.sAH0vYXQ013120@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Nov 2014 00:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274608 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 00:57:34 -0000 Author: kib Date: Mon Nov 17 00:57:33 2014 New Revision: 274608 URL: https://svnweb.freebsd.org/changeset/base/274608 Log: MFC r274040 and r274084. The result is removal of agp_intel.c from the static amd64 kernel when agp is configured. Modified: stable/10/sys/conf/files.amd64 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Sun Nov 16 23:31:23 2014 (r274607) +++ stable/10/sys/conf/files.amd64 Mon Nov 17 00:57:33 2014 (r274608) @@ -154,7 +154,6 @@ dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp -dev/agp/agp_intel.c optional agp dev/agp/agp_via.c optional agp dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdtemp/amdtemp.c optional amdtemp From owner-svn-src-stable-10@FreeBSD.ORG Mon Nov 17 00:59:46 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D008F1A; Mon, 17 Nov 2014 00:59:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 496BF1F1; Mon, 17 Nov 2014 00:59:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAH0xkVc013439; Mon, 17 Nov 2014 00:59:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAH0xk8H013438; Mon, 17 Nov 2014 00:59:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411170059.sAH0xk8H013438@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Nov 2014 00:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274609 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 00:59:46 -0000 Author: kib Date: Mon Nov 17 00:59:45 2014 New Revision: 274609 URL: https://svnweb.freebsd.org/changeset/base/274609 Log: MFC r274023: When other end of the pipe closed during the write, but some bytes were written, return short write instead of EPIPE. Modified: stable/10/sys/kern/sys_pipe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sys_pipe.c ============================================================================== --- stable/10/sys/kern/sys_pipe.c Mon Nov 17 00:57:33 2014 (r274608) +++ stable/10/sys/kern/sys_pipe.c Mon Nov 17 00:59:45 2014 (r274609) @@ -1293,13 +1293,13 @@ pipe_write(fp, uio, active_cred, flags, } /* - * Don't return EPIPE if I/O was successful + * Don't return EPIPE if any byte was written. + * EINTR and other interrupts are handled by generic I/O layer. + * Do not pretend that I/O succeeded for obvious user error + * like EFAULT. */ - if ((wpipe->pipe_buffer.cnt == 0) && - (uio->uio_resid == 0) && - (error == EPIPE)) { + if (uio->uio_resid != orig_resid && error == EPIPE) error = 0; - } if (error == 0) vfs_timestamp(&wpipe->pipe_mtime); From owner-svn-src-stable-10@FreeBSD.ORG Mon Nov 17 01:01:46 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4743DEA; Mon, 17 Nov 2014 01:01:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3430D20A; Mon, 17 Nov 2014 01:01:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAH11knC017287; Mon, 17 Nov 2014 01:01:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAH11j0N017285; Mon, 17 Nov 2014 01:01:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411170101.sAH11j0N017285@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 17 Nov 2014 01:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274610 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 01:01:46 -0000 Author: kib Date: Mon Nov 17 01:01:45 2014 New Revision: 274610 URL: https://svnweb.freebsd.org/changeset/base/274610 Log: MFC r274343: When sleeping waiting for the profiling stop, always set P_STOPPROF before dropping process lock. Clear P_STOPPROF when doing wakeup. Modified: stable/10/sys/kern/kern_clock.c stable/10/sys/kern/subr_prof.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_clock.c ============================================================================== --- stable/10/sys/kern/kern_clock.c Mon Nov 17 00:59:45 2014 (r274609) +++ stable/10/sys/kern/kern_clock.c Mon Nov 17 01:01:45 2014 (r274610) @@ -669,11 +669,11 @@ stopprofclock(p) PROC_LOCK_ASSERT(p, MA_OWNED); if (p->p_flag & P_PROFIL) { if (p->p_profthreads != 0) { - p->p_flag |= P_STOPPROF; - while (p->p_profthreads != 0) + while (p->p_profthreads != 0) { + p->p_flag |= P_STOPPROF; msleep(&p->p_profthreads, &p->p_mtx, PPAUSE, "stopprof", 0); - p->p_flag &= ~P_STOPPROF; + } } if ((p->p_flag & P_PROFIL) == 0) return; Modified: stable/10/sys/kern/subr_prof.c ============================================================================== --- stable/10/sys/kern/subr_prof.c Mon Nov 17 00:59:45 2014 (r274609) +++ stable/10/sys/kern/subr_prof.c Mon Nov 17 01:01:45 2014 (r274610) @@ -533,6 +533,7 @@ out: if (--p->p_profthreads == 0) { if (p->p_flag & P_STOPPROF) { wakeup(&p->p_profthreads); + p->p_flag &= ~P_STOPPROF; stop = 0; } } From owner-svn-src-stable-10@FreeBSD.ORG Mon Nov 17 07:20:05 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B21B7497; Mon, 17 Nov 2014 07:20:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D9CB9A8; Mon, 17 Nov 2014 07:20:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAH7K54f088594; Mon, 17 Nov 2014 07:20:05 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAH7K46K088588; Mon, 17 Nov 2014 07:20:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <201411170720.sAH7K46K088588@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 17 Nov 2014 07:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274612 - stable/10/sys/dev/cxgbe/firmware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 07:20:05 -0000 Author: np Date: Mon Nov 17 07:20:03 2014 New Revision: 274612 URL: https://svnweb.freebsd.org/changeset/base/274612 Log: MFC r274351: cxgbe(4): adjust PMRX and PMTX parameters. Modified: stable/10/sys/dev/cxgbe/firmware/t4fw_cfg.txt stable/10/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt stable/10/sys/dev/cxgbe/firmware/t5fw_cfg.txt stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/firmware/t4fw_cfg.txt ============================================================================== --- stable/10/sys/dev/cxgbe/firmware/t4fw_cfg.txt Mon Nov 17 01:05:29 2014 (r274611) +++ stable/10/sys/dev/cxgbe/firmware/t4fw_cfg.txt Mon Nov 17 07:20:03 2014 (r274612) @@ -28,8 +28,8 @@ tp_ntxch = 0 # TP rx and tx payload memory (% of the total EDRAM + DDR3). - tp_pmrx = 38 - tp_pmtx = 60 + tp_pmrx = 38, 512 + tp_pmtx = 60, 512 tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K @@ -160,7 +160,7 @@ [fini] version = 0x1 - checksum = 0x6a1f8858 + checksum = 0xb4168add # # $FreeBSD$ # Modified: stable/10/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt ============================================================================== --- stable/10/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt Mon Nov 17 01:05:29 2014 (r274611) +++ stable/10/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt Mon Nov 17 07:20:03 2014 (r274612) @@ -125,7 +125,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP RX payload - tp_pmrx = 34 + tp_pmrx = 34, 512 # TP RX payload page size tp_pmrx_pagesize = 64K @@ -135,7 +135,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP TX payload - tp_pmtx = 32 + tp_pmtx = 32, 512 # TP TX payload page size tp_pmtx_pagesize = 64K @@ -544,7 +544,7 @@ [fini] version = 0x14250012 - checksum = 0xd9ae0325 + checksum = 0x22f592a9 # Total resources used by above allocations: # Virtual Interfaces: 104 Modified: stable/10/sys/dev/cxgbe/firmware/t5fw_cfg.txt ============================================================================== --- stable/10/sys/dev/cxgbe/firmware/t5fw_cfg.txt Mon Nov 17 01:05:29 2014 (r274611) +++ stable/10/sys/dev/cxgbe/firmware/t5fw_cfg.txt Mon Nov 17 07:20:03 2014 (r274612) @@ -37,8 +37,8 @@ tp_ntxch = 0 # TP rx and tx payload memory (% of the total EDRAM + DDR3). - tp_pmrx = 38 - tp_pmtx = 60 + tp_pmrx = 38, 512 + tp_pmtx = 60, 512 tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K @@ -173,7 +173,7 @@ [fini] version = 0x1 - checksum = 0xa0ee1715 + checksum = 0x4f45e608 # # $FreeBSD$ # Modified: stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt ============================================================================== --- stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt Mon Nov 17 01:05:29 2014 (r274611) +++ stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt Mon Nov 17 07:20:03 2014 (r274612) @@ -149,7 +149,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP RX payload - tp_pmrx = 30 + tp_pmrx = 30, 512 # TP RX payload page size tp_pmrx_pagesize = 64K @@ -159,7 +159,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP TX payload - tp_pmtx = 50 + tp_pmtx = 50, 512 # TP TX payload page size tp_pmtx_pagesize = 64K @@ -463,7 +463,7 @@ [fini] version = 0x1425000d - checksum = 0xe56cb999 + checksum = 0x22f1530b # Total resources used by above allocations: # Virtual Interfaces: 104 Modified: stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt ============================================================================== --- stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt Mon Nov 17 01:05:29 2014 (r274611) +++ stable/10/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt Mon Nov 17 07:20:03 2014 (r274612) @@ -153,7 +153,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP RX payload - tp_pmrx = 30 + tp_pmrx = 30, 512 # TP RX payload page size tp_pmrx_pagesize = 64K @@ -163,7 +163,7 @@ # Percentage of dynamic memory (in either the EDRAM or external MEM) # to use for TP TX payload - tp_pmtx = 50 + tp_pmtx = 50, 512 # TP TX payload page size tp_pmtx_pagesize = 64K @@ -587,7 +587,7 @@ [fini] version = 0x14250016 - checksum = 0x5d740273 + checksum = 0xafaf8723 # Total resources used by above allocations: # Virtual Interfaces: 104 From owner-svn-src-stable-10@FreeBSD.ORG Mon Nov 17 07:37:42 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8C9FB49; Mon, 17 Nov 2014 07:37:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94B9FB8D; Mon, 17 Nov 2014 07:37:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAH7bgde097201; Mon, 17 Nov 2014 07:37:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAH7bga7097200; Mon, 17 Nov 2014 07:37:42 GMT (envelope-from np@FreeBSD.org) Message-Id: <201411170737.sAH7bga7097200@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 17 Nov 2014 07:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274615 - stable/10/tools/tools/cxgbetool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 07:37:42 -0000 Author: np Date: Mon Nov 17 07:37:41 2014 New Revision: 274615 URL: https://svnweb.freebsd.org/changeset/base/274615 Log: MFC r273360: One of MAP_ANON, MAP_PRIVATE, MAP_SHARED, or MAP_STACK must be specified. Modified: stable/10/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- stable/10/tools/tools/cxgbetool/cxgbetool.c Mon Nov 17 07:20:53 2014 (r274614) +++ stable/10/tools/tools/cxgbetool/cxgbetool.c Mon Nov 17 07:37:41 2014 (r274615) @@ -1462,7 +1462,7 @@ loadfw(int argc, const char *argv[]) } data.len = st.st_size; - data.data = mmap(0, data.len, PROT_READ, 0, fd, 0); + data.data = mmap(0, data.len, PROT_READ, MAP_PRIVATE, fd, 0); if (data.data == MAP_FAILED) { warn("mmap"); close(fd); From owner-svn-src-stable-10@FreeBSD.ORG Mon Nov 17 13:26:51 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D600B854; Mon, 17 Nov 2014 13:26:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1AEA389; Mon, 17 Nov 2014 13:26:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHDQpWQ058729; Mon, 17 Nov 2014 13:26:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHDQpDl058728; Mon, 17 Nov 2014 13:26:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201411171326.sAHDQpDl058728@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 17 Nov 2014 13:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274623 - stable/10/sys/cddl/compat/opensolaris/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 13:26:52 -0000 Author: avg Date: Mon Nov 17 13:26:50 2014 New Revision: 274623 URL: https://svnweb.freebsd.org/changeset/base/274623 Log: MFC r272701: make userland __assfail from opensolaris compat honor 'aok' variable Modified: stable/10/sys/cddl/compat/opensolaris/sys/assfail.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/sys/assfail.h ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/sys/assfail.h Mon Nov 17 13:26:28 2014 (r274622) +++ stable/10/sys/cddl/compat/opensolaris/sys/assfail.h Mon Nov 17 13:26:50 2014 (r274623) @@ -46,20 +46,24 @@ void assfail3(const char *, uintmax_t, c #else /* !defined(_KERNEL) */ #ifndef HAVE_ASSFAIL +extern int aok; + static __inline int __assfail(const char *expr, const char *file, int line) { (void)fprintf(stderr, "Assertion failed: (%s), file %s, line %d.\n", expr, file, line); - abort(); - /* NOTREACHED */ + if (!aok) + abort(); return (0); } #define assfail __assfail #endif #ifndef HAVE_ASSFAIL3 +extern int aok; + static __inline void __assfail3(const char *expr, uintmax_t lv, const char *op, uintmax_t rv, const char *file, int line) { @@ -67,8 +71,8 @@ __assfail3(const char *expr, uintmax_t l (void)fprintf(stderr, "Assertion failed: %s (0x%jx %s 0x%jx), file %s, line %d.\n", expr, lv, op, rv, file, line); - abort(); - /* NOTREACHED */ + if (!aok) + abort(); } #define assfail3 __assfail3 #endif From owner-svn-src-stable-10@FreeBSD.ORG Mon Nov 17 13:30:19 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E5F2D4D; Mon, 17 Nov 2014 13:30:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69F1B3D3; Mon, 17 Nov 2014 13:30:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHDUJRV061237; Mon, 17 Nov 2014 13:30:19 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHDUJDN061236; Mon, 17 Nov 2014 13:30:19 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201411171330.sAHDUJDN061236@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 17 Nov 2014 13:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274625 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 13:30:19 -0000 Author: avg Date: Mon Nov 17 13:30:18 2014 New Revision: 274625 URL: https://svnweb.freebsd.org/changeset/base/274625 Log: MFC r272708: l2arc_write_buffers: reduce headroom value Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 13:29:58 2014 (r274624) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Nov 17 13:30:18 2014 (r274625) @@ -5055,7 +5055,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de if (ab == NULL) ARCSTAT_BUMP(arcstat_l2_write_buffer_list_null_iter); - headroom = target_sz * l2arc_headroom; + headroom = target_sz * l2arc_headroom * 2 / ARC_BUFC_NUMLISTS; if (do_headroom_boost) headroom = (headroom * l2arc_headroom_boost) / 100; From owner-svn-src-stable-10@FreeBSD.ORG Mon Nov 17 17:17:11 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9DB1625; Mon, 17 Nov 2014 17:17:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 956C1880; Mon, 17 Nov 2014 17:17:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHHHBkn067302; Mon, 17 Nov 2014 17:17:11 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHHHBFw067301; Mon, 17 Nov 2014 17:17:11 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411171717.sAHHHBFw067301@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Mon, 17 Nov 2014 17:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274634 - stable/10/usr.bin/mkimg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 17:17:11 -0000 Author: marcel Date: Mon Nov 17 17:17:10 2014 New Revision: 274634 URL: https://svnweb.freebsd.org/changeset/base/274634 Log: MFC r274410: Fix for behaviour of SEEK_DATA on ZFS. Modified: stable/10/usr.bin/mkimg/image.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/mkimg/image.c ============================================================================== --- stable/10/usr.bin/mkimg/image.c Mon Nov 17 16:30:51 2014 (r274633) +++ stable/10/usr.bin/mkimg/image.c Mon Nov 17 17:17:10 2014 (r274634) @@ -405,16 +405,18 @@ image_copyin_mapped(lba_t blk, int fd, u error = 0; while (!error && cur < end) { hole = lseek(fd, cur, SEEK_HOLE); + if (hole == -1) + hole = end; data = lseek(fd, cur, SEEK_DATA); + if (data == -1) + data = end; /* * Treat the entire file as data if sparse files * are not supported by the underlying file system. */ - if (hole == -1 && data == -1) { + if (hole == end && data == end) data = cur; - hole = end; - } if (cur == hole && data > hole) { hole = pos; From owner-svn-src-stable-10@FreeBSD.ORG Tue Nov 18 07:16:04 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 445CC505; Tue, 18 Nov 2014 07:16:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 305FFAFA; Tue, 18 Nov 2014 07:16:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAI7G4qJ062019; Tue, 18 Nov 2014 07:16:04 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAI7G4Yv062018; Tue, 18 Nov 2014 07:16:04 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201411180716.sAI7G4Yv062018@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Tue, 18 Nov 2014 07:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274646 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 07:16:04 -0000 Author: jpaetzel Date: Tue Nov 18 07:16:03 2014 New Revision: 274646 URL: https://svnweb.freebsd.org/changeset/base/274646 Log: MFC 273866 Plug memory ordering holes in buf_ring_enqueue. For at least some users this patch eliminates the races previously discussed on the mailing list. Submitted by: oleg Reviewed by: kmacy MFC after: 2 weeks Tested by: kmacy,rpaulo Modified: stable/10/sys/sys/buf_ring.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/buf_ring.h ============================================================================== --- stable/10/sys/sys/buf_ring.h Tue Nov 18 07:03:10 2014 (r274645) +++ stable/10/sys/sys/buf_ring.h Tue Nov 18 07:16:03 2014 (r274646) @@ -64,8 +64,7 @@ struct buf_ring { static __inline int buf_ring_enqueue(struct buf_ring *br, void *buf) { - uint32_t prod_head, prod_next; - uint32_t cons_tail; + uint32_t prod_head, prod_next, cons_tail; #ifdef DEBUG_BUFRING int i; for (i = br->br_cons_head; i != br->br_prod_head; @@ -77,16 +76,20 @@ buf_ring_enqueue(struct buf_ring *br, vo critical_enter(); do { prod_head = br->br_prod_head; + prod_next = (prod_head + 1) & br->br_prod_mask; cons_tail = br->br_cons_tail; - prod_next = (prod_head + 1) & br->br_prod_mask; - if (prod_next == cons_tail) { - br->br_drops++; - critical_exit(); - return (ENOBUFS); + rmb(); + if (prod_head == br->br_prod_head && + cons_tail == br->br_cons_tail) { + br->br_drops++; + critical_exit(); + return (ENOBUFS); + } + continue; } - } while (!atomic_cmpset_int(&br->br_prod_head, prod_head, prod_next)); + } while (!atomic_cmpset_acq_int(&br->br_prod_head, prod_head, prod_next)); #ifdef DEBUG_BUFRING if (br->br_ring[prod_head] != NULL) panic("dangling value in enqueue"); @@ -94,19 +97,13 @@ buf_ring_enqueue(struct buf_ring *br, vo br->br_ring[prod_head] = buf; /* - * The full memory barrier also avoids that br_prod_tail store - * is reordered before the br_ring[prod_head] is full setup. - */ - mb(); - - /* * If there are other enqueues in progress * that preceeded us, we need to wait for them * to complete */ while (br->br_prod_tail != prod_head) cpu_spinwait(); - br->br_prod_tail = prod_next; + atomic_store_rel_int(&br->br_prod_tail, prod_next); critical_exit(); return (0); } @@ -119,37 +116,23 @@ static __inline void * buf_ring_dequeue_mc(struct buf_ring *br) { uint32_t cons_head, cons_next; - uint32_t prod_tail; void *buf; - int success; critical_enter(); do { cons_head = br->br_cons_head; - prod_tail = br->br_prod_tail; - cons_next = (cons_head + 1) & br->br_cons_mask; - - if (cons_head == prod_tail) { + + if (cons_head == br->br_prod_tail) { critical_exit(); return (NULL); } - - success = atomic_cmpset_int(&br->br_cons_head, cons_head, - cons_next); - } while (success == 0); + } while (!atomic_cmpset_acq_int(&br->br_cons_head, cons_head, cons_next)); buf = br->br_ring[cons_head]; #ifdef DEBUG_BUFRING br->br_ring[cons_head] = NULL; #endif - - /* - * The full memory barrier also avoids that br_ring[cons_read] - * load is reordered after br_cons_tail is set. - */ - mb(); - /* * If there are other dequeues in progress * that preceeded us, we need to wait for them @@ -158,7 +141,7 @@ buf_ring_dequeue_mc(struct buf_ring *br) while (br->br_cons_tail != cons_head) cpu_spinwait(); - br->br_cons_tail = cons_next; + atomic_store_rel_int(&br->br_cons_tail, cons_next); critical_exit(); return (buf); From owner-svn-src-stable-10@FreeBSD.ORG Tue Nov 18 12:53:36 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BAB5A53; Tue, 18 Nov 2014 12:53:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 546F59D; Tue, 18 Nov 2014 12:53:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAICrauC031780; Tue, 18 Nov 2014 12:53:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAICrWhp031761; Tue, 18 Nov 2014 12:53:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411181253.sAICrWhp031761@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 18 Nov 2014 12:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274648 - in stable/10: share/man/man9 sys/amd64/amd64 sys/amd64/ia32 sys/arm/include sys/compat/freebsd32 sys/i386/i386 sys/ia64/include sys/kern sys/mips/include sys/net sys/powerpc/p... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 12:53:36 -0000 Author: kib Date: Tue Nov 18 12:53:32 2014 New Revision: 274648 URL: https://svnweb.freebsd.org/changeset/base/274648 Log: Merge the fueword(9) and casueword(9). In particular, MFC r273783: Add fueword(9) and casueword(9) functions. MFC note: ia64 is handled like arm, with NO_FUEWORD define. MFC r273784: Replace some calls to fuword() by fueword() with proper error checking. MFC r273785: Convert kern_umtx.c to use fueword() and casueword(). MFC note: the sys__umtx_lock and sys__umtx_unlock syscalls are not converted, they are removed from HEAD, and not used. The do_sem2*() family is not yet merged to stable/10, corresponding chunk will be merged after do_sem2* are committed. MFC r273788 (by jkim): Actually install casuword(9) to fix build. MFC r273911: Add type qualifier volatile to the base (userspace) address argument of fuword(9) and suword(9). Added: stable/10/share/man/man9/casuword.9 - copied unchanged from r273783, head/share/man/man9/casuword.9 Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/fetch.9 stable/10/share/man/man9/store.9 stable/10/sys/amd64/amd64/support.S stable/10/sys/amd64/ia32/ia32_syscall.c stable/10/sys/arm/include/param.h stable/10/sys/compat/freebsd32/freebsd32_misc.c stable/10/sys/i386/i386/support.s stable/10/sys/i386/i386/trap.c stable/10/sys/ia64/include/param.h stable/10/sys/kern/kern_exec.c stable/10/sys/kern/kern_umtx.c stable/10/sys/kern/subr_uio.c stable/10/sys/kern/vfs_acl.c stable/10/sys/mips/include/param.h stable/10/sys/net/if_spppsubr.c stable/10/sys/powerpc/powerpc/copyinout.c stable/10/sys/sparc64/include/param.h stable/10/sys/sys/systm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/share/man/man9/Makefile Tue Nov 18 12:53:32 2014 (r274648) @@ -46,6 +46,7 @@ MAN= accept_filter.9 \ BUS_SETUP_INTR.9 \ bus_space.9 \ byteorder.9 \ + casuword.9 \ cd.9 \ condvar.9 \ config_intrhook.9 \ @@ -566,6 +567,9 @@ MLINKS+=condvar.9 cv_broadcast.9 \ MLINKS+=config_intrhook.9 config_intrhook_disestablish.9 \ config_intrhook.9 config_intrhook_establish.9 MLINKS+=contigmalloc.9 contigfree.9 +MLINKS+=casuword.9 casueword.9 \ + casuword.9 casueword32.9 \ + casuword.9 casuword32.9 MLINKS+=copy.9 copyin.9 \ copy.9 copyin_nofault.9 \ copy.9 copyinstr.9 \ @@ -668,7 +672,10 @@ MLINKS+=fetch.9 fubyte.9 \ fetch.9 fuword.9 \ fetch.9 fuword16.9 \ fetch.9 fuword32.9 \ - fetch.9 fuword64.9 + fetch.9 fuword64.9 \ + fetch.9 fueword.9 \ + fetch.9 fueword32.9 \ + fetch.9 fueword64.9 MLINKS+=fpu_kern.9 fpu_kern_alloc_ctx.9 \ fpu_kern.9 fpu_kern_free_ctx.9 \ fpu_kern.9 fpu_kern_enter.9 \ Copied: stable/10/share/man/man9/casuword.9 (from r273783, head/share/man/man9/casuword.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man9/casuword.9 Tue Nov 18 12:53:32 2014 (r274648, copy of r273783, head/share/man/man9/casuword.9) @@ -0,0 +1,95 @@ +.\" Copyright (c) 2014 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" Part of this documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 21, 2014 +.Dt CASU 9 +.Os +.Sh NAME +.Nm casueword , +.Nm casueword32 , +.Nm casuword , +.Nm casuword32 +.Nd fetch, compare and store data from user-space +.Sh SYNOPSIS +.In sys/types.h +.In sys/systm.h +.Ft int +.Fn casueword "volatile u_long *base" "u_long oldval" "u_long *oldvalp" "u_long newval" +.Ft int +.Fn casueword32 "volatile uint32_t *base" "uint32_t oldval" "uint32_t *oldvalp" "uint32_t newval" +.Ft u_long +.Fn casuword "volatile u_long *base" "u_long oldval" "u_long newval" +.Ft uint32_t +.Fn casuword32 "volatile uint32_t *base" "uint32_t oldval" "uint32_t newval" +.Sh DESCRIPTION +The +.Nm +functions are designed to perform atomic compare-and-swap operation on +the value in the usermode memory of the current process. +.Pp +The +.Nm +routines reads the value from user memory with address +.Pa base , +and compare the value read with +.Pa oldval . +If the values are equal, +.Pa newval +is written to the +.Pa *base . +In case of +.Fn casueword32 +and +.Fn casueword , +old value is stored into the (kernel-mode) variable pointed by +.Pa *oldvalp . +The userspace value must be naturally aligned. +.Pp +The callers of +.Fn casuword +and +.Fn casuword32 +functions cannot distinguish between -1 read from +userspace and function failure. +.Sh RETURN VALUES +The +.Fn casuword +and +.Fn casuword32 +functions return the data fetched or -1 on failure. +The +.Fn casueword +and +.Fn casueword32 +functions return 0 on success and -1 on failure. +.Sh SEE ALSO +.Xr atomic 9 , +.Xr fetch 9 , +.Xr store 9 Modified: stable/10/share/man/man9/fetch.9 ============================================================================== --- stable/10/share/man/man9/fetch.9 Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/share/man/man9/fetch.9 Tue Nov 18 12:53:32 2014 (r274648) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2009 +.Dd October 29, 2014 .Dt FETCH 9 .Os .Sh NAME @@ -44,43 +44,56 @@ .Nm fuword , .Nm fuword16 , .Nm fuword32 , -.Nm fuword64 +.Nm fuword64 , +.Nm fueword , +.Nm fueword32 , +.Nm fueword64 .Nd fetch data from user-space .Sh SYNOPSIS .In sys/types.h -.In sys/time.h .In sys/systm.h .Ft int -.Fn fubyte "const void *base" +.Fn fubyte "volatile const void *base" .Ft long -.Fn fuword "const void *base" +.Fn fuword "volatile const void *base" .Ft int -.Fn fuword16 "void *base" +.Fn fuword16 "volatile const void *base" .Ft int32_t -.Fn fuword32 "const void *base" +.Fn fuword32 "volatile const void *base" .Ft int64_t -.Fn fuword64 "const void *base" +.Fn fuword64 "volatile const void *base" +.Ft long +.Fn fueword "volatile const void *base" "long *val" +.Ft int32_t +.Fn fueword32 "volatile const void *base" "int32_t *val" +.Ft int64_t +.Fn fueword64 "volatile const void *base" "int64_t *val" .In sys/resourcevar.h .Ft int .Fn fuswintr "void *base" .Sh DESCRIPTION The .Nm -functions are designed to copy small amounts of data from user-space. +functions are designed to copy small amounts of data from user-space +of the current process. +If read is successful, it is performed atomically. +The data read must be naturally aligned. .Pp The .Nm routines provide the following functionality: -.Bl -tag -width "fuswintr()" +.Bl -tag -width "fueword32()" .It Fn fubyte Fetches a byte of data from the user-space address .Pa base . +The byte read is zero-extended into the results variable. .It Fn fuword -Fetches a word of data from the user-space address +Fetches a word of data (long) from the user-space address .Pa base . .It Fn fuword16 Fetches 16 bits of data from the user-space address .Pa base . +The half-word read is zero-extended into the results variable. .It Fn fuword32 Fetches 32 bits of data from the user-space address .Pa base . @@ -91,11 +104,46 @@ Fetches 64 bits of data from the user-sp Fetches a short word of data from the user-space address .Pa base . This function is safe to call during an interrupt context. +.It Fn fueword +Fetches a word of data (long) from the user-space address +.Pa base +and stores the result in the variable pointed by +.Pa val . +.It Fn fueword32 +Fetches 32 bits of data from the user-space address +.Pa base +and stores the result in the variable pointed by +.Pa val . +.It Fn fueword64 +Fetches 64 bits of data from the user-space address +.Pa base +and stores the result in the variable pointed by +.Pa val . .El +.Pp +The callers of +.Fn fuword , +.Fn fuword32 +and +.Fn fuword64 +functions cannot distinguish between -1 read from +userspace and function failure. .Sh RETURN VALUES The -.Nm +.Fn fubyte , +.Fn fuword , +.Fn fuword16 , +.Fn fuword32 , +.Fn fuword64 , +and +.Fn fuswintr functions return the data fetched or -1 on failure. +The +.Fn fueword , +.Fn fueword32 +and +.Fn fueword64 +functions return 0 on success and -1 on failure. .Sh SEE ALSO .Xr copy 9 , .Xr store 9 Modified: stable/10/share/man/man9/store.9 ============================================================================== --- stable/10/share/man/man9/store.9 Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/share/man/man9/store.9 Tue Nov 18 12:53:32 2014 (r274648) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2009 +.Dd October 29, 2014 .Dt STORE 9 .Os .Sh NAME @@ -48,15 +48,15 @@ .In sys/time.h .In sys/systm.h .Ft int -.Fn subyte "void *base" "int byte" +.Fn subyte "volatile void *base" "int byte" .Ft int -.Fn suword "void *base" "long word" +.Fn suword "volatile void *base" "long word" .Ft int -.Fn suword16 "void *base" "int word" +.Fn suword16 "volatile void *base" "int word" .Ft int -.Fn suword32 "void *base" "int32_t word" +.Fn suword32 "volatile void *base" "int32_t word" .Ft int -.Fn suword64 "void *base" "int64_t word" +.Fn suword64 "volatile void *base" "int64_t word" .In sys/resourcevar.h .Ft int .Fn suswintr "void *base" "int word" @@ -64,6 +64,8 @@ The .Nm functions are designed to copy small amounts of data to user-space. +If write is successful, it is performed atomically. +The data written must be naturally aligned. .Pp The .Nm Modified: stable/10/sys/amd64/amd64/support.S ============================================================================== --- stable/10/sys/amd64/amd64/support.S Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/sys/amd64/amd64/support.S Tue Nov 18 12:53:32 2014 (r274648) @@ -312,12 +312,13 @@ copyin_fault: END(copyin) /* - * casuword32. Compare and set user integer. Returns -1 or the current value. - * dst = %rdi, old = %rsi, new = %rdx + * casueword32. Compare and set user integer. Returns -1 on fault, + * 0 if access was successful. Old value is written to *oldp. + * dst = %rdi, old = %esi, oldp = %rdx, new = %ecx */ -ENTRY(casuword32) - movq PCPU(CURPCB),%rcx - movq $fusufault,PCB_ONFAULT(%rcx) +ENTRY(casueword32) + movq PCPU(CURPCB),%r8 + movq $fusufault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rdi /* verify address is valid */ @@ -327,26 +328,34 @@ ENTRY(casuword32) #ifdef SMP lock #endif - cmpxchgl %edx,(%rdi) /* new = %edx */ + cmpxchgl %ecx,(%rdi) /* new = %ecx */ /* * The old value is in %eax. If the store succeeded it will be the * value we expected (old) from before the store, otherwise it will - * be the current value. + * be the current value. Save %eax into %esi to prepare the return + * value. */ + movl %eax,%esi + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) - movq PCPU(CURPCB),%rcx - movq $0,PCB_ONFAULT(%rcx) + /* + * Access the oldp after the pcb_onfault is cleared, to correctly + * catch corrupted pointer. + */ + movl %esi,(%rdx) /* oldp = %rdx */ ret -END(casuword32) +END(casueword32) /* - * casuword. Compare and set user word. Returns -1 or the current value. - * dst = %rdi, old = %rsi, new = %rdx + * casueword. Compare and set user long. Returns -1 on fault, + * 0 if access was successful. Old value is written to *oldp. + * dst = %rdi, old = %rsi, oldp = %rdx, new = %rcx */ -ENTRY(casuword) - movq PCPU(CURPCB),%rcx - movq $fusufault,PCB_ONFAULT(%rcx) +ENTRY(casueword) + movq PCPU(CURPCB),%r8 + movq $fusufault,PCB_ONFAULT(%r8) movq $VM_MAXUSER_ADDRESS-4,%rax cmpq %rax,%rdi /* verify address is valid */ @@ -356,28 +365,28 @@ ENTRY(casuword) #ifdef SMP lock #endif - cmpxchgq %rdx,(%rdi) /* new = %rdx */ + cmpxchgq %rcx,(%rdi) /* new = %rcx */ /* - * The old value is in %eax. If the store succeeded it will be the + * The old value is in %rax. If the store succeeded it will be the * value we expected (old) from before the store, otherwise it will * be the current value. */ - - movq PCPU(CURPCB),%rcx - movq $fusufault,PCB_ONFAULT(%rcx) - movq $0,PCB_ONFAULT(%rcx) + movq %rax,%rsi + xorl %eax,%eax + movq %rax,PCB_ONFAULT(%r8) + movq %rsi,(%rdx) ret -END(casuword) +END(casueword) /* * Fetch (load) a 64-bit word, a 32-bit word, a 16-bit word, or an 8-bit - * byte from user memory. All these functions are MPSAFE. - * addr = %rdi + * byte from user memory. + * addr = %rdi, valp = %rsi */ -ALTENTRY(fuword64) -ENTRY(fuword) +ALTENTRY(fueword64) +ENTRY(fueword) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) @@ -385,13 +394,15 @@ ENTRY(fuword) cmpq %rax,%rdi /* verify address is valid */ ja fusufault - movq (%rdi),%rax - movq $0,PCB_ONFAULT(%rcx) + xorl %eax,%eax + movq (%rdi),%r11 + movq %rax,PCB_ONFAULT(%rcx) + movq %r11,(%rsi) ret END(fuword64) END(fuword) -ENTRY(fuword32) +ENTRY(fueword32) movq PCPU(CURPCB),%rcx movq $fusufault,PCB_ONFAULT(%rcx) @@ -399,10 +410,12 @@ ENTRY(fuword32) cmpq %rax,%rdi /* verify address is valid */ ja fusufault - movl (%rdi),%eax - movq $0,PCB_ONFAULT(%rcx) + xorl %eax,%eax + movl (%rdi),%r11d + movq %rax,PCB_ONFAULT(%rcx) + movl %r11d,(%rsi) ret -END(fuword32) +END(fueword32) /* * fuswintr() and suswintr() are specialized variants of fuword16() and Modified: stable/10/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/10/sys/amd64/ia32/ia32_syscall.c Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/sys/amd64/ia32/ia32_syscall.c Tue Nov 18 12:53:32 2014 (r274648) @@ -110,7 +110,7 @@ ia32_fetch_syscall_args(struct thread *t struct proc *p; struct trapframe *frame; caddr_t params; - u_int32_t args[8]; + u_int32_t args[8], tmp; int error, i; p = td->td_proc; @@ -126,7 +126,10 @@ ia32_fetch_syscall_args(struct thread *t /* * Code is first argument, followed by actual args. */ - sa->code = fuword32(params); + error = fueword32(params, &tmp); + if (error == -1) + return (EFAULT); + sa->code = tmp; params += sizeof(int); } else if (sa->code == SYS___syscall) { /* @@ -135,7 +138,10 @@ ia32_fetch_syscall_args(struct thread *t * We use a 32-bit fetch in case params is not * aligned. */ - sa->code = fuword32(params); + error = fueword32(params, &tmp); + if (error == -1) + return (EFAULT); + sa->code = tmp; params += sizeof(quad_t); } if (p->p_sysent->sv_mask) Modified: stable/10/sys/arm/include/param.h ============================================================================== --- stable/10/sys/arm/include/param.h Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/sys/arm/include/param.h Tue Nov 18 12:53:32 2014 (r274648) @@ -149,4 +149,8 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) +#ifdef _KERNEL +#define NO_FUEWORD 1 +#endif + #endif /* !_ARM_INCLUDE_PARAM_H_ */ Modified: stable/10/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/10/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/sys/compat/freebsd32/freebsd32_misc.c Tue Nov 18 12:53:32 2014 (r274648) @@ -1924,16 +1924,21 @@ freebsd32_sysctl(struct thread *td, stru { int error, name[CTL_MAXNAME]; size_t j, oldlen; + uint32_t tmp; if (uap->namelen > CTL_MAXNAME || uap->namelen < 2) return (EINVAL); error = copyin(uap->name, name, uap->namelen * sizeof(int)); if (error) return (error); - if (uap->oldlenp) - oldlen = fuword32(uap->oldlenp); - else + if (uap->oldlenp) { + error = fueword32(uap->oldlenp, &tmp); + oldlen = tmp; + } else { oldlen = 0; + } + if (error != 0) + return (EFAULT); error = userland_sysctl(td, name, uap->namelen, uap->old, &oldlen, 1, uap->new, uap->newlen, &j, SCTL_MASK32); Modified: stable/10/sys/i386/i386/support.s ============================================================================== --- stable/10/sys/i386/i386/support.s Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/sys/i386/i386/support.s Tue Nov 18 12:53:32 2014 (r274648) @@ -389,16 +389,16 @@ copyin_fault: ret /* - * casuword. Compare and set user word. Returns -1 or the current value. + * casueword. Compare and set user word. Returns -1 on fault, + * 0 on non-faulting access. The current value is in *oldp. */ - -ALTENTRY(casuword32) -ENTRY(casuword) +ALTENTRY(casueword32) +ENTRY(casueword) movl PCPU(CURPCB),%ecx movl $fusufault,PCB_ONFAULT(%ecx) movl 4(%esp),%edx /* dst */ movl 8(%esp),%eax /* old */ - movl 12(%esp),%ecx /* new */ + movl 16(%esp),%ecx /* new */ cmpl $VM_MAXUSER_ADDRESS-4,%edx /* verify address is valid */ ja fusufault @@ -416,17 +416,20 @@ ENTRY(casuword) movl PCPU(CURPCB),%ecx movl $0,PCB_ONFAULT(%ecx) + movl 12(%esp),%edx /* oldp */ + movl %eax,(%edx) + xorl %eax,%eax ret -END(casuword32) -END(casuword) +END(casueword32) +END(casueword) /* * Fetch (load) a 32-bit word, a 16-bit word, or an 8-bit byte from user - * memory. All these functions are MPSAFE. + * memory. */ -ALTENTRY(fuword32) -ENTRY(fuword) +ALTENTRY(fueword32) +ENTRY(fueword) movl PCPU(CURPCB),%ecx movl $fusufault,PCB_ONFAULT(%ecx) movl 4(%esp),%edx /* from */ @@ -436,9 +439,12 @@ ENTRY(fuword) movl (%edx),%eax movl $0,PCB_ONFAULT(%ecx) + movl 8(%esp),%edx + movl %eax,(%edx) + xorl %eax,%eax ret -END(fuword32) -END(fuword) +END(fueword32) +END(fueword) /* * fuswintr() and suswintr() are specialized variants of fuword16() and Modified: stable/10/sys/i386/i386/trap.c ============================================================================== --- stable/10/sys/i386/i386/trap.c Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/sys/i386/i386/trap.c Tue Nov 18 12:53:32 2014 (r274648) @@ -1062,6 +1062,7 @@ cpu_fetch_syscall_args(struct thread *td struct proc *p; struct trapframe *frame; caddr_t params; + long tmp; int error; p = td->td_proc; @@ -1077,14 +1078,20 @@ cpu_fetch_syscall_args(struct thread *td /* * Code is first argument, followed by actual args. */ - sa->code = fuword(params); + error = fueword(params, &tmp); + if (error == -1) + return (EFAULT); + sa->code = tmp; params += sizeof(int); } else if (sa->code == SYS___syscall) { /* * Like syscall, but code is a quad, so as to maintain * quad alignment for the rest of the arguments. */ - sa->code = fuword(params); + error = fueword(params, &tmp); + if (error == -1) + return (EFAULT); + sa->code = tmp; params += sizeof(quad_t); } Modified: stable/10/sys/ia64/include/param.h ============================================================================== --- stable/10/sys/ia64/include/param.h Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/sys/ia64/include/param.h Tue Nov 18 12:53:32 2014 (r274648) @@ -121,4 +121,8 @@ #define pgtok(x) ((x) * (PAGE_SIZE / 1024)) +#ifdef _KERNEL +#define NO_FUEWORD 1 +#endif + #endif /* !_IA64_INCLUDE_PARAM_H_ */ Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/sys/kern/kern_exec.c Tue Nov 18 12:53:32 2014 (r274648) @@ -1124,7 +1124,7 @@ int exec_copyin_args(struct image_args *args, char *fname, enum uio_seg segflg, char **argv, char **envv) { - char *argp, *envp; + u_long argp, envp; int error; size_t length; @@ -1160,13 +1160,17 @@ exec_copyin_args(struct image_args *args /* * extract arguments first */ - while ((argp = (caddr_t) (intptr_t) fuword(argv++))) { - if (argp == (caddr_t) -1) { + for (;;) { + error = fueword(argv++, &argp); + if (error == -1) { error = EFAULT; goto err_exit; } - if ((error = copyinstr(argp, args->endp, - args->stringspace, &length))) { + if (argp == 0) + break; + error = copyinstr((void *)(uintptr_t)argp, args->endp, + args->stringspace, &length); + if (error != 0) { if (error == ENAMETOOLONG) error = E2BIG; goto err_exit; @@ -1182,13 +1186,17 @@ exec_copyin_args(struct image_args *args * extract environment strings */ if (envv) { - while ((envp = (caddr_t)(intptr_t)fuword(envv++))) { - if (envp == (caddr_t)-1) { + for (;;) { + error = fueword(envv++, &envp); + if (error == -1) { error = EFAULT; goto err_exit; } - if ((error = copyinstr(envp, args->endp, - args->stringspace, &length))) { + if (envp == 0) + break; + error = copyinstr((void *)(uintptr_t)envp, + args->endp, args->stringspace, &length); + if (error != 0) { if (error == ENAMETOOLONG) error = E2BIG; goto err_exit; Modified: stable/10/sys/kern/kern_umtx.c ============================================================================== --- stable/10/sys/kern/kern_umtx.c Tue Nov 18 09:18:35 2014 (r274647) +++ stable/10/sys/kern/kern_umtx.c Tue Nov 18 12:53:32 2014 (r274648) @@ -510,6 +510,15 @@ umtxq_unbusy(struct umtx_key *key) wakeup_one(uc); } +static inline void +umtxq_unbusy_unlocked(struct umtx_key *key) +{ + + umtxq_lock(key); + umtxq_unbusy(key); + umtxq_unlock(key); +} + static struct umtxq_queue * umtxq_queue_lookup(struct umtx_key *key, int q) { @@ -1208,6 +1217,7 @@ do_wait(struct thread *td, void *addr, u struct abs_timeout timo; struct umtx_q *uq; u_long tmp; + uint32_t tmp32; int error = 0; uq = td->td_umtxq; @@ -1221,18 +1231,29 @@ do_wait(struct thread *td, void *addr, u umtxq_lock(&uq->uq_key); umtxq_insert(uq); umtxq_unlock(&uq->uq_key); - if (compat32 == 0) - tmp = fuword(addr); - else - tmp = (unsigned int)fuword32(addr); + if (compat32 == 0) { + error = fueword(addr, &tmp); + if (error != 0) + error = EFAULT; + } else { + error = fueword32(addr, &tmp32); + if (error == 0) + tmp = tmp32; + else + error = EFAULT; + } umtxq_lock(&uq->uq_key); - if (tmp == id) - error = umtxq_sleep(uq, "uwait", timeout == NULL ? - NULL : &timo); - if ((uq->uq_flags & UQF_UMTXQ) == 0) - error = 0; - else + if (error == 0) { + if (tmp == id) + error = umtxq_sleep(uq, "uwait", timeout == NULL ? + NULL : &timo); + if ((uq->uq_flags & UQF_UMTXQ) == 0) + error = 0; + else + umtxq_remove(uq); + } else if ((uq->uq_flags & UQF_UMTXQ) != 0) { umtxq_remove(uq); + } umtxq_unlock(&uq->uq_key); umtx_key_release(&uq->uq_key); if (error == ERESTART) @@ -1269,11 +1290,11 @@ do_lock_normal(struct thread *td, struct struct abs_timeout timo; struct umtx_q *uq; uint32_t owner, old, id; - int error = 0; + int error, rv; id = td->td_tid; uq = td->td_umtxq; - + error = 0; if (timeout != NULL) abs_timeout_init2(&timo, timeout); @@ -1282,7 +1303,9 @@ do_lock_normal(struct thread *td, struct * can fault on any access. */ for (;;) { - owner = fuword32(__DEVOLATILE(void *, &m->m_owner)); + rv = fueword32(&m->m_owner, &owner); + if (rv == -1) + return (EFAULT); if (mode == _UMUTEX_WAIT) { if (owner == UMUTEX_UNOWNED || owner == UMUTEX_CONTESTED) return (0); @@ -1290,31 +1313,31 @@ do_lock_normal(struct thread *td, struct /* * Try the uncontested case. This should be done in userland. */ - owner = casuword32(&m->m_owner, UMUTEX_UNOWNED, id); + rv = casueword32(&m->m_owner, UMUTEX_UNOWNED, + &owner, id); + /* The address was invalid. */ + if (rv == -1) + return (EFAULT); /* The acquire succeeded. */ if (owner == UMUTEX_UNOWNED) return (0); - /* The address was invalid. */ - if (owner == -1) - return (EFAULT); - /* If no one owns it but it is contested try to acquire it. */ if (owner == UMUTEX_CONTESTED) { - owner = casuword32(&m->m_owner, - UMUTEX_CONTESTED, id | UMUTEX_CONTESTED); + rv = casueword32(&m->m_owner, + UMUTEX_CONTESTED, &owner, + id | UMUTEX_CONTESTED); + /* The address was invalid. */ + if (rv == -1) + return (EFAULT); if (owner == UMUTEX_CONTESTED) return (0); - /* The address was invalid. */ - if (owner == -1) - return (EFAULT); - - error = umtxq_check_susp(td); - if (error != 0) - return (error); + rv = umtxq_check_susp(td); + if (rv != 0) + return (rv); /* If this failed the lock has changed, restart. */ continue; @@ -1350,10 +1373,11 @@ do_lock_normal(struct thread *td, struct * either some one else has acquired the lock or it has been * released. */ - old = casuword32(&m->m_owner, owner, owner | UMUTEX_CONTESTED); + rv = casueword32(&m->m_owner, owner, &old, + owner | UMUTEX_CONTESTED); /* The address was invalid. */ - if (old == -1) { + if (rv == -1) { umtxq_lock(&uq->uq_key); umtxq_remove(uq); umtxq_unbusy(&uq->uq_key); @@ -1398,16 +1422,16 @@ do_unlock_normal(struct thread *td, stru /* * Make sure we own this mtx. */ - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - if (owner == -1) + error = fueword32(&m->m_owner, &owner); + if (error == -1) return (EFAULT); if ((owner & ~UMUTEX_CONTESTED) != id) return (EPERM); if ((owner & UMUTEX_CONTESTED) == 0) { - old = casuword32(&m->m_owner, owner, UMUTEX_UNOWNED); - if (old == -1) + error = casueword32(&m->m_owner, owner, &old, UMUTEX_UNOWNED); + if (error == -1) return (EFAULT); if (old == owner) return (0); @@ -1429,14 +1453,14 @@ do_unlock_normal(struct thread *td, stru * there is zero or one thread only waiting for it. * Otherwise, it must be marked as contested. */ - old = casuword32(&m->m_owner, owner, - count <= 1 ? UMUTEX_UNOWNED : UMUTEX_CONTESTED); + error = casueword32(&m->m_owner, owner, &old, + count <= 1 ? UMUTEX_UNOWNED : UMUTEX_CONTESTED); umtxq_lock(&key); umtxq_signal(&key,1); umtxq_unbusy(&key); umtxq_unlock(&key); umtx_key_release(&key); - if (old == -1) + if (error == -1) return (EFAULT); if (old != owner) return (EINVAL); @@ -1456,14 +1480,16 @@ do_wake_umutex(struct thread *td, struct int error; int count; - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - if (owner == -1) + error = fueword32(&m->m_owner, &owner); + if (error == -1) return (EFAULT); if ((owner & ~UMUTEX_CONTESTED) != 0) return (0); - flags = fuword32(&m->m_flags); + error = fueword32(&m->m_flags, &flags); + if (error == -1) + return (EFAULT); /* We should only ever be in here for contested locks */ if ((error = umtx_key_get(m, TYPE_NORMAL_UMUTEX, GET_SHARE(flags), @@ -1475,16 +1501,20 @@ do_wake_umutex(struct thread *td, struct count = umtxq_count(&key); umtxq_unlock(&key); - if (count <= 1) - owner = casuword32(&m->m_owner, UMUTEX_CONTESTED, UMUTEX_UNOWNED); + if (count <= 1) { + error = casueword32(&m->m_owner, UMUTEX_CONTESTED, &owner, + UMUTEX_UNOWNED); + if (error == -1) + error = EFAULT; + } umtxq_lock(&key); - if (count != 0 && (owner & ~UMUTEX_CONTESTED) == 0) + if (error == 0 && count != 0 && (owner & ~UMUTEX_CONTESTED) == 0) umtxq_signal(&key, 1); umtxq_unbusy(&key); umtxq_unlock(&key); umtx_key_release(&key); - return (0); + return (error); } /* @@ -1527,41 +1557,47 @@ do_wake2_umutex(struct thread *td, struc * any memory. */ if (count > 1) { - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - while ((owner & UMUTEX_CONTESTED) ==0) { - old = casuword32(&m->m_owner, owner, - owner|UMUTEX_CONTESTED); + error = fueword32(&m->m_owner, &owner); + if (error == -1) + error = EFAULT; + while (error == 0 && (owner & UMUTEX_CONTESTED) == 0) { + error = casueword32(&m->m_owner, owner, &old, + owner | UMUTEX_CONTESTED); + if (error == -1) { + error = EFAULT; + break; + } if (old == owner) break; owner = old; - if (old == -1) - break; error = umtxq_check_susp(td); if (error != 0) break; } } else if (count == 1) { - owner = fuword32(__DEVOLATILE(uint32_t *, &m->m_owner)); - while ((owner & ~UMUTEX_CONTESTED) != 0 && + error = fueword32(&m->m_owner, &owner); + if (error == -1) + error = EFAULT; + while (error == 0 && (owner & ~UMUTEX_CONTESTED) != 0 && (owner & UMUTEX_CONTESTED) == 0) { - old = casuword32(&m->m_owner, owner, - owner|UMUTEX_CONTESTED); + error = casueword32(&m->m_owner, owner, &old, + owner | UMUTEX_CONTESTED); + if (error == -1) { + error = EFAULT; + break; + } if (old == owner) break; owner = old; - if (old == -1) - break; error = umtxq_check_susp(td); if (error != 0) break; } } umtxq_lock(&key); - if (owner == -1) { - error = EFAULT; + if (error == EFAULT) { umtxq_signal(&key, INT_MAX); - } - else if (count != 0 && (owner & ~UMUTEX_CONTESTED) == 0) + } else if (count != 0 && (owner & ~UMUTEX_CONTESTED) == 0) umtxq_signal(&key, 1); umtxq_unbusy(&key); umtxq_unlock(&key); @@ -1941,7 +1977,7 @@ do_lock_pi(struct thread *td, struct umu struct umtx_q *uq; struct umtx_pi *pi, *new_pi; uint32_t id, owner, old; - int error; + int error, rv; id = td->td_tid; uq = td->td_umtxq; @@ -1984,7 +2020,12 @@ do_lock_pi(struct thread *td, struct umu /* * Try the uncontested case. This should be done in userland. */ - owner = casuword32(&m->m_owner, UMUTEX_UNOWNED, id); + rv = casueword32(&m->m_owner, UMUTEX_UNOWNED, &owner, id); + /* The address was invalid. */ + if (rv == -1) { + error = EFAULT; + break; + } /* The acquire succeeded. */ if (owner == UMUTEX_UNOWNED) { @@ -1992,16 +2033,15 @@ do_lock_pi(struct thread *td, struct umu break; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@FreeBSD.ORG Tue Nov 18 13:01:42 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E061C9D; Tue, 18 Nov 2014 13:01:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A56A17B; Tue, 18 Nov 2014 13:01:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAID1gZa036779; Tue, 18 Nov 2014 13:01:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAID1gLK036778; Tue, 18 Nov 2014 13:01:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411181301.sAID1gLK036778@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 18 Nov 2014 13:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274649 - stable/10/sys/dev/agp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 13:01:42 -0000 Author: kib Date: Tue Nov 18 13:01:41 2014 New Revision: 274649 URL: https://svnweb.freebsd.org/changeset/base/274649 Log: MFC r274377: On 965 and higher, map GTT as write-combining. Modified: stable/10/sys/dev/agp/agp_i810.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/agp/agp_i810.c ============================================================================== --- stable/10/sys/dev/agp/agp_i810.c Tue Nov 18 12:53:32 2014 (r274648) +++ stable/10/sys/dev/agp/agp_i810.c Tue Nov 18 13:01:41 2014 (r274649) @@ -113,6 +113,8 @@ static int agp_sb_get_gtt_total_entries( static int agp_i810_install_gatt(device_t dev); static int agp_i830_install_gatt(device_t dev); +static int agp_i965_install_gatt(device_t dev); +static int agp_g4x_install_gatt(device_t dev); static void agp_i810_deinstall_gatt(device_t dev); static void agp_i830_deinstall_gatt(device_t dev); @@ -395,7 +397,7 @@ static const struct agp_i810_driver agp_ .get_stolen_size = agp_i915_get_stolen_size, .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, .get_gtt_total_entries = agp_i965_get_gtt_total_entries, - .install_gatt = agp_i830_install_gatt, + .install_gatt = agp_i965_install_gatt, .deinstall_gatt = agp_i830_deinstall_gatt, .write_gtt = agp_i965_write_gtt, .install_gtt_pte = agp_i965_install_gtt_pte, @@ -464,7 +466,7 @@ static const struct agp_i810_driver agp_ .get_stolen_size = agp_i915_get_stolen_size, .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, .get_gtt_total_entries = agp_gen5_get_gtt_total_entries, - .install_gatt = agp_i830_install_gatt, + .install_gatt = agp_g4x_install_gatt, .deinstall_gatt = agp_i830_deinstall_gatt, .write_gtt = agp_g4x_write_gtt, .install_gtt_pte = agp_g4x_install_gtt_pte, @@ -487,7 +489,7 @@ static const struct agp_i810_driver agp_ .get_stolen_size = agp_sb_get_stolen_size, .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, .get_gtt_total_entries = agp_sb_get_gtt_total_entries, - .install_gatt = agp_i830_install_gatt, + .install_gatt = agp_g4x_install_gatt, .deinstall_gatt = agp_i830_deinstall_gatt, .write_gtt = agp_sb_write_gtt, .install_gtt_pte = agp_sb_install_gtt_pte, @@ -1405,14 +1407,11 @@ agp_i810_install_gatt(device_t dev) return (0); } -static int -agp_i830_install_gatt(device_t dev) +static void +agp_i830_install_gatt_init(struct agp_i810_softc *sc) { - struct agp_i810_softc *sc; uint32_t pgtblctl; - sc = device_get_softc(dev); - /* * The i830 automatically initializes the 128k gatt on boot. * GATT address is already in there, make sure it's enabled. @@ -1422,10 +1421,46 @@ agp_i830_install_gatt(device_t dev) bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, pgtblctl); sc->gatt->ag_physical = pgtblctl & ~1; +} + +static int +agp_i830_install_gatt(device_t dev) +{ + struct agp_i810_softc *sc; + + sc = device_get_softc(dev); + agp_i830_install_gatt_init(sc); return (0); } static int +agp_gen4_install_gatt(device_t dev, const vm_size_t gtt_offset) +{ + struct agp_i810_softc *sc; + + sc = device_get_softc(dev); + pmap_change_attr((vm_offset_t)rman_get_virtual(sc->sc_res[0]) + + gtt_offset, rman_get_size(sc->sc_res[0]) - gtt_offset, + VM_MEMATTR_WRITE_COMBINING); + agp_i830_install_gatt_init(sc); + return (0); +} + +static int +agp_i965_install_gatt(device_t dev) +{ + + return (agp_gen4_install_gatt(dev, 512 * 1024)); +} + +static int +agp_g4x_install_gatt(device_t dev) +{ + + return (agp_gen4_install_gatt(dev, 2 * 1024 * 1024)); +} + +static int agp_i810_attach(device_t dev) { struct agp_i810_softc *sc; From owner-svn-src-stable-10@FreeBSD.ORG Tue Nov 18 13:03:19 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0B27DEB; Tue, 18 Nov 2014 13:03:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D9DA188; Tue, 18 Nov 2014 13:03:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAID3JIb037113; Tue, 18 Nov 2014 13:03:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAID3JaJ037112; Tue, 18 Nov 2014 13:03:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411181303.sAID3JaJ037112@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 18 Nov 2014 13:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274650 - stable/10/sys/dev/agp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 13:03:19 -0000 Author: kib Date: Tue Nov 18 13:03:18 2014 New Revision: 274650 URL: https://svnweb.freebsd.org/changeset/base/274650 Log: MFC r274378: Attach agp_i810 to non-VGA display class. Modified: stable/10/sys/dev/agp/agp_i810.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/agp/agp_i810.c ============================================================================== --- stable/10/sys/dev/agp/agp_i810.c Tue Nov 18 13:01:41 2014 (r274649) +++ stable/10/sys/dev/agp/agp_i810.c Tue Nov 18 13:03:18 2014 (r274650) @@ -747,7 +747,8 @@ agp_i810_match(device_t dev) int i, devid; if (pci_get_class(dev) != PCIC_DISPLAY - || pci_get_subclass(dev) != PCIS_DISPLAY_VGA) + || (pci_get_subclass(dev) != PCIS_DISPLAY_VGA && + pci_get_subclass(dev) != PCIS_DISPLAY_OTHER)) return (NULL); devid = pci_get_devid(dev); From owner-svn-src-stable-10@FreeBSD.ORG Tue Nov 18 13:05:25 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0864FE3; Tue, 18 Nov 2014 13:05:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2DE919E; Tue, 18 Nov 2014 13:05:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAID5PZQ037557; Tue, 18 Nov 2014 13:05:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAID5Pis037556; Tue, 18 Nov 2014 13:05:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411181305.sAID5Pis037556@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 18 Nov 2014 13:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274651 - stable/10/sys/dev/agp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Nov 2014 13:05:25 -0000 Author: kib Date: Tue Nov 18 13:05:24 2014 New Revision: 274651 URL: https://svnweb.freebsd.org/changeset/base/274651 Log: MFC r274379: Initial attachment of the agp(4) to Haswell IGP. Modified: stable/10/sys/dev/agp/agp_i810.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/agp/agp_i810.c ============================================================================== --- stable/10/sys/dev/agp/agp_i810.c Tue Nov 18 13:03:18 2014 (r274650) +++ stable/10/sys/dev/agp/agp_i810.c Tue Nov 18 13:05:24 2014 (r274651) @@ -501,6 +501,29 @@ static const struct agp_i810_driver agp_ .chipset_flush = agp_i810_chipset_flush, }; +static const struct agp_i810_driver agp_i810_hsw_driver = { + .chiptype = CHIP_SB, + .gen = 7, + .busdma_addr_mask_sz = 40, + .res_spec = agp_g4x_res_spec, + .check_active = agp_sb_check_active, + .set_desc = agp_i810_set_desc, + .dump_regs = agp_sb_dump_regs, + .get_stolen_size = agp_sb_get_stolen_size, + .get_gtt_mappable_entries = agp_i915_get_gtt_mappable_entries, + .get_gtt_total_entries = agp_sb_get_gtt_total_entries, + .install_gatt = agp_g4x_install_gatt, + .deinstall_gatt = agp_i830_deinstall_gatt, + .write_gtt = agp_sb_write_gtt, + .install_gtt_pte = agp_sb_install_gtt_pte, + .read_gtt_pte = agp_g4x_read_gtt_pte, + .read_gtt_pte_paddr = agp_sb_read_gtt_pte_paddr, + .set_aperture = agp_i915_set_aperture, + .chipset_flush_setup = agp_i810_chipset_flush_setup, + .chipset_flush_teardown = agp_i810_chipset_flush_teardown, + .chipset_flush = agp_i810_chipset_flush, +}; + /* For adding new devices, devid is the id of the graphics controller * (pci:0:2:0, for example). The placeholder (usually at pci:0:2:1) for the * second head should never be added. The bridge_offset is the offset to @@ -737,6 +760,41 @@ static const struct agp_i810_match { .driver = &agp_i810_sb_driver }, { + .devid = 0x04028086, + .name = "Haswell desktop GT1", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x04128086, + .name = "Haswell desktop GT2", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x040a8086, + .name = "Haswell server GT1", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x041a8086, + .name = "Haswell server GT2", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x04068086, + .name = "Haswell mobile GT1", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x04168086, + .name = "Haswell mobile GT2", + .driver = &agp_i810_hsw_driver + }, + { + .devid = 0x0c168086, + .name = "Haswell SDV", + .driver = &agp_i810_hsw_driver + }, + { .devid = 0, } }; From owner-svn-src-stable-10@FreeBSD.ORG Wed Nov 19 07:24:45 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE8F353F; Wed, 19 Nov 2014 07:24:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A038FA5E; Wed, 19 Nov 2014 07:24:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJ7OjdN057175; Wed, 19 Nov 2014 07:24:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJ7OiwV057171; Wed, 19 Nov 2014 07:24:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411190724.sAJ7OiwV057171@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 19 Nov 2014 07:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274696 - in stable: 10/contrib/llvm/include/llvm/CodeGen 10/contrib/llvm/lib/CodeGen/SelectionDAG 10/contrib/llvm/patches 9/contrib/llvm/include/llvm/CodeGen 9/contrib/llvm/lib/CodeGen... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 07:24:46 -0000 Author: dim Date: Wed Nov 19 07:24:43 2014 New Revision: 274696 URL: https://svnweb.freebsd.org/changeset/base/274696 Log: MFC r274442: Pull in r221709 from upstream llvm trunk (by Frédéric Riss): Totally forget deallocated SDNodes in SDDbgInfo. What would happen before that commit is that the SDDbgValues associated with a deallocated SDNode would be marked Invalidated, but SDDbgInfo would keep a map entry keyed by the SDNode pointer pointing to this list of invalidated SDDbgNodes. As the memory gets reused, the list might get wrongly associated with another new SDNode. As the SDDbgValues are cloned when they are transfered, this can lead to an exponential number of SDDbgValues being produced during DAGCombine like in http://llvm.org/bugs/show_bug.cgi?id=20893 Note that the previous behavior wasn't really buggy as the invalidation made sure that the SDDbgValues won't be used. This commit can be considered a memory optimization and as such is really hard to validate in a unit-test. This should fix abnormally large memory usage and resulting OOM crashes when compiling certain ports with debug information. Reported by: Dmitry Marakasov Upstream PRs: http://llvm.org/PR19031 http://llvm.org/PR20893 MFC r274483: The fix imported into llvm in r274442 contains some C++11 constructs, which gcc in base cannot handle. Replace these with C++98 equivalents. While here, add the patch for the adapted fix. Reported by: bz, kib Pointy hat to: dim Added: stable/10/contrib/llvm/patches/patch-r274442-llvm-r221709-debug-oom.diff - copied unchanged from r274483, head/contrib/llvm/patches/patch-r274442-llvm-r221709-debug-oom.diff Modified: stable/10/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Added: stable/9/contrib/llvm/patches/patch-r274442-llvm-r221709-debug-oom.diff - copied unchanged from r274483, head/contrib/llvm/patches/patch-r274442-llvm-r221709-debug-oom.diff Modified: stable/9/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/10/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h Wed Nov 19 07:11:29 2014 (r274695) +++ stable/10/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h Wed Nov 19 07:24:43 2014 (r274696) @@ -127,6 +127,10 @@ public: DbgValMap[Node].push_back(V); } + /// \brief Invalidate all DbgValues attached to the node and remove + /// it from the Node-to-DbgValues map. + void erase(const SDNode *Node); + void clear() { DbgValMap.clear(); DbgValues.clear(); Modified: stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Nov 19 07:11:29 2014 (r274695) +++ stable/10/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Nov 19 07:24:43 2014 (r274696) @@ -625,6 +625,15 @@ void SelectionDAG::DeleteNodeNotInCSEMap DeallocateNode(N); } +void SDDbgInfo::erase(const SDNode *Node) { + DbgValMapType::iterator I = DbgValMap.find(Node); + if (I == DbgValMap.end()) + return; + for (unsigned J = 0, N = I->second.size(); J != N; ++J) + I->second[J]->setIsInvalidated(); + DbgValMap.erase(I); +} + void SelectionDAG::DeallocateNode(SDNode *N) { if (N->OperandsNeedDelete) delete[] N->OperandList; @@ -635,10 +644,9 @@ void SelectionDAG::DeallocateNode(SDNode NodeAllocator.Deallocate(AllNodes.remove(N)); - // If any of the SDDbgValue nodes refer to this SDNode, invalidate them. - ArrayRef DbgVals = DbgInfo->getSDDbgValues(N); - for (unsigned i = 0, e = DbgVals.size(); i != e; ++i) - DbgVals[i]->setIsInvalidated(); + // If any of the SDDbgValue nodes refer to this SDNode, invalidate + // them and forget about that node. + DbgInfo->erase(N); } /// RemoveNodeFromCSEMaps - Take the specified node out of the CSE map that Copied: stable/10/contrib/llvm/patches/patch-r274442-llvm-r221709-debug-oom.diff (from r274483, head/contrib/llvm/patches/patch-r274442-llvm-r221709-debug-oom.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/patches/patch-r274442-llvm-r221709-debug-oom.diff Wed Nov 19 07:24:43 2014 (r274696, copy of r274483, head/contrib/llvm/patches/patch-r274442-llvm-r221709-debug-oom.diff) @@ -0,0 +1,73 @@ +Pull in r221709 from upstream llvm trunk (by Frédéric Riss): + + Totally forget deallocated SDNodes in SDDbgInfo. + + What would happen before that commit is that the SDDbgValues associated with + a deallocated SDNode would be marked Invalidated, but SDDbgInfo would keep + a map entry keyed by the SDNode pointer pointing to this list of invalidated + SDDbgNodes. As the memory gets reused, the list might get wrongly associated + with another new SDNode. As the SDDbgValues are cloned when they are transfered, + this can lead to an exponential number of SDDbgValues being produced during + DAGCombine like in http://llvm.org/bugs/show_bug.cgi?id=20893 + + Note that the previous behavior wasn't really buggy as the invalidation made + sure that the SDDbgValues won't be used. This commit can be considered a + memory optimization and as such is really hard to validate in a unit-test. + +This should fix abnormally large memory usage and resulting OOM crashes +when compiling certain ports with debug information. + +Reported by: Dmitry Marakasov +Upstream PRs: http://llvm.org/PR19031 http://llvm.org/PR20893 + +Introduced here: http://svnweb.freebsd.org/changeset/base/274442 + +Index: include/llvm/CodeGen/SelectionDAG.h +=================================================================== +--- include/llvm/CodeGen/SelectionDAG.h ++++ include/llvm/CodeGen/SelectionDAG.h +@@ -127,6 +127,10 @@ class SDDbgInfo { + DbgValMap[Node].push_back(V); + } + ++ /// \brief Invalidate all DbgValues attached to the node and remove ++ /// it from the Node-to-DbgValues map. ++ void erase(const SDNode *Node); ++ + void clear() { + DbgValMap.clear(); + DbgValues.clear(); +Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp +=================================================================== +--- lib/CodeGen/SelectionDAG/SelectionDAG.cpp ++++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp +@@ -625,6 +625,15 @@ void SelectionDAG::DeleteNodeNotInCSEMaps(SDNode * + DeallocateNode(N); + } + ++void SDDbgInfo::erase(const SDNode *Node) { ++ DbgValMapType::iterator I = DbgValMap.find(Node); ++ if (I == DbgValMap.end()) ++ return; ++ for (unsigned J = 0, N = I->second.size(); J != N; ++J) ++ I->second[J]->setIsInvalidated(); ++ DbgValMap.erase(I); ++} ++ + void SelectionDAG::DeallocateNode(SDNode *N) { + if (N->OperandsNeedDelete) + delete[] N->OperandList; +@@ -635,10 +644,9 @@ void SelectionDAG::DeallocateNode(SDNode *N) { + + NodeAllocator.Deallocate(AllNodes.remove(N)); + +- // If any of the SDDbgValue nodes refer to this SDNode, invalidate them. +- ArrayRef DbgVals = DbgInfo->getSDDbgValues(N); +- for (unsigned i = 0, e = DbgVals.size(); i != e; ++i) +- DbgVals[i]->setIsInvalidated(); ++ // If any of the SDDbgValue nodes refer to this SDNode, invalidate ++ // them and forget about that node. ++ DbgInfo->erase(N); + } + + /// RemoveNodeFromCSEMaps - Take the specified node out of the CSE map that From owner-svn-src-stable-10@FreeBSD.ORG Wed Nov 19 08:49:00 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E83F7E26; Wed, 19 Nov 2014 08:49:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3CE931D; Wed, 19 Nov 2014 08:49:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJ8n0Nq095459; Wed, 19 Nov 2014 08:49:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJ8n0Iw095454; Wed, 19 Nov 2014 08:49:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411190849.sAJ8n0Iw095454@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Nov 2014 08:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274699 - in stable/10/sys/dev/usb: . serial X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 08:49:01 -0000 Author: hselasky Date: Wed Nov 19 08:48:59 2014 New Revision: 274699 URL: https://svnweb.freebsd.org/changeset/base/274699 Log: MFC r274227: Add new USB IDs. Modified: stable/10/sys/dev/usb/serial/u3g.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/10/sys/dev/usb/serial/u3g.c Wed Nov 19 07:47:37 2014 (r274698) +++ stable/10/sys/dev/usb/serial/u3g.c Wed Nov 19 08:48:59 2014 (r274699) @@ -469,6 +469,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, K3772_Z, 0), U3G_DEV(QUALCOMMINC, K3772_Z_INIT, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, MF195E, 0), + U3G_DEV(QUALCOMMINC, MF195E_INIT, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Wed Nov 19 07:47:37 2014 (r274698) +++ stable/10/sys/dev/usb/usbdevs Wed Nov 19 08:48:59 2014 (r274699) @@ -3640,6 +3640,8 @@ product QUALCOMMINC E0086 0x0086 3G mode product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial product QUALCOMMINC K3772_Z 0x1181 K3772-Z +product QUALCOMMINC MF195E_INIT 0x1514 MF195E initial +product QUALCOMMINC MF195E 0x1516 MF195E product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem From owner-svn-src-stable-10@FreeBSD.ORG Wed Nov 19 08:56:39 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6E17301; Wed, 19 Nov 2014 08:56:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3CD85FB; Wed, 19 Nov 2014 08:56:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJ8udRR099982; Wed, 19 Nov 2014 08:56:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJ8udfq099981; Wed, 19 Nov 2014 08:56:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411190856.sAJ8udfq099981@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Nov 2014 08:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274702 - stable/10/usr.sbin/usbconfig X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 08:56:40 -0000 Author: hselasky Date: Wed Nov 19 08:56:38 2014 New Revision: 274702 URL: https://svnweb.freebsd.org/changeset/base/274702 Log: MFC r274435: Decode more fields when dumping USB descriptors. - Some minor style changes while at it. Modified: stable/10/usr.sbin/usbconfig/dump.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/usbconfig/dump.c ============================================================================== --- stable/10/usr.sbin/usbconfig/dump.c Wed Nov 19 08:55:07 2014 (r274701) +++ stable/10/usr.sbin/usbconfig/dump.c Wed Nov 19 08:56:38 2014 (r274702) @@ -110,7 +110,6 @@ dump_field(struct libusb20_device *pdev, printf(" \n"); return; } - if (strcmp(field, "bmAttributes") == 0) { switch (value & 0x03) { case 0: @@ -142,7 +141,6 @@ dump_field(struct libusb20_device *pdev, return; } } - if ((field[0] == 'i') && (field[1] != 'd')) { /* Indirect String Descriptor */ if (value == 0) { @@ -157,7 +155,84 @@ dump_field(struct libusb20_device *pdev, printf(" <%s>\n", temp_string); return; } + if (strlen(plevel) == 2 || strlen(plevel) == 6) { + + /* Device and Interface Descriptor class codes */ + + if (strcmp(field, "bInterfaceClass") == 0 || + strcmp(field, "bDeviceClass") == 0) { + switch (value) { + case 0x00: + printf(" \n"); + break; + case 0x01: + printf("