From owner-svn-src-stable-10@freebsd.org Sun Jan 24 02:10:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C658BA8FCE1; Sun, 24 Jan 2016 02:10:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 96FE61278; Sun, 24 Jan 2016 02:10:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0O2A5JW046396; Sun, 24 Jan 2016 02:10:05 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0O2A5U6046395; Sun, 24 Jan 2016 02:10:05 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201601240210.u0O2A5U6046395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sun, 24 Jan 2016 02:10:05 +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: r294651 - stable/10/usr.sbin/bsdinstall/scripts 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.20 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, 24 Jan 2016 02:10:06 -0000 Author: vangyzen Date: Sun Jan 24 02:10:05 2016 New Revision: 294651 URL: https://svnweb.freebsd.org/changeset/base/294651 Log: MFC r293860 bsdinstall: Suggest the GPT+Active workaround on Dell T5810 The Dell Precision Tower 5810 fails to boot from GPT in Legacy/BIOS mode without the Active flag in the Protective MBR. Suggest the workaround during installation. Since an increasing number of Dell systems exhibit this behavior, I imagine all Dells past a certain date will do so. I would like to suggest the workaround for all Dells with a BIOS date of, say, 2014 or later, but I would need to test a variety of systems before committing such a change. Relnotes: We should probably suggest using GPT+Active on "recent" Dells. Sponsored by: Dell Inc. Modified: stable/10/usr.sbin/bsdinstall/scripts/auto Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/auto Sun Jan 24 00:26:45 2016 (r294650) +++ stable/10/usr.sbin/bsdinstall/scripts/auto Sun Jan 24 02:10:05 2016 (r294651) @@ -190,7 +190,7 @@ if f_interactive; then ;; "Dell Inc.") case "$sys_model" in - "Latitude E7440"|"Latitude E7240") + "Latitude E7440"|"Latitude E7240"|"Precision Tower 5810") dialog_workaround "$msg_gpt_active_fix" retval=$? f_dprintf "gpt_active_fix_prompt=[%s]" "$retval" From owner-svn-src-stable-10@freebsd.org Sun Jan 24 06:19:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE992A8FF35; Sun, 24 Jan 2016 06:19:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97E5C1F47; Sun, 24 Jan 2016 06:19:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0O6JoBC019861; Sun, 24 Jan 2016 06:19:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0O6JoLA019853; Sun, 24 Jan 2016 06:19:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601240619.u0O6JoLA019853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 24 Jan 2016 06:19: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: r294657 - stable/10/tools/regression/geom_mirror 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.20 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, 24 Jan 2016 06:19:51 -0000 Author: ngie Date: Sun Jan 24 06:19:49 2016 New Revision: 294657 URL: https://svnweb.freebsd.org/changeset/base/294657 Log: MFC r293073: - Use attach_md instead of hardcoding md(4) provider unit numbers - Implement a gmirror_test_cleanup function, which in turn calls geom_test_cleanup to clean up all md(4) providers allocated in the test run. - Remove duplicate logic in test scripts for removing md(4) providers. - Don't create files in /tmp (outside the kyua sandbox); use the current directory instead Modified: stable/10/tools/regression/geom_mirror/conf.sh stable/10/tools/regression/geom_mirror/test-1.t stable/10/tools/regression/geom_mirror/test-2.t stable/10/tools/regression/geom_mirror/test-3.t stable/10/tools/regression/geom_mirror/test-4.t stable/10/tools/regression/geom_mirror/test-5.t stable/10/tools/regression/geom_mirror/test-6.t stable/10/tools/regression/geom_mirror/test-7.t Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/geom_mirror/conf.sh ============================================================================== --- stable/10/tools/regression/geom_mirror/conf.sh Sun Jan 24 06:04:38 2016 (r294656) +++ stable/10/tools/regression/geom_mirror/conf.sh Sun Jan 24 06:19:49 2016 (r294657) @@ -5,4 +5,11 @@ name="$(mktemp -u mirror.XXXXXX)" class="mirror" base=`basename $0` +gmirror_test_cleanup() +{ + [ -c /dev/$class/$name ] && gmirror destroy $name + geom_test_cleanup +} +trap gmirror_test_cleanup ABRT EXIT INT TERM + . `dirname $0`/../geom_subr.sh Modified: stable/10/tools/regression/geom_mirror/test-1.t ============================================================================== --- stable/10/tools/regression/geom_mirror/test-1.t Sun Jan 24 06:04:38 2016 (r294656) +++ stable/10/tools/regression/geom_mirror/test-1.t Sun Jan 24 06:19:49 2016 (r294657) @@ -5,15 +5,11 @@ echo "1..1" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` - -mdconfig -a -t malloc -s 1M -u $us0 || exit 1 -mdconfig -a -t malloc -s 2M -u $us1 || exit 1 -mdconfig -a -t malloc -s 3M -u $us2 || exit 1 +us0=$(attach_md -t malloc -s 1M) || exit 1 +us1=$(attach_md -t malloc -s 2M) || exit 1 +us2=$(attach_md -t malloc -s 3M) || exit 1 -gmirror label $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label $name /dev/$us0 /dev/$us1 /dev/$us2 || exit 1 devwait # Size of created device should be 1MB - 512b. @@ -25,10 +21,3 @@ if [ $size -eq 1048064 ]; then else echo "not ok 1" fi - -gmirror remove $name md${us0} -gmirror remove $name md${us1} -gmirror remove $name md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 Modified: stable/10/tools/regression/geom_mirror/test-2.t ============================================================================== --- stable/10/tools/regression/geom_mirror/test-2.t Sun Jan 24 06:04:38 2016 (r294656) +++ stable/10/tools/regression/geom_mirror/test-2.t Sun Jan 24 06:19:49 2016 (r294657) @@ -6,22 +6,19 @@ echo "1..4" balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -32,28 +29,24 @@ if [ `md5 -q ${src}` != `md5 -q ${dst}` else echo "ok 1" fi -dd if=/dev/md${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us0} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -dd if=/dev/md${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us1} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" else echo "ok 3" fi -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" else echo "ok 4" fi -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_mirror/test-3.t ============================================================================== --- stable/10/tools/regression/geom_mirror/test-3.t Sun Jan 24 06:04:38 2016 (r294656) +++ stable/10/tools/regression/geom_mirror/test-3.t Sun Jan 24 06:19:49 2016 (r294657) @@ -6,22 +6,19 @@ echo "1..5" balance="round-robin" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_mirror/test-4.t ============================================================================== --- stable/10/tools/regression/geom_mirror/test-4.t Sun Jan 24 06:04:38 2016 (r294656) +++ stable/10/tools/regression/geom_mirror/test-4.t Sun Jan 24 06:19:49 2016 (r294657) @@ -6,22 +6,19 @@ echo "1..5" balance="load" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -57,6 +54,8 @@ else echo "ok 4" fi +gmirror destroy $name + # mirror/${name} should be removed. if [ -c /dev/${name} ]; then echo "not ok 5" @@ -64,7 +63,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_mirror/test-5.t ============================================================================== --- stable/10/tools/regression/geom_mirror/test-5.t Sun Jan 24 06:04:38 2016 (r294656) +++ stable/10/tools/regression/geom_mirror/test-5.t Sun Jan 24 06:19:49 2016 (r294657) @@ -6,22 +6,19 @@ echo "1..5" balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=8192 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_mirror/test-6.t ============================================================================== --- stable/10/tools/regression/geom_mirror/test-6.t Sun Jan 24 06:04:38 2016 (r294656) +++ stable/10/tools/regression/geom_mirror/test-6.t Sun Jan 24 06:19:49 2016 (r294657) @@ -6,26 +6,23 @@ echo "1..2" balance="split" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=8192 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/md${us0} /dev/md${us1} || exit 1 +gmirror label -b $balance -s `expr $ddbs / 2` $name /dev/${us0} /dev/${us1} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -dd if=/dev/zero of=/dev/md${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/zero of=/dev/${us2} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then @@ -35,18 +32,14 @@ else fi # Connect disk to the mirror. -gmirror insert ${name} md${us2} +gmirror insert ${name} ${us2} # Wait for synchronization. sleep 1 -dd if=/dev/md${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 +dd if=/dev/${us2} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" else echo "ok 2" fi -gmirror remove $name md${us0} md${us1} md${us2} -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} Modified: stable/10/tools/regression/geom_mirror/test-7.t ============================================================================== --- stable/10/tools/regression/geom_mirror/test-7.t Sun Jan 24 06:04:38 2016 (r294656) +++ stable/10/tools/regression/geom_mirror/test-7.t Sun Jan 24 06:19:49 2016 (r294657) @@ -6,22 +6,19 @@ echo "1..5" balance="prefer" -us0=45 -us1=`expr $us0 + 1` -us2=`expr $us0 + 2` ddbs=2048 nblocks1=1024 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)` -src=`mktemp /tmp/$base.XXXXXX` || exit 1 -dst=`mktemp /tmp/$base.XXXXXX` || exit 1 +src=`mktemp $base.XXXXXX` || exit 1 +dst=`mktemp $base.XXXXXX` || exit 1 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us0 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us1 || exit 1 -mdconfig -a -t malloc -s `expr $nblocks1 + 1` -u $us2 || exit 1 +us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 +us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1 -gmirror label -b $balance $name /dev/md${us0} /dev/md${us1} /dev/md${us2} || exit 1 +gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1 devwait dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 @@ -33,7 +30,7 @@ else echo "ok 1" fi -gmirror remove $name md${us0} +gmirror remove $name ${us0} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 2" @@ -41,7 +38,7 @@ else echo "ok 2" fi -gmirror remove $name md${us1} +gmirror remove $name ${us1} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 3" @@ -49,7 +46,7 @@ else echo "ok 3" fi -gmirror remove $name md${us2} +gmirror remove $name ${us2} dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then echo "not ok 4" @@ -64,7 +61,4 @@ else echo "ok 5" fi -mdconfig -d -u $us0 -mdconfig -d -u $us1 -mdconfig -d -u $us2 rm -f ${src} ${dst} From owner-svn-src-stable-10@freebsd.org Sun Jan 24 15:45:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ED2C7F1E; Sun, 24 Jan 2016 15:45:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FF51D3F; Sun, 24 Jan 2016 15:45:03 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OFj36B012372; Sun, 24 Jan 2016 15:45:03 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OFiwko012314; Sun, 24 Jan 2016 15:44:58 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601241544.u0OFiwko012314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sun, 24 Jan 2016 15:44:58 +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: r294666 - stable/10/crypto/openssh 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.20 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, 24 Jan 2016 15:45:04 -0000 Author: des Date: Sun Jan 24 15:44:57 2016 New Revision: 294666 URL: https://svnweb.freebsd.org/changeset/base/294666 Log: MFH (r263234, r263691, r266465, r290671, r290672, r290673, r290674, r294320, r294322, r294324, r294330, r294469, r294494, r294466) Reduce diffs to head in preparation for removing HPN and None. Added: stable/10/crypto/openssh/freebsd-post-merge.sh (contents, props changed) - copied, changed from r263691, head/crypto/openssh/freebsd-post-merge.sh stable/10/crypto/openssh/freebsd-pre-merge.sh (contents, props changed) - copied, changed from r263691, head/crypto/openssh/freebsd-pre-merge.sh Deleted: stable/10/crypto/openssh/FREEBSD-tricks stable/10/crypto/openssh/config.h.in stable/10/crypto/openssh/configure stable/10/crypto/openssh/schnorr.c Modified: stable/10/crypto/openssh/FREEBSD-upgrade stable/10/crypto/openssh/auth-krb5.c (contents, props changed) stable/10/crypto/openssh/auth-pam.c (contents, props changed) stable/10/crypto/openssh/auth2-chall.c (contents, props changed) stable/10/crypto/openssh/bufaux.c (contents, props changed) stable/10/crypto/openssh/buffer.c stable/10/crypto/openssh/channels.c stable/10/crypto/openssh/cipher.c stable/10/crypto/openssh/clientloop.c stable/10/crypto/openssh/compat.c stable/10/crypto/openssh/config.h stable/10/crypto/openssh/digest-libc.c (contents, props changed) stable/10/crypto/openssh/freebsd-configure.sh stable/10/crypto/openssh/kex.c stable/10/crypto/openssh/misc.c stable/10/crypto/openssh/moduli.5 stable/10/crypto/openssh/monitor.c (contents, props changed) stable/10/crypto/openssh/monitor_wrap.c (contents, props changed) stable/10/crypto/openssh/mux.c (contents, props changed) stable/10/crypto/openssh/packet.c stable/10/crypto/openssh/pathnames.h (contents, props changed) stable/10/crypto/openssh/readconf.c stable/10/crypto/openssh/scp.1 stable/10/crypto/openssh/servconf.c stable/10/crypto/openssh/serverloop.c stable/10/crypto/openssh/session.c stable/10/crypto/openssh/sftp-common.c (contents, props changed) stable/10/crypto/openssh/sftp-server.8 (contents, props changed) stable/10/crypto/openssh/sftp.1 stable/10/crypto/openssh/sftp.c stable/10/crypto/openssh/ssh-add.1 stable/10/crypto/openssh/ssh-gss.h (contents, props changed) stable/10/crypto/openssh/ssh-keygen.1 (contents, props changed) stable/10/crypto/openssh/ssh-keyscan.1 (contents, props changed) stable/10/crypto/openssh/ssh-keysign.8 stable/10/crypto/openssh/ssh-pkcs11-helper.8 stable/10/crypto/openssh/ssh.1 stable/10/crypto/openssh/ssh.c stable/10/crypto/openssh/ssh_config (contents, props changed) stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/ssh_namespace.h stable/10/crypto/openssh/sshconnect.c stable/10/crypto/openssh/sshconnect2.c stable/10/crypto/openssh/sshd.8 stable/10/crypto/openssh/sshd.c stable/10/crypto/openssh/sshd_config (contents, props changed) stable/10/crypto/openssh/sshd_config.5 Directory Properties: stable/10/ (props changed) stable/10/crypto/openssh/sandbox-capsicum.c (props changed) Modified: stable/10/crypto/openssh/FREEBSD-upgrade ============================================================================== --- stable/10/crypto/openssh/FREEBSD-upgrade Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/FREEBSD-upgrade Sun Jan 24 15:44:57 2016 (r294666) @@ -3,81 +3,97 @@ FreeBSD maintainer's guide to OpenSSH-portable ============================================== -XXX -XXX this needs a complete rewrite -XXX svn merge from vendor branch, resolve conflicts manually -XXX (see FREEBSD-tricks for tips on how to reduce conflicts) -XXX run freebsd-configure.sh to generate config.h and krb5_config.h -XXX svn diff Makefile.in to see if the Makefiles need adjusting -XXX +00) Make sure your mail spool has plenty of free space. It'll fill up + pretty fast once you're done with this checklist. -0) Make sure your mail spool has plenty of free space. It'll fill up - pretty fast once you're done with this checklist. +01) Download the latest OpenSSH-portable tarball and signature from + OpenBSD (ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/). -1) Grab the latest OpenSSH-portable tarball from the OpenBSD FTP - site (ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/) +02) Verify the signature: -2) Unpack the tarball in a suitable directory. + $ gpg --verify openssh-X.YpZ.tar.gz.asc - $ tar xf openssh-X.YpZ.tar.gz \ - -X /usr/src/crypto/openssh/FREEBSD-Xlist +03) Unpack the tarball in a suitable directory: -3) Remove trash: + $ tar xf openssh-X.YpZ.tar.gz - Make sure -X took care of everything, and if it didn't, make sure - to update FREEBSD-Xlist so you won't miss it the next time. A good - way to do this is to run a test import and see if any new files - show up: +04) Copy to the vendor directory: - $ cvs -n import src/crypto/openssh OPENSSH x | grep \^N + $ svn co svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/dist + $ rsync --archive --delete openssh-X.YpZ/ dist/ -4) Import the sources: +05) Take care of added / deleted files: - $ cvs import src/crypto/openssh OPENSSH OpenSSH_X_YpZ + $ svn rm $(svn stat dist | awk '$1 == "!" { print $2 }') + $ svn add --no-auto-props $(svn stat dist | awk '$1 == "?" { print $2 }') -5) Resolve conflicts. Remember to bump the version number and - addendum in version.h, and update the default value in - ssh{,d}_config and ssh{,d}_config.5. +06) Commit: -6) Generate configure and config.h.in: + $ svn commit -m "Vendor import of OpenSSH X.YpZ." dist - $ autoconf - $ autoheader +07) Tag: - Note: this requires a recent version of autoconf, not autoconf213. + $ svn copy -m "Tag OpenSSH X.YpZ." \ + svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/dist \ + svn+ssh://svn.freebsd.org/base/vendor-crypto/openssh/X.YpZ -7) Run configure with the appropriate arguments: +08) Check out head and run the pre-merge script: - $ ./configure --prefix=/usr --sysconfdir=/etc/ssh \ - --with-pam --with-tcp-wrappers --with-libedit \ - --with-ssl-engine + $ svn co svn+ssh://svn.freebsd.org/base/head + $ cd head/crypto/openssh + $ sh freebsd-pre-merge.sh - This will regenerate config.h, which must be committed along with - the rest. +09) Merge from the vendor branch: - Note that we don't want to configure OpenSSH for Kerberos using - configure since we have to be able to turn it on or off depending - on the value of MK_KERBEROS. Our Makefiles take care of this. + $ svn merge -cNNNNNN \^/vendor-crypto/openssh/dist . -8) If source files have been added or removed, update the appropriate - makefiles to reflect changes in the vendor's Makefile.in. +0A) Resolve conflicts. Remember to bump the version addendum in + version.h, and update the default value in ssh{,d}_config and + ssh{,d}_config.5. -9) Build libssh. Follow the instructions in ssh_namespace.h to get a - list of new symbols. Update ssh_namespace.h, build everything, - install and test. +0B) Diff against the vendor branch: -A) Build and test the pam_ssh PAM module. It gropes around libssh's - internals and will break if something significant changes or if - ssh_namespace.h is out of whack. + $ svn diff \^/vendor-crypto/openssh/dist . -B) Re-commit everything on repoman (you *did* use a test repo for - this, didn't you?) + Files that have modifications relative to the vendor code, and + only those files, must have the svn:keywords property set to + FreeBSD=%H and be listed in the 'keywords' file created by the + pre-merge script. + +0C) Run the post-merge script: + + $ sh freebsd-post-merge.sh + +0D) Run the configure script: + + $ sh freebsd-configure.sh + +0E) Check config.h very carefully. + +0F) If source files have been added or removed, update the appropriate + makefiles to reflect changes in the vendor's Makefile.in. + +10) Build libssh: + + $ cd ../../secure/lib/libssh && make obj && make depend && make + +11) Follow the instructions in ssh_namespace.h to get a list of new + symbols, and them to ssh_namespace.h. Keep it sorted! + +12) Build and install world, reboot, test. Pay particular attention + to pam_ssh(8), which gropes inside libssh and will break if + something significant changes or if ssh_namespace.h is out of + whack. + +13) Commit, and hunker down for the inevitable storm of complaints. An overview of FreeBSD changes to OpenSSH-portable ================================================== +XXX This section is out of date + 0) VersionAddendum The SSH protocol allows for a human-readable version string of up Modified: stable/10/crypto/openssh/auth-krb5.c ============================================================================== --- stable/10/crypto/openssh/auth-krb5.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/auth-krb5.c Sun Jan 24 15:44:57 2016 (r294666) @@ -2,7 +2,7 @@ /* * Kerberos v5 authentication and ticket-passing routines. * - * $FreeBSD: src/crypto/openssh/auth-krb5.c,v 1.6 2001/02/13 16:58:04 assar Exp $ + * $FreeBSD$ */ /* * Copyright (c) 2002 Daniel Kouril. All rights reserved. Modified: stable/10/crypto/openssh/auth-pam.c ============================================================================== --- stable/10/crypto/openssh/auth-pam.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/auth-pam.c Sun Jan 24 15:44:57 2016 (r294666) @@ -45,7 +45,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ +/* Based on $FreeBSD$ */ #include "includes.h" #include Modified: stable/10/crypto/openssh/auth2-chall.c ============================================================================== --- stable/10/crypto/openssh/auth2-chall.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/auth2-chall.c Sun Jan 24 15:44:57 2016 (r294666) @@ -25,6 +25,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include Modified: stable/10/crypto/openssh/bufaux.c ============================================================================== --- stable/10/crypto/openssh/bufaux.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/bufaux.c Sun Jan 24 15:44:57 2016 (r294666) @@ -38,6 +38,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include Modified: stable/10/crypto/openssh/buffer.c ============================================================================== --- stable/10/crypto/openssh/buffer.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/buffer.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: buffer.c,v 1.35 2014/02/02 03:44:31 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -14,6 +13,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include Modified: stable/10/crypto/openssh/channels.c ============================================================================== --- stable/10/crypto/openssh/channels.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/channels.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: channels.c,v 1.331 2014/02/26 20:29:29 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -41,6 +40,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/cipher.c ============================================================================== --- stable/10/crypto/openssh/cipher.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/cipher.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: cipher.c,v 1.97 2014/02/07 06:55:54 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -37,6 +36,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include Modified: stable/10/crypto/openssh/clientloop.c ============================================================================== --- stable/10/crypto/openssh/clientloop.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/clientloop.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: clientloop.c,v 1.258 2014/02/02 03:44:31 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -61,6 +60,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/compat.c ============================================================================== --- stable/10/crypto/openssh/compat.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/compat.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: compat.c,v 1.82 2013/12/30 23:52:27 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved. * @@ -25,6 +24,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include Modified: stable/10/crypto/openssh/config.h ============================================================================== --- stable/10/crypto/openssh/config.h Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/config.h Sun Jan 24 15:44:57 2016 (r294666) @@ -1681,6 +1681,11 @@ /* Define if xauth is found in your path */ /* #undef XAUTH_PATH */ +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ Modified: stable/10/crypto/openssh/digest-libc.c ============================================================================== --- stable/10/crypto/openssh/digest-libc.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/digest-libc.c Sun Jan 24 15:44:57 2016 (r294666) @@ -17,6 +17,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/freebsd-configure.sh ============================================================================== --- stable/10/crypto/openssh/freebsd-configure.sh Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/freebsd-configure.sh Sun Jan 24 15:44:57 2016 (r294666) @@ -7,6 +7,7 @@ configure_args=" --prefix=/usr --sysconfdir=/etc/ssh --with-pam + --with-ssl-dir=/usr --with-tcp-wrappers --with-libedit --with-ssl-engine @@ -15,6 +16,19 @@ configure_args=" set -e +# make sure configure uses the correct compiler +export CC=$(echo ".include " | make -f /dev/stdin -VCC) +export CPP=$(echo ".include " | make -f /dev/stdin -VCPP) +unset CFLAGS CPPFLAGS LDFLAGS LIBS + +# regenerate configure and config.h.in +autoheader +autoconf + +# reset PATH to avoid picking up the wrong libraries +export PATH=/bin:/sbin:/usr/bin:/usr/sbin +unset LD_LIBRARY_PATH + # generate config.h with krb5 and stash it sh configure $configure_args --with-kerberos5 mv config.log config.log.orig Copied and modified: stable/10/crypto/openssh/freebsd-post-merge.sh (from r263691, head/crypto/openssh/freebsd-post-merge.sh) ============================================================================== --- head/crypto/openssh/freebsd-post-merge.sh Mon Mar 24 19:15:13 2014 (r263691, copy source) +++ stable/10/crypto/openssh/freebsd-post-merge.sh Sun Jan 24 15:44:57 2016 (r294666) @@ -1,14 +1,14 @@ #!/bin/sh # -# $FreeBSD$ +# $FreeBSD: stable/10/crypto/openssh/freebsd-post-merge.sh 263691 2014-03-24 19:15:13Z des $ # xargs perl -n -i -e ' print; s/\$(Id|OpenBSD): [^\$]*/\$FreeBSD/ && print; - m/^\#include "includes.h"/ && print "__RCSID(\"\$FreeBSD\$\");\n"; ' keywords +:>rcsid +svn list -R | grep -v '/$' | \ while read f ; do - svn propget svn:keywords $f | grep -q . && echo $f -done >keywords -xargs perl -n -i -e ' + svn proplist -v $f | grep -q 'FreeBSD=%H' || continue + egrep -l '^(#|\.\\"|/\*)[[:space:]]+\$FreeBSD[:\$]' $f >>keywords + egrep -l '__RCSID\("\$FreeBSD[:\$]' $f >>rcsid +done +sort -u keywords rcsid | xargs perl -n -i -e ' $strip = $ARGV if /\$(Id|OpenBSD):.*\$/; - print unless ($strip eq $ARGV && /\$FreeBSD.*\$/); -' mdocdates -xargs perl -p -i -e ' - s/^\.Dd (\w+) (\d+), (\d+)$/.Dd \$Mdocdate: $1 $2 $3 \$/; -' Modified: stable/10/crypto/openssh/misc.c ============================================================================== --- stable/10/crypto/openssh/misc.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/misc.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: misc.c,v 1.92 2013/10/14 23:28:23 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -26,6 +25,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/moduli.5 ============================================================================== --- stable/10/crypto/openssh/moduli.5 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/moduli.5 Sun Jan 24 15:44:57 2016 (r294666) @@ -13,7 +13,7 @@ .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.Dd September 26, 2012 +.Dd $Mdocdate: September 26 2012 $ .Dt MODULI 5 .Os .Sh NAME Modified: stable/10/crypto/openssh/monitor.c ============================================================================== --- stable/10/crypto/openssh/monitor.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/monitor.c Sun Jan 24 15:44:57 2016 (r294666) @@ -26,6 +26,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/monitor_wrap.c ============================================================================== --- stable/10/crypto/openssh/monitor_wrap.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/monitor_wrap.c Sun Jan 24 15:44:57 2016 (r294666) @@ -26,6 +26,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/mux.c ============================================================================== --- stable/10/crypto/openssh/mux.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/mux.c Sun Jan 24 15:44:57 2016 (r294666) @@ -31,6 +31,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/packet.c ============================================================================== --- stable/10/crypto/openssh/packet.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/packet.c Sun Jan 24 15:44:57 2016 (r294666) @@ -38,6 +38,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include "openbsd-compat/sys-queue.h" Modified: stable/10/crypto/openssh/pathnames.h ============================================================================== --- stable/10/crypto/openssh/pathnames.h Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/pathnames.h Sun Jan 24 15:44:57 2016 (r294666) @@ -1,4 +1,5 @@ /* $OpenBSD: pathnames.h,v 1.24 2013/12/06 13:39:49 markus Exp $ */ +/* $FreeBSD$ */ /* * Author: Tatu Ylonen Modified: stable/10/crypto/openssh/readconf.c ============================================================================== --- stable/10/crypto/openssh/readconf.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/readconf.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: readconf.c,v 1.218 2014/02/23 20:11:36 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: stable/10/crypto/openssh/scp.1 ============================================================================== --- stable/10/crypto/openssh/scp.1 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/scp.1 Sun Jan 24 15:44:57 2016 (r294666) @@ -10,7 +10,7 @@ .\" .\" $OpenBSD: scp.1,v 1.61 2013/10/20 09:51:26 djm Exp $ .\" -.Dd October 20, 2013 +.Dd $Mdocdate: October 20 2013 $ .Dt SCP 1 .Os .Sh NAME Modified: stable/10/crypto/openssh/servconf.c ============================================================================== --- stable/10/crypto/openssh/servconf.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/servconf.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,6 +1,5 @@ /* $OpenBSD: servconf.c,v 1.249 2014/01/29 06:18:35 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved Modified: stable/10/crypto/openssh/serverloop.c ============================================================================== --- stable/10/crypto/openssh/serverloop.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/serverloop.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: serverloop.c,v 1.170 2014/02/02 03:44:31 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -37,6 +36,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/session.c ============================================================================== --- stable/10/crypto/openssh/session.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/session.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: session.c,v 1.270 2014/01/31 16:39:19 tedu Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved Modified: stable/10/crypto/openssh/sftp-common.c ============================================================================== --- stable/10/crypto/openssh/sftp-common.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sftp-common.c Sun Jan 24 15:44:57 2016 (r294666) @@ -25,6 +25,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/sftp-server.8 ============================================================================== --- stable/10/crypto/openssh/sftp-server.8 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sftp-server.8 Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ .\" $OpenBSD: sftp-server.8,v 1.25 2013/10/14 14:18:56 jmc Exp $ -.\" $FreeBSD$ .\" .\" Copyright (c) 2000 Markus Friedl. All rights reserved. .\" @@ -23,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 14, 2013 +.Dd $Mdocdate: October 14 2013 $ .Dt SFTP-SERVER 8 .Os .Sh NAME Modified: stable/10/crypto/openssh/sftp.1 ============================================================================== --- stable/10/crypto/openssh/sftp.1 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sftp.1 Sun Jan 24 15:44:57 2016 (r294666) @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 20, 2013 +.Dd $Mdocdate: October 20 2013 $ .Dt SFTP 1 .Os .Sh NAME Modified: stable/10/crypto/openssh/sftp.c ============================================================================== --- stable/10/crypto/openssh/sftp.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sftp.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: sftp.c,v 1.158 2013/11/20 20:54:10 deraadt Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -17,6 +16,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/ssh-add.1 ============================================================================== --- stable/10/crypto/openssh/ssh-add.1 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh-add.1 Sun Jan 24 15:44:57 2016 (r294666) @@ -35,7 +35,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 7, 2013 +.Dd $Mdocdate: December 7 2013 $ .Dt SSH-ADD 1 .Os .Sh NAME Modified: stable/10/crypto/openssh/ssh-gss.h ============================================================================== --- stable/10/crypto/openssh/ssh-gss.h Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh-gss.h Sun Jan 24 15:44:57 2016 (r294666) @@ -1,4 +1,5 @@ /* $OpenBSD: ssh-gss.h,v 1.11 2014/02/26 20:28:44 djm Exp $ */ +/* $FreeBSD$ */ /* * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. * Modified: stable/10/crypto/openssh/ssh-keygen.1 ============================================================================== --- stable/10/crypto/openssh/ssh-keygen.1 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh-keygen.1 Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ .\" $OpenBSD: ssh-keygen.1,v 1.120 2014/02/05 20:13:25 naddy Exp $ -.\" $FreeBSD$ .\" .\" Author: Tatu Ylonen .\" Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -36,7 +35,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 5, 2014 +.Dd $Mdocdate: February 5 2014 $ .Dt SSH-KEYGEN 1 .Os .Sh NAME Modified: stable/10/crypto/openssh/ssh-keyscan.1 ============================================================================== --- stable/10/crypto/openssh/ssh-keyscan.1 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh-keyscan.1 Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ .\" $OpenBSD: ssh-keyscan.1,v 1.34 2014/01/28 14:13:39 jmc Exp $ -.\" $FreeBSD$ .\" .\" Copyright 1995, 1996 by David Mazieres . .\" @@ -7,7 +6,7 @@ .\" permitted provided that due credit is given to the author and the .\" OpenBSD project by leaving this copyright notice intact. .\" -.Dd January 28, 2014 +.Dd $Mdocdate: January 28 2014 $ .Dt SSH-KEYSCAN 1 .Os .Sh NAME Modified: stable/10/crypto/openssh/ssh-keysign.8 ============================================================================== --- stable/10/crypto/openssh/ssh-keysign.8 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh-keysign.8 Sun Jan 24 15:44:57 2016 (r294666) @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 7, 2013 +.Dd $Mdocdate: December 7 2013 $ .Dt SSH-KEYSIGN 8 .Os .Sh NAME Modified: stable/10/crypto/openssh/ssh-pkcs11-helper.8 ============================================================================== --- stable/10/crypto/openssh/ssh-pkcs11-helper.8 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh-pkcs11-helper.8 Sun Jan 24 15:44:57 2016 (r294666) @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd July 16, 2013 +.Dd $Mdocdate: July 16 2013 $ .Dt SSH-PKCS11-HELPER 8 .Os .Sh NAME Modified: stable/10/crypto/openssh/ssh.1 ============================================================================== --- stable/10/crypto/openssh/ssh.1 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh.1 Sun Jan 24 15:44:57 2016 (r294666) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: ssh.1,v 1.343 2013/12/07 11:58:46 naddy Exp $ .\" $FreeBSD$ -.Dd December 7, 2013 +.Dd $Mdocdate: December 7 2013 $ .Dt SSH 1 .Os .Sh NAME Modified: stable/10/crypto/openssh/ssh.c ============================================================================== --- stable/10/crypto/openssh/ssh.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: ssh.c,v 1.401 2014/02/26 20:18:37 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: stable/10/crypto/openssh/ssh_config ============================================================================== --- stable/10/crypto/openssh/ssh_config Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh_config Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ # $OpenBSD: ssh_config,v 1.28 2013/09/16 11:35:43 sthen Exp $ -# $FreeBSD$ # This is the ssh client system-wide configuration file. See # ssh_config(5) for more information. This file provides defaults for Modified: stable/10/crypto/openssh/ssh_config.5 ============================================================================== --- stable/10/crypto/openssh/ssh_config.5 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh_config.5 Sun Jan 24 15:44:57 2016 (r294666) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: ssh_config.5,v 1.185 2014/02/23 20:11:36 djm Exp $ .\" $FreeBSD$ -.Dd March 22, 2015 +.Dd $Mdocdate: February 23 2014 $ .Dt SSH_CONFIG 5 .Os .Sh NAME Modified: stable/10/crypto/openssh/ssh_namespace.h ============================================================================== --- stable/10/crypto/openssh/ssh_namespace.h Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/ssh_namespace.h Sun Jan 24 15:44:57 2016 (r294666) @@ -202,6 +202,7 @@ #define compat20 ssh_compat20 #define compat_cipher_proposal ssh_compat_cipher_proposal #define compat_datafellows ssh_compat_datafellows +#define compat_kex_proposal ssh_compat_kex_proposal #define compat_pkalg_proposal ssh_compat_pkalg_proposal #define convtime ssh_convtime #define crypto_hash_sha512 ssh_crypto_hash_sha512 Modified: stable/10/crypto/openssh/sshconnect.c ============================================================================== --- stable/10/crypto/openssh/sshconnect.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sshconnect.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: sshconnect.c,v 1.246 2014/02/06 22:21:01 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -15,6 +14,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/sshconnect2.c ============================================================================== --- stable/10/crypto/openssh/sshconnect2.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sshconnect2.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: sshconnect2.c,v 1.204 2014/02/02 03:44:32 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2008 Damien Miller. All rights reserved. @@ -26,6 +25,7 @@ */ #include "includes.h" +__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/sshd.8 ============================================================================== --- stable/10/crypto/openssh/sshd.8 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sshd.8 Sun Jan 24 15:44:57 2016 (r294666) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: sshd.8,v 1.273 2013/12/07 11:58:46 naddy Exp $ .\" $FreeBSD$ -.Dd December 7, 2013 +.Dd $Mdocdate: December 7 2013 $ .Dt SSHD 8 .Os .Sh NAME Modified: stable/10/crypto/openssh/sshd.c ============================================================================== --- stable/10/crypto/openssh/sshd.c Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sshd.c Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ /* $OpenBSD: sshd.c,v 1.420 2014/02/26 21:53:37 markus Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland Modified: stable/10/crypto/openssh/sshd_config ============================================================================== --- stable/10/crypto/openssh/sshd_config Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sshd_config Sun Jan 24 15:44:57 2016 (r294666) @@ -1,5 +1,4 @@ # $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $ -# $FreeBSD$ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. @@ -128,7 +127,7 @@ # override default of no subsystems Subsystem sftp /usr/libexec/sftp-server -# Disable HPN tuning improvements. +# Change to yes to disable HPN tuning improvements. #HPNDisabled no # Buffer size for HPN to non-HPN connections. Modified: stable/10/crypto/openssh/sshd_config.5 ============================================================================== --- stable/10/crypto/openssh/sshd_config.5 Sun Jan 24 15:15:57 2016 (r294665) +++ stable/10/crypto/openssh/sshd_config.5 Sun Jan 24 15:44:57 2016 (r294666) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: sshd_config.5,v 1.172 2014/02/27 22:47:07 djm Exp $ .\" $FreeBSD$ -.Dd March 22, 2015 +.Dd $Mdocdate: February 27 2014 $ .Dt SSHD_CONFIG 5 .Os .Sh NAME From owner-svn-src-stable-10@freebsd.org Sun Jan 24 18:25:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F971A31007; Sun, 24 Jan 2016 18:25:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 125E3130E; Sun, 24 Jan 2016 18:25:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OIPc0N061319; Sun, 24 Jan 2016 18:25:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OIPcx2061318; Sun, 24 Jan 2016 18:25:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241825.u0OIPcx2061318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 18:25:38 +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: r294671 - stable/10/sys/arm/arm 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.20 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, 24 Jan 2016 18:25:39 -0000 Author: ian Date: Sun Jan 24 18:25:37 2016 New Revision: 294671 URL: https://svnweb.freebsd.org/changeset/base/294671 Log: MFC r289619: Follow the advice of the misplaced comment and don't access the map struct after freeing it. Remove the comment whose uselessness has been revealed. Modified: stable/10/sys/arm/arm/busdma_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep.c Sun Jan 24 18:11:36 2016 (r294670) +++ stable/10/sys/arm/arm/busdma_machdep.c Sun Jan 24 18:25:37 2016 (r294671) @@ -786,10 +786,9 @@ bus_dmamem_free(bus_dma_tag_t dmat, void ba = coherent_allocator; else ba = standard_allocator; - uma_zfree(dmamap_zone, map); free(map->slist, M_DEVBUF); - /* Be careful not to access map from here on. */ + uma_zfree(dmamap_zone, map); bufzone = busdma_bufalloc_findzone(ba, dmat->maxsize); From owner-svn-src-stable-10@freebsd.org Sun Jan 24 18:50:39 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B058A3182A; Sun, 24 Jan 2016 18:50:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E08601D40; Sun, 24 Jan 2016 18:50:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OIob10067265; Sun, 24 Jan 2016 18:50:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OIobxW067262; Sun, 24 Jan 2016 18:50:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241850.u0OIobxW067262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 18:50:37 +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: r294672 - in stable/10/sys: boot/fdt/dts/arm dev/ofw 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.20 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, 24 Jan 2016 18:50:39 -0000 Author: ian Date: Sun Jan 24 18:50:37 2016 New Revision: 294672 URL: https://svnweb.freebsd.org/changeset/base/294672 Log: MFC r289704: Fix parsing of I2C addresses properties in fdt data. I2C address is represented in 7-bits format in DT files, but system expect it in 8-bit format. Also, fix two drivers that locally hack around this bug. This includes a direct-commit change to the beaglebone dts data in the 10-stable branch to adjust the i2c slave addresses directly. In -current the equivelent change happened with a switch from homegrown to standard fdt data. Modified: stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts stable/10/sys/boot/fdt/dts/arm/beaglebone.dts stable/10/sys/dev/ofw/ofw_iicbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts Sun Jan 24 18:25:37 2016 (r294671) +++ stable/10/sys/boot/fdt/dts/arm/beaglebone-black.dts Sun Jan 24 18:50:37 2016 (r294672) @@ -146,9 +146,9 @@ }; i2c@44e0b000 { - pmic@48 { + pmic@24 { compatible = "ti,am335x-pmic"; - reg = <0x48>; + reg = <0x24>; }; }; }; Modified: stable/10/sys/boot/fdt/dts/arm/beaglebone.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/arm/beaglebone.dts Sun Jan 24 18:25:37 2016 (r294671) +++ stable/10/sys/boot/fdt/dts/arm/beaglebone.dts Sun Jan 24 18:50:37 2016 (r294672) @@ -133,7 +133,7 @@ i2c@44e0b000 { pmic@24 { compatible = "ti,am335x-pmic"; - reg = <0x48>; + reg = <0x24>; }; }; }; Modified: stable/10/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_iicbus.c Sun Jan 24 18:25:37 2016 (r294671) +++ stable/10/sys/dev/ofw/ofw_iicbus.c Sun Jan 24 18:50:37 2016 (r294672) @@ -147,7 +147,11 @@ ofw_iicbus_attach(device_t dev) M_NOWAIT | M_ZERO); if (dinfo == NULL) continue; - dinfo->opd_dinfo.addr = paddr; + /* + * OFW uses 7-bit I2C address format (see ePAPR), + * but system expect 8-bit. + */ + dinfo->opd_dinfo.addr = paddr << 1; if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, child) != 0) { free(dinfo, M_DEVBUF); From owner-svn-src-stable-10@freebsd.org Sun Jan 24 18:54:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91413A318D0; Sun, 24 Jan 2016 18:54:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43F3610B; Sun, 24 Jan 2016 18:54:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OIsCMd069978; Sun, 24 Jan 2016 18:54:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OIsCRs069976; Sun, 24 Jan 2016 18:54:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241854.u0OIsCRs069976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 18:54:12 +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: r294673 - stable/10/sys/dev/iicbus 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.20 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, 24 Jan 2016 18:54:13 -0000 Author: ian Date: Sun Jan 24 18:54:11 2016 New Revision: 294673 URL: https://svnweb.freebsd.org/changeset/base/294673 Log: MFC r289726: Add iicbus_transfer_excl(), a helper routine to do an i2c bus transaction while holding exclusive ownership of the bus. This is the routine most slave drivers should use unless they have a need to acquire and hold the bus across a series of related operations that involves multiple transfers. Modified: stable/10/sys/dev/iicbus/iiconf.c stable/10/sys/dev/iicbus/iiconf.h Modified: stable/10/sys/dev/iicbus/iiconf.c ============================================================================== --- stable/10/sys/dev/iicbus/iiconf.c Sun Jan 24 18:50:37 2016 (r294672) +++ stable/10/sys/dev/iicbus/iiconf.c Sun Jan 24 18:54:11 2016 (r294673) @@ -395,6 +395,21 @@ iicbus_transfer(device_t bus, struct iic return (IICBUS_TRANSFER(device_get_parent(bus), msgs, nmsgs)); } +int +iicbus_transfer_excl(device_t dev, struct iic_msg *msgs, uint32_t nmsgs, + int how) +{ + device_t bus; + int error; + + bus = device_get_parent(dev); + error = iicbus_request_bus(bus, dev, how); + if (error == 0) + error = IICBUS_TRANSFER(bus, msgs, nmsgs); + iicbus_release_bus(bus, dev); + return (error); +} + /* * Generic version of iicbus_transfer that calls the appropriate * routines to accomplish this. See note above about acceptable Modified: stable/10/sys/dev/iicbus/iiconf.h ============================================================================== --- stable/10/sys/dev/iicbus/iiconf.h Sun Jan 24 18:50:37 2016 (r294672) +++ stable/10/sys/dev/iicbus/iiconf.h Sun Jan 24 18:54:11 2016 (r294673) @@ -129,6 +129,8 @@ extern int iicbus_block_read(device_t, u /* vectors of iic operations to pass to bridge */ int iicbus_transfer(device_t bus, struct iic_msg *msgs, uint32_t nmsgs); +int iicbus_transfer_excl(device_t bus, struct iic_msg *msgs, uint32_t nmsgs, + int how); int iicbus_transfer_gen(device_t bus, struct iic_msg *msgs, uint32_t nmsgs); #define IICBUS_MODVER 1 From owner-svn-src-stable-10@freebsd.org Sun Jan 24 18:54:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20EC5A31969; Sun, 24 Jan 2016 18:54:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED88E2C3; Sun, 24 Jan 2016 18:54:56 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OIstAE070041; Sun, 24 Jan 2016 18:54:55 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OIstlU070040; Sun, 24 Jan 2016 18:54:55 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241854.u0OIstlU070040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 18:54:55 +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: r294674 - stable/10/sys/dev/iicbus 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.20 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, 24 Jan 2016 18:54:57 -0000 Author: ian Date: Sun Jan 24 18:54:55 2016 New Revision: 294674 URL: https://svnweb.freebsd.org/changeset/base/294674 Log: MFC r289727: Add FDT compatibility to the icee driver. The FDT bindings for eeprom parts don't include any metadata about the device other than the part name encoded in the compatible property. Instead, a driver is required to have a compiled-in table of information about the various parts (page size, device capacity, addressing scheme). So much for FDT being an abstract description of hardware characteristics, huh? In addition to the FDT-specific changes, this also switches to using the newer iicbus_transfer_excl() mechanism which holds bus ownership for the duration of the transfer. Previously this code held the bus across all the transfers needed to complete the user's IO request, which could be up to 128KB of data which might occupy the bus for 10-20 seconds. Now the bus will be released and re-aquired between every page-sized (8-256 byte) transfer, making this driver a much nicer citizen on the i2c bus. The hint-based configuration mechanism is still in place for non-FDT systems. Modified: stable/10/sys/dev/iicbus/icee.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iicbus/icee.c ============================================================================== --- stable/10/sys/dev/iicbus/icee.c Sun Jan 24 18:54:11 2016 (r294673) +++ stable/10/sys/dev/iicbus/icee.c Sun Jan 24 18:54:55 2016 (r294674) @@ -27,6 +27,9 @@ __FBSDID("$FreeBSD$"); /* * Generic IIC eeprom support, modeled after the AT24C family of products. */ + +#include "opt_platform.h" + #include #include #include @@ -37,26 +40,73 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#ifdef FDT +#include +#include +#endif + #include #include #include "iicbus_if.h" -#define IIC_M_WR 0 /* write operation */ +/* + * AT24 parts have a "write page size" that differs per-device, and a "read page + * size" that is always equal to the full device size. We define maximum values + * here to limit how long we occupy the bus with a single transfer, and because + * there are temporary buffers of these sizes allocated on the stack. + */ #define MAX_RD_SZ 256 /* Largest read size we support */ -#define MAX_WR_SZ 256 /* Largest write size we support */ +#define MAX_WR_SZ 256 /* Largest write size we support */ struct icee_softc { - device_t sc_dev; /* Myself */ - device_t sc_busdev; /* Parent bus */ + device_t dev; /* Myself */ struct cdev *cdev; /* user interface */ - int addr; + int addr; /* Slave address on the bus */ int size; /* How big am I? */ - int type; /* What type 8 or 16 bit? */ - int rd_sz; /* What's the read page size */ + int type; /* What address type 8 or 16 bit? */ int wr_sz; /* What's the write page size */ }; +#ifdef FDT +struct eeprom_desc { + int type; + int size; + int wr_sz; + const char *name; +}; + +static struct eeprom_desc type_desc[] = { + { 8, 128, 8, "AT24C01"}, + { 8, 256, 8, "AT24C02"}, + { 8, 512, 16, "AT24C04"}, + { 8, 1024, 16, "AT24C08"}, + { 8, 2 * 1024, 16, "AT24C16"}, + {16, 4 * 1024, 32, "AT24C32"}, + {16, 8 * 1024, 32, "AT24C64"}, + {16, 16 * 1024, 64, "AT24C128"}, + {16, 32 * 1024, 64, "AT24C256"}, + {16, 64 * 1024, 128, "AT24C512"}, + {16, 128 * 1024, 256, "AT24CM01"}, +}; + +static struct ofw_compat_data compat_data[] = { + {"atmel,24c01", (uintptr_t)(&type_desc[0])}, + {"atmel,24c02", (uintptr_t)(&type_desc[1])}, + {"atmel,24c04", (uintptr_t)(&type_desc[2])}, + {"atmel,24c08", (uintptr_t)(&type_desc[3])}, + {"atmel,24c16", (uintptr_t)(&type_desc[4])}, + {"atmel,24c32", (uintptr_t)(&type_desc[5])}, + {"atmel,24c64", (uintptr_t)(&type_desc[6])}, + {"atmel,24c128", (uintptr_t)(&type_desc[7])}, + {"atmel,24c256", (uintptr_t)(&type_desc[8])}, + {"atmel,24c512", (uintptr_t)(&type_desc[9])}, + {"atmel,24c1024", (uintptr_t)(&type_desc[10])}, + {NULL, (uintptr_t)NULL}, +}; +#endif + #define CDEV2SOFTC(dev) ((dev)->si_drv1) /* cdev routines */ @@ -75,6 +125,39 @@ static struct cdevsw icee_cdevsw = .d_write = icee_write }; +#ifdef FDT +static int +icee_probe(device_t dev) +{ + struct eeprom_desc *d; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + d = (struct eeprom_desc *) + ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (d == NULL) + return (ENXIO); + + device_set_desc(dev, d->name); + return (BUS_PROBE_DEFAULT); +} + +static void +icee_init(struct icee_softc *sc) +{ + struct eeprom_desc *d; + + d = (struct eeprom_desc *) + ofw_bus_search_compatible(sc->dev, compat_data)->ocd_data; + if (d == NULL) + return; /* attach will see sc->size == 0 and return error */ + + sc->size = d->size; + sc->type = d->type; + sc->wr_sz = d->wr_sz; +} +#else /* !FDT */ static int icee_probe(device_t dev) { @@ -83,37 +166,44 @@ icee_probe(device_t dev) return (BUS_PROBE_NOWILDCARD); } -static int -icee_attach(device_t dev) +static void +icee_init(struct icee_softc *sc) { - struct icee_softc *sc = device_get_softc(dev); const char *dname; - int dunit, err; + int dunit; - sc->sc_dev = dev; - sc->sc_busdev = device_get_parent(sc->sc_dev); - sc->addr = iicbus_get_addr(dev); - err = 0; - dname = device_get_name(dev); - dunit = device_get_unit(dev); + dname = device_get_name(sc->dev); + dunit = device_get_unit(sc->dev); resource_int_value(dname, dunit, "size", &sc->size); resource_int_value(dname, dunit, "type", &sc->type); - resource_int_value(dname, dunit, "rd_sz", &sc->rd_sz); - if (sc->rd_sz > MAX_RD_SZ) - sc->rd_sz = MAX_RD_SZ; resource_int_value(dname, dunit, "wr_sz", &sc->wr_sz); +} +#endif /* FDT */ + +static int +icee_attach(device_t dev) +{ + struct icee_softc *sc = device_get_softc(dev); + + sc->dev = dev; + sc->addr = iicbus_get_addr(dev); + icee_init(sc); + if (sc->size == 0 || sc->type == 0 || sc->wr_sz == 0) { + device_printf(sc->dev, "Missing config data, " + "these cannot be zero: size %d type %d wr_sz %d\n", + sc->size, sc->type, sc->wr_sz); + return (EINVAL); + } if (bootverbose) - device_printf(dev, "size: %d bytes bus_width: %d-bits\n", + device_printf(dev, "size: %d bytes, addressing: %d-bits\n", sc->size, sc->type); sc->cdev = make_dev(&icee_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "icee%d", device_get_unit(dev)); if (sc->cdev == NULL) { - err = ENOMEM; - goto out; + return (ENOMEM); } sc->cdev->si_drv1 = sc; -out: - return (err); + return (0); } static int @@ -149,14 +239,11 @@ icee_read(struct cdev *dev, struct uio * return (EIO); if (sc->type != 8 && sc->type != 16) return (EINVAL); - error = iicbus_request_bus(sc->sc_busdev, sc->sc_dev, IIC_INTRWAIT); - if (error!= 0) - return (iic2errno(error)); slave = error = 0; while (uio->uio_resid > 0) { if (uio->uio_offset >= sc->size) break; - len = MIN(sc->rd_sz - (uio->uio_offset & (sc->rd_sz - 1)), + len = MIN(MAX_RD_SZ - (uio->uio_offset & (MAX_RD_SZ - 1)), uio->uio_resid); switch (sc->type) { case 8: @@ -175,7 +262,7 @@ icee_read(struct cdev *dev, struct uio * } for (i = 0; i < 2; i++) msgs[i].slave = slave; - error = iicbus_transfer(sc->sc_dev, msgs, 2); + error = iicbus_transfer_excl(sc->dev, msgs, 2, IIC_INTRWAIT); if (error) { error = iic2errno(error); break; @@ -184,7 +271,6 @@ icee_read(struct cdev *dev, struct uio * if (error) break; } - iicbus_release_bus(sc->sc_busdev, sc->sc_dev); return (error); } @@ -213,9 +299,6 @@ icee_write(struct cdev *dev, struct uio if (sc->type != 8 && sc->type != 16) return (EINVAL); - error = iicbus_request_bus(sc->sc_busdev, sc->sc_dev, IIC_INTRWAIT); - if (error!= 0) - return (iic2errno(error)); slave = error = 0; while (uio->uio_resid > 0) { if (uio->uio_offset >= sc->size) @@ -239,7 +322,7 @@ icee_write(struct cdev *dev, struct uio error = uiomove(data + sc->type / 8, len, uio); if (error) break; - error = iicbus_transfer(sc->sc_dev, wr, 1); + error = iicbus_transfer_excl(sc->dev, wr, 1, IIC_INTRWAIT); if (error) { error = iic2errno(error); break; @@ -248,14 +331,14 @@ icee_write(struct cdev *dev, struct uio waitlimit = 10000; rd[0].slave = slave; do { - error = iicbus_transfer(sc->sc_dev, rd, 1); + error = iicbus_transfer_excl(sc->dev, rd, 1, + IIC_INTRWAIT); } while (waitlimit-- > 0 && error != 0); if (error) { error = iic2errno(error); break; } } - iicbus_release_bus(sc->sc_busdev, sc->sc_dev); return error; } From owner-svn-src-stable-10@freebsd.org Sun Jan 24 19:21:55 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E3B3717D; Sun, 24 Jan 2016 19:21:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8EF220F; Sun, 24 Jan 2016 19:21:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OJLra7078599; Sun, 24 Jan 2016 19:21:53 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OJLrSa078594; Sun, 24 Jan 2016 19:21:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241921.u0OJLrSa078594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 19:21:53 +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: r294677 - in stable/10/sys: kern powerpc/powerpc sparc64/sparc64 x86/x86 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.20 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, 24 Jan 2016 19:21:55 -0000 Author: ian Date: Sun Jan 24 19:21:53 2016 New Revision: 294677 URL: https://svnweb.freebsd.org/changeset/base/294677 Log: MFC r289618, r290316: Fix printf format to allow for bus_size_t not being u_long on all platforms. Fix an alignment check that is wrong in half the busdma implementations. This will enable the elimination of a workaround in the USB driver that artifically allocates buffers twice as big as they need to be (which actually saves memory for very small buffers on the buggy platforms). When deciding how to allocate a dma buffer, armv4, armv6, mips, and x86/iommu all correctly check for the tag alignment <= maxsize as enabling simple uma/malloc based allocation. Powerpc, sparc64, x86/bounce, and arm64/bounce were all checking for alignment < maxsize; on those platforms when alignment was equal to the max size it would fall back to page-based allocators even for very small buffers. This change makes all platforms use the <= check. It should be noted that on all platforms other than arm[v6] and mips, this check is relying on undocumented behavior in malloc(9) that if you allocate a block of a given size it will be aligned to the next larger power-of-2 boundary. There is nothing in the malloc(9) man page that makes that explicit promise (but the busdma code has been relying on this behavior all along so I guess it works). Arm and mips code uses the allocator in kern/subr_busdma_buffalloc.c, which does explicitly implement this promise about size and alignment. Other platforms probably should switch to the aligned allocator. Modified: stable/10/sys/kern/subr_busdma_bufalloc.c stable/10/sys/powerpc/powerpc/busdma_machdep.c stable/10/sys/sparc64/sparc64/bus_machdep.c stable/10/sys/x86/x86/busdma_bounce.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_busdma_bufalloc.c ============================================================================== --- stable/10/sys/kern/subr_busdma_bufalloc.c Sun Jan 24 19:12:16 2016 (r294676) +++ stable/10/sys/kern/subr_busdma_bufalloc.c Sun Jan 24 19:21:53 2016 (r294677) @@ -94,8 +94,8 @@ busdma_bufalloc_create(const char *name, for (i = 0, bz = ba->buf_zones, cursize = ba->min_size; i < nitems(ba->buf_zones) && cursize <= MAX_ZONE_BUFSIZE; ++i, ++bz, cursize <<= 1) { - snprintf(bz->name, sizeof(bz->name), "dma %.10s %lu", - name, cursize); + snprintf(bz->name, sizeof(bz->name), "dma %.10s %ju", + name, (uintmax_t)cursize); bz->size = cursize; bz->umazone = uma_zcreate(bz->name, bz->size, NULL, NULL, NULL, NULL, bz->size - 1, zcreate_flags); Modified: stable/10/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- stable/10/sys/powerpc/powerpc/busdma_machdep.c Sun Jan 24 19:12:16 2016 (r294676) +++ stable/10/sys/powerpc/powerpc/busdma_machdep.c Sun Jan 24 19:21:53 2016 (r294677) @@ -514,14 +514,14 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi /* * XXX: - * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact + * (dmat->alignment <= dmat->maxsize) is just a quick hack; the exact * alignment guarantees of malloc need to be nailed down, and the * code below should be rewritten to take that into account. * * In the meantime, we'll warn the user if malloc gets it wrong. */ if ((dmat->maxsize <= PAGE_SIZE) && - (dmat->alignment < dmat->maxsize) && + (dmat->alignment <= dmat->maxsize) && dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { *vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags); Modified: stable/10/sys/sparc64/sparc64/bus_machdep.c ============================================================================== --- stable/10/sys/sparc64/sparc64/bus_machdep.c Sun Jan 24 19:12:16 2016 (r294676) +++ stable/10/sys/sparc64/sparc64/bus_machdep.c Sun Jan 24 19:21:53 2016 (r294677) @@ -521,14 +521,14 @@ nexus_dmamem_alloc(bus_dma_tag_t dmat, v /* * XXX: - * (dmat->dt_alignment < dmat->dt_maxsize) is just a quick hack; the + * (dmat->dt_alignment <= dmat->dt_maxsize) is just a quick hack; the * exact alignment guarantees of malloc need to be nailed down, and * the code below should be rewritten to take that into account. * * In the meantime, we'll warn the user if malloc gets it wrong. */ if (dmat->dt_maxsize <= PAGE_SIZE && - dmat->dt_alignment < dmat->dt_maxsize) + dmat->dt_alignment <= dmat->dt_maxsize) *vaddr = malloc(dmat->dt_maxsize, M_DEVBUF, mflags); else { /* Modified: stable/10/sys/x86/x86/busdma_bounce.c ============================================================================== --- stable/10/sys/x86/x86/busdma_bounce.c Sun Jan 24 19:12:16 2016 (r294676) +++ stable/10/sys/x86/x86/busdma_bounce.c Sun Jan 24 19:21:53 2016 (r294677) @@ -402,14 +402,14 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dm /* * XXX: - * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact + * (dmat->alignment <= dmat->maxsize) is just a quick hack; the exact * alignment guarantees of malloc need to be nailed down, and the * code below should be rewritten to take that into account. * * In the meantime, we'll warn the user if malloc gets it wrong. */ if ((dmat->common.maxsize <= PAGE_SIZE) && - (dmat->common.alignment < dmat->common.maxsize) && + (dmat->common.alignment <= dmat->common.maxsize) && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { *vaddr = malloc(dmat->common.maxsize, M_DEVBUF, mflags); From owner-svn-src-stable-10@freebsd.org Sun Jan 24 19:34:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACADC7752; Sun, 24 Jan 2016 19:34:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C864A34; Sun, 24 Jan 2016 19:34:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OJY6qN081664; Sun, 24 Jan 2016 19:34:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OJY6pK081659; Sun, 24 Jan 2016 19:34:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241934.u0OJY6pK081659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 19:34:05 +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: r294678 - stable/10/sys/arm/freescale/imx 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.20 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, 24 Jan 2016 19:34:07 -0000 Author: ian Date: Sun Jan 24 19:34:05 2016 New Revision: 294678 URL: https://svnweb.freebsd.org/changeset/base/294678 Log: MFC r291149, r291367: Update the imx5/imx6 cpu_reset() implementation based on a new understanding of the SRS (software reset) bit in the watchdog control register. Despite what the manual seems to imply, this bit DOES trigger an immediate reset, as opposed to simply flagging the type of reset as software-triggered. Rename sysctl node hw.imx6 to hw.imx. Move its definition to imx_machdep.c so that code shared between imx5 and imx6 can work with OIDs under that node. Add last_reset_status (integer) and last_reset_reason (string) OIDs that provide info about the last chip reset (power-on, software reset, watchdog timeout). Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c stable/10/sys/arm/freescale/imx/imx6_machdep.c stable/10/sys/arm/freescale/imx/imx_machdep.c stable/10/sys/arm/freescale/imx/imx_machdep.h stable/10/sys/arm/freescale/imx/imx_wdogreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun Jan 24 19:21:53 2016 (r294677) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun Jan 24 19:34:05 2016 (r294678) @@ -73,11 +73,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -static SYSCTL_NODE(_hw, OID_AUTO, imx6, CTLFLAG_RW, NULL, "i.MX6 container"); - static struct resource_spec imx6_anatop_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, @@ -396,23 +395,23 @@ cpufreq_initialize(struct imx6_anatop_so uint32_t cfg3speed; struct oppt * op; - SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), OID_AUTO, "cpu_mhz", CTLFLAG_RD, &sc->cpu_curmhz, 0, "CPU frequency"); - SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency"); - SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency"); - SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), OID_AUTO, "cpu_maxmhz_hw", CTLFLAG_RD, &sc->cpu_maxmhz_hw, 0, "Maximum CPU frequency allowed by hardware"); - SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), OID_AUTO, "cpu_overclock_enable", CTLFLAG_RWTUN, &sc->cpu_overclock_enable, 0, "Allow setting CPU frequency higher than cpu_maxmhz_hw"); @@ -630,10 +629,10 @@ initialize_tempmon(struct imx6_anatop_so callout_reset_sbt(&sc->temp_throttle_callout, sc->temp_throttle_delay, 0, tempmon_throttle_check, sc, 0); - SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, temp_sysctl_handler, "IK", "Current die temperature"); - SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx6), + SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), OID_AUTO, "throttle_temperature", CTLTYPE_INT | CTLFLAG_RW, sc, 0, temp_throttle_sysctl_handler, "IK", "Throttle CPU when exceeding this temperature"); Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_machdep.c Sun Jan 24 19:21:53 2016 (r294677) +++ stable/10/sys/arm/freescale/imx/imx6_machdep.c Sun Jan 24 19:34:05 2016 (r294678) @@ -99,7 +99,6 @@ initarm_lastaddr(void) void initarm_early_init(void) { - /* Inform the MPCore timer driver that its clock is variable. */ arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES); } @@ -113,6 +112,9 @@ initarm_gpio_init(void) void initarm_late_init(void) { + const uint32_t IMX6_WDOG_SR_PHYS = 0x020bc004; + + imx_wdog_init_last_reset(IMX6_WDOG_SR_PHYS); /* Cache the gpio1 node handle for imx6_decode_fdt() workaround code. */ gpio1_node = OF_node_from_xref( Modified: stable/10/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.c Sun Jan 24 19:21:53 2016 (r294677) +++ stable/10/sys/arm/freescale/imx/imx_machdep.c Sun Jan 24 19:34:05 2016 (r294678) @@ -45,6 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include +SYSCTL_NODE(_hw, OID_AUTO, imx, CTLFLAG_RW, NULL, "i.MX container"); + +static int last_reset_status; +SYSCTL_UINT(_hw_imx, OID_AUTO, last_reset_status, CTLFLAG_RD, + &last_reset_status, 0, "Last reset status register"); + +SYSCTL_STRING(_hw_imx, OID_AUTO, last_reset_reason, CTLFLAG_RD, + "unknown", 0, "Last reset reason"); + struct arm32_dma_range * bus_dma_get_range(void) { @@ -72,21 +81,36 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_phys volatile uint16_t * pcr; /* - * The deceptively simple write of WDOG_CR_WDE enables the watchdog, - * sets the timeout to its minimum value (half a second), and also - * clears the SRS bit which results in the SFTW (software-requested - * reset) bit being set in the watchdog status register after the reset. - * This is how software can distinguish a reset from a wdog timeout. + * Trigger an immediate reset by clearing the SRS bit in the watchdog + * control register. The reset happens on the next cycle of the wdog + * 32KHz clock, so hang out in a spin loop until the reset takes effect. */ if ((pcr = arm_devmap_ptov(wdcr_physaddr, sizeof(*pcr))) == NULL) { printf("cpu_reset() can't find its control register... locking up now."); } else { - *pcr = WDOG_CR_WDE; + *pcr &= ~WDOG_CR_SRS; } for (;;) continue; } +void +imx_wdog_init_last_reset(vm_offset_t wdsr_phys) +{ + volatile uint16_t * psr; + + if ((psr = arm_devmap_ptov(wdsr_phys, sizeof(*psr))) == NULL) + return; + last_reset_status = *psr; + if (last_reset_status & WDOG_RSR_SFTW) { + sysctl___hw_imx_last_reset_reason.oid_arg1 = "SoftwareReset"; + } else if (last_reset_status & WDOG_RSR_TOUT) { + sysctl___hw_imx_last_reset_reason.oid_arg1 = "WatchdogTimeout"; + } else if (last_reset_status & WDOG_RSR_POR) { + sysctl___hw_imx_last_reset_reason.oid_arg1 = "PowerOnReset"; + } +} + u_int imx_soc_family(void) { Modified: stable/10/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.h Sun Jan 24 19:21:53 2016 (r294677) +++ stable/10/sys/arm/freescale/imx/imx_machdep.h Sun Jan 24 19:34:05 2016 (r294678) @@ -30,10 +30,14 @@ #define IMX_MACHDEP_H #include +#include + +SYSCTL_DECL(_hw_imx); /* Common functions, implemented in imx_machdep.c. */ void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys) __attribute__((__noreturn__)); +void imx_wdog_init_last_reset(vm_offset_t _wdsr_phys); /* From here down, routines are implemented in imxNN_machdep.c. */ Modified: stable/10/sys/arm/freescale/imx/imx_wdogreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_wdogreg.h Sun Jan 24 19:21:53 2016 (r294677) +++ stable/10/sys/arm/freescale/imx/imx_wdogreg.h Sun Jan 24 19:34:05 2016 (r294678) @@ -47,6 +47,7 @@ #define WDOG_SR_STEP2 0xaaaa #define WDOG_RSR_REG 0x04 /* Reset Status Register */ +#define WDOG_RSR_POR (1 << 4) /* Due to Power-On Reset */ #define WDOG_RSR_TOUT (1 << 1) /* Due WDog timeout reset */ #define WDOG_RSR_SFTW (1 << 0) /* Due Soft reset */ From owner-svn-src-stable-10@freebsd.org Sun Jan 24 19:36:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE66F7859; Sun, 24 Jan 2016 19:36:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FB77BC4; Sun, 24 Jan 2016 19:36:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OJanmG081793; Sun, 24 Jan 2016 19:36:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OJan11081792; Sun, 24 Jan 2016 19:36:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241936.u0OJan11081792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 19:36:49 +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: r294679 - stable/10/sys/arm/freescale/imx 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.20 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, 24 Jan 2016 19:36:50 -0000 Author: ian Date: Sun Jan 24 19:36:49 2016 New Revision: 294679 URL: https://svnweb.freebsd.org/changeset/base/294679 Log: MFC r292419, r294237: Fix the clock divisor calc for imx6 sdcard bus speed. Quick exit after setting the clock control register. Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_sdhci.c Sun Jan 24 19:34:05 2016 (r294678) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Sun Jan 24 19:36:49 2016 (r294679) @@ -429,6 +429,7 @@ imx_sdhci_write_2(device_t dev, struct s } else { imx_sdhc_set_clock(sc, false); } + return; } /* @@ -522,12 +523,19 @@ imx_sdhc_set_clock(struct imx_sdhci_soft else freq = sc->baseclk_hz / (2 * divisor); - for (prescale = 2; prescale < freq / prescale / 16;) + for (prescale = 2; freq < sc->baseclk_hz / (prescale * 16);) prescale <<= 1; - for (divisor = 1; freq < freq / prescale / divisor;) + for (divisor = 1; freq < sc->baseclk_hz / (prescale * divisor);) ++divisor; +#ifdef DEBUG + device_printf(sc->dev, + "desired SD freq: %d, actual: %d; base %d prescale %d divisor %d\n", + freq, sc->baseclk_hz / (prescale * divisor), sc->baseclk_hz, + prescale, divisor); +#endif + prescale >>= 1; divisor -= 1; From owner-svn-src-stable-10@freebsd.org Sun Jan 24 19:41:33 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6418E79FD; Sun, 24 Jan 2016 19:41:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25C75E16; Sun, 24 Jan 2016 19:41:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OJfWle082604; Sun, 24 Jan 2016 19:41:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OJfVus082601; Sun, 24 Jan 2016 19:41:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241941.u0OJfVus082601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 19:41:31 +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: r294680 - in stable/10/etc: defaults rc.d 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.20 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, 24 Jan 2016 19:41:33 -0000 Author: ian Date: Sun Jan 24 19:41:31 2016 New Revision: 294680 URL: https://svnweb.freebsd.org/changeset/base/294680 Log: MFC r292752: Enhance rc.d/netwait script to wait for late-attaching interfaces such as USB NICs. USB network hardware may not be enumerated and available when the rc.d networking scripts run. Eventually the USB attachment completes and devd events cause the network initialization to happen, but by then other rc.d scripts have already failed, because services which depend on NETWORKING (such as mountcritremote) may end up running before the network is actually ready. There is an existing netwait script, but because it is dependent on NETWORKING it runs too late to prevent failure of some other rc scripts. This change flips the order so that NETWORKING depends on netwait, and netwait now depends on devd and routing (the former is needed to make interfaces appear, and the latter is needed to run the ping tests in netwait). The netwait script used to be oriented primarily towards "as soon as any host is reachable the network is fully functional", so you gave it a list of IPs to try and you could optionally name an interface and it would wait for carrier on that interface. That functionality still works the same, but now you can provide a list of interfaces to wait for and it waits until each one of them is available. The ping logic still completes as soon as the first IP on the list responds. These changes were submitted by Brenden Molloy in PR 205186, and lightly modified by me to allow a list of interfaces instead of just one. PR: 205186 Relnotes: yes Modified: stable/10/etc/defaults/rc.conf stable/10/etc/rc.d/NETWORKING stable/10/etc/rc.d/netwait Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Sun Jan 24 19:36:49 2016 (r294679) +++ stable/10/etc/defaults/rc.conf Sun Jan 24 19:41:31 2016 (r294680) @@ -452,9 +452,9 @@ ubthidhci_enable="NO" # Switch an USB B ### Network link/usability verification options netwait_enable="NO" # Enable rc.d/netwait (or NO) -#netwait_ip="" # IP addresses to be pinged by netwait. +#netwait_ip="" # Wait for ping response from any IP in this list. netwait_timeout="60" # Total number of seconds to perform pings. -#netwait_if="" # Interface name to watch link state on. +#netwait_if="" # Wait for active link on each intf in this list. netwait_if_timeout="30" # Total number of seconds to monitor link state. ### Miscellaneous network options: ### Modified: stable/10/etc/rc.d/NETWORKING ============================================================================== --- stable/10/etc/rc.d/NETWORKING Sun Jan 24 19:36:49 2016 (r294679) +++ stable/10/etc/rc.d/NETWORKING Sun Jan 24 19:41:31 2016 (r294680) @@ -4,7 +4,7 @@ # # PROVIDE: NETWORKING NETWORK -# REQUIRE: netif netoptions routing ppp ipfw stf faith +# REQUIRE: netif netwait netoptions routing ppp ipfw stf faith # REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge # REQUIRE: static_arp static_ndp Modified: stable/10/etc/rc.d/netwait ============================================================================== --- stable/10/etc/rc.d/netwait Sun Jan 24 19:36:49 2016 (r294679) +++ stable/10/etc/rc.d/netwait Sun Jan 24 19:41:31 2016 (r294680) @@ -3,13 +3,20 @@ # $FreeBSD$ # # PROVIDE: netwait -# REQUIRE: NETWORKING +# REQUIRE: devd routing # KEYWORD: nojail # -# The netwait script is intended to be used by systems which have -# statically-configured IP addresses in rc.conf(5). If your system -# uses DHCP, you should use synchronous_dhclient="YES" in your -# /etc/rc.conf instead of using netwait. +# The netwait script helps handle two situations: +# - Systems with USB or other late-attaching network hardware which +# is initialized by devd events. The script waits for all the +# interfaces named in the netwait_if list to appear. +# - Systems with statically-configured IP addresses in rc.conf(5). +# The IP addresses in the netwait_ip list are pinged. The script +# waits for any single IP in the list to respond to the ping. If your +# system uses DHCP, you should probably use synchronous_dhclient="YES" +# in your /etc/rc.conf instead of netwait_ip. +# Either or both of the wait lists can be used (at least one must be +# non-empty if netwait is enabled). . /etc/rc.subr @@ -21,77 +28,87 @@ stop_cmd=":" netwait_start() { - local ip rc count output link + local ip rc count output link wait_if got_if any_error - if [ -z "${netwait_ip}" ]; then - err 1 "You must define one or more IP addresses in netwait_ip" + if [ -z "${netwait_if}" ] && [ -z "${netwait_ip}" ]; then + err 1 "No interface or IP addresses listed, nothing to wait for" fi if [ ${netwait_timeout} -lt 1 ]; then err 1 "netwait_timeout must be >= 1" fi - # Handle SIGINT (Ctrl-C); force abort of while() loop - trap break SIGINT - if [ -n "${netwait_if}" ]; then - echo -n "Waiting for $netwait_if to have link" - - count=1 - while [ ${count} -le ${netwait_if_timeout} ]; do - if output=`/sbin/ifconfig ${netwait_if} 2>/dev/null`; then - link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` - if [ -z "${link}" ]; then - echo '.' - break + any_error=0 + for wait_if in ${netwait_if}; do + echo -n "Waiting for ${wait_if}" + link="" + got_if=0 + count=1 + # Handle SIGINT (Ctrl-C); force abort of while() loop + trap break SIGINT + while [ ${count} -le ${netwait_if_timeout} ]; do + if output=`/sbin/ifconfig ${wait_if} 2>/dev/null`; then + if [ ${got_if} -eq 0 ]; then + echo -n ", interface present" + got_if=1 + fi + link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'` + if [ -z "${link}" ]; then + echo ', got link.' + break + fi fi - else - echo '' - err 1 "ifconfig ${netwait_if} failed" - fi - sleep 1 - count=$((count+1)) - done - if [ -n "${link}" ]; then + sleep 1 + count=$((count+1)) + done # Restore default SIGINT handler trap - SIGINT - - echo '' - warn "Interface still has no link. Continuing with startup, but" - warn "be aware you may not have a fully functional networking" - warn "layer at this point." - return + if [ ${got_if} -eq 0 ]; then + echo ", wait failed: interface never appeared." + any_error=1 + elif [ -n "${link}" ]; then + echo ", wait failed: interface still has no link." + any_error=1 + fi + done + if [ ${any_error} -eq 1 ]; then + warn "Continuing with startup, but be aware you may not have " + warn "a fully functional networking layer at this point." fi fi + + if [ -n "${netwait_ip}" ]; then + # Handle SIGINT (Ctrl-C); force abort of for() loop + trap break SIGINT + + for ip in ${netwait_ip}; do + echo -n "Waiting for ${ip} to respond to ICMP ping" + + count=1 + while [ ${count} -le ${netwait_timeout} ]; do + /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 + rc=$? + + if [ $rc -eq 0 ]; then + # Restore default SIGINT handler + trap - SIGINT - # Handle SIGINT (Ctrl-C); force abort of while() loop - trap break SIGINT - - for ip in ${netwait_ip}; do - echo -n "Waiting for ${ip} to respond to ICMP" - - count=1 - while [ ${count} -le ${netwait_timeout} ]; do - /sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1 - rc=$? - - if [ $rc -eq 0 ]; then - # Restore default SIGINT handler - trap - SIGINT - - echo '.' - return - fi - count=$((count+1)) + echo ', got response.' + return + fi + count=$((count+1)) + done + echo ', failed: No response from host.' done - echo ': No response from host.' - done - # Restore default SIGINT handler - trap - SIGINT + # Restore default SIGINT handler + trap - SIGINT + + warn "Exhausted IP list. Continuing with startup, but be aware you may" + warn "not have a fully functional networking layer at this point." + fi - warn "Exhausted IP list. Continuing with startup, but be aware you may" - warn "not have a fully functional networking layer at this point." } load_rc_config $name From owner-svn-src-stable-10@freebsd.org Sun Jan 24 19:59:00 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA7D8A1D00F; Sun, 24 Jan 2016 19:59:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2D4D867; Sun, 24 Jan 2016 19:59:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OJwxMq087624; Sun, 24 Jan 2016 19:58:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OJwxnX087617; Sun, 24 Jan 2016 19:58:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601241958.u0OJwxnX087617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 19:58:59 +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: r294681 - stable/10/sys/arm/arm 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.20 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, 24 Jan 2016 19:59:01 -0000 Author: ian Date: Sun Jan 24 19:58:58 2016 New Revision: 294681 URL: https://svnweb.freebsd.org/changeset/base/294681 Log: MFC r277416, r282023, r282024, r282025, r284264: Remove the SMP code from locore-v4. These will never use the SMP code as there is no multi-core hardware prior to ARMv6. Remove the armv6 code from locore-v4.S, it's not needed there. Fix the style of locore-v4.S and locore-v6.S to help find any common code. Cleanup a little more: - Remove whitespace at the end of lines - Use a tab after instructions, not spaces Fix the spelling of __ARM_ARCH >= 6 in sys/arm/arm. Modified: stable/10/sys/arm/arm/bcopyinout.S stable/10/sys/arm/arm/bcopyinout_xscale.S stable/10/sys/arm/arm/copystr.S stable/10/sys/arm/arm/locore-v4.S stable/10/sys/arm/arm/locore-v6.S stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/bcopyinout.S ============================================================================== --- stable/10/sys/arm/arm/bcopyinout.S Sun Jan 24 19:41:31 2016 (r294680) +++ stable/10/sys/arm/arm/bcopyinout.S Sun Jan 24 19:58:58 2016 (r294681) @@ -38,6 +38,7 @@ #include "assym.s" +#include #include #include @@ -54,7 +55,7 @@ __FBSDID("$FreeBSD$"); .text .align 2 -#ifdef _ARM_ARCH_6 +#if __ARM_ARCH >= 6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ add tmp, tmp, #(TD_PCB) Modified: stable/10/sys/arm/arm/bcopyinout_xscale.S ============================================================================== --- stable/10/sys/arm/arm/bcopyinout_xscale.S Sun Jan 24 19:41:31 2016 (r294680) +++ stable/10/sys/arm/arm/bcopyinout_xscale.S Sun Jan 24 19:58:58 2016 (r294681) @@ -38,11 +38,13 @@ #include __FBSDID("$FreeBSD$"); +#include + .syntax unified .text .align 2 -#ifdef _ARM_ARCH_6 +#if __ARM_ARCH >= 6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ add tmp, tmp, #(TD_PCB) Modified: stable/10/sys/arm/arm/copystr.S ============================================================================== --- stable/10/sys/arm/arm/copystr.S Sun Jan 24 19:41:31 2016 (r294680) +++ stable/10/sys/arm/arm/copystr.S Sun Jan 24 19:58:58 2016 (r294681) @@ -40,6 +40,7 @@ #include "assym.s" +#include #include #include __FBSDID("$FreeBSD$"); @@ -49,7 +50,7 @@ __FBSDID("$FreeBSD$"); .text .align 2 -#ifdef _ARM_ARCH_6 +#if __ARM_ARCH >= 6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ add tmp, tmp, #(TD_PCB) Modified: stable/10/sys/arm/arm/locore-v4.S ============================================================================== --- stable/10/sys/arm/arm/locore-v4.S Sun Jan 24 19:41:31 2016 (r294680) +++ stable/10/sys/arm/arm/locore-v4.S Sun Jan 24 19:58:58 2016 (r294681) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); * * TODO: Fix the ARMv4/v5 case. */ -#if (defined(FLASHADDR) || defined(LOADERRAMADDR) || !defined(_ARM_ARCH_6)) && \ - !defined(PHYSADDR) +#ifndef PHYSADDR #error PHYSADDR must be defined for this configuration #endif @@ -116,7 +115,7 @@ ASENTRY_NP(_start) * If we're running with MMU disabled, test against the * physical address instead. */ - mrc p15, 0, r2, c1, c0, 0 + mrc p15, 0, r2, c1, c0, 0 ands r2, r2, #CPU_CONTROL_MMU_ENABLE ldreq r6, =PHYSADDR ldrne r6, =LOADERRAMADDR @@ -125,7 +124,7 @@ ASENTRY_NP(_start) cmp r7, pc bhi from_ram b do_copy - + flash_lower: cmp r6, pc bls from_ram @@ -148,12 +147,12 @@ from_ram: disable_mmu: /* Disable MMU for a while */ - mrc p15, 0, r2, c1, c0, 0 + mrc p15, 0, r2, c1, c0, 0 bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ CPU_CONTROL_WBUF_ENABLE) bic r2, r2, #(CPU_CONTROL_IC_ENABLE) bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE) - mcr p15, 0, r2, c1, c0, 0 + mcr p15, 0, r2, c1, c0, 0 nop nop @@ -169,36 +168,16 @@ Lunmapped: adr r0, Lpagetable bl translate_va_to_pa -#ifndef _ARM_ARCH_6 /* * Some of the older ports (the various XScale, mostly) assume * that the memory before the kernel is mapped, and use it for - * the various stacks, page tables, etc. For those CPUs, map the - * 64 first MB of RAM, as it used to be. + * the various stacks, page tables, etc. For those CPUs, map the + * 64 first MB of RAM, as it used to be. */ /* * Map PA == VA - */ - ldr r5, =PHYSADDR - mov r1, r5 - mov r2, r5 - /* Map 64MiB, preserved over calls to build_pagetables */ - mov r3, #64 - bl build_pagetables - - /* Create the kernel map to jump to */ - mov r1, r5 - ldr r2, =(KERNBASE) - bl build_pagetables - ldr r5, =(KERNPHYSADDR) -#else - /* - * Map PA == VA - */ - /* Find the start kernels load address */ - adr r5, _start - ldr r2, =(L1_S_OFFSET) - bic r5, r2 + */ + ldr r5, =PHYSADDR mov r1, r5 mov r2, r5 /* Map 64MiB, preserved over calls to build_pagetables */ @@ -207,10 +186,10 @@ Lunmapped: /* Create the kernel map to jump to */ mov r1, r5 - ldr r2, =(KERNVIRTADDR) + ldr r2, =(KERNBASE) bl build_pagetables -#endif - + ldr r5, =(KERNPHYSADDR) + #if defined(SOCDEV_PA) && defined(SOCDEV_VA) /* Create the custom map */ ldr r1, =SOCDEV_PA @@ -218,32 +197,19 @@ Lunmapped: bl build_pagetables #endif -#if defined(SMP) - orr r0, r0, #2 /* Set TTB shared memory flag */ -#endif mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_CORTEXA) || defined(CPU_MV_PJ4B) || defined(CPU_KRAIT) - mov r0, #0 - mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ -#endif - /* Set the Domain Access register. Very important! */ - mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) + mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) mcr p15, 0, r0, c3, c0, 0 - /* + /* * Enable MMU. * On armv6 enable extended page tables, and set alignment checking * to modulo-4 (CPU_CONTROL_UNAL_ENABLE) for the ldrd/strd * instructions emitted by clang. */ mrc p15, 0, r0, c1, c0, 0 -#ifdef _ARM_ARCH_6 - orr r0, r0, #(CPU_CONTROL_V6_EXTPAGE | CPU_CONTROL_UNAL_ENABLE) - orr r0, r0, #(CPU_CONTROL_AFLT_ENABLE) - orr r0, r0, #(CPU_CONTROL_AF_ENABLE) -#endif orr r0, r0, #(CPU_CONTROL_MMU_ENABLE) mcr p15, 0, r0, c1, c0, 0 nop @@ -283,7 +249,7 @@ virt_done: /* init arm will return the new stack pointer. */ mov sp, r0 - bl _C_LABEL(mi_startup) /* call mi_startup()! */ + bl _C_LABEL(mi_startup) /* call mi_startup()! */ adr r0, .Lmainreturned b _C_LABEL(panic) @@ -338,9 +304,6 @@ translate_va_to_pa: build_pagetables: /* Set the required page attributed */ ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) -#if defined(SMP) - orr r4, #(L1_SHARED) -#endif orr r1, r4 /* Move the virtual address to the correct bit location */ @@ -394,98 +357,12 @@ pagetable: .Lcpufuncs: .word _C_LABEL(cpufuncs) -#if defined(SMP) - -.Lmpvirt_done: - .word mpvirt_done -VA_TO_PA_POINTER(Lstartup_pagetable_secondary, temp_pagetable) - -ASENTRY_NP(mpentry) - - /* Make sure interrupts are disabled. */ - mrs r7, cpsr - orr r7, r7, #(PSR_I | PSR_F) - msr cpsr_c, r7 - - /* Disable MMU. It should be disabled already, but make sure. */ - mrc p15, 0, r2, c1, c0, 0 - bic r2, r2, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ - CPU_CONTROL_WBUF_ENABLE) - bic r2, r2, #(CPU_CONTROL_IC_ENABLE) - bic r2, r2, #(CPU_CONTROL_BPRD_ENABLE) - mcr p15, 0, r2, c1, c0, 0 - nop - nop - nop - CPWAIT(r0) - -#if ARM_MMU_V6 - bl armv6_idcache_inv_all /* Modifies r0 only */ -#elif ARM_MMU_V7 - bl armv7_idcache_inv_all /* Modifies r0-r3, ip */ -#endif - - /* Load the page table physical address */ - adr r0, Lstartup_pagetable_secondary - bl translate_va_to_pa - /* Load the address the secondary page table */ - ldr r0, [r0] - - orr r0, r0, #2 /* Set TTB shared memory flag */ - mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ - mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ - - mov r0, #0 - mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */ - - /* Set the Domain Access register. Very important! */ - mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT) - mcr p15, 0, r0, c3, c0, 0 - /* Enable MMU */ - mrc p15, 0, r0, c1, c0, 0 - orr r0, r0, #CPU_CONTROL_V6_EXTPAGE - orr r0, r0, #CPU_CONTROL_AF_ENABLE - orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE |\ - CPU_CONTROL_WBUF_ENABLE) - orr r0, r0, #(CPU_CONTROL_IC_ENABLE) - orr r0, r0, #(CPU_CONTROL_BPRD_ENABLE) - mcr p15, 0, r0, c1, c0, 0 - nop - nop - nop - CPWAIT(r0) - - adr r1, .Lstart - ldmia r1, {r1, r2, sp} /* Set initial stack and */ - mrc p15, 0, r0, c0, c0, 5 - and r0, r0, #15 - mov r1, #2048 - mul r2, r1, r0 - sub sp, sp, r2 - str r1, [sp] - ldr pc, .Lmpvirt_done - -mpvirt_done: - - mov fp, #0 /* trace back starts here */ - bl _C_LABEL(init_secondary) /* Off we go */ - - adr r0, .Lmpreturned - b _C_LABEL(panic) - /* NOTREACHED */ - -.Lmpreturned: - .asciz "init_secondary() returned" - .align 2 -END(mpentry) -#endif - ENTRY_NP(cpu_halt) - mrs r2, cpsr + mrs r2, cpsr bic r2, r2, #(PSR_MODE) - orr r2, r2, #(PSR_SVC32_MODE) + orr r2, r2, #(PSR_SVC32_MODE) orr r2, r2, #(PSR_I | PSR_F) - msr cpsr_fsxc, r2 + msr cpsr_fsxc, r2 ldr r4, .Lcpu_reset_address ldr r4, [r4] @@ -511,9 +388,9 @@ ENTRY_NP(cpu_halt) * Hurl ourselves into the ROM */ mov r0, #(CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE) - mcr p15, 0, r0, c1, c0, 0 - mcrne p15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ - mov pc, r4 + mcr p15, 0, r0, c1, c0, 0 + mcrne p15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ + mov pc, r4 /* * _cpu_reset_address contains the address to branch to, to complete @@ -550,7 +427,7 @@ ENTRY(longjmp) END(longjmp) .data - .global _C_LABEL(esym) + .global _C_LABEL(esym) _C_LABEL(esym): .word _C_LABEL(end) ENTRY_NP(abort) @@ -563,7 +440,7 @@ ENTRY_NP(sigcode) /* * Call the sigreturn system call. - * + * * We have to load r7 manually rather than using * "ldr r7, =SYS_sigreturn" to ensure the value of szsigcode is * correct. Using the alternative places esigcode at the address Modified: stable/10/sys/arm/arm/locore-v6.S ============================================================================== --- stable/10/sys/arm/arm/locore-v6.S Sun Jan 24 19:41:31 2016 (r294680) +++ stable/10/sys/arm/arm/locore-v6.S Sun Jan 24 19:58:58 2016 (r294681) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); -#ifndef ARM_NEW_PMAP +#ifndef ARM_NEW_PMAP #define PTE1_OFFSET L1_S_OFFSET #define PTE1_SHIFT L1_S_SHIFT #define PTE1_SIZE L1_S_SIZE @@ -52,13 +52,13 @@ __FBSDID("$FreeBSD$"); .align 2 /* - * On entry for FreeBSD boot ABI: - * r0 - metadata pointer or 0 (boothowto on AT91's boot2) - * r1 - if (r0 == 0) then metadata pointer - * On entry for Linux boot ABI: + * On entry for FreeBSD boot ABI: + * r0 - metadata pointer or 0 (boothowto on AT91's boot2) + * r1 - if (r0 == 0) then metadata pointer + * On entry for Linux boot ABI: * r0 - 0 * r1 - machine type (passed as arg2 to initarm) - * r2 - Pointer to a tagged list or dtb image (phys addr) (passed as arg1 initarm) + * r2 - Pointer to a tagged list or dtb image (phys addr) (passed as arg1 initarm) * * For both types of boot we gather up the args, put them in a struct arm_boot_params * structure and pass that to initarm. @@ -66,17 +66,17 @@ __FBSDID("$FreeBSD$"); .globl btext btext: ASENTRY_NP(_start) - STOP_UNWINDING /* Can't unwind into the bootloader! */ + STOP_UNWINDING /* Can't unwind into the bootloader! */ - /* Make sure interrupts are disabled. */ + /* Make sure interrupts are disabled. */ cpsid ifa - mov r8, r0 /* 0 or boot mode from boot2 */ - mov r9, r1 /* Save Machine type */ - mov r10, r2 /* Save meta data */ + mov r8, r0 /* 0 or boot mode from boot2 */ + mov r9, r1 /* Save Machine type */ + mov r10, r2 /* Save meta data */ mov r11, r3 /* Future expansion */ - /* + /* * Check whether data cache is enabled. If it is, then we know * current tags are valid (not power-on garbage values) and there * might be dirty lines that need cleaning. Disable cache to prevent @@ -93,7 +93,7 @@ ASENTRY_NP(_start) * valid. Disable all caches and the MMU, and invalidate everything * before setting up new page tables and re-enabling the mmu. */ -1: +1: bic r7, #CPU_CONTROL_DC_ENABLE bic r7, #CPU_CONTROL_MMU_ENABLE bic r7, #CPU_CONTROL_IC_ENABLE @@ -119,13 +119,13 @@ ASENTRY_NP(_start) /* * Map PA == VA */ - /* Find the start kernels load address */ + /* Find the start kernels load address */ adr r5, _start ldr r2, =(PTE1_OFFSET) bic r5, r2 mov r1, r5 mov r2, r5 - /* Map 64MiB, preserved over calls to build_pagetables */ + /* Map 64MiB, preserved over calls to build_pagetables */ mov r3, #64 bl build_pagetables @@ -142,41 +142,41 @@ ASENTRY_NP(_start) #endif bl init_mmu - /* Switch to virtual addresses. */ + /* Switch to virtual addresses. */ ldr pc, =1f 1: - /* Setup stack, clear BSS */ + /* Setup stack, clear BSS */ ldr r1, =.Lstart ldmia r1, {r1, r2, sp} /* Set initial stack and */ add sp, sp, #INIT_ARM_STACK_SIZE - sub r2, r2, r1 /* get zero init data */ + sub r2, r2, r1 /* get zero init data */ mov r3, #0 2: str r3, [r1], #0x0004 /* get zero init data */ - subs r2, r2, #4 + subs r2, r2, #4 bgt 2b - mov r1, #28 /* loader info size is 28 bytes also second arg */ - subs sp, sp, r1 /* allocate arm_boot_params struct on stack */ - mov r0, sp /* loader info pointer is first arg */ - bic sp, sp, #7 /* align stack to 8 bytes */ - str r1, [r0] /* Store length of loader info */ + mov r1, #28 /* loader info size is 28 bytes also second arg */ + subs sp, sp, r1 /* allocate arm_boot_params struct on stack */ + mov r0, sp /* loader info pointer is first arg */ + bic sp, sp, #7 /* align stack to 8 bytes */ + str r1, [r0] /* Store length of loader info */ str r8, [r0, #4] /* Store r0 from boot loader */ str r9, [r0, #8] /* Store r1 from boot loader */ str r10, [r0, #12] /* store r2 from boot loader */ str r11, [r0, #16] /* store r3 from boot loader */ str r5, [r0, #20] /* store the physical address */ - adr r4, Lpagetable /* load the pagetable address */ + adr r4, Lpagetable /* load the pagetable address */ ldr r5, [r4, #4] str r5, [r0, #24] /* store the pagetable address */ mov fp, #0 /* trace back starts here */ bl _C_LABEL(initarm) /* Off we go */ - /* init arm will return the new stack pointer. */ + /* init arm will return the new stack pointer. */ mov sp, r0 - bl _C_LABEL(mi_startup) /* call mi_startup()! */ + bl _C_LABEL(mi_startup) /* call mi_startup()! */ ldr r0, =.Lmainreturned b _C_LABEL(panic) @@ -219,8 +219,8 @@ translate_va_to_pa: mov pc, lr /* - * Init MMU - * r0 - The table base address + * Init MMU + * r0 - the table base address */ ASENTRY_NP(init_mmu) @@ -267,11 +267,11 @@ END(init_mmu) /* - * Init SMP coherent mode, enable caching and switch to final MMU table. - * Called with disabled caches - * r0 - The table base address - * r1 - clear bits for aux register - * r2 - set bits for aux register + * Init SMP coherent mode, enable caching and switch to final MMU table. + * Called with disabled caches + * r0 - The table base address + * r1 - clear bits for aux register + * r2 - set bits for aux register */ ASENTRY_NP(reinit_mmu) push {r4-r11, lr} @@ -331,11 +331,11 @@ END(reinit_mmu) /* * Builds the page table - * r0 - The table base address - * r1 - The physical address (trashed) - * r2 - The virtual address (trashed) - * r3 - The number of 1MiB sections - * r4 - Trashed + * r0 - The table base address + * r1 - The physical address (trashed) + * r2 - The virtual address (trashed) + * r3 - The number of 1MiB sections + * r4 - Trashed * * Addresses must be 1MiB aligned */ @@ -350,15 +350,15 @@ build_pagetables: #endif orr r1, r4 - /* Move the virtual address to the correct bit location */ + /* Move the virtual address to the correct bit location */ lsr r2, #(PTE1_SHIFT - 2) mov r4, r3 1: str r1, [r0, r2] - add r2, r2, #4 - add r1, r1, #(PTE1_SIZE) - adds r4, r4, #-1 + add r2, r2, #4 + add r1, r1, #(PTE1_SIZE) + adds r4, r4, #-1 bhi 1b mov pc, lr @@ -372,7 +372,7 @@ VA_TO_PA_POINTER(Lpagetable, boot_pt1) .word svcstk /* must remain in order together. */ .Lmainreturned: - .asciz "main() returned" + .asciz "main() returned" .align 2 .bss @@ -380,8 +380,8 @@ svcstk: .space INIT_ARM_STACK_SIZE * MAXCPU /* - * Memory for the initial pagetable. We are unable to place this in - * the bss as this will be cleared after the table is loaded. + * Memory for the initial pagetable. We are unable to place this in + * the bss as this will be cleared after the table is loaded. */ .section ".init_pagetable" .align 14 /* 16KiB aligned */ @@ -398,7 +398,7 @@ boot_pt1: #if defined(SMP) ASENTRY_NP(mpentry) - /* Make sure interrupts are disabled. */ + /* Make sure interrupts are disabled. */ cpsid ifa /* Setup core, disable all caches. */ @@ -419,10 +419,10 @@ ASENTRY_NP(mpentry) mcr CP15_ICIALLU ISB - /* Find the delta between VA and PA */ + /* Find the delta between VA and PA */ adr r0, Lpagetable bl translate_va_to_pa - + bl init_mmu adr r1, .Lstart+8 /* Get initstack pointer from */ @@ -433,7 +433,7 @@ ASENTRY_NP(mpentry) mul r2, r1, r0 /* Point sp to initstack */ add sp, sp, r2 /* area for this processor. */ - /* Switch to virtual addresses. */ + /* Switch to virtual addresses. */ ldr pc, =1f 1: mov fp, #0 /* trace back starts here */ @@ -459,14 +459,14 @@ ENTRY_NP(cpu_halt) ldr r4, [r4] teq r4, #0 movne pc, r4 -1: +1: WFI b 1b /* * _cpu_reset_address contains the address to branch to, to complete * the cpu reset after turning the MMU off - * This variable is provided by the hardware specific code + * This variable is provided by the hardware specific code */ .Lcpu_reset_address: .word _C_LABEL(cpu_reset_address) @@ -498,38 +498,37 @@ END(abort) ENTRY_NP(sigcode) mov r0, sp - add r0, r0, #SIGF_UC + add r0, r0, #SIGF_UC /* - * Call the sigreturn system call. + * Call the sigreturn system call. * * We have to load r7 manually rather than using - * "ldr r7, =SYS_sigreturn" to ensure the value of szsigcode is + * "ldr r7, =SYS_sigreturn" to ensure the value of szsigcode is * correct. Using the alternative places esigcode at the address - * of the data rather than the address one past the data. + * of the data rather than the address one past the data. */ - ldr r7, [pc, #12] /* Load SYS_sigreturn */ + ldr r7, [pc, #12] /* Load SYS_sigreturn */ swi SYS_sigreturn - /* Well if that failed we better exit quick ! */ + /* Well if that failed we better exit quick ! */ - ldr r7, [pc, #8] /* Load SYS_exit */ + ldr r7, [pc, #8] /* Load SYS_exit */ swi SYS_exit - /* Branch back to retry SYS_sigreturn */ + /* Branch back to retry SYS_sigreturn */ b . - 16 END(sigcode) - .word SYS_sigreturn .word SYS_exit .align 2 - .global _C_LABEL(esigcode) + .global _C_LABEL(esigcode) _C_LABEL(esigcode): .data - .global szsigcode + .global szsigcode szsigcode: .long esigcode-sigcode Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Sun Jan 24 19:41:31 2016 (r294680) +++ stable/10/sys/arm/arm/machdep.c Sun Jan 24 19:58:58 2016 (r294681) @@ -832,7 +832,7 @@ fake_preload_metadata(struct arm_boot_pa void pcpu0_init(void) { -#if ARM_ARCH_6 || ARM_ARCH_7A || defined(CPU_MV_PJ4B) +#if __ARM_ARCH >= 6 set_curthread(&thread0); #endif pcpu_init(pcpup, 0, sizeof(struct pcpu)); Modified: stable/10/sys/arm/arm/trap.c ============================================================================== --- stable/10/sys/arm/arm/trap.c Sun Jan 24 19:41:31 2016 (r294680) +++ stable/10/sys/arm/arm/trap.c Sun Jan 24 19:58:58 2016 (r294681) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -322,7 +323,7 @@ abort_handler(struct trapframe *tf, int * location, so we can deal with those quickly. Otherwise we need to * disassemble the faulting instruction to determine if it was a write. */ -#if ARM_ARCH_6 || ARM_ARCH_7A +#if __ARM_ARCH >= 6 ftype = (fsr & FAULT_WNR) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ; #else if (IS_PERMISSION_FAULT(fsr)) From owner-svn-src-stable-10@freebsd.org Sun Jan 24 20:15:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F064A1D699; Sun, 24 Jan 2016 20:15:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B864D27F; Sun, 24 Jan 2016 20:15:53 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OKFqvq093816; Sun, 24 Jan 2016 20:15:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OKFq39093814; Sun, 24 Jan 2016 20:15:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601242015.u0OKFq39093814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 20:15:52 +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: r294682 - stable/10/sys/arm/arm 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.20 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, 24 Jan 2016 20:15:54 -0000 Author: ian Date: Sun Jan 24 20:15:52 2016 New Revision: 294682 URL: https://svnweb.freebsd.org/changeset/base/294682 Log: MFC r290647, r292523, r292891: ARM: Improve robustness of locore_v6.S and fix errors. - boot page table is not allocated in data section, so must be cleared before use - map only one section (1 MB) for SOCDEV mapping (*) - DSB must be used for ensuring of finishing TLB operations - Invalidate BTB when appropriate Allow armv4/5 kernels to be loaded on any 2MB boundary, like armv6/7. This eliminates the reliance on PHYSADDR and KERNPHYSADDR compile-time symbols (except when the rom-copy code is enabled) by using the current PC and the assumption that the entry-point routine is in the first 1MB section of the text segment. Other cleanups done: - Reduce the initarm() stack size back to 2K. It got increased to 4 * 2K when this file was supporting multicore armv6, but that support is now in locore-v6.S. - When building the temporary startup page tables, map the entire 4GB address space as VA=PA before mapping the kernel at its loaded location. This allows access to boot parameters stored somewhere in ram by the bootloader, regardless of where that may be. - When building the page table entry for supporting EARLY_PRINTF, map the section as uncached unbuffered, since it is presumably device registers. Note that this restores the ability to use loader(8)/ubldr on armv4/5 kernels. That was broken in r283035, the point at which ubldr started loading an arm kernel at any 2MB boundary. Also note that after this, there is no reason to set KERNVIRTADDR to anything other than 0xc0000000, and no need for PHYSADDR or KERNPHYSADDR symbols at all. Bring some of the recent locore-v4.S improvements into locore-V6... - Map all 4GB as VA=PA so that args passed in from a bootloader can be accessed regardless of where they are. - Figure out the kernel load address by directly masking the PC rather then by doing pc-relative math on the _start symbol. - For EARLY_PRINTF support, map device memory as uncacheable (no-op for ARM_NEW_PMAP because all TEX types resolve to uncacheable). Modified: stable/10/sys/arm/arm/locore-v4.S stable/10/sys/arm/arm/locore-v6.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/locore-v4.S ============================================================================== --- stable/10/sys/arm/arm/locore-v4.S Sun Jan 24 19:58:58 2016 (r294681) +++ stable/10/sys/arm/arm/locore-v4.S Sun Jan 24 20:15:52 2016 (r294682) @@ -42,19 +42,8 @@ __FBSDID("$FreeBSD$"); -/* - * Sanity check the configuration. - * FLASHADDR and LOADERRAMADDR depend on PHYSADDR in some cases. - * ARMv4 and ARMv5 make assumptions on where they are loaded. - * - * TODO: Fix the ARMv4/v5 case. - */ -#ifndef PHYSADDR -#error PHYSADDR must be defined for this configuration -#endif - -/* What size should this really be ? It is only used by initarm() */ -#define INIT_ARM_STACK_SIZE (2048 * 4) +/* 2K initial stack is plenty, it is only used by initarm() */ +#define INIT_ARM_STACK_SIZE 2048 #define CPWAIT_BRANCH \ sub pc, pc, #4 @@ -109,6 +98,16 @@ ASENTRY_NP(_start) msr cpsr_c, r7 #if defined (FLASHADDR) && defined(LOADERRAMADDR) +/* + * Sanity check the configuration. + * FLASHADDR and LOADERRAMADDR depend on PHYSADDR in some cases. + * ARMv4 and ARMv5 make assumptions on where they are loaded. + * TODO: Fix the ARMv4/v5 case. + */ +#ifndef PHYSADDR +#error PHYSADDR must be defined for this configuration +#endif + /* Check if we're running from flash. */ ldr r7, =FLASHADDR /* @@ -164,37 +163,45 @@ Lunmapped: * Build page table from scratch. */ - /* Find the delta between VA and PA */ + /* + * Figure out the physical address we're loaded at by assuming this + * entry point code is in the first L1 section and so if we clear the + * offset bits of the pc that will give us the section-aligned load + * address, which remains in r5 throughout all the following code. + */ + ldr r2, =(L1_S_OFFSET) + bic r5, pc, r2 + + /* Find the delta between VA and PA, result stays in r0 throughout. */ adr r0, Lpagetable bl translate_va_to_pa - /* - * Some of the older ports (the various XScale, mostly) assume - * that the memory before the kernel is mapped, and use it for - * the various stacks, page tables, etc. For those CPUs, map the - * 64 first MB of RAM, as it used to be. - */ - /* - * Map PA == VA + /* + * First map the entire 4GB address space as VA=PA. It's mapped as + * normal (cached) memory because it's for things like accessing the + * parameters passed in from the bootloader, which might be at any + * physical address, different for every platform. */ - ldr r5, =PHYSADDR - mov r1, r5 - mov r2, r5 - /* Map 64MiB, preserved over calls to build_pagetables */ - mov r3, #64 + mov r1, #0 + mov r2, #0 + mov r3, #4096 bl build_pagetables - /* Create the kernel map to jump to */ + /* + * Next we do 64MiB starting at the physical load address, mapped to + * the VA the kernel is linked for. + */ mov r1, r5 - ldr r2, =(KERNBASE) + ldr r2, =(KERNVIRTADDR) + mov r3, #64 bl build_pagetables - ldr r5, =(KERNPHYSADDR) + /* Create a device mapping for early_printf if specified. */ #if defined(SOCDEV_PA) && defined(SOCDEV_VA) - /* Create the custom map */ ldr r1, =SOCDEV_PA ldr r2, =SOCDEV_VA - bl build_pagetables + mov r3, #1 + bl build_device_pagetables #endif mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ @@ -205,9 +212,6 @@ Lunmapped: mcr p15, 0, r0, c3, c0, 0 /* * Enable MMU. - * On armv6 enable extended page tables, and set alignment checking - * to modulo-4 (CPU_CONTROL_UNAL_ENABLE) for the ldrd/strd - * instructions emitted by clang. */ mrc p15, 0, r0, c1, c0, 0 orr r0, r0, #(CPU_CONTROL_MMU_ENABLE) @@ -217,6 +221,9 @@ Lunmapped: nop CPWAIT(r0) + /* Transition the PC from physical to virtual addressing. */ + ldr pc,=mmu_done + mmu_done: nop adr r1, .Lstart @@ -227,7 +234,6 @@ mmu_done: str r3, [r1], #0x0004 /* get zero init data */ subs r2, r2, #4 bgt .L1 - ldr pc, .Lvirt_done virt_done: mov r1, #28 /* loader info size is 28 bytes also second arg */ @@ -301,21 +307,25 @@ translate_va_to_pa: * * Addresses must be 1MiB aligned */ +build_device_pagetables: + ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW)) + b 1f build_pagetables: /* Set the required page attributed */ ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) +1: orr r1, r4 /* Move the virtual address to the correct bit location */ lsr r2, #(L1_S_SHIFT - 2) mov r4, r3 -1: +2: str r1, [r0, r2] add r2, r2, #4 add r1, r1, #(L1_S_SIZE) adds r4, r4, #-1 - bhi 1b + bhi 2b RET Modified: stable/10/sys/arm/arm/locore-v6.S ============================================================================== --- stable/10/sys/arm/arm/locore-v6.S Sun Jan 24 19:58:58 2016 (r294681) +++ stable/10/sys/arm/arm/locore-v6.S Sun Jan 24 20:15:52 2016 (r294682) @@ -103,46 +103,60 @@ ASENTRY_NP(_start) orr r7, #CPU_CONTROL_AFLT_ENABLE orr r7, #CPU_CONTROL_VECRELOC mcr CP15_SCTLR(r7) + DSB ISB bl dcache_inv_poc_all mcr CP15_ICIALLU + DSB ISB /* * Build page table from scratch. */ - /* Calculate the physical address of the startup pagetable. */ + /* + * Figure out the physical address we're loaded at by assuming this + * entry point code is in the first L1 section and so if we clear the + * offset bits of the pc that will give us the section-aligned load + * address, which remains in r5 throughout all the following code. + */ + ldr r2, =(L1_S_OFFSET) + bic r5, pc, r2 + + /* Find the delta between VA and PA, result stays in r0 throughout. */ adr r0, Lpagetable bl translate_va_to_pa - /* - * Map PA == VA + /* + * First map the entire 4GB address space as VA=PA. It's mapped as + * normal (cached) memory because it's for things like accessing the + * parameters passed in from the bootloader, which might be at any + * physical address, different for every platform. */ - /* Find the start kernels load address */ - adr r5, _start - ldr r2, =(PTE1_OFFSET) - bic r5, r2 - mov r1, r5 - mov r2, r5 - /* Map 64MiB, preserved over calls to build_pagetables */ - mov r3, #64 + mov r1, #0 + mov r2, #0 + mov r3, #4096 bl build_pagetables - /* Create the kernel map to jump to */ + /* + * Next we do 64MiB starting at the physical load address, mapped to + * the VA the kernel is linked for. + */ mov r1, r5 ldr r2, =(KERNVIRTADDR) + mov r3, #64 bl build_pagetables + /* Create a device mapping for early_printf if specified. */ #if defined(SOCDEV_PA) && defined(SOCDEV_VA) - /* Create the custom map used for early_printf(). */ ldr r1, =SOCDEV_PA ldr r2, =SOCDEV_VA - bl build_pagetables + mov r3, #1 + bl build_device_pagetables #endif bl init_mmu - /* Switch to virtual addresses. */ + /* Transition the PC from physical to virtual addressing. */ ldr pc, =1f 1: @@ -261,7 +275,9 @@ ASENTRY_NP(init_mmu) ISB mcr CP15_TLBIALL /* Flush TLB */ mcr CP15_BPIALL /* Flush Branch predictor */ + DSB ISB + mov pc, lr END(init_mmu) @@ -289,6 +305,7 @@ ASENTRY_NP(reinit_mmu) bl dcache_inv_pou_all #endif mcr CP15_ICIALLU + DSB ISB /* Set auxiliary register */ @@ -297,6 +314,7 @@ ASENTRY_NP(reinit_mmu) eor r8, r8, r6 /* Set bits */ teq r7, r8 mcrne CP15_ACTLR(r8) + DSB ISB /* Enable caches. */ @@ -311,8 +329,8 @@ ASENTRY_NP(reinit_mmu) DSB ISB - /* Flush all TLBs */ - mcr CP15_TLBIALL + mcr CP15_TLBIALL /* Flush TLB */ + mcr CP15_BPIALL /* Flush Branch predictor */ DSB ISB @@ -323,6 +341,7 @@ ASENTRY_NP(reinit_mmu) bl dcache_inv_pou_all #endif mcr CP15_ICIALLU + DSB ISB pop {r4-r11, pc} @@ -339,6 +358,15 @@ END(reinit_mmu) * * Addresses must be 1MiB aligned */ +build_device_pagetables: +#if defined(ARM_NEW_PMAP) + ldr r4, =PTE1_V|PTE1_A|PTE1_AP_KRW|TEX1_CLASS_0 +#elif defined(SMP) + ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW)|L1_SHARED) +#else + ldr r4, =(L1_TYPE_S|L1_S_AP(AP_KRW)) +#endif + b 1f build_pagetables: /* Set the required page attributed */ #if defined(ARM_NEW_PMAP) @@ -348,18 +376,19 @@ build_pagetables: #else ldr r4, =(L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) #endif +1: orr r1, r4 /* Move the virtual address to the correct bit location */ lsr r2, #(PTE1_SHIFT - 2) mov r4, r3 -1: +2: str r1, [r0, r2] add r2, r2, #4 add r1, r1, #(PTE1_SIZE) adds r4, r4, #-1 - bhi 1b + bhi 2b mov pc, lr @@ -412,11 +441,13 @@ ASENTRY_NP(mpentry) orr r0, #CPU_CONTROL_AFLT_ENABLE orr r0, #CPU_CONTROL_VECRELOC mcr CP15_SCTLR(r0) + DSB ISB /* Invalidate L1 cache I+D cache */ bl dcache_inv_pou_all mcr CP15_ICIALLU + DSB ISB /* Find the delta between VA and PA */ From owner-svn-src-stable-10@freebsd.org Sun Jan 24 21:04:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C88157F21; Sun, 24 Jan 2016 21:04:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A4E4667; Sun, 24 Jan 2016 21:04:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OL47X7008822; Sun, 24 Jan 2016 21:04:07 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OL47UM008815; Sun, 24 Jan 2016 21:04:07 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601242104.u0OL47UM008815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 21:04:07 +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: r294683 - in stable/10/sys: amd64/amd64 arm/arm arm/xscale/ixp425 i386/i386 kern sparc64/sparc64 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.20 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, 24 Jan 2016 21:04:09 -0000 Author: ian Date: Sun Jan 24 21:04:06 2016 New Revision: 294683 URL: https://svnweb.freebsd.org/changeset/base/294683 Log: MFC r293045, r293046: Make the 'env' directive described in config(5) work on all architectures, providing compiled-in static environment data that is used instead of any data passed in from a boot loader. Previously 'env' worked only on i386 and arm xscale systems, because it required the MD startup code to examine the global envmode variable and decide whether to use static_env or an environment obtained from the boot loader, and set the global kern_envp accordingly. Most startup code wasn't doing so. Making things even more complex, some mips startup code uses an alternate scheme that involves calling init_static_kenv() to pass an empty buffer and its size, then uses a series of kern_setenv() calls to populate that buffer. Now all MD startup code calls init_static_kenv(), and that routine provides a single point where envmode is checked and the decision is made whether to use the compiled-in static_kenv or the values provided by the MD code. The routine also continues to serve its original purpose for mips; if a non-zero buffer size is passed the routine installs the empty buffer ready to accept kern_setenv() values. Now if the size is zero, the provided buffer full of existing env data is installed. A NULL pointer can be passed if the boot loader provides no env data; this allows the static env to be installed if envmode is set to do so. Most of the work here is a near-mechanical change to call the init function instead of directly setting kern_envp. A notable exception is in xen/pv.c; that code was originally installing a buffer full of preformatted env data along with its non-zero size (like mips code does), which would have allowed kern_setenv() calls to wipe out the preformatted data. Now it passes a zero for the size so that the buffer of data it installs is treated as non-writeable. Also, revert accidental change that snuck into r293045. Modified: stable/10/sys/amd64/amd64/machdep.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/xscale/ixp425/avila_machdep.c stable/10/sys/i386/i386/machdep.c stable/10/sys/kern/kern_environment.c stable/10/sys/sparc64/sparc64/machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Sun Jan 24 20:15:52 2016 (r294682) +++ stable/10/sys/amd64/amd64/machdep.c Sun Jan 24 21:04:06 2016 (r294683) @@ -1847,7 +1847,7 @@ hammer_time(u_int64_t modulep, u_int64_t if (kmdp == NULL) kmdp = preload_search_by_type("elf64 kernel"); boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *) + KERNBASE; + init_static_kenv(MD_FETCH(kmdp, MODINFOMD_ENVP, char *) + KERNBASE, 0); #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t); Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Sun Jan 24 20:15:52 2016 (r294682) +++ stable/10/sys/arm/arm/machdep.c Sun Jan 24 21:04:06 2016 (r294683) @@ -826,6 +826,8 @@ fake_preload_metadata(struct arm_boot_pa fake_preload[i] = 0; preload_metadata = (void *)fake_preload; + init_static_kenv(NULL, 0); + return (lastaddr); } @@ -901,6 +903,8 @@ linux_parse_boot_param(struct arm_boot_p bcopy(atag_list, atags, (char *)walker - (char *)atag_list + ATAG_SIZE(walker)); + init_static_kenv(NULL, 0); + return fake_preload_metadata(abp); } #endif @@ -929,7 +933,7 @@ freebsd_parse_boot_param(struct arm_boot return 0; boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); + init_static_kenv(MD_FETCH(kmdp, MODINFOMD_ENVP, char *), 0); lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, uintptr_t); Modified: stable/10/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/avila_machdep.c Sun Jan 24 20:15:52 2016 (r294682) +++ stable/10/sys/arm/xscale/ixp425/avila_machdep.c Sun Jan 24 21:04:06 2016 (r294683) @@ -223,8 +223,8 @@ initarm(struct arm_boot_params *abp) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); - if (envmode == 1) - kern_envp = static_env; + init_static_kenv(NULL, 0); + /* Do basic tuning, hz etc */ init_param1(); @@ -420,10 +420,6 @@ initarm(struct arm_boot_params *abp) init_param2(physmem); kdb_init(); - /* use static kernel environment if so configured */ - if (envmode == 1) - kern_envp = static_env; - return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - sizeof(struct pcb))); #undef next_page Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Sun Jan 24 20:15:52 2016 (r294682) +++ stable/10/sys/i386/i386/machdep.c Sun Jan 24 21:04:06 2016 (r294683) @@ -3190,10 +3190,11 @@ init386(first) } else { metadata_missing = 1; } - if (envmode == 1) - kern_envp = static_env; - else if (bootinfo.bi_envp) - kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE; + + if (bootinfo.bi_envp) + init_static_kenv((caddr_t)bootinfo.bi_envp + KERNBASE, 0); + else + init_static_kenv(NULL, 0); /* Init basic tunables, hz etc */ init_param1(); Modified: stable/10/sys/kern/kern_environment.c ============================================================================== --- stable/10/sys/kern/kern_environment.c Sun Jan 24 20:15:52 2016 (r294682) +++ stable/10/sys/kern/kern_environment.c Sun Jan 24 21:04:06 2016 (r294683) @@ -210,12 +210,44 @@ done: return (error); } +/* + * Populate the initial kernel environment. + * + * This is called very early in MD startup, either to provide a copy of the + * environment obtained from a boot loader, or to provide an empty buffer into + * which MD code can store an initial environment using kern_setenv() calls. + * + * If the global envmode is 1, the environment is initialized from the global + * static_env[], regardless of the arguments passed. This implements the env + * keyword described in config(5). In this case env_pos is set to env_len, + * causing kern_setenv() to return -1 (if len > 0) or panic (if len == 0) until + * the dynamic environment is available. The envmode and static_env variables + * are defined in env.c which is generated by config(8). + * + * If len is non-zero, the caller is providing an empty buffer. The caller will + * subsequently use kern_setenv() to add up to len bytes of initial environment + * before the dynamic environment is available. + * + * If len is zero, the caller is providing a pre-loaded buffer containing + * environment strings. Additional strings cannot be added until the dynamic + * environment is available. The memory pointed to must remain stable at least + * until sysinit runs init_dynamic_kenv(). If no initial environment is + * available from the boot loader, passing a NULL pointer allows the static_env + * to be installed if it is configured. + */ void init_static_kenv(char *buf, size_t len) { - kern_envp = buf; - env_len = len; - env_pos = 0; + + if (envmode == 1) { + kern_envp = static_env; + env_len = len; + env_pos = len; + } else { + kern_envp = buf; + env_len = len; + env_pos = 0; + } } /* Modified: stable/10/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/10/sys/sparc64/sparc64/machdep.c Sun Jan 24 20:15:52 2016 (r294682) +++ stable/10/sys/sparc64/sparc64/machdep.c Sun Jan 24 21:04:06 2016 (r294683) @@ -383,7 +383,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_l kmdp = preload_search_by_type("elf kernel"); if (kmdp != NULL) { boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int); - kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); + init_static_kenv(MD_FETCH(kmdp, MODINFOMD_ENVP, char *), + 0); end = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); kernel_tlb_slots = MD_FETCH(kmdp, MODINFOMD_DTLB_SLOTS, int); From owner-svn-src-stable-10@freebsd.org Sun Jan 24 22:00:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F1EC9D9FC9; Sun, 24 Jan 2016 22:00:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61C60F07; Sun, 24 Jan 2016 22:00:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OM0aVr024062; Sun, 24 Jan 2016 22:00:36 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OM0anN024060; Sun, 24 Jan 2016 22:00:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601242200.u0OM0anN024060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 22:00:36 +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: r294685 - in stable/10/sys: arm/arm boot/uboot/lib 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.20 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, 24 Jan 2016 22:00:37 -0000 Author: ian Date: Sun Jan 24 22:00:36 2016 New Revision: 294685 URL: https://svnweb.freebsd.org/changeset/base/294685 Log: MFC r293053, r293061, r293063, r293064, r293065, r293775, r293792: Use 64-bit math when finding a block of ram to hold the kernel. This fixes a problem on 32-bit systems which have ram occupying the end of the physical address space -- for example, a block of ram at 0x80000000 with a size of 0x80000000 was overflowing 32 bit math and ending up with a calculated size of zero. Use 64-bit math when processing the lists of physical and excluded memory to generate the phys_avail and dump_avail arrays. Work around problems that happen when there is ram at the end of the physical address space. Cast pointer through uintptr_t on the way to uint64_t to squelch a warning. Reword the comment to better describe what I found while researching the problem that led to this temporary workaround (and also so I can properly cite the PR in the commit this time). Cast using uintfptr_t and eliminate the cast to uint64_t which is uneeded because rounding down cannot increase the number of bits needed to express the result. Go back to using uintptr_t, because code that actually compiles is infinitely less buggy than code that is theoretically correct in some alternate universe. PR: 201614 Modified: stable/10/sys/arm/arm/physmem.c stable/10/sys/boot/uboot/lib/copy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/physmem.c ============================================================================== --- stable/10/sys/arm/arm/physmem.c Sun Jan 24 21:18:54 2016 (r294684) +++ stable/10/sys/arm/arm/physmem.c Sun Jan 24 22:00:36 2016 (r294685) @@ -161,7 +161,7 @@ static size_t regions_to_avail(vm_paddr_t *avail, uint32_t exflags, long *pavail) { size_t acnt, exi, hwi; - vm_paddr_t end, start, xend, xstart; + uint64_t end, start, xend, xstart; long availmem; const struct region *exp, *hwp; @@ -171,7 +171,7 @@ regions_to_avail(vm_paddr_t *avail, uint for (hwi = 0, hwp = hwregions; hwi < hwcnt; ++hwi, ++hwp) { start = hwp->addr; end = hwp->size + start; - realmem += arm32_btop(end - start); + realmem += arm32_btop((vm_offset_t)(end - start)); for (exi = 0, exp = exregions; exi < excnt; ++exi, ++exp) { /* * If the excluded region does not match given flags, @@ -212,9 +212,10 @@ regions_to_avail(vm_paddr_t *avail, uint * could affect the remainder of this hw region. */ if ((xstart > start) && (xend < end)) { - avail[acnt++] = start; - avail[acnt++] = xstart; - availmem += arm32_btop(xstart - start); + avail[acnt++] = (vm_paddr_t)start; + avail[acnt++] = (vm_paddr_t)xstart; + availmem += + arm32_btop((vm_offset_t)(xstart - start)); start = xend; continue; } @@ -233,9 +234,9 @@ regions_to_avail(vm_paddr_t *avail, uint * available entry for it. */ if (end > start) { - avail[acnt++] = start; - avail[acnt++] = end; - availmem += arm32_btop(end - start); + avail[acnt++] = (vm_paddr_t)start; + avail[acnt++] = (vm_paddr_t)end; + availmem += arm32_btop((vm_offset_t)(end - start)); } if (acnt >= MAX_AVAIL_ENTRIES) panic("Not enough space in the dump/phys_avail arrays"); @@ -279,10 +280,22 @@ arm_physmem_hardware_region(vm_paddr_t p /* * Filter out the page at PA 0x00000000. The VM can't handle it, as * pmap_extract() == 0 means failure. + * + * Also filter out the page at the end of the physical address space -- + * if addr is non-zero and addr+size is zero we wrapped to the next byte + * beyond what vm_paddr_t can express. That leads to a NULL pointer + * deref early in startup; work around it by leaving the last page out. + * + * XXX This just in: subtract out a whole megabyte, not just 1 page. + * Reducing the size by anything less than 1MB results in the NULL + * pointer deref in _vm_map_lock_read(). Better to give up a megabyte + * than leave some folks with an unusable system while we investigate. */ if (pa == 0) { pa = PAGE_SIZE; sz -= PAGE_SIZE; + } else if (pa + sz == 0) { + sz -= 1024 * 1024; } /* Modified: stable/10/sys/boot/uboot/lib/copy.c ============================================================================== --- stable/10/sys/boot/uboot/lib/copy.c Sun Jan 24 21:18:54 2016 (r294684) +++ stable/10/sys/boot/uboot/lib/copy.c Sun Jan 24 22:00:36 2016 (r294685) @@ -69,11 +69,11 @@ uint64_t uboot_loadaddr(u_int type, void *data, uint64_t addr) { struct sys_info *si; - uintptr_t sblock, eblock, subldr, eubldr; - uintptr_t biggest_block, this_block; - size_t biggest_size, this_size; + uint64_t sblock, eblock, subldr, eubldr; + uint64_t biggest_block, this_block; + uint64_t biggest_size, this_size; int i; - char * envstr; + char *envstr; if (addr == 0) { /* @@ -101,13 +101,14 @@ uboot_loadaddr(u_int type, void *data, u biggest_block = 0; biggest_size = 0; subldr = rounddown2((uintptr_t)_start, KERN_ALIGN); - eubldr = roundup2(uboot_heap_end, KERN_ALIGN); + eubldr = roundup2((uint64_t)uboot_heap_end, KERN_ALIGN); for (i = 0; i < si->mr_no; i++) { if (si->mr[i].flags != MR_ATTR_DRAM) continue; - sblock = roundup2(si->mr[i].start, KERN_ALIGN); - eblock = rounddown2(si->mr[i].start + si->mr[i].size, + sblock = roundup2((uint64_t)si->mr[i].start, KERN_ALIGN); + eblock = rounddown2((uint64_t)si->mr[i].start + + si->mr[i].size, KERN_ALIGN); if (biggest_size == 0) sblock += KERN_MINADDR; if (subldr >= sblock && subldr < eblock) { @@ -127,9 +128,10 @@ uboot_loadaddr(u_int type, void *data, u if (biggest_size == 0) panic("Not enough DRAM to load kernel\n"); #if 0 - printf("Loading kernel into region 0x%08x-0x%08x (%u MiB)\n", - biggest_block, biggest_block + biggest_size - 1, - biggest_size / 1024 / 1024); + printf("Loading kernel into region 0x%08jx-0x%08jx (%ju MiB)\n", + (uintmax_t)biggest_block, + (uintmax_t)biggest_block + biggest_size - 1, + (uintmax_t)biggest_size / 1024 / 1024); #endif return (biggest_block); } From owner-svn-src-stable-10@freebsd.org Sun Jan 24 22:05:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 490FF7232; Sun, 24 Jan 2016 22:05:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B9113B2; Sun, 24 Jan 2016 22:05:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OM5MkO026823; Sun, 24 Jan 2016 22:05:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OM5M8r026822; Sun, 24 Jan 2016 22:05:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601242205.u0OM5M8r026822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 22:05:22 +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: r294686 - stable/10/sys/arm/arm 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.20 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, 24 Jan 2016 22:05:23 -0000 Author: ian Date: Sun Jan 24 22:05:21 2016 New Revision: 294686 URL: https://svnweb.freebsd.org/changeset/base/294686 Log: MFC r293830: Fix the spelling of fueword* to eliminate compile warnings about mismatched begin/end symbols when the warning level is turned up. Modified: stable/10/sys/arm/arm/fusu.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/fusu.S ============================================================================== --- stable/10/sys/arm/arm/fusu.S Sun Jan 24 22:00:36 2016 (r294685) +++ stable/10/sys/arm/arm/fusu.S Sun Jan 24 22:05:21 2016 (r294686) @@ -131,8 +131,8 @@ EENTRY_NP(fuword32) str r1, [r2, #PCB_ONFAULT] mov r0, r3 RET -EEND(fuword32) -END(fuword) +EEND(fueword32) +END(fueword) /* * fusword(caddr_t uaddr); From owner-svn-src-stable-10@freebsd.org Sun Jan 24 22:06:58 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 036FC72DC; Sun, 24 Jan 2016 22:06:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B77817CC; Sun, 24 Jan 2016 22:06:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OM6uaV026917; Sun, 24 Jan 2016 22:06:56 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OM6uuR026916; Sun, 24 Jan 2016 22:06:56 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601242206.u0OM6uuR026916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 22:06:56 +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: r294687 - stable/10/sys/arm/at91 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.20 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, 24 Jan 2016 22:06:58 -0000 Author: ian Date: Sun Jan 24 22:06:56 2016 New Revision: 294687 URL: https://svnweb.freebsd.org/changeset/base/294687 Log: MFC r294032: Fix the handling of the "PDC write transfer length" erratum for at91. The problem affects revision 1xx hardware as well as later versions. Also, the recommended workaround is to set the PDC count register for a 12-byte transfer when the actual size is less than that, but there is no need to extend or zero-out the data buffer, because the blklen register contains the real transfer size and only that many bytes will be transferred. Also add a sysctl to turn debugging printfs on or off on the fly. Modified: stable/10/sys/arm/at91/at91_mci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/at91_mci.c ============================================================================== --- stable/10/sys/arm/at91/at91_mci.c Sun Jan 24 22:05:21 2016 (r294686) +++ stable/10/sys/arm/at91/at91_mci.c Sun Jan 24 22:06:56 2016 (r294687) @@ -446,6 +446,9 @@ at91_mci_attach(device_t dev) CTLFLAG_RW, &sc->allow_overclock, 0, "Allow up to 30MHz clock for 25MHz request when next highest speed 15MHz or less."); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "debug", + CTLFLAG_RWTUN, &mci_debug, 0, "enable debug output"); + /* * Our real min freq is master_clock/512, but upper driver layers are * going to set the min speed during card discovery, and the right speed @@ -783,15 +786,6 @@ at91_mci_start_cmd(struct at91_mci_softc WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN); } else { len = min(BBSIZE, remaining); - /* - * If this is MCI1 revision 2xx controller, apply - * a work-around for the "Data Write Operation and - * number of bytes" erratum. - */ - if ((sc->sc_cap & CAP_MCI1_REV2XX) && len < 12) { - len = 12; - memset(sc->bbuf_vaddr[0], 0, 12); - } at91_bswap_buf(sc, sc->bbuf_vaddr[0], data->data, len); err = bus_dmamap_load(sc->dmatag, sc->bbuf_map[0], sc->bbuf_vaddr[0], len, at91_mci_getaddr, @@ -800,8 +794,13 @@ at91_mci_start_cmd(struct at91_mci_softc panic("IO write dmamap_load failed\n"); bus_dmamap_sync(sc->dmatag, sc->bbuf_map[0], BUS_DMASYNC_PREWRITE); + /* + * Erratum workaround: PDC transfer length on a write + * must not be smaller than 12 bytes (3 words); only + * blklen bytes (set above) are actually transferred. + */ WR4(sc, PDC_TPR,paddr); - WR4(sc, PDC_TCR, len / 4); + WR4(sc, PDC_TCR, (len < 12) ? 3 : len / 4); sc->bbuf_len[0] = len; remaining -= len; if (remaining == 0) { @@ -818,7 +817,7 @@ at91_mci_start_cmd(struct at91_mci_softc bus_dmamap_sync(sc->dmatag, sc->bbuf_map[1], BUS_DMASYNC_PREWRITE); WR4(sc, PDC_TNPR, paddr); - WR4(sc, PDC_TNCR, len / 4); + WR4(sc, PDC_TNCR, (len < 12) ? 3 : len / 4); sc->bbuf_len[1] = len; remaining -= len; } From owner-svn-src-stable-10@freebsd.org Sun Jan 24 22:14:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 718D475C5; Sun, 24 Jan 2016 22:14:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE9ACBE; Sun, 24 Jan 2016 22:14:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OMEb6w029611; Sun, 24 Jan 2016 22:14:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OMEbp1029610; Sun, 24 Jan 2016 22:14:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601242214.u0OMEbp1029610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 22:14:37 +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: r294689 - stable/10/sys/dev/rt 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.20 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, 24 Jan 2016 22:14:38 -0000 Author: ian Date: Sun Jan 24 22:14:37 2016 New Revision: 294689 URL: https://svnweb.freebsd.org/changeset/base/294689 Log: MFC r293105: Eliminate code for walking through the early static env data. This code is called from a device attach routine, and thus cannot be called before the cutover from static to dynamic kernel env. Modified: stable/10/sys/dev/rt/if_rt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/rt/if_rt.c ============================================================================== --- stable/10/sys/dev/rt/if_rt.c Sun Jan 24 22:08:15 2016 (r294688) +++ stable/10/sys/dev/rt/if_rt.c Sun Jan 24 22:14:37 2016 (r294689) @@ -176,20 +176,6 @@ macaddr_atoi(const char *str, uint8_t *m } #ifdef USE_GENERATED_MAC_ADDRESS -static char * -kernenv_next(char *cp) -{ - - if (cp != NULL) { - while (*cp != 0) - cp++; - cp++; - if (*cp == 0) - cp = NULL; - } - return (cp); -} - /* * generate_mac(uin8_t *mac) * This is MAC address generator for cases when real device MAC address @@ -208,14 +194,8 @@ generate_mac(uint8_t *mac) uint32_t crc = 0xffffffff; /* Generate CRC32 on kenv */ - if (dynamic_kenv) { - for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) { - crc = calculate_crc32c(crc, cp, strlen(cp) + 1); - } - } else { - for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { - crc = calculate_crc32c(crc, cp, strlen(cp) + 1); - } + for (cp = kenvp[0]; cp != NULL; cp = kenvp[++i]) { + crc = calculate_crc32c(crc, cp, strlen(cp) + 1); } crc = ~crc; From owner-svn-src-stable-10@freebsd.org Sun Jan 24 22:17:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E51076C0; Sun, 24 Jan 2016 22:17:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C78FE46; Sun, 24 Jan 2016 22:17:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OMH5M5029749; Sun, 24 Jan 2016 22:17:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OMH51c029748; Sun, 24 Jan 2016 22:17:05 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201601242217.u0OMH51c029748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 24 Jan 2016 22:17:05 +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: r294690 - stable/10/sys/arm/mv 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.20 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, 24 Jan 2016 22:17:06 -0000 Author: ian Date: Sun Jan 24 22:17:05 2016 New Revision: 294690 URL: https://svnweb.freebsd.org/changeset/base/294690 Log: MFC r289477: Fix a strange macro re-definition compile error. If the VM_MAXUSER_ADDRESS value is defined as a config option the definition is emitted into opt_global.h which is force-included into everything. In addition, the symbol is emitted by the genassym mechanism, but that by its nature reduces the value to a 0xnnnnnnnn number. When compiling a .S file you end up with two different definitions of the macro (they evaluate to the same number, but the text is different, upsetting the compiler). Modified: stable/10/sys/arm/mv/std-pj4b.mv Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/mv/std-pj4b.mv ============================================================================== --- stable/10/sys/arm/mv/std-pj4b.mv Sun Jan 24 22:14:37 2016 (r294689) +++ stable/10/sys/arm/mv/std-pj4b.mv Sun Jan 24 22:17:05 2016 (r294690) @@ -5,4 +5,8 @@ cpu CPU_MV_PJ4B machine arm armv6 makeoptions CONF_CFLAGS="-march=armv7a -Wa,-march=armv7a" -options VM_MAXUSER_ADDRESS="(KERNBASE-(1024*1024*1024))" +# This was originally defined as "(KERNBASE-(1024*1024*1024))" but that +# (in opt_global.h) clashed with the value emitted by genassym which +# reduces the original macro text to its numeric value. The only way +# to avoid that is to define it here as the numeric value genassym emits. +options VM_MAXUSER_ADDRESS="0x80000000" From owner-svn-src-stable-10@freebsd.org Sun Jan 24 22:28:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A497BB2; Sun, 24 Jan 2016 22:28:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C51A9E1; Sun, 24 Jan 2016 22:28:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0OMSLWN032978; Sun, 24 Jan 2016 22:28:21 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0OMSIn7032949; Sun, 24 Jan 2016 22:28:18 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601242228.u0OMSIn7032949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sun, 24 Jan 2016 22:28:18 +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: r294693 - in stable/10: . crypto/openssh secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd share/mk tools/build/options 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.20 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, 24 Jan 2016 22:28:22 -0000 Author: des Date: Sun Jan 24 22:28:18 2016 New Revision: 294693 URL: https://svnweb.freebsd.org/changeset/base/294693 Log: MFH (r291198, r291260, r291261, r291375, r294325, r294335, r294563) Remove the HPN and None cipher patches. Deleted: stable/10/crypto/openssh/README.hpn stable/10/tools/build/options/WITH_OPENSSH_NONE_CIPHER Modified: stable/10/UPDATING stable/10/crypto/openssh/auth-pam.c (contents, props changed) stable/10/crypto/openssh/auth2-chall.c (contents, props changed) stable/10/crypto/openssh/bufaux.c (contents, props changed) stable/10/crypto/openssh/buffer.c (contents, props changed) stable/10/crypto/openssh/buffer.h (contents, props changed) stable/10/crypto/openssh/channels.c (contents, props changed) stable/10/crypto/openssh/channels.h (contents, props changed) stable/10/crypto/openssh/cipher.c (contents, props changed) stable/10/crypto/openssh/clientloop.c (contents, props changed) stable/10/crypto/openssh/compat.c (contents, props changed) stable/10/crypto/openssh/compat.h (contents, props changed) stable/10/crypto/openssh/configure.ac (contents, props changed) stable/10/crypto/openssh/digest-libc.c (contents, props changed) stable/10/crypto/openssh/freebsd-post-merge.sh (contents, props changed) stable/10/crypto/openssh/freebsd-pre-merge.sh (contents, props changed) stable/10/crypto/openssh/kex.c (contents, props changed) stable/10/crypto/openssh/kex.h (contents, props changed) stable/10/crypto/openssh/misc.c (contents, props changed) stable/10/crypto/openssh/misc.h (contents, props changed) stable/10/crypto/openssh/monitor.c (contents, props changed) stable/10/crypto/openssh/monitor_wrap.c (contents, props changed) stable/10/crypto/openssh/myproposal.h stable/10/crypto/openssh/packet.c stable/10/crypto/openssh/packet.h (contents, props changed) stable/10/crypto/openssh/readconf.c stable/10/crypto/openssh/readconf.h stable/10/crypto/openssh/servconf.c stable/10/crypto/openssh/servconf.h (contents, props changed) stable/10/crypto/openssh/serverloop.c (contents, props changed) stable/10/crypto/openssh/session.c stable/10/crypto/openssh/sftp.1 (contents, props changed) stable/10/crypto/openssh/sftp.c (contents, props changed) stable/10/crypto/openssh/ssh-agent.1 stable/10/crypto/openssh/ssh.c stable/10/crypto/openssh/ssh_config (contents, props changed) stable/10/crypto/openssh/ssh_config.5 stable/10/crypto/openssh/ssh_namespace.h stable/10/crypto/openssh/sshconnect.c stable/10/crypto/openssh/sshconnect2.c (contents, props changed) stable/10/crypto/openssh/sshd.c stable/10/crypto/openssh/sshd_config (contents, props changed) stable/10/crypto/openssh/sshd_config.5 stable/10/crypto/openssh/version.h stable/10/secure/lib/libssh/Makefile stable/10/secure/usr.bin/ssh/Makefile stable/10/secure/usr.sbin/sshd/Makefile stable/10/share/mk/bsd.own.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/UPDATING Sun Jan 24 22:28:18 2016 (r294693) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20160124: + The NONE and HPN patches has been removed from OpenSSH. They are + still available in the security/openssh-portable port. + 20151214: r292223 changed the internal interface between the nfsd.ko and nfscommon.ko modules. As such, they must both be upgraded to-gether. Modified: stable/10/crypto/openssh/auth-pam.c ============================================================================== --- stable/10/crypto/openssh/auth-pam.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/auth-pam.c Sun Jan 24 22:28:18 2016 (r294693) @@ -45,7 +45,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* Based on $FreeBSD$ */ +/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ #include "includes.h" #include Modified: stable/10/crypto/openssh/auth2-chall.c ============================================================================== --- stable/10/crypto/openssh/auth2-chall.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/auth2-chall.c Sun Jan 24 22:28:18 2016 (r294693) @@ -25,7 +25,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include Modified: stable/10/crypto/openssh/bufaux.c ============================================================================== --- stable/10/crypto/openssh/bufaux.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/bufaux.c Sun Jan 24 22:28:18 2016 (r294693) @@ -38,7 +38,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include Modified: stable/10/crypto/openssh/buffer.c ============================================================================== --- stable/10/crypto/openssh/buffer.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/buffer.c Sun Jan 24 22:28:18 2016 (r294693) @@ -13,7 +13,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include @@ -27,7 +26,7 @@ __RCSID("$FreeBSD$"); #include "log.h" #define BUFFER_MAX_CHUNK 0x100000 -#define BUFFER_MAX_LEN 0x4000000 /* 64MB */ +#define BUFFER_MAX_LEN 0xa00000 #define BUFFER_ALLOCSZ 0x008000 /* Initializes the buffer structure. */ @@ -167,13 +166,6 @@ buffer_len(const Buffer *buffer) return buffer->end - buffer->offset; } -/* Returns the maximum number of bytes of data that may be in the buffer. */ -u_int -buffer_get_max_len(void) -{ - return (BUFFER_MAX_LEN); -} - /* Gets data from the beginning of the buffer. */ int Modified: stable/10/crypto/openssh/buffer.h ============================================================================== --- stable/10/crypto/openssh/buffer.h Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/buffer.h Sun Jan 24 22:28:18 2016 (r294693) @@ -1,5 +1,4 @@ /* $OpenBSD: buffer.h,v 1.23 2014/01/12 08:13:13 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -47,8 +46,6 @@ int buffer_get_ret(Buffer *, void *, u_ int buffer_consume_ret(Buffer *, u_int); int buffer_consume_end_ret(Buffer *, u_int); -u_int buffer_get_max_len(void); - #include void buffer_put_bignum(Buffer *, const BIGNUM *); Modified: stable/10/crypto/openssh/channels.c ============================================================================== --- stable/10/crypto/openssh/channels.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/channels.c Sun Jan 24 22:28:18 2016 (r294693) @@ -40,7 +40,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include @@ -174,11 +173,6 @@ static void port_open_helper(Channel *c, static int connect_next(struct channel_connect *); static void channel_connect_ctx_free(struct channel_connect *); -/* -- HPN */ - -static int hpn_disabled = 0; -static u_int buffer_size = CHAN_HPN_MIN_WINDOW_DEFAULT; - /* -- channel core */ Channel * @@ -325,7 +319,6 @@ channel_new(char *ctype, int type, int r c->self = found; c->type = type; c->ctype = ctype; - c->dynamic_window = 0; c->local_window = window; c->local_window_max = window; c->local_consumed = 0; @@ -826,45 +819,10 @@ channel_pre_open_13(Channel *c, fd_set * FD_SET(c->sock, writeset); } -static u_int -channel_tcpwinsz(void) -{ - u_int32_t tcpwinsz; - socklen_t optsz; - int ret, sd; - u_int maxlen; - - /* If we are not on a socket return 128KB. */ - if (!packet_connection_is_on_socket()) - return (128 * 1024); - - tcpwinsz = 0; - optsz = sizeof(tcpwinsz); - sd = packet_get_connection_in(); - ret = getsockopt(sd, SOL_SOCKET, SO_RCVBUF, &tcpwinsz, &optsz); - - /* Return no more than the maximum buffer size. */ - maxlen = buffer_get_max_len(); - if ((ret == 0) && tcpwinsz > maxlen) - tcpwinsz = maxlen; - /* In case getsockopt() failed return a minimum. */ - if (tcpwinsz == 0) - tcpwinsz = CHAN_TCP_WINDOW_DEFAULT; - debug2("tcpwinsz: %d for connection: %d", tcpwinsz, sd); - return (tcpwinsz); -} - static void channel_pre_open(Channel *c, fd_set *readset, fd_set *writeset) { - u_int limit; - - /* Check buffer limits. */ - if (!c->tcpwinsz || c->dynamic_window > 0) - c->tcpwinsz = channel_tcpwinsz(); - - limit = MIN(compat20 ? c->remote_window : packet_get_maxsize(), - 2 * c->tcpwinsz); + u_int limit = compat20 ? c->remote_window : packet_get_maxsize(); if (c->istate == CHAN_INPUT_OPEN && limit > 0 && @@ -1857,25 +1815,14 @@ channel_check_window(Channel *c) c->local_maxpacket*3) || c->local_window < c->local_window_max/2) && c->local_consumed > 0) { - u_int addition = 0; - - /* Adjust max window size if we are in a dynamic environment. */ - if (c->dynamic_window && c->tcpwinsz > c->local_window_max) { - /* - * Grow the window somewhat aggressively to maintain - * pressure. - */ - addition = 1.5 * (c->tcpwinsz - c->local_window_max); - c->local_window_max += addition; - } packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); packet_put_int(c->remote_id); - packet_put_int(c->local_consumed + addition); + packet_put_int(c->local_consumed); packet_send(); debug2("channel %d: window %d sent adjust %d", c->self, c->local_window, c->local_consumed); - c->local_window += c->local_consumed + addition; + c->local_window += c->local_consumed; c->local_consumed = 0; } return 1; @@ -2739,14 +2686,6 @@ channel_set_af(int af) IPv4or6 = af; } -void -channel_set_hpn(int disabled, u_int buf_size) -{ - hpn_disabled = disabled; - buffer_size = buf_size; - debug("HPN Disabled: %d, HPN Buffer Size: %d", - hpn_disabled, buffer_size); -} /* * Determine whether or not a port forward listens to loopback, the @@ -2924,18 +2863,10 @@ channel_setup_fwd_listener(int type, con *allocated_listen_port); } - /* - * Allocate a channel number for the socket. Explicitly test - * for hpn disabled option. If true use smaller window size. - */ - if (hpn_disabled) - c = channel_new("port listener", type, sock, sock, -1, - CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, - 0, "port listener", 1); - else - c = channel_new("port listener", type, sock, sock, -1, - buffer_size, CHAN_TCP_PACKET_DEFAULT, - 0, "port listener", 1); + /* Allocate a channel number for the socket. */ + c = channel_new("port listener", type, sock, sock, -1, + CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, + 0, "port listener", 1); c->path = xstrdup(host); c->host_port = port_to_connect; c->listening_addr = addr == NULL ? NULL : xstrdup(addr); @@ -3583,16 +3514,10 @@ x11_create_display_inet(int x11_display_ *chanids = xcalloc(num_socks + 1, sizeof(**chanids)); for (n = 0; n < num_socks; n++) { sock = socks[n]; - if (hpn_disabled) - nc = channel_new("x11 listener", - SSH_CHANNEL_X11_LISTENER, sock, sock, -1, - CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, - 0, "X11 inet listener", 1); - else - nc = channel_new("x11 listener", - SSH_CHANNEL_X11_LISTENER, sock, sock, -1, - buffer_size, CHAN_X11_PACKET_DEFAULT, - 0, "X11 inet listener", 1); + nc = channel_new("x11 listener", + SSH_CHANNEL_X11_LISTENER, sock, sock, -1, + CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, + 0, "X11 inet listener", 1); nc->single_connection = single_connection; (*chanids)[n] = nc->self; } Modified: stable/10/crypto/openssh/channels.h ============================================================================== --- stable/10/crypto/openssh/channels.h Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/channels.h Sun Jan 24 22:28:18 2016 (r294693) @@ -1,5 +1,4 @@ /* $OpenBSD: channels.h,v 1.113 2013/06/07 15:37:52 dtucker Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -133,8 +132,6 @@ struct Channel { u_int local_window_max; u_int local_consumed; u_int local_maxpacket; - u_int tcpwinsz; - int dynamic_window; int extended_usage; int single_connection; @@ -176,7 +173,6 @@ struct Channel { #define CHAN_TCP_WINDOW_DEFAULT (64*CHAN_TCP_PACKET_DEFAULT) #define CHAN_X11_PACKET_DEFAULT (16*1024) #define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT) -#define CHAN_HPN_MIN_WINDOW_DEFAULT (2*1024*1024) /* possible input states */ #define CHAN_INPUT_OPEN 0 @@ -310,8 +306,4 @@ void chan_rcvd_ieof(Channel *); void chan_write_failed(Channel *); void chan_obuf_empty(Channel *); -/* hpn handler */ - -void channel_set_hpn(int, u_int); - #endif Modified: stable/10/crypto/openssh/cipher.c ============================================================================== --- stable/10/crypto/openssh/cipher.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/cipher.c Sun Jan 24 22:28:18 2016 (r294693) @@ -36,7 +36,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include @@ -225,12 +224,7 @@ ciphers_valid(const char *names) for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0'; (p = strsep(&cp, CIPHER_SEP))) { c = cipher_by_name(p); -#ifdef NONE_CIPHER_ENABLED - if (c == NULL || (c->number != SSH_CIPHER_SSH2 && - c->number != SSH_CIPHER_NONE)) { -#else - if (c == NULL || (c->number != SSH_CIPHER_SSH2)) { -#endif + if (c == NULL || c->number != SSH_CIPHER_SSH2) { debug("bad cipher %s [%s]", p, names); free(cipher_list); return 0; @@ -485,9 +479,6 @@ cipher_get_keyiv(CipherContext *cc, u_ch } switch (c->number) { -#ifdef NONE_CIPHER_ENABLED - case SSH_CIPHER_NONE: -#endif case SSH_CIPHER_SSH2: case SSH_CIPHER_DES: case SSH_CIPHER_BLOWFISH: @@ -527,9 +518,6 @@ cipher_set_keyiv(CipherContext *cc, u_ch return; switch (c->number) { -#ifdef NONE_CIPHER_ENABLED - case SSH_CIPHER_NONE: -#endif case SSH_CIPHER_SSH2: case SSH_CIPHER_DES: case SSH_CIPHER_BLOWFISH: Modified: stable/10/crypto/openssh/clientloop.c ============================================================================== --- stable/10/crypto/openssh/clientloop.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/clientloop.c Sun Jan 24 22:28:18 2016 (r294693) @@ -60,7 +60,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include @@ -1892,14 +1891,9 @@ client_request_x11(const char *request_t sock = x11_connect_display(); if (sock < 0) return NULL; - if (options.hpn_disabled) - c = channel_new("x11", SSH_CHANNEL_X11_OPEN, sock, sock, -1, - CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, - 0, "x11", 1); - else - c = channel_new("x11", SSH_CHANNEL_X11_OPEN, sock, sock, -1, - options.hpn_buffer_size, CHAN_X11_PACKET_DEFAULT, - 0, "x11", 1); + c = channel_new("x11", + SSH_CHANNEL_X11_OPEN, sock, sock, -1, + CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1); c->force_drain = 1; return c; } @@ -1919,16 +1913,10 @@ client_request_agent(const char *request sock = ssh_get_authentication_socket(); if (sock < 0) return NULL; - if (options.hpn_disabled) - c = channel_new("authentication agent connection", - SSH_CHANNEL_OPEN, sock, sock, -1, - CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, - "authentication agent connection", 1); - else - c = channel_new("authentication agent connection", - SSH_CHANNEL_OPEN, sock, sock, -1, - options.hpn_buffer_size, options.hpn_buffer_size, 0, - "authentication agent connection", 1); + c = channel_new("authentication agent connection", + SSH_CHANNEL_OPEN, sock, sock, -1, + CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, + "authentication agent connection", 1); c->force_drain = 1; return c; } @@ -1955,14 +1943,8 @@ client_request_tun_fwd(int tun_mode, int return -1; } - if (options.hpn_disabled) - c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, - CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, - 0, "tun", 1); - else - c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, - options.hpn_buffer_size, CHAN_TCP_PACKET_DEFAULT, - 0, "tun", 1); + c = channel_new("tun", SSH_CHANNEL_OPENING, fd, fd, -1, + CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, "tun", 1); c->datagram = 1; #if defined(SSH_TUN_FILTER) Modified: stable/10/crypto/openssh/compat.c ============================================================================== --- stable/10/crypto/openssh/compat.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/compat.c Sun Jan 24 22:28:18 2016 (r294693) @@ -24,7 +24,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include @@ -178,16 +177,6 @@ compat_datafellows(const char *version) datafellows = check[i].bugs; debug("match: %s pat %s compat 0x%08x", version, check[i].pat, datafellows); - /* - * Check to see if the remote side is OpenSSH and not - * HPN. It is utterly strange to check it from the - * version string and expose the option that way. - */ - if (strstr(version,"OpenSSH") != NULL && - strstr(version,"hpn") == NULL) { - datafellows |= SSH_BUG_LARGEWINDOW; - debug("Remote is not HPN-aware"); - } return; } } Modified: stable/10/crypto/openssh/compat.h ============================================================================== --- stable/10/crypto/openssh/compat.h Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/compat.h Sun Jan 24 22:28:18 2016 (r294693) @@ -1,5 +1,4 @@ /* $OpenBSD: compat.h,v 1.44 2013/12/30 23:52:27 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved. @@ -62,8 +61,6 @@ #define SSH_BUG_DYNAMIC_RPORT 0x08000000 #define SSH_BUG_CURVE25519PAD 0x10000000 -#define SSH_BUG_LARGEWINDOW 0x80000000 - void enable_compat13(void); void enable_compat20(void); void compat_datafellows(const char *); Modified: stable/10/crypto/openssh/configure.ac ============================================================================== --- stable/10/crypto/openssh/configure.ac Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/configure.ac Sun Jan 24 22:28:18 2016 (r294693) @@ -1,4 +1,5 @@ # $Id: configure.ac,v 1.571 2014/02/21 17:09:34 tim Exp $ +# $FreeBSD$ # # Copyright (c) 1999-2004 Damien Miller # Modified: stable/10/crypto/openssh/digest-libc.c ============================================================================== --- stable/10/crypto/openssh/digest-libc.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/digest-libc.c Sun Jan 24 22:28:18 2016 (r294693) @@ -17,7 +17,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/freebsd-post-merge.sh ============================================================================== --- stable/10/crypto/openssh/freebsd-post-merge.sh Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/freebsd-post-merge.sh Sun Jan 24 22:28:18 2016 (r294693) @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: stable/10/crypto/openssh/freebsd-post-merge.sh 263691 2014-03-24 19:15:13Z des $ +# $FreeBSD$ # xargs perl -n -i -e ' Modified: stable/10/crypto/openssh/freebsd-pre-merge.sh ============================================================================== --- stable/10/crypto/openssh/freebsd-pre-merge.sh Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/freebsd-pre-merge.sh Sun Jan 24 22:28:18 2016 (r294693) @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: stable/10/crypto/openssh/freebsd-pre-merge.sh 263691 2014-03-24 19:15:13Z des $ +# $FreeBSD$ # :>keywords Modified: stable/10/crypto/openssh/kex.c ============================================================================== --- stable/10/crypto/openssh/kex.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/kex.c Sun Jan 24 22:28:18 2016 (r294693) @@ -24,7 +24,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include @@ -146,13 +145,8 @@ kex_names_valid(const char *names) return 1; } -/* put algorithm proposal into buffer. */ -#ifndef NONE_CIPHER_ENABLED +/* put algorithm proposal into buffer */ static void -#else -/* Also used in sshconnect2.c. */ -void -#endif kex_prop2buf(Buffer *b, char *proposal[PROPOSAL_MAX]) { u_int i; @@ -466,9 +460,6 @@ kex_choose_conf(Kex *kex) int nenc, nmac, ncomp; u_int mode, ctos, need, dh_need, authlen; int first_kex_follows, type; -#ifdef NONE_CIPHER_ENABLED - int auth_flag; -#endif my = kex_buf2prop(&kex->my, NULL); peer = kex_buf2prop(&kex->peer, &first_kex_follows); @@ -492,10 +483,6 @@ kex_choose_conf(Kex *kex) } /* Algorithm Negotiation */ -#ifdef NONE_CIPHER_ENABLED - auth_flag = packet_get_authentication_state(); - debug ("AUTH STATE is %d", auth_flag); -#endif for (mode = 0; mode < MODE_MAX; mode++) { newkeys = xcalloc(1, sizeof(*newkeys)); kex->newkeys[mode] = newkeys; @@ -510,17 +497,6 @@ kex_choose_conf(Kex *kex) if (authlen == 0) choose_mac(&newkeys->mac, cprop[nmac], sprop[nmac]); choose_comp(&newkeys->comp, cprop[ncomp], sprop[ncomp]); -#ifdef NONE_CIPHER_ENABLED - debug("REQUESTED ENC.NAME is '%s'", newkeys->enc.name); - if (strcmp(newkeys->enc.name, "none") == 0) { - debug("Requesting NONE. Authflag is %d", auth_flag); - if (auth_flag == 1) - debug("None requested post authentication."); - else - fatal("Pre-authentication none cipher requests " - "are not allowed."); - } -#endif debug("kex: %s %s %s %s", ctos ? "client->server" : "server->client", newkeys->enc.name, Modified: stable/10/crypto/openssh/kex.h ============================================================================== --- stable/10/crypto/openssh/kex.h Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/kex.h Sun Jan 24 22:28:18 2016 (r294693) @@ -1,5 +1,4 @@ /* $OpenBSD: kex.h,v 1.62 2014/01/27 18:58:14 markus Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. @@ -149,10 +148,6 @@ struct Kex { int kex_names_valid(const char *); char *kex_alg_list(char); -#ifdef NONE_CIPHER_ENABLED -void kex_prop2buf(Buffer *, char *[PROPOSAL_MAX]); -#endif - Kex *kex_setup(char *[PROPOSAL_MAX]); void kex_finish(Kex *); Modified: stable/10/crypto/openssh/misc.c ============================================================================== --- stable/10/crypto/openssh/misc.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/misc.c Sun Jan 24 22:28:18 2016 (r294693) @@ -25,7 +25,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include @@ -1037,34 +1036,3 @@ sock_set_v6only(int s) error("setsockopt IPV6_V6ONLY: %s", strerror(errno)); #endif } - -void -sock_get_rcvbuf(int *size, int rcvbuf) -{ - int sock, socksize; - socklen_t socksizelen = sizeof(socksize); - - /* - * Create a socket but do not connect it. We use it - * only to get the rcv socket size. - */ - sock = socket(AF_INET6, SOCK_STREAM, 0); - if (sock < 0) - sock = socket(AF_INET, SOCK_STREAM, 0); - if (sock < 0) - return; - - /* - * If the tcp_rcv_buf option is set and passed in, attempt to set the - * buffer size to its value. - */ - if (rcvbuf) - setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf, - sizeof(rcvbuf)); - - if (getsockopt(sock, SOL_SOCKET, SO_RCVBUF, - &socksize, &socksizelen) == 0) - if (size != NULL) - *size = socksize; - close(sock); -} Modified: stable/10/crypto/openssh/misc.h ============================================================================== --- stable/10/crypto/openssh/misc.h Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/misc.h Sun Jan 24 22:28:18 2016 (r294693) @@ -1,5 +1,4 @@ /* $OpenBSD: misc.h,v 1.50 2013/10/14 23:28:23 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -40,7 +39,6 @@ time_t monotime(void); void lowercase(char *s); void sock_set_v6only(int); -void sock_get_rcvbuf(int *, int); struct passwd *pwcopy(struct passwd *); const char *ssh_gai_strerror(int); Modified: stable/10/crypto/openssh/monitor.c ============================================================================== --- stable/10/crypto/openssh/monitor.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/monitor.c Sun Jan 24 22:28:18 2016 (r294693) @@ -26,7 +26,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/monitor_wrap.c ============================================================================== --- stable/10/crypto/openssh/monitor_wrap.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/monitor_wrap.c Sun Jan 24 22:28:18 2016 (r294693) @@ -26,7 +26,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include Modified: stable/10/crypto/openssh/myproposal.h ============================================================================== --- stable/10/crypto/openssh/myproposal.h Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/myproposal.h Sun Jan 24 22:28:18 2016 (r294693) @@ -110,10 +110,6 @@ "chacha20-poly1305@openssh.com," \ "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc," \ "aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se" -#ifdef NONE_CIPHER_ENABLED -#define KEX_ENCRYPT_INCLUDE_NONE KEX_DEFAULT_ENCRYPT \ - ",none" -#endif #define KEX_DEFAULT_MAC \ "hmac-md5-etm@openssh.com," \ Modified: stable/10/crypto/openssh/packet.c ============================================================================== --- stable/10/crypto/openssh/packet.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/packet.c Sun Jan 24 22:28:18 2016 (r294693) @@ -202,9 +202,6 @@ struct session_state { }; static struct session_state *active_state, *backup_state; -#ifdef NONE_CIPHER_ENABLED -static int rekey_requested = 0; -#endif static struct session_state * alloc_session_state(void) @@ -1316,7 +1313,6 @@ packet_read_poll2(u_int32_t *seqnr_p) buffer_ptr(&active_state->input), block_size, 0, 0) != 0) fatal("Decryption integrity check failed"); cp = buffer_ptr(&active_state->incoming_packet); - active_state->packlen = get_u32(cp); if (active_state->packlen < 1 + 4 || active_state->packlen > PACKET_MAX_SIZE) { @@ -1943,26 +1939,12 @@ packet_send_ignore(int nbytes) } } -#ifdef NONE_CIPHER_ENABLED -void -packet_request_rekeying(void) -{ - rekey_requested = 1; -} -#endif - #define MAX_PACKETS (1U<<31) int packet_need_rekeying(void) { if (datafellows & SSH_BUG_NOREKEY) return 0; -#ifdef NONE_CIPHER_ENABLED - if (rekey_requested == 1) { - rekey_requested = 0; - return 1; - } -#endif return (active_state->p_send.packets > MAX_PACKETS) || (active_state->p_read.packets > MAX_PACKETS) || @@ -2074,11 +2056,3 @@ packet_restore_state(void) add_recv_bytes(len); } } - -#ifdef NONE_CIPHER_ENABLED -int -packet_get_authentication_state(void) -{ - return (active_state->after_authentication); -} -#endif Modified: stable/10/crypto/openssh/packet.h ============================================================================== --- stable/10/crypto/openssh/packet.h Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/packet.h Sun Jan 24 22:28:18 2016 (r294693) @@ -1,5 +1,4 @@ /* $OpenBSD: packet.h,v 1.59 2013/07/12 00:19:59 djm Exp $ */ -/* $FreeBSD$ */ /* * Author: Tatu Ylonen @@ -39,9 +38,6 @@ void packet_set_interactive(int, int int packet_is_interactive(void); void packet_set_server(void); void packet_set_authenticated(void); -#ifdef NONE_CIPHER_ENABLED -int packet_get_authentication_state(void); -#endif void packet_start(u_char); void packet_put_char(int ch); @@ -119,9 +115,6 @@ do { \ } while (0) int packet_need_rekeying(void); -#ifdef NONE_CIPHER_ENABLED -void packet_request_rekeying(void); -#endif void packet_set_rekey_limits(u_int32_t, time_t); time_t packet_get_rekey_timeout(void); Modified: stable/10/crypto/openssh/readconf.c ============================================================================== --- stable/10/crypto/openssh/readconf.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/readconf.c Sun Jan 24 22:28:18 2016 (r294693) @@ -152,12 +152,8 @@ typedef enum { oKexAlgorithms, oIPQoS, oRequestTTY, oIgnoreUnknown, oProxyUseFdpass, oCanonicalDomains, oCanonicalizeHostname, oCanonicalizeMaxDots, oCanonicalizeFallbackLocal, oCanonicalizePermittedCNAMEs, - oIgnoredUnknownOption, - oHPNDisabled, oHPNBufferSize, oTcpRcvBufPoll, oTcpRcvBuf, -#ifdef NONE_CIPHER_ENABLED - oNoneEnabled, oNoneSwitch, -#endif - oVersionAddendum, oDeprecated, oUnsupported + oVersionAddendum, + oIgnoredUnknownOption, oDeprecated, oUnsupported } OpCodes; /* Textual representations of the tokens. */ @@ -270,14 +266,10 @@ static struct { { "canonicalizemaxdots", oCanonicalizeMaxDots }, { "canonicalizepermittedcnames", oCanonicalizePermittedCNAMEs }, { "ignoreunknown", oIgnoreUnknown }, - { "hpndisabled", oHPNDisabled }, - { "hpnbuffersize", oHPNBufferSize }, - { "tcprcvbufpoll", oTcpRcvBufPoll }, - { "tcprcvbuf", oTcpRcvBuf }, -#ifdef NONE_CIPHER_ENABLED - { "noneenabled", oNoneEnabled }, - { "noneswitch", oNoneSwitch }, -#endif + { "hpndisabled", oDeprecated }, + { "hpnbuffersize", oDeprecated }, + { "tcprcvbufpoll", oDeprecated }, + { "tcprcvbuf", oDeprecated }, { "versionaddendum", oVersionAddendum }, { NULL, oBadOption } @@ -1359,47 +1351,6 @@ parse_int: multistate_ptr = multistate_requesttty; goto parse_multistate; - case oHPNDisabled: - intptr = &options->hpn_disabled; - goto parse_flag; - - case oHPNBufferSize: - intptr = &options->hpn_buffer_size; - goto parse_int; - - case oTcpRcvBufPoll: - intptr = &options->tcp_rcv_buf_poll; - goto parse_flag; - - case oTcpRcvBuf: - intptr = &options->tcp_rcv_buf; - goto parse_int; - -#ifdef NONE_CIPHER_ENABLED - case oNoneEnabled: - intptr = &options->none_enabled; - goto parse_flag; - - /* - * We check to see if the command comes from the command line or not. - * If it does then enable it otherwise fail. NONE must never be a - * default configuration. - */ - case oNoneSwitch: - if (strcmp(filename,"command-line") == 0) { - intptr = &options->none_switch; - goto parse_flag; - } else { - debug("NoneSwitch directive found in %.200s.", - filename); - error("NoneSwitch is found in %.200s.\n" - "You may only use this configuration option " - "from the command line", filename); - error("Continuing..."); - return 0; - } -#endif - case oVersionAddendum: if (s == NULL) fatal("%.200s line %d: Missing argument.", filename, @@ -1655,14 +1606,6 @@ initialize_options(Options * options) options->canonicalize_fallback_local = -1; options->canonicalize_hostname = -1; options->version_addendum = NULL; - options->hpn_disabled = -1; - options->hpn_buffer_size = -1; - options->tcp_rcv_buf_poll = -1; - options->tcp_rcv_buf = -1; -#ifdef NONE_CIPHER_ENABLED - options->none_enabled = -1; - options->none_switch = -1; -#endif } /* @@ -1857,36 +1800,6 @@ fill_default_options(Options * options) /* options->preferred_authentications will be set in ssh */ if (options->version_addendum == NULL) options->version_addendum = xstrdup(SSH_VERSION_FREEBSD); - if (options->hpn_disabled == -1) - options->hpn_disabled = 0; - if (options->hpn_buffer_size > -1) - { - u_int maxlen; - - /* If a user tries to set the size to 0 set it to 1KB. */ - if (options->hpn_buffer_size == 0) - options->hpn_buffer_size = 1024; - /* Limit the buffer to BUFFER_MAX_LEN. */ - maxlen = buffer_get_max_len(); - if (options->hpn_buffer_size > (maxlen / 1024)) { - debug("User requested buffer larger than %ub: %ub. " - "Request reverted to %ub", maxlen, - options->hpn_buffer_size * 1024, maxlen); - options->hpn_buffer_size = maxlen; - } - debug("hpn_buffer_size set to %d", options->hpn_buffer_size); - } - if (options->tcp_rcv_buf == 0) - options->tcp_rcv_buf = 1; - if (options->tcp_rcv_buf > -1) - options->tcp_rcv_buf *= 1024; - if (options->tcp_rcv_buf_poll == -1) - options->tcp_rcv_buf_poll = 1; -#ifdef NONE_CIPHER_ENABLED - /* options->none_enabled must not be set by default */ - if (options->none_switch == -1) - options->none_switch = 0; -#endif } /* Modified: stable/10/crypto/openssh/readconf.h ============================================================================== --- stable/10/crypto/openssh/readconf.h Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/readconf.h Sun Jan 24 22:28:18 2016 (r294693) @@ -154,21 +154,9 @@ typedef struct { int num_permitted_cnames; struct allowed_cname permitted_cnames[MAX_CANON_DOMAINS]; - char *ignored_unknown; /* Pattern list of unknown tokens to ignore */ - char *version_addendum; /* Appended to SSH banner */ - int hpn_disabled; /* Switch to disable HPN buffer management. */ - int hpn_buffer_size; /* User definable size for HPN buffer - * window. */ - int tcp_rcv_buf_poll; /* Option to poll recv buf every window - * transfer. */ - int tcp_rcv_buf; /* User switch to set tcp recv buffer. */ - -#ifdef NONE_CIPHER_ENABLED - int none_enabled; /* Allow none to be used */ - int none_switch; /* Use none cipher */ -#endif + char *ignored_unknown; /* Pattern list of unknown tokens to ignore */ } Options; #define SSH_CANONICALISE_NO 0 Modified: stable/10/crypto/openssh/servconf.c ============================================================================== --- stable/10/crypto/openssh/servconf.c Sun Jan 24 22:26:25 2016 (r294692) +++ stable/10/crypto/openssh/servconf.c Sun Jan 24 22:28:18 2016 (r294693) @@ -155,12 +155,6 @@ initialize_server_options(ServerOptions options->ip_qos_interactive = -1; options->ip_qos_bulk = -1; options->version_addendum = NULL; - options->hpn_disabled = -1; - options->hpn_buffer_size = -1; - options->tcp_rcv_buf_poll = -1; -#ifdef NONE_CIPHER_ENABLED - options->none_enabled = -1; -#endif } void @@ -321,38 +315,6 @@ fill_default_server_options(ServerOption } #endif - if (options->hpn_disabled == -1) - options->hpn_disabled = 0; - if (options->hpn_buffer_size == -1) { - /* - * HPN buffer size option not explicitly set. Try to figure - * out what value to use or resort to default. - */ - options->hpn_buffer_size = CHAN_SES_WINDOW_DEFAULT; - if (!options->hpn_disabled) { - sock_get_rcvbuf(&options->hpn_buffer_size, 0); - debug ("HPN Buffer Size: %d", options->hpn_buffer_size); - } - } else { - /* - * In the case that the user sets both values in a - * contradictory manner hpn_disabled overrrides hpn_buffer_size. - */ - if (options->hpn_disabled <= 0) { - u_int maxlen; - - maxlen = buffer_get_max_len(); - if (options->hpn_buffer_size == 0) - options->hpn_buffer_size = 1; - /* Limit the maximum buffer to BUFFER_MAX_LEN. */ - if (options->hpn_buffer_size > maxlen / 1024) - options->hpn_buffer_size = maxlen; - else - options->hpn_buffer_size *= 1024; - } else { - options->hpn_buffer_size = CHAN_TCP_WINDOW_DEFAULT; - } - } } /* Keyword tokens. */ @@ -388,10 +350,6 @@ typedef enum { sKexAlgorithms, sIPQoS, sVersionAddendum, sAuthorizedKeysCommand, sAuthorizedKeysCommandUser, sAuthenticationMethods, sHostKeyAgent, - sHPNDisabled, sHPNBufferSize, sTcpRcvBufPoll, -#ifdef NONE_CIPHER_ENABLED - sNoneEnabled, -#endif sDeprecated, sUnsupported } ServerOpCodes; @@ -518,12 +476,10 @@ static struct { { "authorizedkeyscommanduser", sAuthorizedKeysCommandUser, SSHCFG_ALL }, { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, { "authenticationmethods", sAuthenticationMethods, SSHCFG_ALL }, - { "hpndisabled", sHPNDisabled, SSHCFG_ALL }, - { "hpnbuffersize", sHPNBufferSize, SSHCFG_ALL }, - { "tcprcvbufpoll", sTcpRcvBufPoll, SSHCFG_ALL }, -#ifdef NONE_CIPHER_ENABLED - { "noneenabled", sNoneEnabled, SSHCFG_ALL }, -#endif + { "noneenabled", sUnsupported, SSHCFG_ALL }, + { "hpndisabled", sDeprecated, SSHCFG_ALL }, + { "hpnbuffersize", sDeprecated, SSHCFG_ALL }, + { "tcprcvbufpoll", sDeprecated, SSHCFG_ALL }, { NULL, sBadOption, 0 } }; @@ -1670,24 +1626,6 @@ process_server_config_line(ServerOptions } return 0; - case sHPNDisabled: - intptr = &options->hpn_disabled; - goto parse_flag; - - case sHPNBufferSize: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Mon Jan 25 00:38:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70A8BA45A5C; Mon, 25 Jan 2016 00:38:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com [IPv6:2607:f8b0:4003:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FDA68A0; Mon, 25 Jan 2016 00:38:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-oi0-x235.google.com with SMTP id o124so78398922oia.3; Sun, 24 Jan 2016 16:38:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=K7+nRTIGoRc3ALcyp/hgNyR1r0JyfuumrOEV9PZ9Vd0=; b=zSNpQxWIg0h1yp0OtEvBtlx3N4Do3jp1s9lAZ9lMBJZyYHRu4+KdBKb26NBslkPVOS aJnzVOBndMFB9D5WwLQTcQMWPFafOtlTiBtjwp7ASqeXsdShE6rR+5elSV9XGc6ZJDL0 63sBBk39So1Ay+mZgaPnBrIiTkq233bHD3d6uQZ3j+CjiG0XBQ+ZwqTmfe568bfVd6Fp MWdfj6KJpYMZhhznS0kJ9Ov0ir1YGh6a/QhEdL9BSLJdghxs/SDfknPaTzdT9zLqWY53 BF1j4et3DUldrDkDL/CERA6dDmclqwI9AYjwOdMDTlXFT1O6/zcQrK1GwV7WDib4d1Y+ a2SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=K7+nRTIGoRc3ALcyp/hgNyR1r0JyfuumrOEV9PZ9Vd0=; b=ilX0/oMAnDEo2gWEzULTIB8GEQfT27bUsQ1Trs+QAlMv2hCAfVs3BEJY1H2YH7z/g/ WmtBHDuZyflTcaWl8s0X7D42pYTlE+34vWbSRp+CFWMFUZ7RFV2oC2eHPUXcx44OVBcW wsrKb7aXCOAX0EMg80d68c4XZ9S9mjjbNGbADBlAtnui2hHTLyMAZopi3C8wQxn6c6Jp Gren1I7iQnEj15yn/bhHQXWXrYwQMjqHM1ka2AY1evFIDq5+oPiN8FVAUGMuWlTSmOO+ dbRdsA7n824C0sf3rqODPBWHLMfuexs+LUFEQJznAukr4KnW1avkr0A3PhKx2jlDsq4g d74g== X-Gm-Message-State: AG10YOQNhVJczCUgc1NHleDcen3gySRj0gxMPS7kA89VqVyu+nfvysvfBdXDBSJqbr6ffQ== X-Received: by 10.202.230.197 with SMTP id d188mr10526029oih.59.1453682281208; Sun, 24 Jan 2016 16:38:01 -0800 (PST) Received: from [33.232.102.160] (m9e5636d0.tmodns.net. [208.54.86.158]) by smtp.gmail.com with ESMTPSA id w143sm9268036oiw.16.2016.01.24.16.37.59 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 24 Jan 2016 16:37:59 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r294693 - in stable/10: . crypto/openssh secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd share/mk tools/build/options From: NGie Cooper X-Mailer: iPhone Mail (13D15) In-Reply-To: <201601242228.u0OMSIn7032949@repo.freebsd.org> Date: Sun, 24 Jan 2016 16:37:58 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <187CD899-961D-4DF7-BFC4-439EF17802D4@gmail.com> References: <201601242228.u0OMSIn7032949@repo.freebsd.org> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Jan 2016 00:38:02 -0000 > On Jan 24, 2016, at 14:28, Dag-Erling Sm=C3=B8rgrav wrot= e: >=20 > Author: des > Date: Sun Jan 24 22:28:18 2016 > New Revision: 294693 > URL: https://svnweb.freebsd.org/changeset/base/294693 >=20 > Log: > MFH (r291198, r291260, r291261, r291375, r294325, r294335, r294563) >=20 > Remove the HPN and None cipher patches. Relnotes: yes?= From owner-svn-src-stable-10@freebsd.org Mon Jan 25 05:28:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D144A45516; Mon, 25 Jan 2016 05:28:02 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 662481A1; Mon, 25 Jan 2016 05:28:01 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 3A6985BCC; Mon, 25 Jan 2016 05:28:00 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 4ECA348416; Mon, 25 Jan 2016 06:28:02 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: NGie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r294693 - in stable/10: . crypto/openssh secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd share/mk tools/build/options References: <201601242228.u0OMSIn7032949@repo.freebsd.org> <187CD899-961D-4DF7-BFC4-439EF17802D4@gmail.com> Date: Mon, 25 Jan 2016 06:28:02 +0100 In-Reply-To: <187CD899-961D-4DF7-BFC4-439EF17802D4@gmail.com> (NGie Cooper's message of "Sun, 24 Jan 2016 16:37:58 -0800") Message-ID: <86vb6ib53x.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Jan 2016 05:28:02 -0000 NGie Cooper writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Log: > > MFH (r291198, r291260, r291261, r291375, r294325, r294335, r294563) > >=20 > > Remove the HPN and None cipher patches. > Relnotes: yes? Yes, sorry. There's a lot more coming, though. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable-10@freebsd.org Mon Jan 25 09:19:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 856ECA310FF; Mon, 25 Jan 2016 09:19:30 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (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 522C97B6; Mon, 25 Jan 2016 09:19:30 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from [176.158.145.63] (helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aNdJ1-000AJs-Kg; Mon, 25 Jan 2016 10:19:27 +0100 Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 To: Slawa Olhovchenkov References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <56A5E89A.3050106@FreeBSD.org> Date: Mon, 25 Jan 2016 10:19:22 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160123162617.GL37895@zxy.spb.ru> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fAcmc9DEHNLsEeVB82mCLLgC0eBN5cOdi" X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Jan 2016 09:19:30 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fAcmc9DEHNLsEeVB82mCLLgC0eBN5cOdi Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 23/01/2016 17:26, Slawa Olhovchenkov wrote: > Accelerating still not workin on 915GM. Hi! Is this a regression? Ie. was it working a year ago? Unfortunately, I won't have time to work on this. I need to focus on the i915 update. Hopefully, it will fix this issue at the same time. Speaking of it, could you please test it? https://wiki.freebsd.org/Graphics/Update%20i915%20GPU%20driver%20to%20Lin= ux%203.8 --=20 Jean-S=C3=A9bastien P=C3=A9dron --fAcmc9DEHNLsEeVB82mCLLgC0eBN5cOdi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJWpeiaXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTMG5AP/RK1YX3O2hVhWHMLOaw4tQ4Y sruGOeqAlw5LBXLBPATUDnO8ALJyWnVkmEULAg9BlAdAmDlREGK01bYOy9YF/5mT PKo6SwKes0gRVs0f1X7bjup+ZsvE+oOdQabu86U/IWvh4+RJ+MWHDK4Yu3fUolZl ynO/Z2KIhnECCfBwlnRVGULW3gWzrkUYdu4Cr3FIuE6cCJIp9WXXvwZr3F+TFCuE iA3e+RqzveTXKqu08SXuXkH3DvQUrG4STkaYYRaZTxWlAtblhK7cfusJd25NBPjY cwX+0KtKi3tHj08AExrdQjsfZwu5JRkj+cL1/zE3czvmMugB8IG7A58c33LiAylQ kEiB4xTl1kqMBBuexmoTIKNuQFds3qc8DKFBcmu4rmVDkZMBc8n8LuoZyp0s6Nxx 1Wptk6MadiK2qsaXOnY7n68QoIzpE+stlOAcRFTZ9DGg5gxA4UG7DxKUxzuofp3r 3ChKWo4urDNdC5a/MmOjBJKTSNvKP19KZIXfL05/t4CQRfkcShK585P0w1rIE9Wg nWz6A7LRRLvSq7IHewG8zdyOemz19m8MmpWpJ9PxVbgV1TqE+X55hpw+Lo623IwI 71b28wN20ujU1jHsQ4qnM5xgsxMH9bi2TptE0v65EM/qcyVFfEq46MV2VCSgKssw 0UJwFUKUo/DSEgd05+Rc =YdH/ -----END PGP SIGNATURE----- --fAcmc9DEHNLsEeVB82mCLLgC0eBN5cOdi-- From owner-svn-src-stable-10@freebsd.org Mon Jan 25 09:26:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59CBFA3163A; Mon, 25 Jan 2016 09:26:25 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 31253C89; Mon, 25 Jan 2016 09:26:25 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P9QO7W026536; Mon, 25 Jan 2016 09:26:24 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P9QODW026534; Mon, 25 Jan 2016 09:26:24 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601250926.u0P9QODW026534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 09:26:24 +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: r294708 - stable/10/sys/dev/iscsi 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.20 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, 25 Jan 2016 09:26:25 -0000 Author: smh Date: Mon Jan 25 09:26:23 2016 New Revision: 294708 URL: https://svnweb.freebsd.org/changeset/base/294708 Log: MFC r291911, r293659: Fix panic on shutdown due to iscsi event priority. Close iSCSI sessions on shutdown. Sponsored by: Multiplay Modified: stable/10/sys/dev/iscsi/iscsi.c stable/10/sys/dev/iscsi/iscsi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Mon Jan 25 08:19:16 2016 (r294707) +++ stable/10/sys/dev/iscsi/iscsi.c Mon Jan 25 09:26:23 2016 (r294708) @@ -102,6 +102,9 @@ static int fail_on_disconnection = 0; TUNABLE_INT("kern.iscsi.fail_on_disconnection", &fail_on_disconnection); SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_disconnection, CTLFLAG_RWTUN, &fail_on_disconnection, 0, "Destroy CAM SIM on connection failure"); +static int fail_on_shutdown = 1; +SYSCTL_INT(_kern_iscsi, OID_AUTO, fail_on_shutdown, CTLFLAG_RWTUN, + &fail_on_shutdown, 0, "Fail disconnected sessions on shutdown"); static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator"); static uma_zone_t iscsi_outstanding_zone; @@ -421,8 +424,6 @@ iscsi_maintenance_thread_terminate(struc sc = is->is_softc; sx_xlock(&sc->sc_lock); - TAILQ_REMOVE(&sc->sc_sessions, is, is_next); - sx_xunlock(&sc->sc_lock); icl_conn_close(is->is_conn); callout_drain(&is->is_callout); @@ -454,6 +455,9 @@ iscsi_maintenance_thread_terminate(struc #ifdef ICL_KERNEL_PROXY cv_destroy(&is->is_login_cv); #endif + TAILQ_REMOVE(&sc->sc_sessions, is, is_next); + sx_xunlock(&sc->sc_lock); + ISCSI_SESSION_DEBUG(is, "terminated"); free(is, M_ISCSI); @@ -477,12 +481,7 @@ iscsi_maintenance_thread(void *arg) STAILQ_EMPTY(&is->is_postponed)) cv_wait(&is->is_maintenance_cv, &is->is_lock); - if (is->is_reconnecting) { - ISCSI_SESSION_UNLOCK(is); - iscsi_maintenance_thread_reconnect(is); - continue; - } - + /* Terminate supersedes reconnect. */ if (is->is_terminating) { ISCSI_SESSION_UNLOCK(is); iscsi_maintenance_thread_terminate(is); @@ -490,6 +489,12 @@ iscsi_maintenance_thread(void *arg) return; } + if (is->is_reconnecting) { + ISCSI_SESSION_UNLOCK(is); + iscsi_maintenance_thread_reconnect(is); + continue; + } + iscsi_session_send_postponed(is); ISCSI_SESSION_UNLOCK(is); } @@ -609,6 +614,11 @@ iscsi_callout(void *context) return; out: + if (is->is_terminating) { + ISCSI_SESSION_UNLOCK(is); + return; + } + ISCSI_SESSION_UNLOCK(is); if (reconnect_needed) @@ -2320,30 +2330,62 @@ iscsi_poll(struct cam_sim *sim) } static void -iscsi_shutdown(struct iscsi_softc *sc) +iscsi_terminate_sessions(struct iscsi_softc *sc) { struct iscsi_session *is; - /* - * Trying to reconnect during system shutdown would lead to hang. - */ - fail_on_disconnection = 1; + sx_slock(&sc->sc_lock); + TAILQ_FOREACH(is, &sc->sc_sessions, is_next) + iscsi_session_terminate(is); + while(!TAILQ_EMPTY(&sc->sc_sessions)) { + ISCSI_DEBUG("waiting for sessions to terminate"); + cv_wait(&sc->sc_cv, &sc->sc_lock); + } + ISCSI_DEBUG("all sessions terminated"); + sx_sunlock(&sc->sc_lock); +} + +static void +iscsi_shutdown_pre(struct iscsi_softc *sc) +{ + struct iscsi_session *is; + + if (!fail_on_shutdown) + return; /* * If we have any sessions waiting for reconnection, request * maintenance thread to fail them immediately instead of waiting * for reconnect timeout. + * + * This prevents LUNs with mounted filesystems that are supported + * by disconnected iSCSI sessions from hanging, however it will + * fail all queued BIOs. */ + ISCSI_DEBUG("forcing failing all disconnected sessions due to shutdown"); + + fail_on_disconnection = 1; + sx_slock(&sc->sc_lock); TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { ISCSI_SESSION_LOCK(is); - if (is->is_waiting_for_iscsid) + if (!is->is_connected) { + ISCSI_SESSION_DEBUG(is, "force failing disconnected session early"); iscsi_session_reconnect(is); + } ISCSI_SESSION_UNLOCK(is); } sx_sunlock(&sc->sc_lock); } +static void +iscsi_shutdown_post(struct iscsi_softc *sc) +{ + + ISCSI_DEBUG("removing all sessions due to shutdown"); + iscsi_terminate_sessions(sc); +} + static int iscsi_load(void) { @@ -2366,8 +2408,16 @@ iscsi_load(void) } sc->sc_cdev->si_drv1 = sc; - sc->sc_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, - iscsi_shutdown, sc, SHUTDOWN_PRI_FIRST); + sc->sc_shutdown_pre_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, + iscsi_shutdown_pre, sc, SHUTDOWN_PRI_FIRST); + /* + * shutdown_post_sync needs to run after filesystem shutdown and before + * CAM shutdown - otherwise when rebooting with an iSCSI session that is + * disconnected but has outstanding requests, dashutdown() will hang on + * cam_periph_runccb(). + */ + sc->sc_shutdown_post_eh = EVENTHANDLER_REGISTER(shutdown_post_sync, + iscsi_shutdown_post, sc, SHUTDOWN_PRI_DEFAULT - 1); return (0); } @@ -2375,7 +2425,6 @@ iscsi_load(void) static int iscsi_unload(void) { - struct iscsi_session *is, *tmp; if (sc->sc_cdev != NULL) { ISCSI_DEBUG("removing device node"); @@ -2383,18 +2432,12 @@ iscsi_unload(void) ISCSI_DEBUG("device node removed"); } - if (sc->sc_shutdown_eh != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->sc_shutdown_eh); + if (sc->sc_shutdown_pre_eh != NULL) + EVENTHANDLER_DEREGISTER(shutdown_pre_sync, sc->sc_shutdown_pre_eh); + if (sc->sc_shutdown_post_eh != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, sc->sc_shutdown_post_eh); - sx_slock(&sc->sc_lock); - TAILQ_FOREACH_SAFE(is, &sc->sc_sessions, is_next, tmp) - iscsi_session_terminate(is); - while(!TAILQ_EMPTY(&sc->sc_sessions)) { - ISCSI_DEBUG("waiting for sessions to terminate"); - cv_wait(&sc->sc_cv, &sc->sc_lock); - } - ISCSI_DEBUG("all sessions terminated"); - sx_sunlock(&sc->sc_lock); + iscsi_terminate_sessions(sc); uma_zdestroy(iscsi_outstanding_zone); sx_destroy(&sc->sc_lock); Modified: stable/10/sys/dev/iscsi/iscsi.h ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.h Mon Jan 25 08:19:16 2016 (r294707) +++ stable/10/sys/dev/iscsi/iscsi.h Mon Jan 25 09:26:23 2016 (r294708) @@ -130,7 +130,8 @@ struct iscsi_softc { TAILQ_HEAD(, iscsi_session) sc_sessions; struct cv sc_cv; unsigned int sc_last_session_id; - eventhandler_tag sc_shutdown_eh; + eventhandler_tag sc_shutdown_pre_eh; + eventhandler_tag sc_shutdown_post_eh; }; #endif /* !ISCSI_H */ From owner-svn-src-stable-10@freebsd.org Mon Jan 25 09:29:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEE87A31752; Mon, 25 Jan 2016 09:29:30 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 95153E12; Mon, 25 Jan 2016 09:29:30 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P9TTce026684; Mon, 25 Jan 2016 09:29:29 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P9TTZH026683; Mon, 25 Jan 2016 09:29:29 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601250929.u0P9TTZH026683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 09:29:29 +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: r294709 - stable/10/sys/geom/multipath 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.20 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, 25 Jan 2016 09:29:31 -0000 Author: smh Date: Mon Jan 25 09:29:29 2016 New Revision: 294709 URL: https://svnweb.freebsd.org/changeset/base/294709 Log: MFC r292289: Prevent g_access calls to bad multipath members Sponsored by: Multiplay Modified: stable/10/sys/geom/multipath/g_multipath.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/multipath/g_multipath.c ============================================================================== --- stable/10/sys/geom/multipath/g_multipath.c Mon Jan 25 09:26:23 2016 (r294708) +++ stable/10/sys/geom/multipath/g_multipath.c Mon Jan 25 09:29:29 2016 (r294709) @@ -107,8 +107,9 @@ struct g_class g_multipath_class = { #define MP_NEW 0x00000004 #define MP_POSTED 0x00000008 #define MP_BAD (MP_FAIL | MP_LOST | MP_NEW) -#define MP_IDLE 0x00000010 -#define MP_IDLE_MASK 0xfffffff0 +#define MP_WITHER 0x00000010 +#define MP_IDLE 0x00000020 +#define MP_IDLE_MASK 0xffffffe0 static int g_multipath_good(struct g_geom *gp) @@ -204,6 +205,7 @@ g_mpd(void *arg, int flags __unused) g_access(cp, -cp->acr, -cp->acw, -cp->ace); if (w > 0 && cp->provider != NULL && (cp->provider->geom->flags & G_GEOM_WITHER) == 0) { + cp->index |= MP_WITHER; g_post_event(g_mpd, cp, M_WAITOK, NULL); return; } @@ -467,23 +469,37 @@ g_multipath_access(struct g_provider *pp gp = pp->geom; + /* Error used if we have no valid consumers. */ + error = ENXIO; + LIST_FOREACH(cp, &gp->consumer, consumer) { + if (cp->index & MP_WITHER) + continue; + error = g_access(cp, dr, dw, de); if (error) { badcp = cp; goto fail; } } + + if (error != 0) + return (error); + sc = gp->softc; sc->sc_opened += dr + dw + de; if (sc->sc_stopping && sc->sc_opened == 0) g_multipath_destroy(gp); + return (0); fail: LIST_FOREACH(cp, &gp->consumer, consumer) { if (cp == badcp) break; + if (cp->index & MP_WITHER) + continue; + (void) g_access(cp, -dr, -dw, -de); } return (error); From owner-svn-src-stable-10@freebsd.org Mon Jan 25 09:40:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D7ECA31D0C; Mon, 25 Jan 2016 09:40:27 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7167C770; Mon, 25 Jan 2016 09:40:27 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0P9eQUj029828; Mon, 25 Jan 2016 09:40:26 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0P9eQTj029824; Mon, 25 Jan 2016 09:40:26 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601250940.u0P9eQTj029824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 09:40:26 +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: r294711 - in stable/10/sys/dev: nvd nvme 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.20 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, 25 Jan 2016 09:40:27 -0000 Author: smh Date: Mon Jan 25 09:40:25 2016 New Revision: 294711 URL: https://svnweb.freebsd.org/changeset/base/294711 Log: MFC r292074: Limit stripesize reported from nvd(4) to 4K Sponsored by: Multiplay Modified: stable/10/sys/dev/nvd/nvd.c stable/10/sys/dev/nvme/nvme.h stable/10/sys/dev/nvme/nvme_ns.c stable/10/sys/dev/nvme/nvme_sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nvd/nvd.c ============================================================================== --- stable/10/sys/dev/nvd/nvd.c Mon Jan 25 09:31:32 2016 (r294710) +++ stable/10/sys/dev/nvd/nvd.c Mon Jan 25 09:40:25 2016 (r294711) @@ -295,7 +295,7 @@ nvd_new_disk(struct nvme_namespace *ns, disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); - disk->d_stripesize = nvme_ns_get_stripesize(ns); + disk->d_stripesize = nvme_ns_get_optimal_sector_size(ns); if (TAILQ_EMPTY(&disk_head)) disk->d_unit = 0; Modified: stable/10/sys/dev/nvme/nvme.h ============================================================================== --- stable/10/sys/dev/nvme/nvme.h Mon Jan 25 09:31:32 2016 (r294710) +++ stable/10/sys/dev/nvme/nvme.h Mon Jan 25 09:40:25 2016 (r294711) @@ -870,6 +870,7 @@ const char * nvme_ns_get_serial_number(s const char * nvme_ns_get_model_number(struct nvme_namespace *ns); const struct nvme_namespace_data * nvme_ns_get_data(struct nvme_namespace *ns); +uint32_t nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns); uint32_t nvme_ns_get_stripesize(struct nvme_namespace *ns); int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, Modified: stable/10/sys/dev/nvme/nvme_ns.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_ns.c Mon Jan 25 09:31:32 2016 (r294710) +++ stable/10/sys/dev/nvme/nvme_ns.c Mon Jan 25 09:40:25 2016 (r294711) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" +extern int nvme_max_optimal_sectorsize; + static void nvme_bio_child_inbed(struct bio *parent, int bio_error); static void nvme_bio_child_done(void *arg, const struct nvme_completion *cpl); @@ -217,6 +219,22 @@ nvme_ns_get_stripesize(struct nvme_names return (ns->stripesize); } +uint32_t +nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns) +{ + uint32_t stripesize; + + stripesize = nvme_ns_get_stripesize(ns); + + if (stripesize == 0) + return nvme_ns_get_sector_size(ns); + + if (nvme_max_optimal_sectorsize == 0) + return (stripesize); + + return (MIN(stripesize, nvme_max_optimal_sectorsize)); +} + static void nvme_ns_bio_done(void *arg, const struct nvme_completion *status) { Modified: stable/10/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- stable/10/sys/dev/nvme/nvme_sysctl.c Mon Jan 25 09:31:32 2016 (r294710) +++ stable/10/sys/dev/nvme/nvme_sysctl.c Mon Jan 25 09:40:25 2016 (r294711) @@ -33,6 +33,22 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" +SYSCTL_NODE(_kern, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVM Express"); +/* + * Intel NVMe controllers have a slow path for I/Os that span a 128KB + * stripe boundary but ZFS limits ashift, which is derived from + * d_stripesize, to 13 (8KB) so we limit the stripesize reported to + * geom(8) to 4KB by default. + * + * This may result in a small number of additional I/Os to require + * splitting in nvme(4), however the NVMe I/O path is very efficient + * so these additional I/Os will cause very minimal (if any) difference + * in performance or CPU utilisation. + */ +int nvme_max_optimal_sectorsize = 1<<12; +SYSCTL_INT(_kern_nvme, OID_AUTO, max_optimal_sectorsize, CTLFLAG_RWTUN, + &nvme_max_optimal_sectorsize, 0, "The maximum optimal sectorsize reported"); + /* * CTLTYPE_S64 and sysctl_handle_64 were added in r217616. Define these * explicitly here for older kernels that don't include the r217616 From owner-svn-src-stable-10@freebsd.org Mon Jan 25 10:41:25 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF1FA457E1; Mon, 25 Jan 2016 10:41:25 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 043B0B18; Mon, 25 Jan 2016 10:41:24 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PAfOCT047948; Mon, 25 Jan 2016 10:41:24 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PAfN0V047945; Mon, 25 Jan 2016 10:41:23 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601251041.u0PAfN0V047945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 10:41:23 +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: r294715 - in stable/10/sys/boot/efi/include: amd64 i386 ia64 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.20 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, 25 Jan 2016 10:41:25 -0000 Author: smh Date: Mon Jan 25 10:41:23 2016 New Revision: 294715 URL: https://svnweb.freebsd.org/changeset/base/294715 Log: MFC r293268: Fix _MSC_EXTENSIONS checks Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/include/amd64/efibind.h stable/10/sys/boot/efi/include/i386/efibind.h stable/10/sys/boot/efi/include/ia64/efibind.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/include/amd64/efibind.h ============================================================================== --- stable/10/sys/boot/efi/include/amd64/efibind.h Mon Jan 25 10:23:36 2016 (r294714) +++ stable/10/sys/boot/efi/include/amd64/efibind.h Mon Jan 25 10:41:23 2016 (r294715) @@ -39,7 +39,7 @@ Revision History // No ANSI C 1999/2000 stdint.h integer width declarations - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS // Use Microsoft C compiler integer width declarations @@ -160,7 +160,7 @@ typedef uint64_t UINTN; #endif #ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else #define EFIAPI // Substitute expresion to force C calling convention @@ -261,7 +261,7 @@ typedef uint64_t UINTN; #endif #endif /* __FreeBSD__ */ -#if _MSC_EXTENSIONS +#ifdef _MSC_EXTENSIONS #pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP #endif Modified: stable/10/sys/boot/efi/include/i386/efibind.h ============================================================================== --- stable/10/sys/boot/efi/include/i386/efibind.h Mon Jan 25 10:23:36 2016 (r294714) +++ stable/10/sys/boot/efi/include/i386/efibind.h Mon Jan 25 10:41:23 2016 (r294715) @@ -39,7 +39,7 @@ Revision History // No ANSI C 1999/2000 stdint.h integer width declarations - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS // Use Microsoft C compiler integer width declarations @@ -156,7 +156,7 @@ typedef uint32_t UINTN; // #ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else #define EFIAPI // Substitute expresion to force C calling convention @@ -257,7 +257,7 @@ typedef uint32_t UINTN; #endif #endif /* __FreeBSD__ */ -#if _MSC_EXTENSIONS +#ifdef _MSC_EXTENSIONS #pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP #endif Modified: stable/10/sys/boot/efi/include/ia64/efibind.h ============================================================================== --- stable/10/sys/boot/efi/include/ia64/efibind.h Mon Jan 25 10:23:36 2016 (r294714) +++ stable/10/sys/boot/efi/include/ia64/efibind.h Mon Jan 25 10:41:23 2016 (r294715) @@ -39,7 +39,7 @@ Revision History // No ANSI C 1999/2000 stdint.h integer width declarations - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS // Use Microsoft C compiler integer width declarations @@ -159,7 +159,7 @@ typedef uint64_t UINTN; // #ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options - #if _MSC_EXTENSIONS + #ifdef _MSC_EXTENSIONS #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler #else #define EFIAPI // Substitute expresion to force C calling convention From owner-svn-src-stable-10@freebsd.org Mon Jan 25 10:43:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1282EA4588C; Mon, 25 Jan 2016 10:43:46 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D3D0CDF7; Mon, 25 Jan 2016 10:43:45 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PAhiOi050627; Mon, 25 Jan 2016 10:43:44 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PAhiHM050626; Mon, 25 Jan 2016 10:43:44 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601251043.u0PAhiHM050626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 10:43: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: r294716 - stable/10/sys/boot/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.20 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, 25 Jan 2016 10:43:46 -0000 Author: smh Date: Mon Jan 25 10:43:44 2016 New Revision: 294716 URL: https://svnweb.freebsd.org/changeset/base/294716 Log: MFC r293269: Fix return from zfs_probe_dev Sponsored by: Multiplay Modified: stable/10/sys/boot/zfs/zfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/zfs/zfs.c ============================================================================== --- stable/10/sys/boot/zfs/zfs.c Mon Jan 25 10:41:23 2016 (r294715) +++ stable/10/sys/boot/zfs/zfs.c Mon Jan 25 10:43:44 2016 (r294716) @@ -154,7 +154,7 @@ zfs_read(struct open_file *f, void *star n = size; if (fp->f_seekp + n > sb.st_size) n = sb.st_size - fp->f_seekp; - + rc = dnode_read(spa, &fp->f_dnode, fp->f_seekp, start, n); if (rc) return (rc); @@ -507,7 +507,7 @@ zfs_probe_dev(const char *devname, uint6 } } close(pa.fd); - return (0); + return (ret); } /* From owner-svn-src-stable-10@freebsd.org Mon Jan 25 10:45:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7BA2A45982; Mon, 25 Jan 2016 10:45:10 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 A723D179; Mon, 25 Jan 2016 10:45:10 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aNedu-0009lS-KY; Mon, 25 Jan 2016 13:45:06 +0300 Date: Mon, 25 Jan 2016 13:45:06 +0300 From: Slawa Olhovchenkov To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 Message-ID: <20160125104506.GV88527@zxy.spb.ru> References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56A5E89A.3050106@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Jan 2016 10:45:11 -0000 On Mon, Jan 25, 2016 at 10:19:22AM +0100, Jean-Sébastien Pédron wrote: > On 23/01/2016 17:26, Slawa Olhovchenkov wrote: > > Accelerating still not workin on 915GM. > > Hi! > > Is this a regression? Ie. was it working a year ago? Yes. In stable this is break by r282199. > Unfortunately, I won't have time to work on this. I need to focus on the > i915 update. Hopefully, it will fix this issue at the same time. > > Speaking of it, could you please test it? > https://wiki.freebsd.org/Graphics/Update%20i915%20GPU%20driver%20to%20Linux%203.8 This is for -current? From owner-svn-src-stable-10@freebsd.org Mon Jan 25 10:45:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 314BBA459B6; Mon, 25 Jan 2016 10:45:20 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 038772E5; Mon, 25 Jan 2016 10:45:19 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PAjJ78050805; Mon, 25 Jan 2016 10:45:19 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PAjJEm050804; Mon, 25 Jan 2016 10:45:19 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601251045.u0PAjJEm050804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 10:45: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: r294718 - stable/10/sys/cddl/boot/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.20 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, 25 Jan 2016 10:45:20 -0000 Author: smh Date: Mon Jan 25 10:45:18 2016 New Revision: 294718 URL: https://svnweb.freebsd.org/changeset/base/294718 Log: MFC r293271: Fix const conversion warning in lz4_decompress Sponsored by: Multiplay Modified: stable/10/sys/cddl/boot/zfs/lz4.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/boot/zfs/lz4.c ============================================================================== --- stable/10/sys/cddl/boot/zfs/lz4.c Mon Jan 25 10:44:10 2016 (r294717) +++ stable/10/sys/cddl/boot/zfs/lz4.c Mon Jan 25 10:45:18 2016 (r294718) @@ -52,7 +52,7 @@ lz4_decompress(void *s_start, void *d_st * Returns 0 on success (decompression function returned non-negative) * and non-zero on failure (decompression function returned negative). */ - return (LZ4_uncompress_unknownOutputSize(s_start + 4, d_start, bufsiz, + return (LZ4_uncompress_unknownOutputSize((const char *)s_start + 4, d_start, bufsiz, d_len) < 0); } From owner-svn-src-stable-10@freebsd.org Mon Jan 25 10:48:59 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4986A45AA0; Mon, 25 Jan 2016 10:48:59 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 759F16C6; Mon, 25 Jan 2016 10:48:59 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PAmw5e050981; Mon, 25 Jan 2016 10:48:58 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PAmwB7050980; Mon, 25 Jan 2016 10:48:58 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601251048.u0PAmwB7050980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 10:48:58 +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: r294719 - stable/10/sys/boot/efi/boot1 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.20 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, 25 Jan 2016 10:48:59 -0000 Author: smh Date: Mon Jan 25 10:48:58 2016 New Revision: 294719 URL: https://svnweb.freebsd.org/changeset/base/294719 Log: MFC r281059 (by rpaulo): boot1 EFI: reset the screen and select the best mode. Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/boot1/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 25 10:45:18 2016 (r294718) +++ stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 25 10:48:58 2016 (r294719) @@ -108,11 +108,12 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E { EFI_HANDLE handles[128]; EFI_BLOCK_IO *blkio; - UINTN i, nparts = sizeof(handles); + UINTN i, nparts = sizeof(handles), cols, rows, max_dim, best_mode; EFI_STATUS status; EFI_DEVICE_PATH *devpath; EFI_BOOT_SERVICES *BS; EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; + SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; char *path = _PATH_LOADER; systab = Xsystab; @@ -124,6 +125,26 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E if (status == EFI_SUCCESS) (void)ConsoleControl->SetMode(ConsoleControl, EfiConsoleControlScreenText); + /* + * Reset the console and find the best text mode. + */ + conout = systab->ConOut; + conout->Reset(conout, TRUE); + max_dim = best_mode = 0; + for (i = 0; ; i++) { + status = conout->QueryMode(conout, i, + &cols, &rows); + if (EFI_ERROR(status)) + break; + if (cols * rows > max_dim) { + max_dim = cols * rows; + best_mode = i; + } + } + if (max_dim > 0) + conout->SetMode(conout, best_mode); + conout->EnableCursor(conout, TRUE); + conout->ClearScreen(conout); printf(" \n>> FreeBSD EFI boot block\n"); printf(" Loader path: %s\n", path); From owner-svn-src-stable-10@freebsd.org Mon Jan 25 10:50:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF9FBA45B42; Mon, 25 Jan 2016 10:50:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9CDA3881; Mon, 25 Jan 2016 10:50:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PAoBch051094; Mon, 25 Jan 2016 10:50:11 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PAoBvP051092; Mon, 25 Jan 2016 10:50:11 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601251050.u0PAoBvP051092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 10:50: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: r294720 - in stable/10/sys/boot/efi: boot1 loader 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.20 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, 25 Jan 2016 10:50:12 -0000 Author: smh Date: Mon Jan 25 10:50:11 2016 New Revision: 294720 URL: https://svnweb.freebsd.org/changeset/base/294720 Log: MFC r293274: style(9) fixes for EFI boot Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/efi/loader/devicename.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 25 10:48:58 2016 (r294719) +++ stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 25 10:50:11 2016 (r294720) @@ -132,8 +132,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E conout->Reset(conout, TRUE); max_dim = best_mode = 0; for (i = 0; ; i++) { - status = conout->QueryMode(conout, i, - &cols, &rows); + status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) break; if (cols * rows > max_dim) { Modified: stable/10/sys/boot/efi/loader/devicename.c ============================================================================== --- stable/10/sys/boot/efi/loader/devicename.c Mon Jan 25 10:48:58 2016 (r294719) +++ stable/10/sys/boot/efi/loader/devicename.c Mon Jan 25 10:50:11 2016 (r294720) @@ -147,7 +147,7 @@ efi_fmtdev(void *vdev) break; } - return(buf); + return (buf); } /* @@ -161,7 +161,7 @@ efi_setcurrdev(struct env_var *ev, int f rv = efi_parsedev(&ncurr, value, NULL); if (rv != 0) - return(rv); + return (rv); free(ncurr); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); From owner-svn-src-stable-10@freebsd.org Mon Jan 25 10:55:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75E77A45D64; Mon, 25 Jan 2016 10:55:42 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08D3BC43; Mon, 25 Jan 2016 10:55:41 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f54.google.com with SMTP id h129so82720126lfh.3; Mon, 25 Jan 2016 02:55:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:to:subject:references:date:cc :mime-version:content-transfer-encoding:from:message-id:in-reply-to :user-agent; bh=Hhye4qxy2OOfwUz7hRgyWM0NxzYrdZ1eQF7CztFDXXY=; b=Rdd6XbXtzs26bs4paRZItK9qVHuvk8+56PzCe7M+fNogEYdvcktz8EQAeOJoPLqDss pjB3kJ6kZoeIxubhRG1bXIN3D7zdDIXRVPAfRXvSiBjydCe8pCl4nCdPodrm7uESQTO4 lZQyvre8HEjeRyNAN3RCIUQS/n5uokaYhwkOFL4b17CeUbvGM3maH0wdBU6hGT5ZL1Zp vKfNwwj/1rth87rnWg58NF5/CkmCTrn1NvjUSDjxvCL9VMFa3vZTP7hNebS7bdZskEKz te7UKi8XYMN2Ygj2GK6uT4wepPbpTjAi30tOO9QVtAIB4UhKZ/ybRUE0vCzft2F7rDcF Hd/Q== X-Gm-Message-State: AG10YOScHZTz8Hs4NAOF/PPyqpEZkU9QuPkQKd4WzJpdHJadOT1GpaeayllULUUN3AUwbA== X-Received: by 10.25.28.80 with SMTP id c77mr6451236lfc.74.1453719014338; Mon, 25 Jan 2016 02:50:14 -0800 (PST) Received: from localhost ([77.91.171.160]) by smtp.gmail.com with ESMTPSA id mj4sm2643326lbc.19.2016.01.25.02.50.13 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 25 Jan 2016 02:50:13 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Slawa Olhovchenkov" Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> <20160125104506.GV88527@zxy.spb.ru> Date: Mon, 25 Jan 2016 12:50:12 +0200 Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <20160125104506.GV88527@zxy.spb.ru> User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Jan 2016 10:55:42 -0000 Mon, 25 Jan 2016 12:45:06 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Slawa Olhovchenkov = : Hi! Try to apply https://svnweb.freebsd.org/base?view=3Drevision&revision=3D= 288653 (as for me, head/sys/dev/drm2/i915/i915_dma.c change fixes this) > On Mon, Jan 25, 2016 at 10:19:22AM +0100, Jean-S=C3=A9bastien P=C3=A9d= ron wrote: > >> On 23/01/2016 17:26, Slawa Olhovchenkov wrote: >> > Accelerating still not workin on 915GM. >> >> Hi! >> >> Is this a regression? Ie. was it working a year ago? > > Yes. In stable this is break by r282199. > >> Unfortunately, I won't have time to work on this. I need to focus on = the >> i915 update. Hopefully, it will fix this issue at the same time. >> >> Speaking of it, could you please test it? >> https://wiki.freebsd.org/Graphics/Update%20i915%20GPU%20driver%20to%2= 0Linux%203.8 > > This is for -current? From owner-svn-src-stable-10@freebsd.org Mon Jan 25 10:55:54 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E85DA45DA3; Mon, 25 Jan 2016 10:55:54 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 DFEE3D7E; Mon, 25 Jan 2016 10:55:53 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PAtqtj053916; Mon, 25 Jan 2016 10:55:52 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PAtqtM053913; Mon, 25 Jan 2016 10:55:52 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601251055.u0PAtqtM053913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 10:55:52 +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: r294721 - in stable/10/sys/boot: common efi/boot1 powerpc/boot1.chrp 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.20 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, 25 Jan 2016 10:55:54 -0000 Author: smh Date: Mon Jan 25 10:55:52 2016 New Revision: 294721 URL: https://svnweb.freebsd.org/changeset/base/294721 Log: MFC r293461: Remove hidden "Not ufs" printfs from boot code Sponsored by: Multiplay Modified: stable/10/sys/boot/common/ufsread.c stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/powerpc/boot1.chrp/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/ufsread.c ============================================================================== --- stable/10/sys/boot/common/ufsread.c Mon Jan 25 10:50:11 2016 (r294720) +++ stable/10/sys/boot/common/ufsread.c Mon Jan 25 10:55:52 2016 (r294721) @@ -211,7 +211,6 @@ fsread(ufs_ino_t inode, void *buf, size_ break; } if (sblock_try[n] == -1) { - printf("Not ufs\n"); return -1; } dsk_meta++; Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 25 10:50:11 2016 (r294720) +++ stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 25 10:55:52 2016 (r294721) @@ -249,7 +249,6 @@ fsstat(ufs_ino_t inode) break; } if (sblock_try[n] == -1) { - printf("Not ufs\n"); return -1; } dsk_meta++; Modified: stable/10/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- stable/10/sys/boot/powerpc/boot1.chrp/boot1.c Mon Jan 25 10:50:11 2016 (r294720) +++ stable/10/sys/boot/powerpc/boot1.chrp/boot1.c Mon Jan 25 10:55:52 2016 (r294721) @@ -564,10 +564,6 @@ printf(const char *fmt, ...) va_list ap; int ret; - /* Don't annoy the user as we probe for partitions */ - if (strcmp(fmt,"Not ufs\n") == 0) - return 0; - va_start(ap, fmt); ret = vprintf(fmt, ap); va_end(ap); From owner-svn-src-stable-10@freebsd.org Mon Jan 25 12:49:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 418ADA45319; Mon, 25 Jan 2016 12:49:16 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (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 EAEFA89A; Mon, 25 Jan 2016 12:49:15 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from [176.158.145.63] (helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aNga1-000DNj-Nd; Mon, 25 Jan 2016 13:49:13 +0100 Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 To: Andriy Voskoboinyk , Slawa Olhovchenkov References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> <20160125104506.GV88527@zxy.spb.ru> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: <56A619C5.6070109@FreeBSD.org> Date: Mon, 25 Jan 2016 13:49:09 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="liumSIgRClWorUh2f7p621NKSk8mFDEpx" X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Jan 2016 12:49:16 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --liumSIgRClWorUh2f7p621NKSk8mFDEpx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 25/01/2016 11:50, Andriy Voskoboinyk wrote: > Try to apply https://svnweb.freebsd.org/base?view=3Drevision&revision=3D= 288653 > (as for me, head/sys/dev/drm2/i915/i915_dma.c change fixes this) If this fixes the problem, perfect, I will merge it. --=20 Jean-S=C3=A9bastien P=C3=A9dron --liumSIgRClWorUh2f7p621NKSk8mFDEpx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJWphnFXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NzA4N0ZEMUFFQUUwRTEyREJDNkE2RjAz OUU5OTc2MUE1RkQ5NENDAAoJEDnpl2Gl/ZTM+0EQAMjKsvk/ZESt+TgoS3S52FNI cG0JnLEcOnFVZZN9XZqRsF5LX5BlgoSdlQ9rQlk+xAW3LdWcKc4ccPmlh4Xf8zMp ZgssUj0B4G2BGbbGrlQBKFvnGXQ5YbdyeDY19mq3on05ce8/06jF7SGtTE2DRm1g CDcRm0W4ERqUYd09+sNRmI6gAj17Du8AatEHDpqoA+uHWqHmTjj50WqW+lgVXpUW 7AlYCunTDjTfltk1Sh/ztynxW5G28IeCa1x0O3Dod3nz00bR0cHTzMEDmFcCFrdW sEsyIhMujPzt/v3MfYjiq8/PQljfbgG0X6kkyn/KwuUb29JhgbIRTIexXkpG69zF VKL/GHHxCuwpIuXqQNw+r4r1YY4PdNRdeCu5cWMxzQnUh1IdxRUj7na8GOZcDxgN FM8YNRLIhU515nOlSCgpFEQ7I6tVAuzoQOEN54sYlhx2FPnAENn9TptGzcwnc3OF 3ZTPKTj+n9P/7iLuTgRrWP1/GP00kDrycvkPnmLIkn6h9EYdP9oWmOMILkaLR12a a/JPaFvEn2TNUwwh0a2KktqkRHL8Q948arRaeI5AFfXssMyzd6MloT5fw/FCyXqQ /K7asA0Wk9MTD57RoH1HvoqjEaYRCoNjiZRzH6Upa6ajcMvvZco0GVOFIgHedOXI wnRYJ4SXOuTYJBj4KEI3 =wbRO -----END PGP SIGNATURE----- --liumSIgRClWorUh2f7p621NKSk8mFDEpx-- From owner-svn-src-stable-10@freebsd.org Mon Jan 25 13:27:50 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3C7EA45302; Mon, 25 Jan 2016 13:27:50 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 65D44ECA; Mon, 25 Jan 2016 13:27:50 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PDRnG3001205; Mon, 25 Jan 2016 13:27:49 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PDRnIe001204; Mon, 25 Jan 2016 13:27:49 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601251327.u0PDRnIe001204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 13:27:49 +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: r294725 - stable/10/sys/boot/efi/boot1 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.20 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, 25 Jan 2016 13:27:50 -0000 Author: smh Date: Mon Jan 25 13:27:49 2016 New Revision: 294725 URL: https://svnweb.freebsd.org/changeset/base/294725 Log: MFC r293422 (partial): Update generated EFI boot image templates. This is a partial MFC as stable/10 only has EFI boot support for amd64, and there are no plans to change this, so the other platform images aren't included. Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu ============================================================================== --- stable/10/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu Mon Jan 25 12:55:24 2016 (r294724) +++ stable/10/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu Mon Jan 25 13:27:49 2016 (r294725) @@ -2,19 +2,25 @@ FAT template boot filesystem created by DO NOT EDIT $FreeBSD$ begin 644 fat-amd64.tmpl.bz2 -M0EIH.3%!629362AK*D(`&I+____[ZZKJZ_^N_ZO^Z_Z_OJ[L`4`!7I0$#&$" -M0$!$3&(I-DTU,)ZAZ0VA-!M0T'J`>H#"9 -M'I#0-H&HQI&0&3&FH>H>*`JHHU3V]1%/4/2``T#0`!H``#0`````#1H,@``6 -M'1&G'&@?$6[T#A)?X8$A160"20BO#")0J4TB1*4GXF$B4I,&>43+=_?K=#3* -M6]R"ZNKJZI,9*68E8*E2Q -M4J5*E3'(1830A"$(12A-"<(0A#]VD)H0A"$,>I0FA"$(0I\>P^=F5:M6K5JU -M:DI3:64UN;[7%5B]Y-^\]@_K@B:N\/,5F%&H<\G#IXQXAEFC&D?![6%0'6MR -MX1@@%FC"FD`M7,/SXFNG:2`'-0<-C$8^+$N.7M1B,^6)9,DV9,0A\OL<:C"L -ML1V&,<\9YRB>XV#BG")'6NKRK^("UF2XO?_L!#29">MGDF$R3).!PX&%E,4C -M''=(FL1.`_3?CN@-IB2PI3!FF\<8X.X@D,>CA90I)#M$XRPNDFJELL<3=1?8 -M2B7\5Z64,!7Z;EEBW-MXN-4IJ@W$462]-*\YCR,-B,5[W?=3&L/U>SX,WV#\ -M\B`:I"'0Z)5"$1B.E)(K[5I4RS`%R$>Y\D0NR*,;<9CZ:^V3P(I?D0`&T#_____ZZKJ[_^N_^O^Z_Z[OJ_NJ^JK^KZNKNNJ +MZ^KNZOJ^P`+\&$`!D#0T:`80&@T#`@`-`:9`:`P"`R::```:8)II@@,FC(-& +M$`!D,(:9`E5%&3_]*J?ZHC(--&@::#3)HQ#0`&C330,"9,F$::9!D#`F30#3 +M3)H9-&1DTR`R:,3"`&0-#1H!A`:#0,"``T!ID!H#`(#)IH``!I@FFF"`R:,@ +MT80`&0PAID!5)$)Y0@R&HQ#3U-I--,@-&0R-&@T-`&FF@9-!IIIH-&1ILHTT +M&ADQ#-$\B;1-/2-H93$\4\34Q9ZDM*M:U49"2K6F0C'21$(GD$1$085)7RB( +M00A7Q'^3"!"&CM$T+&UM5A49]7/"3^:EK7GMDVS9MRWK=+E>.(OG-?ZZMDA: +MR74C/HR\T0"$,Y+,YBA.JO&6C*K-DV26*@S24I%*E-2I4J5*JH43)*%"A0H4 +M*5-"E)2E2I4J5+!RPP]&&&&&&,P(9X]&&&&&&.IMKISQPX<.'#AP@0A"$(0A +M"$(0A"(MX]&&&&&&&$(0A"$(0(0A"$(?ME2N'#APX<.'"+EZ,,,,,,,($(0A +M"$0>NEGIM!8-(Y6FM$:.>9*3D219:RJKD^H2>1%9\LD8O.X4EIVM=.HDTT1'B:J=8;[A9NLU +M"OX%C.X>0U/WZ^E74T&IHJ3EG))(^U[S\6_?HX;B.,Y*]7SGN@PV*_(O+^9# +M+^Q,N_S1'42+=METV+CK9;+US'.8#H,%B,9Y*RD-/)TYXB8XQHI(RLF')')< +MI>OZ Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A729A45790; Mon, 25 Jan 2016 13:35:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4C377669; Mon, 25 Jan 2016 13:35:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PDZSPC004223; Mon, 25 Jan 2016 13:35:28 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PDZSpm004221; Mon, 25 Jan 2016 13:35:28 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601251335.u0PDZSpm004221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 25 Jan 2016 13:35:28 +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: r294726 - stable/10/sys/boot/efi/boot1 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.20 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, 25 Jan 2016 13:35:29 -0000 Author: smh Date: Mon Jan 25 13:35:28 2016 New Revision: 294726 URL: https://svnweb.freebsd.org/changeset/base/294726 Log: MFC r293460: Switch EFT boot1 to use libstand This includes a change to the Makefile comment to correct it due to the lack of arm and i386 support in 10.x. Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/boot1/Makefile stable/10/sys/boot/efi/boot1/boot1.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/10/sys/boot/efi/boot1/Makefile Mon Jan 25 13:27:49 2016 (r294725) +++ stable/10/sys/boot/efi/boot1/Makefile Mon Jan 25 13:35:28 2016 (r294726) @@ -38,6 +38,12 @@ LDFLAGS= -Wl,-T${LDSCRIPT} -Wl,-Bsymboli LDFLAGS+= -Wl,-znocombreloc .endif +# +# Add libstand for required string and memory functions for all platforms. +# +DPADD+= ${LIBSTAND} +LDADD+= -lstand + DPADD+= ${LDSCRIPT} OBJCOPY?= objcopy Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 25 13:27:49 2016 (r294725) +++ stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 25 13:35:28 2016 (r294726) @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -33,28 +34,8 @@ __FBSDID("$FreeBSD$"); #define BSIZEMAX 16384 -typedef int putc_func_t(char c, void *arg); - -struct sp_data { - char *sp_buf; - u_int sp_len; - u_int sp_size; -}; - -static const char digits[] = "0123456789abcdef"; - -static void panic(const char *fmt, ...) __dead2; -static int printf(const char *fmt, ...); -static int putchar(char c, void *arg); -static int vprintf(const char *fmt, va_list ap); -static int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); - -static int __printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap); -static int __putc(char c, void *arg); -static int __puts(const char *s, putc_func_t *putc, void *arg); -static int __sputc(char c, void *arg); -static char *__uitoa(char *buf, u_int val, int base); -static char *__ultoa(char *buf, u_long val, int base); +void panic(const char *fmt, ...) __dead2; +void putchar(int c); static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet); static void load(const char *fname); @@ -62,39 +43,6 @@ static void load(const char *fname); EFI_SYSTEM_TABLE *systab; EFI_HANDLE *image; -static void -bcopy(const void *src, void *dst, size_t len) -{ - const char *s = src; - char *d = dst; - - while (len-- != 0) - *d++ = *s++; -} - -static void -memcpy(void *dst, const void *src, size_t len) -{ - bcopy(src, dst, len); -} - -static void -bzero(void *b, size_t len) -{ - char *p = b; - - while (len-- != 0) - *p++ = 0; -} - -static int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++) - ; - return ((u_char)*s1 - (u_char)*s2); -} - static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; @@ -344,38 +292,22 @@ load(const char *fname) EFI_ERROR_CODE(status)); } -static void +void panic(const char *fmt, ...) { - char buf[128]; va_list ap; + printf("panic: "); va_start(ap, fmt); - vsnprintf(buf, sizeof buf, fmt, ap); - printf("panic: %s\n", buf); + vprintf(fmt, ap); va_end(ap); + printf("\n"); while (1) {} } -static int -printf(const char *fmt, ...) -{ - va_list ap; - int ret; - - /* Don't annoy the user as we probe for partitions */ - if (strcmp(fmt,"Not ufs\n") == 0) - return 0; - - va_start(ap, fmt); - ret = vprintf(fmt, ap); - va_end(ap); - return (ret); -} - -static int -putchar(char c, void *arg) +void +putchar(int c) { CHAR16 buf[2]; @@ -387,187 +319,4 @@ putchar(char c, void *arg) buf[0] = c; buf[1] = 0; systab->ConOut->OutputString(systab->ConOut, buf); - return (1); -} - -static int -vprintf(const char *fmt, va_list ap) -{ - int ret; - - ret = __printf(fmt, putchar, 0, ap); - return (ret); -} - -static int -vsnprintf(char *str, size_t sz, const char *fmt, va_list ap) -{ - struct sp_data sp; - int ret; - - sp.sp_buf = str; - sp.sp_len = 0; - sp.sp_size = sz; - ret = __printf(fmt, __sputc, &sp, ap); - return (ret); -} - -static int -__printf(const char *fmt, putc_func_t *putc, void *arg, va_list ap) -{ - char buf[(sizeof(long) * 8) + 1]; - char *nbuf; - u_long ul; - u_int ui; - int lflag; - int sflag; - char *s; - int pad; - int ret; - int c; - - nbuf = &buf[sizeof buf - 1]; - ret = 0; - while ((c = *fmt++) != 0) { - if (c != '%') { - ret += putc(c, arg); - continue; - } - lflag = 0; - sflag = 0; - pad = 0; -reswitch: c = *fmt++; - switch (c) { - case '#': - sflag = 1; - goto reswitch; - case '%': - ret += putc('%', arg); - break; - case 'c': - c = va_arg(ap, int); - ret += putc(c, arg); - break; - case 'd': - if (lflag == 0) { - ui = (u_int)va_arg(ap, int); - if (ui < (int)ui) { - ui = -ui; - ret += putc('-', arg); - } - s = __uitoa(nbuf, ui, 10); - } else { - ul = (u_long)va_arg(ap, long); - if (ul < (long)ul) { - ul = -ul; - ret += putc('-', arg); - } - s = __ultoa(nbuf, ul, 10); - } - ret += __puts(s, putc, arg); - break; - case 'l': - lflag = 1; - goto reswitch; - case 'o': - if (lflag == 0) { - ui = (u_int)va_arg(ap, u_int); - s = __uitoa(nbuf, ui, 8); - } else { - ul = (u_long)va_arg(ap, u_long); - s = __ultoa(nbuf, ul, 8); - } - ret += __puts(s, putc, arg); - break; - case 'p': - ul = (u_long)va_arg(ap, void *); - s = __ultoa(nbuf, ul, 16); - ret += __puts("0x", putc, arg); - ret += __puts(s, putc, arg); - break; - case 's': - s = va_arg(ap, char *); - ret += __puts(s, putc, arg); - break; - case 'u': - if (lflag == 0) { - ui = va_arg(ap, u_int); - s = __uitoa(nbuf, ui, 10); - } else { - ul = va_arg(ap, u_long); - s = __ultoa(nbuf, ul, 10); - } - ret += __puts(s, putc, arg); - break; - case 'x': - if (lflag == 0) { - ui = va_arg(ap, u_int); - s = __uitoa(nbuf, ui, 16); - } else { - ul = va_arg(ap, u_long); - s = __ultoa(nbuf, ul, 16); - } - if (sflag) - ret += __puts("0x", putc, arg); - ret += __puts(s, putc, arg); - break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - pad = pad * 10 + c - '0'; - goto reswitch; - default: - break; - } - } - return (ret); -} - -static int -__sputc(char c, void *arg) -{ - struct sp_data *sp; - - sp = arg; - if (sp->sp_len < sp->sp_size) - sp->sp_buf[sp->sp_len++] = c; - sp->sp_buf[sp->sp_len] = '\0'; - return (1); -} - -static int -__puts(const char *s, putc_func_t *putc, void *arg) -{ - const char *p; - int ret; - - ret = 0; - for (p = s; *p != '\0'; p++) - ret += putc(*p, arg); - return (ret); -} - -static char * -__uitoa(char *buf, u_int ui, int base) -{ - char *p; - - p = buf; - *p = '\0'; - do - *--p = digits[ui % base]; - while ((ui /= base) != 0); - return (p); -} - -static char * -__ultoa(char *buf, u_long ul, int base) -{ - char *p; - - p = buf; - *p = '\0'; - do - *--p = digits[ul % base]; - while ((ul /= base) != 0); - return (p); } From owner-svn-src-stable-10@freebsd.org Mon Jan 25 17:38:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 207B1A454F9; Mon, 25 Jan 2016 17:38:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E1950A2C; Mon, 25 Jan 2016 17:38:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PHcKMv076709; Mon, 25 Jan 2016 17:38:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PHcKlH076708; Mon, 25 Jan 2016 17:38:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601251738.u0PHcKlH076708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 25 Jan 2016 17:38:20 +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: r294737 - stable/10/share/mk 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.20 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, 25 Jan 2016 17:38:22 -0000 Author: bdrewery Date: Mon Jan 25 17:38:20 2016 New Revision: 294737 URL: https://svnweb.freebsd.org/changeset/base/294737 Log: MFC r294370: mkdep: Fix -include not being added for .depend tracking. Modified: stable/10/share/mk/bsd.dep.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.dep.mk ============================================================================== --- stable/10/share/mk/bsd.dep.mk Mon Jan 25 16:49:39 2016 (r294736) +++ stable/10/share/mk/bsd.dep.mk Mon Jan 25 17:38:20 2016 (r294737) @@ -160,12 +160,25 @@ depend: beforedepend ${DEPENDFILE} after # Tell bmake not to look for generated files via .PATH .NOPATH: ${DEPENDFILE} +# Capture -include from CFLAGS. +# This could be simpler with bmake :tW but needs to support fmake for MFC. +_CFLAGS_INCLUDES= ${CFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} +_CXXFLAGS_INCLUDES= ${CXXFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} +# XXX: Temporary hack to workaround .depend files not tracking -include +.if !empty(_CFLAGS_INCLUDES) +${OBJS} ${POBJS} ${SOBJS}: ${_CFLAGS_INCLUDES:M*.h} +.endif +.if !empty(_CXXFLAGS_INCLUDES) +${OBJS} ${POBJS} ${SOBJS}: ${_CXXFLAGS_INCLUDES:M*.h} +.endif + # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} \ - ${CFLAGS:M-ansi} + ${CFLAGS:M-ansi} ${_CFLAGS_INCLUDES} MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} \ - ${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} ${CXXFLAGS:M-stdlib=*} + ${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} ${CXXFLAGS:M-stdlib=*} \ + ${_CXXFLAGS_INCLUDES} DPSRCS+= ${SRCS} ${DEPENDFILE}: ${DPSRCS} From owner-svn-src-stable-10@freebsd.org Mon Jan 25 18:18:20 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BEF07800; Mon, 25 Jan 2016 18:18:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D76DA32; Mon, 25 Jan 2016 18:18:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5169AB945; Mon, 25 Jan 2016 13:18:19 -0500 (EST) From: John Baldwin To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r294719 - stable/10/sys/boot/efi/boot1 Date: Mon, 25 Jan 2016 10:16:49 -0800 Message-ID: <4954368.cJavQLNNVz@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201601251048.u0PAmwB7050980@repo.freebsd.org> References: <201601251048.u0PAmwB7050980@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 25 Jan 2016 13:18:19 -0500 (EST) X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Jan 2016 18:18:20 -0000 On Monday, January 25, 2016 10:48:58 AM Steven Hartland wrote: > Author: smh > Date: Mon Jan 25 10:48:58 2016 > New Revision: 294719 > URL: https://svnweb.freebsd.org/changeset/base/294719 > > Log: > MFC r281059 (by rpaulo): > > boot1 EFI: reset the screen and select the best mode. > > Sponsored by: Multiplay Note that this breaks the console on certain HP laptops. There was an earlier thread on hackers@. I will forward it to you. -- John Baldwin From owner-svn-src-stable-10@freebsd.org Mon Jan 25 21:28:13 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79EFFA46EA6; Mon, 25 Jan 2016 21:28:13 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 3A5B0A69; Mon, 25 Jan 2016 21:28:13 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aNogD-000PKa-JP; Tue, 26 Jan 2016 00:28:09 +0300 Date: Tue, 26 Jan 2016 00:28:09 +0300 From: Slawa Olhovchenkov To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Cc: Andriy Voskoboinyk , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org Subject: Re: svn commit: r293857 - stable/10/sys/dev/drm2/i915 Message-ID: <20160125212809.GO37895@zxy.spb.ru> References: <201601132156.u0DLunQs020854@repo.freebsd.org> <20160123162617.GL37895@zxy.spb.ru> <56A5E89A.3050106@FreeBSD.org> <20160125104506.GV88527@zxy.spb.ru> <56A619C5.6070109@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56A619C5.6070109@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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, 25 Jan 2016 21:28:13 -0000 On Mon, Jan 25, 2016 at 01:49:09PM +0100, Jean-Sébastien Pédron wrote: > On 25/01/2016 11:50, Andriy Voskoboinyk wrote: > > Try to apply https://svnweb.freebsd.org/base?view=revision&revision=288653 > > (as for me, head/sys/dev/drm2/i915/i915_dma.c change fixes this) > > If this fixes the problem, perfect, I will merge it. At least partially for me: mplayer now playback, but I am got message (from mplayer) '[VD_FFMPEG] DRI failure'. May be need something rebuild? PS: Can you check other driver too? As I see this is lost transition of pci_enable_busmaster from sys/dev/drm2/drm_drv.c:drm_load to individual drivers. From owner-svn-src-stable-10@freebsd.org Tue Jan 26 00:22:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42D26A463EE; Tue, 26 Jan 2016 00:22:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F15AFD32; Tue, 26 Jan 2016 00:22:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q0M2Zp094296; Tue, 26 Jan 2016 00:22:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q0M2AR094295; Tue, 26 Jan 2016 00:22:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201601260022.u0Q0M2AR094295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 26 Jan 2016 00:22:02 +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: r294755 - 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.20 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, 26 Jan 2016 00:22:04 -0000 Author: markj Date: Tue Jan 26 00:22:02 2016 New Revision: 294755 URL: https://svnweb.freebsd.org/changeset/base/294755 Log: MFC r293458: Prevent cv_waiters wraparound. Modified: stable/10/sys/kern/kern_condvar.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_condvar.c ============================================================================== --- stable/10/sys/kern/kern_condvar.c Mon Jan 25 23:04:40 2016 (r294754) +++ stable/10/sys/kern/kern_condvar.c Tue Jan 26 00:22:02 2016 (r294755) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,6 +48,17 @@ __FBSDID("$FreeBSD$"); #endif /* + * A bound below which cv_waiters is valid. Once cv_waiters reaches this bound, + * cv_signal must manually check the wait queue for threads. + */ +#define CV_WAITERS_BOUND INT_MAX + +#define CV_WAITERS_INC(cvp) do { \ + if ((cvp)->cv_waiters < CV_WAITERS_BOUND) \ + (cvp)->cv_waiters++; \ +} while (0) + +/* * Common sanity checks for cv_wait* functions. */ #define CV_ASSERT(cvp, lock, td) do { \ @@ -122,7 +134,7 @@ _cv_wait(struct cv *cvp, struct lock_obj sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -184,7 +196,7 @@ _cv_wait_unlock(struct cv *cvp, struct l sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); DROP_GIANT(); sleepq_add(cvp, lock, cvp->cv_description, SLEEPQ_CONDVAR, 0); @@ -240,7 +252,7 @@ _cv_wait_sig(struct cv *cvp, struct lock sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -307,7 +319,7 @@ _cv_timedwait_sbt(struct cv *cvp, struct sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -376,7 +388,7 @@ _cv_timedwait_sig_sbt(struct cv *cvp, st sleepq_lock(cvp); - cvp->cv_waiters++; + CV_WAITERS_INC(cvp); if (lock == &Giant.lock_object) mtx_assert(&Giant, MA_OWNED); DROP_GIANT(); @@ -422,8 +434,15 @@ cv_signal(struct cv *cvp) wakeup_swapper = 0; sleepq_lock(cvp); if (cvp->cv_waiters > 0) { - cvp->cv_waiters--; - wakeup_swapper = sleepq_signal(cvp, SLEEPQ_CONDVAR, 0, 0); + if (cvp->cv_waiters == CV_WAITERS_BOUND && + sleepq_lookup(cvp) == NULL) { + cvp->cv_waiters = 0; + } else { + if (cvp->cv_waiters < CV_WAITERS_BOUND) + cvp->cv_waiters--; + wakeup_swapper = sleepq_signal(cvp, SLEEPQ_CONDVAR, 0, + 0); + } } sleepq_release(cvp); if (wakeup_swapper) From owner-svn-src-stable-10@freebsd.org Tue Jan 26 04:51:46 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DC6EA46D38; Tue, 26 Jan 2016 04:51:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0097C15EE; Tue, 26 Jan 2016 04:51:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q4piat076347; Tue, 26 Jan 2016 04:51:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q4pi7M076346; Tue, 26 Jan 2016 04:51:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601260451.u0Q4pi7M076346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Jan 2016 04:51: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: r294762 - stable/10/lib/libc/stdlib 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.20 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, 26 Jan 2016 04:51:46 -0000 Author: pfg Date: Tue Jan 26 04:51:44 2016 New Revision: 294762 URL: https://svnweb.freebsd.org/changeset/base/294762 Log: Revert r279010: tdelete(3): don't delete the node we are about to return. The original change, from NetBSD, was bogus; introduced a memory leak and and broke POSIX. By reverting we actually match NetBSD's latest revision. This is a direct commit to 10 since this function was rewritten in 11-current. Reported by: Markiyan Kushnir Obtained from: NetBSD (CVS rev. 1.7, 1.8) Modified: stable/10/lib/libc/stdlib/tdelete.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/tdelete.c ============================================================================== --- stable/10/lib/libc/stdlib/tdelete.c Tue Jan 26 04:48:24 2016 (r294761) +++ stable/10/lib/libc/stdlib/tdelete.c Tue Jan 26 04:51:44 2016 (r294762) @@ -1,4 +1,4 @@ -/* $NetBSD: tdelete.c,v 1.2 1999/09/16 11:45:37 lukem Exp $ */ +/* $NetBSD: tdelete.c,v 1.8 2016/01/20 20:47:41 christos Exp $ */ /* * Tree search generalized from Knuth (6.2.2) Algorithm T just like @@ -14,7 +14,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: tdelete.c,v 1.6 2012/06/25 22:32:45 abs Exp $"); +__RCSID("$NetBSD: tdelete.c,v 1.8 2016/01/20 20:47:41 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); @@ -25,9 +25,9 @@ __FBSDID("$FreeBSD$"); /* - * find a node with given key + * delete node with given key * - * vkey: key to be found + * vkey: key to be deleted * vrootp: address of the root of the tree * compar: function to carry out node comparisons */ @@ -65,8 +65,7 @@ tdelete(const void * __restrict vkey, vo q->rlink = (*rootp)->rlink; } } - if (p != *rootp) - free(*rootp); /* D4: Free node */ + free(*rootp); /* D4: Free node */ *rootp = q; /* link parent to new node */ return p; } From owner-svn-src-stable-10@freebsd.org Tue Jan 26 06:05:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DFD8A46820; Tue, 26 Jan 2016 06:05:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 704D0A44; Tue, 26 Jan 2016 06:05:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q65tgD097510; Tue, 26 Jan 2016 06:05:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q65tBa097508; Tue, 26 Jan 2016 06:05:55 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601260605.u0Q65tBa097508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 26 Jan 2016 06:05:55 +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: r294764 - stable/10/sys/amd64/linux 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.20 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, 26 Jan 2016 06:05:56 -0000 Author: dchagin Date: Tue Jan 26 06:05:55 2016 New Revision: 294764 URL: https://svnweb.freebsd.org/changeset/base/294764 Log: MFC r294620: Fix a typo. MFC r294621: Remove obsolete comment. Modified: stable/10/sys/amd64/linux/linux.h stable/10/sys/amd64/linux/linux_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux.h ============================================================================== --- stable/10/sys/amd64/linux/linux.h Tue Jan 26 05:04:36 2016 (r294763) +++ stable/10/sys/amd64/linux/linux.h Tue Jan 26 06:05:55 2016 (r294764) @@ -530,8 +530,8 @@ struct l_pollfd { #define LINUX_ARCH_SET_GS 0x1001 #define LINUX_ARCH_SET_FS 0x1002 -#define LINUX_ARCH_GET_GS 0x1003 -#define LINUX_ARCH_GET_FS 0x1004 +#define LINUX_ARCH_GET_FS 0x1003 +#define LINUX_ARCH_GET_GS 0x1004 #define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r)) Modified: stable/10/sys/amd64/linux/linux_machdep.c ============================================================================== --- stable/10/sys/amd64/linux/linux_machdep.c Tue Jan 26 05:04:36 2016 (r294763) +++ stable/10/sys/amd64/linux/linux_machdep.c Tue Jan 26 06:05:55 2016 (r294764) @@ -383,7 +383,6 @@ linux_sigaltstack(struct thread *td, str return (error); } -/* XXX do all */ int linux_arch_prctl(struct thread *td, struct linux_arch_prctl_args *args) { From owner-svn-src-stable-10@freebsd.org Tue Jan 26 06:37:23 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3705A4740D; Tue, 26 Jan 2016 06:37:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA7A51180; Tue, 26 Jan 2016 06:37:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q6bLng006519; Tue, 26 Jan 2016 06:37:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q6bLRE006518; Tue, 26 Jan 2016 06:37:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601260637.u0Q6bLRE006518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 26 Jan 2016 06:37:21 +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: r294770 - stable/10/tools/build/mk 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.20 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, 26 Jan 2016 06:37:23 -0000 Author: ngie Date: Tue Jan 26 06:37:21 2016 New Revision: 294770 URL: https://svnweb.freebsd.org/changeset/base/294770 Log: MFC r278047: PR: 206622 Sponsored by: EMC / Isilon Storage Division r278047 (by amdmi3): - Remove more files when MK_BSNMP == no Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Jan 26 06:26:56 2016 (r294769) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Jan 26 06:37:21 2016 (r294770) @@ -336,25 +336,44 @@ OLD_FILES+=usr/include/bsnmp/snmpagent.h OLD_FILES+=usr/include/bsnmp/snmpclient.h OLD_FILES+=usr/include/bsnmp/snmpmod.h OLD_FILES+=usr/lib/libbsnmp.a +OLD_FILES+=usr/lib/libbsnmp.so OLD_LIBS+=usr/lib/libbsnmp.so.6 OLD_FILES+=usr/lib/libbsnmp_p.a OLD_FILES+=usr/lib/libbsnmptools.a +OLD_FILES+=usr/lib/libbsnmptools.so OLD_LIBS+=usr/lib/libbsnmptools.so.0 OLD_FILES+=usr/lib/libbsnmptools_p.a +OLD_FILES+=usr/lib/snmp_atm.so OLD_LIBS+=usr/lib/snmp_atm.so.6 +OLD_FILES+=usr/lib/snmp_bridge.so OLD_LIBS+=usr/lib/snmp_bridge.so.6 +OLD_FILES+=usr/lib/snmp_hast.so OLD_LIBS+=usr/lib/snmp_hast.so.6 +OLD_FILES+=usr/lib/snmp_hostres.so OLD_LIBS+=usr/lib/snmp_hostres.so.6 +OLD_FILES+=usr/lib/snmp_lm75.so OLD_LIBS+=usr/lib/snmp_lm75.so.6 +OLD_FILES+=usr/lib/snmp_mibII.so OLD_LIBS+=usr/lib/snmp_mibII.so.6 +OLD_FILES+=usr/lib/snmp_netgraph.so OLD_LIBS+=usr/lib/snmp_netgraph.so.6 +OLD_FILES+=usr/lib/snmp_pf.so OLD_LIBS+=usr/lib/snmp_pf.so.6 +OLD_FILES+=usr/lib/snmp_target.so OLD_LIBS+=usr/lib/snmp_target.so.6 +OLD_FILES+=usr/lib/snmp_usm.so OLD_LIBS+=usr/lib/snmp_usm.so.6 +OLD_FILES+=usr/lib/snmp_vacm.so OLD_LIBS+=usr/lib/snmp_vacm.so.6 +OLD_FILES+=usr/lib/snmp_wlan.so OLD_LIBS+=usr/lib/snmp_wlan.so.6 +OLD_FILES+=usr/lib32/libbsnmp.a +OLD_FILES+=usr/lib32/libbsnmp.so +OLD_LIBS+=usr/lib32/libbsnmp.so.6 +OLD_FILES+=usr/lib32/libbsnmp_p.a OLD_FILES+=usr/sbin/bsnmpd OLD_FILES+=usr/sbin/gensnmptree +OLD_FILES+=usr/share/examples/etc/snmpd.config OLD_FILES+=usr/share/man/man1/bsnmpd.1.gz OLD_FILES+=usr/share/man/man1/bsnmpget.1.gz OLD_FILES+=usr/share/man/man1/bsnmpset.1.gz From owner-svn-src-stable-10@freebsd.org Tue Jan 26 07:06:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32912A461AC; Tue, 26 Jan 2016 07:06:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0151B1F3; Tue, 26 Jan 2016 07:06:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q76c5K015265; Tue, 26 Jan 2016 07:06:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q76cSg015264; Tue, 26 Jan 2016 07:06:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201601260706.u0Q76cSg015264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 26 Jan 2016 07:06:38 +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: r294772 - stable/10/tools/build/mk 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.20 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, 26 Jan 2016 07:06:40 -0000 Author: ngie Date: Tue Jan 26 07:06:38 2016 New Revision: 294772 URL: https://svnweb.freebsd.org/changeset/base/294772 Log: MFC r286652: r286652 (by jmmv): Mark usr/include/c++/v1/tr1 as obsolete The directory usr/include/c++/v1 was marked as obsolete but its tr1 subdir was not, resulting in a removal error in delete-old. Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Jan 26 06:39:11 2016 (r294771) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Tue Jan 26 07:06:38 2016 (r294772) @@ -3504,6 +3504,7 @@ OLD_FILES+=usr/include/c++/v1/unwind.h OLD_FILES+=usr/include/c++/v1/utility OLD_FILES+=usr/include/c++/v1/valarray OLD_FILES+=usr/include/c++/v1/vector +OLD_DIRS+=usr/include/c++/v1/tr1 OLD_DIRS+=usr/include/c++/v1/experimental OLD_DIRS+=usr/include/c++/v1/ext OLD_DIRS+=usr/include/c++/v1 From owner-svn-src-stable-10@freebsd.org Tue Jan 26 08:44:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D4D2A46CDD; Tue, 26 Jan 2016 08:44:03 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 000691A3F; Tue, 26 Jan 2016 08:44:02 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q8i24G044011; Tue, 26 Jan 2016 08:44:02 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q8i1Pn044009; Tue, 26 Jan 2016 08:44:01 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601260844.u0Q8i1Pn044009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 26 Jan 2016 08:44:01 +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: r294779 - stable/10/usr.bin/locate/locate 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.20 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, 26 Jan 2016 08:44:03 -0000 Author: des Date: Tue Jan 26 08:44:01 2016 New Revision: 294779 URL: https://svnweb.freebsd.org/changeset/base/294779 Log: MFH (r290742): don't index /var/db/freebsd-update Modified: stable/10/usr.bin/locate/locate/locate.rc stable/10/usr.bin/locate/locate/updatedb.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/locate/locate/locate.rc ============================================================================== --- stable/10/usr.bin/locate/locate/locate.rc Tue Jan 26 07:57:44 2016 (r294778) +++ stable/10/usr.bin/locate/locate/locate.rc Tue Jan 26 08:44:01 2016 (r294779) @@ -16,7 +16,7 @@ #SEARCHPATHS="/" # paths unwanted in output -#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap" +#PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update" # directories unwanted in output #PRUNEDIRS=".zfs" Modified: stable/10/usr.bin/locate/locate/updatedb.sh ============================================================================== --- stable/10/usr.bin/locate/locate/updatedb.sh Tue Jan 26 07:57:44 2016 (r294778) +++ stable/10/usr.bin/locate/locate/updatedb.sh Tue Jan 26 08:44:01 2016 (r294779) @@ -51,7 +51,7 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; ex : ${mklocatedb:=locate.mklocatedb} # make locate database program : ${FCODES:=/var/db/locate.database} # the database : ${SEARCHPATHS="/"} # directories to be put in the database -: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories +: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /var/db/freebsd-update"} # unwanted directories : ${PRUNEDIRS=".zfs"} # unwanted directories, in any parent : ${FILESYSTEMS="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ From owner-svn-src-stable-10@freebsd.org Tue Jan 26 08:45:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AD21A46DFB; Tue, 26 Jan 2016 08:45:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEB3E1BE7; Tue, 26 Jan 2016 08:45:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q8jJer044108; Tue, 26 Jan 2016 08:45:19 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q8jJqV044107; Tue, 26 Jan 2016 08:45:19 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601260845.u0Q8jJqV044107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 26 Jan 2016 08:45: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: r294780 - stable/10/etc/periodic/daily 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.20 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, 26 Jan 2016 08:45:21 -0000 Author: des Date: Tue Jan 26 08:45:19 2016 New Revision: 294780 URL: https://svnweb.freebsd.org/changeset/base/294780 Log: MFH (r290743): support an exclusion regex, like security/200.chkmounts Modified: stable/10/etc/periodic/daily/400.status-disks Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/periodic/daily/400.status-disks ============================================================================== --- stable/10/etc/periodic/daily/400.status-disks Tue Jan 26 08:44:01 2016 (r294779) +++ stable/10/etc/periodic/daily/400.status-disks Tue Jan 26 08:45:19 2016 (r294780) @@ -16,7 +16,12 @@ case "$daily_status_disks_enable" in echo "" echo "Disk status:" - df $daily_status_disks_df_flags && rc=1 || rc=3 + if [ -n "${daily_status_disks_ignore}" ] ; then + ignore="egrep -v ${daily_status_disks_ignore}" + else + ignore="cat" + fi + (df $daily_status_disks_df_flags | ${ignore}) && rc=1 || rc=3 # display which filesystems need backing up if [ -s /etc/dumpdates ]; then From owner-svn-src-stable-10@freebsd.org Tue Jan 26 08:46:03 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 921E4A46E72; Tue, 26 Jan 2016 08:46:03 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6292C1D34; Tue, 26 Jan 2016 08:46:03 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q8k2Jp044184; Tue, 26 Jan 2016 08:46:02 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q8k2L6044183; Tue, 26 Jan 2016 08:46:02 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601260846.u0Q8k2L6044183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 26 Jan 2016 08:46:02 +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: r294781 - stable/10/lib/libc/stdio 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.20 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, 26 Jan 2016 08:46:03 -0000 Author: des Date: Tue Jan 26 08:46:02 2016 New Revision: 294781 URL: https://svnweb.freebsd.org/changeset/base/294781 Log: MFH (r291197): markup fixes Modified: stable/10/lib/libc/stdio/fopen.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdio/fopen.3 ============================================================================== --- stable/10/lib/libc/stdio/fopen.3 Tue Jan 26 08:45:19 2016 (r294780) +++ stable/10/lib/libc/stdio/fopen.3 Tue Jan 26 08:46:02 2016 (r294781) @@ -120,7 +120,9 @@ This is strictly for compatibility with .St -isoC and has effect only for .Fn fmemopen -; otherwise the ``b'' is ignored. +; otherwise +.Dq Li b +is ignored. .Pp Any created files will have mode .Do Dv S_IRUSR @@ -230,7 +232,9 @@ allocates .Fa size bytes of memory. This buffer is automatically freed when the stream is closed. Buffers can be opened in text-mode (default) or binary-mode -(if ``b'' is present in the second or third position of the +(if +.Dq Li b +is present in the second or third position of the .Fa mode argument). Buffers opened in text-mode make sure that writes are terminated with a NULL byte, if the last write hasn't filled up the whole buffer. Buffers @@ -343,5 +347,7 @@ The function conforms to .St -p1003.1-2008 . -The ``b'' mode does not conform to any standard +The +.Dq Li b +mode does not conform to any standard but is also supported by glibc. From owner-svn-src-stable-10@freebsd.org Tue Jan 26 08:49:45 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9FCDA47045; Tue, 26 Jan 2016 08:49:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8FBC1F3C; Tue, 26 Jan 2016 08:49:45 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q8ni9U044350; Tue, 26 Jan 2016 08:49:44 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q8nikx044349; Tue, 26 Jan 2016 08:49:44 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601260849.u0Q8nikx044349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 26 Jan 2016 08:49: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: r294782 - 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.20 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, 26 Jan 2016 08:49:46 -0000 Author: des Date: Tue Jan 26 08:49:44 2016 New Revision: 294782 URL: https://svnweb.freebsd.org/changeset/base/294782 Log: MFH (r293033): ignore unload unless loaded + add a reload target Modified: stable/10/sys/conf/kmod.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/kmod.mk ============================================================================== --- stable/10/sys/conf/kmod.mk Tue Jan 26 08:46:02 2016 (r294781) +++ stable/10/sys/conf/kmod.mk Tue Jan 26 08:49:44 2016 (r294782) @@ -31,6 +31,9 @@ # MFILES Optionally a list of interfaces used by the module. # This file contains a default list of interfaces. # +# KMODISLOADED Command to check whether a kernel module is +# loaded [/sbin/kldstat -q -n] +# # PROG The name of the kernel module to build. # If not supplied, ${KMOD}.ko is used. # @@ -59,6 +62,9 @@ # unload: # Unload a module. # +# reload: +# Unload if loaded, then load. +# # backwards compat option for older systems. MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} @@ -66,6 +72,7 @@ MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n AWK?= awk KMODLOAD?= /sbin/kldload KMODUNLOAD?= /sbin/kldunload +KMODISLOADED?= /sbin/kldstat -q -n OBJCOPY?= objcopy .if defined(KMODDEPS) @@ -324,7 +331,11 @@ load: ${PROG} .if !target(unload) unload: - ${KMODUNLOAD} -v ${PROG} + if ${KMODISLOADED} ${PROG} ; then ${KMODUNLOAD} -v ${PROG} ; fi +.endif + +.if !target(reload) +reload: unload load .endif .if defined(KERNBUILDDIR) From owner-svn-src-stable-10@freebsd.org Tue Jan 26 08:55:33 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A8EA473B0; Tue, 26 Jan 2016 08:55:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55C38650; Tue, 26 Jan 2016 08:55:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q8tWCT047205; Tue, 26 Jan 2016 08:55:32 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q8tVCX047200; Tue, 26 Jan 2016 08:55:31 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601260855.u0Q8tVCX047200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 26 Jan 2016 08:55:31 +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: r294783 - in stable/10: share/man/man4 sys/dev/syscons/plasma sys/modules/syscons sys/modules/syscons/plasma 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.20 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, 26 Jan 2016 08:55:33 -0000 Author: des Date: Tue Jan 26 08:55:31 2016 New Revision: 294783 URL: https://svnweb.freebsd.org/changeset/base/294783 Log: MFH (r293034, r29304): plasma screensaver Added: stable/10/sys/dev/syscons/plasma/ - copied from r293034, head/sys/dev/syscons/plasma/ stable/10/sys/modules/syscons/plasma/ - copied from r293034, head/sys/modules/syscons/plasma/ Modified: stable/10/share/man/man4/splash.4 stable/10/sys/dev/syscons/plasma/fp16.c stable/10/sys/dev/syscons/plasma/fp16.h stable/10/sys/dev/syscons/plasma/plasma_saver.c stable/10/sys/modules/syscons/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/splash.4 ============================================================================== --- stable/10/share/man/man4/splash.4 Tue Jan 26 08:49:44 2016 (r294782) +++ stable/10/share/man/man4/splash.4 Tue Jan 26 08:55:31 2016 (r294783) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2010 +.Dd December 31, 2015 .Dt SPLASH 4 .Os .Sh NAME @@ -130,6 +130,8 @@ the screen will also be powered off. Animated graphical .Fx logo. +.It Pa plasma_saver.ko +Draws an animated interference pattern. .It Pa rain_saver.ko Draws a shower on the screen. .It Pa snake_saver.ko @@ -282,6 +284,14 @@ based on the code, with some additional inspiration from the .Pa daemon_saver code. +The +.Pa logo_saver , +.Pa plasma_saver , +.Pa rain_saver +and +.Pa warp_saver +modules were written by +.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . .Sh CAVEATS Both the splash screen and the screen saver work with .Xr syscons 4 Modified: stable/10/sys/dev/syscons/plasma/fp16.c ============================================================================== --- head/sys/dev/syscons/plasma/fp16.c Fri Jan 1 04:04:40 2016 (r293034) +++ stable/10/sys/dev/syscons/plasma/fp16.c Tue Jan 26 08:55:31 2016 (r294783) @@ -71,42 +71,66 @@ fp16_sqrt(fp16_t x) return (y); } -static fp16_t fp16_cos_table[256] = { - 65536, 65534, 65531, 65524, 65516, 65505, 65491, 65475, - 65457, 65436, 65412, 65386, 65358, 65327, 65294, 65258, - 65220, 65179, 65136, 65091, 65043, 64992, 64939, 64884, - 64826, 64766, 64703, 64638, 64571, 64501, 64428, 64353, - 64276, 64197, 64115, 64030, 63943, 63854, 63762, 63668, - 63571, 63473, 63371, 63268, 63162, 63053, 62942, 62829, - 62714, 62596, 62475, 62353, 62228, 62100, 61971, 61839, - 61705, 61568, 61429, 61288, 61144, 60998, 60850, 60700, - 60547, 60392, 60235, 60075, 59913, 59749, 59583, 59414, - 59243, 59070, 58895, 58718, 58538, 58356, 58172, 57986, - 57797, 57606, 57414, 57219, 57022, 56822, 56621, 56417, - 56212, 56004, 55794, 55582, 55368, 55152, 54933, 54713, - 54491, 54266, 54040, 53811, 53581, 53348, 53114, 52877, - 52639, 52398, 52155, 51911, 51665, 51416, 51166, 50914, - 50660, 50403, 50146, 49886, 49624, 49360, 49095, 48828, - 48558, 48288, 48015, 47740, 47464, 47186, 46906, 46624, - 46340, 46055, 45768, 45480, 45189, 44897, 44603, 44308, - 44011, 43712, 43412, 43110, 42806, 42501, 42194, 41885, - 41575, 41263, 40950, 40636, 40319, 40002, 39682, 39362, - 39039, 38716, 38390, 38064, 37736, 37406, 37075, 36743, - 36409, 36074, 35738, 35400, 35061, 34721, 34379, 34036, - 33692, 33346, 32999, 32651, 32302, 31952, 31600, 31247, - 30893, 30538, 30181, 29824, 29465, 29105, 28745, 28383, - 28020, 27656, 27291, 26925, 26557, 26189, 25820, 25450, - 25079, 24707, 24334, 23960, 23586, 23210, 22833, 22456, - 22078, 21699, 21319, 20938, 20557, 20175, 19792, 19408, - 19024, 18638, 18253, 17866, 17479, 17091, 16702, 16313, - 15923, 15533, 15142, 14751, 14359, 13966, 13573, 13179, - 12785, 12390, 11995, 11600, 11204, 10807, 10410, 10013, - 9616, 9218, 8819, 8421, 8022, 7623, 7223, 6823, - 6423, 6023, 5622, 5222, 4821, 4420, 4018, 3617, - 3215, 2814, 2412, 2010, 1608, 1206, 804, 402, +static fp16_t fp16_sin_table[256] = { + 0, 402, 804, 1206, 1608, 2010, 2412, 2814, + 3215, 3617, 4018, 4420, 4821, 5222, 5622, 6023, + 6423, 6823, 7223, 7623, 8022, 8421, 8819, 9218, + 9616, 10013, 10410, 10807, 11204, 11600, 11995, 12390, + 12785, 13179, 13573, 13966, 14359, 14751, 15142, 15533, + 15923, 16313, 16702, 17091, 17479, 17866, 18253, 18638, + 19024, 19408, 19792, 20175, 20557, 20938, 21319, 21699, + 22078, 22456, 22833, 23210, 23586, 23960, 24334, 24707, + 25079, 25450, 25820, 26189, 26557, 26925, 27291, 27656, + 28020, 28383, 28745, 29105, 29465, 29824, 30181, 30538, + 30893, 31247, 31600, 31952, 32302, 32651, 32999, 33346, + 33692, 34036, 34379, 34721, 35061, 35400, 35738, 36074, + 36409, 36743, 37075, 37406, 37736, 38064, 38390, 38716, + 39039, 39362, 39682, 40002, 40319, 40636, 40950, 41263, + 41575, 41885, 42194, 42501, 42806, 43110, 43412, 43712, + 44011, 44308, 44603, 44897, 45189, 45480, 45768, 46055, + 46340, 46624, 46906, 47186, 47464, 47740, 48015, 48288, + 48558, 48828, 49095, 49360, 49624, 49886, 50146, 50403, + 50660, 50914, 51166, 51416, 51665, 51911, 52155, 52398, + 52639, 52877, 53114, 53348, 53581, 53811, 54040, 54266, + 54491, 54713, 54933, 55152, 55368, 55582, 55794, 56004, + 56212, 56417, 56621, 56822, 57022, 57219, 57414, 57606, + 57797, 57986, 58172, 58356, 58538, 58718, 58895, 59070, + 59243, 59414, 59583, 59749, 59913, 60075, 60235, 60392, + 60547, 60700, 60850, 60998, 61144, 61288, 61429, 61568, + 61705, 61839, 61971, 62100, 62228, 62353, 62475, 62596, + 62714, 62829, 62942, 63053, 63162, 63268, 63371, 63473, + 63571, 63668, 63762, 63854, 63943, 64030, 64115, 64197, + 64276, 64353, 64428, 64501, 64571, 64638, 64703, 64766, + 64826, 64884, 64939, 64992, 65043, 65091, 65136, 65179, + 65220, 65258, 65294, 65327, 65358, 65386, 65412, 65436, + 65457, 65475, 65491, 65505, 65516, 65524, 65531, 65534, }; /* + * Compute the sine of theta. + */ +fp16_t +fp16_sin(fp16_t theta) +{ + unsigned int i; + + i = 1024 * (theta % FP16_2PI) / FP16_2PI; + switch (i / 256) { + case 0: + return (fp16_sin_table[i % 256]); + case 1: + return (fp16_sin_table[255 - i % 256]); + case 2: + return (-fp16_sin_table[i % 256]); + case 3: + return (-fp16_sin_table[255 - i % 256]); + default: + /* inconceivable! */ + return (0); + } +} + +/* * Compute the cosine of theta. */ fp16_t @@ -117,13 +141,13 @@ fp16_cos(fp16_t theta) i = 1024 * (theta % FP16_2PI) / FP16_2PI; switch (i / 256) { case 0: - return (fp16_cos_table[i % 256]); + return (fp16_sin_table[255 - i % 256]); case 1: - return (-fp16_cos_table[255 - i % 256]); + return (-fp16_sin_table[i % 256]); case 2: - return (-fp16_cos_table[i % 256]); + return (-fp16_sin_table[255 - i % 256]); case 3: - return (fp16_cos_table[255 - i % 256]); + return (fp16_sin_table[i % 256]); default: /* inconceivable! */ return (0); Modified: stable/10/sys/dev/syscons/plasma/fp16.h ============================================================================== --- head/sys/dev/syscons/plasma/fp16.h Fri Jan 1 04:04:40 2016 (r293034) +++ stable/10/sys/dev/syscons/plasma/fp16.h Tue Jan 26 08:55:31 2016 (r294783) @@ -78,7 +78,8 @@ fp16_t fp16_sqrt(fp16_t); #define FP16_PI_2 102943 #define FP16_PI_4 51471 -/* cosine */ +/* sine and cosine */ +fp16_t fp16_sin(fp16_t); fp16_t fp16_cos(fp16_t); #endif Modified: stable/10/sys/dev/syscons/plasma/plasma_saver.c ============================================================================== --- head/sys/dev/syscons/plasma/plasma_saver.c Fri Jan 1 04:04:40 2016 (r293034) +++ stable/10/sys/dev/syscons/plasma/plasma_saver.c Tue Jan 26 08:55:31 2016 (r294783) @@ -104,7 +104,7 @@ plasma_update(video_adapter_t *adp) sqd = ItoFP16(dx * dx + dy * dy); d = fp16_sqrt(sqd); /* divide by 4 to stretch out the pattern */ - m = fp16_add(m, fp16_cos(d / 4)); + m = fp16_sub(m, fp16_cos(d / 4)); } /* * m is now in the range +/- FOCI, but we need a Modified: stable/10/sys/modules/syscons/Makefile ============================================================================== --- stable/10/sys/modules/syscons/Makefile Tue Jan 26 08:49:44 2016 (r294782) +++ stable/10/sys/modules/syscons/Makefile Tue Jan 26 08:55:31 2016 (r294783) @@ -9,6 +9,7 @@ SUBDIR= ${_apm} \ ${_fire} \ green \ ${_logo} \ + ${_plasma} \ ${_rain} \ ${_snake} \ ${_star} \ @@ -25,6 +26,7 @@ _daemon= daemon _dragon= dragon _fire= fire _logo= logo +_plasma= plasma _rain= rain _snake= snake _star= star From owner-svn-src-stable-10@freebsd.org Tue Jan 26 08:57:47 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11F14A4744E; Tue, 26 Jan 2016 08:57:47 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7F50807; Tue, 26 Jan 2016 08:57:46 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q8vjVD047339; Tue, 26 Jan 2016 08:57:45 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q8vj7U047338; Tue, 26 Jan 2016 08:57:45 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601260857.u0Q8vj7U047338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 26 Jan 2016 08:57: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: r294784 - stable/10/etc 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.20 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, 26 Jan 2016 08:57:47 -0000 Author: des Date: Tue Jan 26 08:57:45 2016 New Revision: 294784 URL: https://svnweb.freebsd.org/changeset/base/294784 Log: MFH (r290006): loading rc.subr and rc.conf has no effect here Modified: stable/10/etc/netstart Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/netstart ============================================================================== --- stable/10/etc/netstart Tue Jan 26 08:55:31 2016 (r294783) +++ stable/10/etc/netstart Tue Jan 26 08:57:45 2016 (r294784) @@ -34,9 +34,6 @@ # the network by hand, this script will do it for you). # -. /etc/rc.subr - -load_rc_config 'XXX' _start=quietstart /etc/rc.d/devd ${_start} From owner-svn-src-stable-10@freebsd.org Tue Jan 26 08:59:01 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35ACAA474C1; Tue, 26 Jan 2016 08:59:01 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 065B7949; Tue, 26 Jan 2016 08:59:00 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q8x0fG047433; Tue, 26 Jan 2016 08:59:00 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q8wxEb047429; Tue, 26 Jan 2016 08:58:59 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601260858.u0Q8wxEb047429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 26 Jan 2016 08:58:59 +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: r294785 - in stable/10/etc: . rc.d 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.20 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, 26 Jan 2016 08:59:01 -0000 Author: des Date: Tue Jan 26 08:58:59 2016 New Revision: 294785 URL: https://svnweb.freebsd.org/changeset/base/294785 Log: MFH (r290008): load_rc_config no longer requires a service name Modified: stable/10/etc/rc.d/othermta stable/10/etc/rc.shutdown Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/othermta ============================================================================== --- stable/10/etc/rc.d/othermta Tue Jan 26 08:57:45 2016 (r294784) +++ stable/10/etc/rc.d/othermta Tue Jan 26 08:58:59 2016 (r294785) @@ -10,7 +10,7 @@ # . /etc/rc.subr -load_rc_config 'XXX' +load_rc_config if [ -n "${mta_start_script}" ]; then [ "${mta_start_script}" != "/etc/rc.sendmail" ] && \ Modified: stable/10/etc/rc.shutdown ============================================================================== --- stable/10/etc/rc.shutdown Tue Jan 26 08:57:45 2016 (r294784) +++ stable/10/etc/rc.shutdown Tue Jan 26 08:58:59 2016 (r294785) @@ -45,7 +45,7 @@ export HOME PATH . /etc/rc.subr -load_rc_config 'XXX' +load_rc_config # reverse_list list # print the list in reverse order From owner-svn-src-stable-10@freebsd.org Tue Jan 26 09:02:24 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF516A47826; Tue, 26 Jan 2016 09:02:24 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC3A2CB4; Tue, 26 Jan 2016 09:02:24 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q92NO3050181; Tue, 26 Jan 2016 09:02:23 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q92NNe050180; Tue, 26 Jan 2016 09:02:23 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601260902.u0Q92NNe050180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 26 Jan 2016 09:02:23 +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: r294786 - stable/10/etc/rc.d 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.20 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, 26 Jan 2016 09:02:25 -0000 Author: des Date: Tue Jan 26 09:02:23 2016 New Revision: 294786 URL: https://svnweb.freebsd.org/changeset/base/294786 Log: MFH (r277706): allow the user to specify the location of control.conf Modified: stable/10/etc/rc.d/local_unbound Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/local_unbound ============================================================================== --- stable/10/etc/rc.d/local_unbound Tue Jan 26 08:58:59 2016 (r294785) +++ stable/10/etc/rc.d/local_unbound Tue Jan 26 09:02:23 2016 (r294786) @@ -30,6 +30,7 @@ load_rc_config $name : ${local_unbound_config:=${local_unbound_workdir}/unbound.conf} : ${local_unbound_flags:="-c ${local_unbound_config}"} : ${local_unbound_forwardconf:=${local_unbound_workdir}/forward.conf} +: ${local_unbound_controlconf:=${local_unbound_workdir}/control.conf} : ${local_unbound_anchor:=${local_unbound_workdir}/root.key} : ${local_unbound_forwarders:=} @@ -68,6 +69,7 @@ local_unbound_setup() -w ${local_unbound_workdir} \ -c ${local_unbound_config} \ -f ${local_unbound_forwardconf} \ + -o ${local_unbound_controlconf} \ -a ${local_unbound_anchor} \ ${local_unbound_forwarders} } From owner-svn-src-stable-10@freebsd.org Tue Jan 26 09:09:21 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D677AA47C4E; Tue, 26 Jan 2016 09:09:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3E16F89; Tue, 26 Jan 2016 09:09:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q99K4e050478; Tue, 26 Jan 2016 09:09:20 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q99KL6050477; Tue, 26 Jan 2016 09:09:20 GMT (envelope-from des@FreeBSD.org) Message-Id: <201601260909.u0Q99KL6050477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Tue, 26 Jan 2016 09:09:20 +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: r294787 - in stable/10/usr.sbin: . vigr 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.20 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, 26 Jan 2016 09:09:21 -0000 Author: des Date: Tue Jan 26 09:09:20 2016 New Revision: 294787 URL: https://svnweb.freebsd.org/changeset/base/294787 Log: MFH (r275765): add a vigr(8) tool to mirror vipw(8) Added: stable/10/usr.sbin/vigr/ - copied from r275768, head/usr.sbin/vigr/ Modified: stable/10/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Tue Jan 26 09:02:23 2016 (r294786) +++ stable/10/usr.sbin/Makefile Tue Jan 26 09:09:20 2016 (r294787) @@ -90,6 +90,7 @@ SUBDIR= adduser \ tzsetup \ uefisign \ ugidfw \ + vigr \ vipw \ wake \ watch \ From owner-svn-src-stable-10@freebsd.org Tue Jan 26 09:50:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4E00A46629; Tue, 26 Jan 2016 09:50:37 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 AB93F258; Tue, 26 Jan 2016 09:50:37 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0Q9oajw063446; Tue, 26 Jan 2016 09:50:36 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0Q9oaZV063199; Tue, 26 Jan 2016 09:50:36 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201601260950.u0Q9oaZV063199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Tue, 26 Jan 2016 09:50:36 +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: r294790 - stable/10/usr.sbin/bhyvectl 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.20 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, 26 Jan 2016 09:50:38 -0000 Author: brueffer Date: Tue Jan 26 09:50:36 2016 New Revision: 294790 URL: https://svnweb.freebsd.org/changeset/base/294790 Log: MFH: r293745 Add a basic bhyvectl manpage. Added: stable/10/usr.sbin/bhyvectl/bhyvectl.8 - copied unchanged from r293745, head/usr.sbin/bhyvectl/bhyvectl.8 Modified: stable/10/usr.sbin/bhyvectl/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyvectl/Makefile ============================================================================== --- stable/10/usr.sbin/bhyvectl/Makefile Tue Jan 26 09:50:23 2016 (r294789) +++ stable/10/usr.sbin/bhyvectl/Makefile Tue Jan 26 09:50:36 2016 (r294790) @@ -5,7 +5,7 @@ PROG= bhyvectl SRCS= bhyvectl.c -MAN= +MAN= bhyvectl.8 DPADD= ${LIBVMMAPI} ${LIBUTIL} LDADD= -lvmmapi -lutil Copied: stable/10/usr.sbin/bhyvectl/bhyvectl.8 (from r293745, head/usr.sbin/bhyvectl/bhyvectl.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyvectl/bhyvectl.8 Tue Jan 26 09:50:36 2016 (r294790, copy of r293745, head/usr.sbin/bhyvectl/bhyvectl.8) @@ -0,0 +1,97 @@ +.\" Copyright (c) 2015 Christian Brueffer +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 12, 2016 +.Dt BHYVECTL 8 +.Os +.Sh NAME +.Nm bhyvectl +.Nd "control utility for bhyve instances" +.Sh SYNOPSIS +.Nm +.Fl -vm= Ns Ar +.Op Fl -create +.Op Fl -destroy +.Op Fl -get-stats +.Op Fl -inject-nmi +.Op Fl -force-reset +.Op Fl -force-poweroff +.Sh DESCRIPTION +The +.Nm +command is a control utility for active +.Xr bhyve 8 +virtual machine instances. +.Pp +.Em Note : +Most +.Nm +flags are intended for querying and setting the state of an active instance. +These commands are intended for development purposes, and are not documented here. +A complete list can be obtained by executing +.Nm +without any arguments. +.Pp +The user-facing options are as follows: +.Bl -tag -width ".Fl d Ar argument" +.It Fl -vm= Ns Ar +Operate on the virtual machine +.Ar . +.It Fl -create +Create the specified VM. +.It Fl -destroy +Destroy the specified VM. +.It Fl -get-state +Retrieve statistics for the specified VM. +.It Fl -inject-nmi +Inject a non-maskable interrupt (NMI) into the VM. +.It Fl -force-reset +Force the VM to reset. +.It Fl -force-poweroff +Force the VM to power off. +.El +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +Destroy the VM called fbsd10: +.Pp +.Dl "bhyvectl --vm=fbsd10 --destroy" +.Sh SEE ALSO +.Xr bhyve 8 , +.Xr bhyveload 8 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 10.1 . +.Sh AUTHORS +.An -nosplit +The +.Nm +utility was written by +.An Peter Grehan +and +.An Neel Natu . From owner-svn-src-stable-10@freebsd.org Tue Jan 26 17:00:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE41CA6EFA4; Tue, 26 Jan 2016 17:00:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC3FA4D; Tue, 26 Jan 2016 17:00:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QH0Vgn089477; Tue, 26 Jan 2016 17:00:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QH0V0Z089475; Tue, 26 Jan 2016 17:00:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601261700.u0QH0V0Z089475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 26 Jan 2016 17:00:31 +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: r294843 - 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.20 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, 26 Jan 2016 17:00:32 -0000 Author: asomers Date: Tue Jan 26 17:00:31 2016 New Revision: 294843 URL: https://svnweb.freebsd.org/changeset/base/294843 Log: MFC r292066, r292069, r293708, r294027, and r294358, mostly to vdev_geom.c r292066 | asomers | 2015-12-10 14:46:21 -0700 (Thu, 10 Dec 2015) | 25 lines During vdev_geom_open, require that the vdev guids match the device's label except during split, add, or create operations. This fixes a bug where the wrong disk could be returned, and higher layers of ZFS would immediately eject it again. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c: o When opening by GUID, require both the pool and vdev GUIDs to match. While it is highly unlikely for two vdevs to have the same vdev GUIDs, the ZFS storage pool allocator only guarantees they are unique within a pool. o Modify the open behavior to: - If we are opening a vdev that hasn't previously been opened, open by path without checking GUIDs. - Otherwise, open by path and verify GUIDs. - If that fails, search all geom providers for a device with matching GUIDs. - If that fails, return ENOENT. r292069 | asomers | 2015-12-10 17:04:13 -0700 (Thu, 10 Dec 2015) | 6 lines Change an important error message from ZFS_LOG to printf r293708 | asomers | 2016-01-11 15:15:46 -0700 (Mon, 11 Jan 2016) | 16 lines Fix importing l2arc device by guid After r292066, vdev_geom verifies both the vdev and pool guids of device labels during open. However, spare and l2arc devices don't have pool guids, so opening them by guid will fail (opening by path, when the pathname is known, still succeeds). This change allows a vdev to be opened by guid if the label contains no pool_guid, which is the case for inactive spares and l2arc devices. r294027 | asomers | 2016-01-14 11:19:05 -0700 (Thu, 14 Jan 2016) | 14 lines Fix race condition involving ZFS remove events When a ZFS drive disappears, ZFS sends a resource.fs.zfs.removed event to userland. A userland program like zfsd(8) can use that event, for example to activate a hotspare. The current code contains a race condition: vdev_geom will sent the sysevent _before_ spa.c would update the vdev's status, causing userland processes to see pool state that does not reflect the device removal. This change moves the sysevent to spa.c, closing the race. r294358 | asomers | 2016-01-19 16:16:24 -0700 (Tue, 19 Jan 2016) | 10 lines Quell harmless CID about unchecked return value in nvlist_get_guids. The return value doesn't need to be checked, because nvlist_get_guid's callers check the returned values of the guids. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 26 16:50:59 2016 (r294842) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 26 17:00:31 2016 (r294843) @@ -5951,6 +5951,8 @@ spa_async_remove(spa_t *spa, vdev_t *vd) vd->vdev_stat.vs_checksum_errors = 0; vdev_state_dirty(vd->vdev_top); + /* Tell userspace that the vdev is gone. */ + zfs_post_remove(spa, vd); } for (int c = 0; c < vd->vdev_children; c++) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Jan 26 16:50:59 2016 (r294842) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Jan 26 17:00:31 2016 (r294843) @@ -116,7 +116,6 @@ vdev_geom_orphan(struct g_consumer *cp) * async removal support to invoke a close on this * vdev once it is safe to do so. */ - zfs_post_remove(vd->vdev_spa, vd); vd->vdev_remove_wanted = B_TRUE; spa_async_request(vd->vdev_spa, SPA_ASYNC_REMOVE); } @@ -208,14 +207,12 @@ vdev_geom_detach(void *arg, int flag __u } } -static uint64_t -nvlist_get_guid(nvlist_t *list) +static void +nvlist_get_guids(nvlist_t *list, uint64_t *pguid, uint64_t *vguid) { - uint64_t value; - value = 0; - nvlist_lookup_uint64(list, ZPOOL_CONFIG_GUID, &value); - return (value); + (void) nvlist_lookup_uint64(list, ZPOOL_CONFIG_GUID, vguid); + (void) nvlist_lookup_uint64(list, ZPOOL_CONFIG_POOL_GUID, pguid); } static int @@ -270,7 +267,7 @@ vdev_geom_read_config(struct g_consumer size_t buflen; uint64_t psize; off_t offset, size; - uint64_t guid, state, txg; + uint64_t state, txg; int error, l, len; g_topology_assert_not(); @@ -284,7 +281,6 @@ vdev_geom_read_config(struct g_consumer size = sizeof(*label) + pp->sectorsize - ((sizeof(*label) - 1) % pp->sectorsize) - 1; - guid = 0; label = kmem_alloc(size, KM_SLEEP); buflen = sizeof(label->vl_vdev_phys.vp_nvlist); @@ -479,30 +475,29 @@ vdev_geom_read_pool_label(const char *na return (*count > 0 ? 0 : ENOENT); } -static uint64_t -vdev_geom_read_guid(struct g_consumer *cp) +static void +vdev_geom_read_guids(struct g_consumer *cp, uint64_t *pguid, uint64_t *vguid) { nvlist_t *config; - uint64_t guid; g_topology_assert_not(); - guid = 0; + *pguid = 0; + *vguid = 0; if (vdev_geom_read_config(cp, &config) == 0) { - guid = nvlist_get_guid(config); + nvlist_get_guids(config, pguid, vguid); nvlist_free(config); } - return (guid); } static struct g_consumer * -vdev_geom_attach_by_guid(uint64_t guid) +vdev_geom_attach_by_guids(uint64_t pool_guid, uint64_t vdev_guid) { struct g_class *mp; struct g_geom *gp, *zgp; struct g_provider *pp; struct g_consumer *cp, *zcp; - uint64_t pguid; + uint64_t pguid, vguid; g_topology_assert(); @@ -522,15 +517,24 @@ vdev_geom_attach_by_guid(uint64_t guid) if (vdev_geom_attach_taster(zcp, pp) != 0) continue; g_topology_unlock(); - pguid = vdev_geom_read_guid(zcp); + vdev_geom_read_guids(zcp, &pguid, &vguid); g_topology_lock(); vdev_geom_detach_taster(zcp); - if (pguid != guid) + /* + * Check that the label's vdev guid matches the + * desired guid. If the label has a pool guid, + * check that it matches too. (Inactive spares + * and L2ARCs do not have any pool guid in the + * label.) + */ + if ((pguid != 0 && + pguid != pool_guid) || + vguid != vdev_guid) continue; cp = vdev_geom_attach(pp); if (cp == NULL) { - printf("ZFS WARNING: Unable to attach to %s.\n", - pp->name); + printf("ZFS WARNING: Unable to " + "attach to %s.\n", pp->name); continue; } break; @@ -548,7 +552,7 @@ end: } static struct g_consumer * -vdev_geom_open_by_guid(vdev_t *vd) +vdev_geom_open_by_guids(vdev_t *vd) { struct g_consumer *cp; char *buf; @@ -557,7 +561,7 @@ vdev_geom_open_by_guid(vdev_t *vd) g_topology_assert(); ZFS_LOG(1, "Searching by guid [%ju].", (uintmax_t)vd->vdev_guid); - cp = vdev_geom_attach_by_guid(vd->vdev_guid); + cp = vdev_geom_attach_by_guids(spa_guid(vd->vdev_spa), vd->vdev_guid); if (cp != NULL) { len = strlen(cp->provider->name) + strlen("/dev/") + 1; buf = kmem_alloc(len, KM_SLEEP); @@ -566,10 +570,12 @@ vdev_geom_open_by_guid(vdev_t *vd) spa_strfree(vd->vdev_path); vd->vdev_path = buf; - ZFS_LOG(1, "Attach by guid [%ju] succeeded, provider %s.", + ZFS_LOG(1, "Attach by guid [%ju:%ju] succeeded, provider %s.", + (uintmax_t)spa_guid(vd->vdev_spa), (uintmax_t)vd->vdev_guid, vd->vdev_path); } else { - ZFS_LOG(1, "Search by guid [%ju] failed.", + ZFS_LOG(1, "Search by guid [%ju:%ju] failed.", + (uintmax_t)spa_guid(vd->vdev_spa), (uintmax_t)vd->vdev_guid); } @@ -581,7 +587,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c { struct g_provider *pp; struct g_consumer *cp; - uint64_t guid; + uint64_t pguid, vguid; g_topology_assert(); @@ -593,14 +599,17 @@ vdev_geom_open_by_path(vdev_t *vd, int c if (cp != NULL && check_guid && ISP2(pp->sectorsize) && pp->sectorsize <= VDEV_PAD_SIZE) { g_topology_unlock(); - guid = vdev_geom_read_guid(cp); + vdev_geom_read_guids(cp, &pguid, &vguid); g_topology_lock(); - if (guid != vd->vdev_guid) { + if (pguid != spa_guid(vd->vdev_spa) || + vguid != vd->vdev_guid) { vdev_geom_detach(cp, 0); cp = NULL; ZFS_LOG(1, "guid mismatch for provider %s: " - "%ju != %ju.", vd->vdev_path, - (uintmax_t)vd->vdev_guid, (uintmax_t)guid); + "%ju:%ju != %ju:%ju.", vd->vdev_path, + (uintmax_t)spa_guid(vd->vdev_spa), + (uintmax_t)vd->vdev_guid, + (uintmax_t)pguid, (uintmax_t)vguid); } else { ZFS_LOG(1, "guid match for provider %s.", vd->vdev_path); @@ -634,23 +643,38 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi g_topology_lock(); error = 0; - /* - * If we're creating or splitting a pool, just find the GEOM provider - * by its name and ignore GUID mismatches. - */ - if (vd->vdev_spa->spa_load_state == SPA_LOAD_NONE || - vd->vdev_spa->spa_splitting_newspa == B_TRUE) + if (vd->vdev_spa->spa_splitting_newspa || + (vd->vdev_prevstate == VDEV_STATE_UNKNOWN && + vd->vdev_spa->spa_load_state == SPA_LOAD_NONE)) { + /* + * We are dealing with a vdev that hasn't been previously + * opened (since boot), and we are not loading an + * existing pool configuration. This looks like a + * vdev add operation to a new or existing pool. + * Assume the user knows what he/she is doing and find + * GEOM provider by its name, ignoring GUID mismatches. + * + * XXPOLICY: It would be safer to only allow a device + * that is unlabeled or labeled but missing + * GUID information to be opened in this fashion, + * unless we are doing a split, in which case we + * should allow any guid. + */ cp = vdev_geom_open_by_path(vd, 0); - else { + } else { + /* + * Try using the recorded path for this device, but only + * accept it if its label data contains the expected GUIDs. + */ cp = vdev_geom_open_by_path(vd, 1); if (cp == NULL) { /* * The device at vd->vdev_path doesn't have the - * expected guid. The disks might have merely + * expected GUIDs. The disks might have merely * moved around so try all other GEOM providers - * to find one with the right guid. + * to find one with the right GUIDs. */ - cp = vdev_geom_open_by_guid(vd); + cp = vdev_geom_open_by_guids(vd); } } From owner-svn-src-stable-10@freebsd.org Tue Jan 26 20:45:42 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73622A6EAB0; Tue, 26 Jan 2016 20:45:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 412BB7B5; Tue, 26 Jan 2016 20:45:42 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QKjfQB059676; Tue, 26 Jan 2016 20:45:41 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QKjfvd059675; Tue, 26 Jan 2016 20:45:41 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201601262045.u0QKjfvd059675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 26 Jan 2016 20:45:41 +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: r294850 - stable/10/usr.bin/truncate/tests 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.20 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, 26 Jan 2016 20:45:42 -0000 Author: asomers Date: Tue Jan 26 20:45:41 2016 New Revision: 294850 URL: https://svnweb.freebsd.org/changeset/base/294850 Log: MFC r294347 Fix usr.bin.truncate.truncate_test.bad_truncate with ZFS /tmp. The bad_truncate test sets the uimmutable flag to produce an error in truncate, but that flag isn't supported by ZFS. If /tmp is on a ZFS filesystem, the test will fail. Change it to use readonly permissions and an unpriveleged user instead. Modified: stable/10/usr.bin/truncate/tests/truncate_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/truncate/tests/truncate_test.sh ============================================================================== --- stable/10/usr.bin/truncate/tests/truncate_test.sh Tue Jan 26 19:07:09 2016 (r294849) +++ stable/10/usr.bin/truncate/tests/truncate_test.sh Tue Jan 26 20:45:41 2016 (r294850) @@ -173,26 +173,23 @@ bad_refer_body() [ ! -e afile ] || atf_fail "afile should not exist" } -atf_test_case bad_truncate cleanup +atf_test_case bad_truncate bad_truncate_head() { atf_set "descr" "Verifies that truncate reports an error during" \ "truncation" + atf_set "require.user" "unprivileged" } bad_truncate_body() { - create_stderr_file "truncate: exists.txt: Operation not permitted" + create_stderr_file "truncate: exists.txt: Permission denied" # Trying to get the ftruncate() call to return -1. > exists.txt - atf_check chflags uimmutable exists.txt + atf_check chmod 444 exists.txt atf_check -s not-exit:0 -e file:stderr.txt truncate -s1 exists.txt } -bad_truncate_cleanup() -{ - chflags 0 exists.txt -} atf_test_case new_absolute_grow new_absolute_grow_head() From owner-svn-src-stable-10@freebsd.org Tue Jan 26 21:35:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98FEDA6FC83; Tue, 26 Jan 2016 21:35:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 502BC175A; Tue, 26 Jan 2016 21:35:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QLZl2i075102; Tue, 26 Jan 2016 21:35:47 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QLZlDn075100; Tue, 26 Jan 2016 21:35:47 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201601262135.u0QLZlDn075100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 26 Jan 2016 21:35:47 +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: r294852 - in stable: 10/sys/boot/i386/libi386 9/sys/boot/i386/libi386 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.20 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, 26 Jan 2016 21:35:48 -0000 Author: jkim Date: Tue Jan 26 21:35:47 2016 New Revision: 294852 URL: https://svnweb.freebsd.org/changeset/base/294852 Log: MFC: r256940 Allow users to set UUID in network byte order regardless of SMBIOS version. Modified: stable/10/sys/boot/i386/libi386/Makefile stable/10/sys/boot/i386/libi386/smbios.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/boot/i386/libi386/Makefile stable/9/sys/boot/i386/libi386/smbios.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/10/sys/boot/i386/libi386/Makefile ============================================================================== --- stable/10/sys/boot/i386/libi386/Makefile Tue Jan 26 21:24:49 2016 (r294851) +++ stable/10/sys/boot/i386/libi386/Makefile Tue Jan 26 21:35:47 2016 (r294852) @@ -36,6 +36,9 @@ CFLAGS+= -DSMBIOS_SERIAL_NUMBERS .if defined(BOOT_LITTLE_ENDIAN_UUID) # Use little-endian UUID format as defined in SMBIOS 2.6. CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID +.elif defined(BOOT_NETWORK_ENDIAN_UUID) +# Use network-endian UUID format for backward compatibility. +CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID .endif .endif Modified: stable/10/sys/boot/i386/libi386/smbios.c ============================================================================== --- stable/10/sys/boot/i386/libi386/smbios.c Tue Jan 26 21:24:49 2016 (r294851) +++ stable/10/sys/boot/i386/libi386/smbios.c Tue Jan 26 21:35:47 2016 (r294852) @@ -152,7 +152,7 @@ static void smbios_setuuid(const char *name, const caddr_t addr, const int ver) { char uuid[37]; - int i, ones, zeros; + int byteorder, i, ones, zeros; UUID_TYPE n; uint32_t f1; uint16_t f2, f3; @@ -182,14 +182,18 @@ smbios_setuuid(const char *name, const c * Note: We use network byte order for backward compatibility * unless SMBIOS version is 2.6+ or little-endian is forced. */ -#ifndef SMBIOS_LITTLE_ENDIAN_UUID - if (ver < 0x0206) { +#if defined(SMBIOS_LITTLE_ENDIAN_UUID) + byteorder = LITTLE_ENDIAN; +#elif defined(SMBIOS_NETWORK_ENDIAN_UUID) + byteorder = BIG_ENDIAN; +#else + byteorder = ver < 0x0206 ? BIG_ENDIAN : LITTLE_ENDIAN; +#endif + if (byteorder != LITTLE_ENDIAN) { f1 = ntohl(SMBIOS_GET32(addr, 0)); f2 = ntohs(SMBIOS_GET16(addr, 4)); f3 = ntohs(SMBIOS_GET16(addr, 6)); - } else -#endif - { + } else { f1 = le32toh(SMBIOS_GET32(addr, 0)); f2 = le16toh(SMBIOS_GET16(addr, 4)); f3 = le16toh(SMBIOS_GET16(addr, 6)); From owner-svn-src-stable-10@freebsd.org Tue Jan 26 22:14:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D46D6A469A9; Tue, 26 Jan 2016 22:14:56 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1746D71; Tue, 26 Jan 2016 22:14:56 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0QMEtPP086876; Tue, 26 Jan 2016 22:14:55 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0QMEtiY086875; Tue, 26 Jan 2016 22:14:55 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201601262214.u0QMEtiY086875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Tue, 26 Jan 2016 22:14:55 +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: r294853 - stable/10/sys/fs/nandfs 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.20 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, 26 Jan 2016 22:14:56 -0000 Author: rpokala Date: Tue Jan 26 22:14:55 2016 New Revision: 294853 URL: https://svnweb.freebsd.org/changeset/base/294853 Log: MFC r294200: [PR 206224] bv_cnt is sometimes examined without holding the bufobj lock Add locking around access to bv_cnt which is currently being done unlocked Approved by: jhb Sponsored by: Panasas, Inc. Modified: stable/10/sys/fs/nandfs/nandfs_segment.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nandfs/nandfs_segment.c ============================================================================== --- stable/10/sys/fs/nandfs/nandfs_segment.c Tue Jan 26 21:35:47 2016 (r294852) +++ stable/10/sys/fs/nandfs/nandfs_segment.c Tue Jan 26 22:14:55 2016 (r294853) @@ -479,6 +479,7 @@ nandfs_iterate_dirty_vnodes(struct mount struct nandfs_node *nandfs_node; struct vnode *vp, *mvp; struct thread *td; + struct bufobj *bo; int error, update; td = curthread; @@ -499,17 +500,21 @@ nandfs_iterate_dirty_vnodes(struct mount update = 1; } + bo = &vp->v_bufobj; + BO_LOCK(bo); if (vp->v_bufobj.bo_dirty.bv_cnt) { error = nandfs_iterate_dirty_buf(vp, seginfo, 0); if (error) { nandfs_error("%s: cannot iterate vnode:%p " "err:%d\n", __func__, vp, error); vput(vp); + BO_UNLOCK(bo); return (error); } update = 1; } else vput(vp); + BO_UNLOCK(bo); if (update) nandfs_node_update(nandfs_node); From owner-svn-src-stable-10@freebsd.org Wed Jan 27 05:04:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6A80A6E0F3; Wed, 27 Jan 2016 05:04:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 869BAB7E; Wed, 27 Jan 2016 05:04:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R54HUb010027; Wed, 27 Jan 2016 05:04:17 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R54Hdr010022; Wed, 27 Jan 2016 05:04:17 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270504.u0R54Hdr010022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 05:04:17 +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: r294888 - stable/10/share/dtrace 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.20 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, 27 Jan 2016 05:04:18 -0000 Author: dteske Date: Wed Jan 27 05:04:17 2016 New Revision: 294888 URL: https://svnweb.freebsd.org/changeset/base/294888 Log: MFC 294548-294549,294556,294684: Add watch scripts r294548: Add scripts for watching common entry points. r294549: Fix bad title on script (caused by copy/paste). r294556: fbt -> syscall; fbt names changed to be sys_* r294684: Bump copyright for change from fbt to syscall Added: stable/10/share/dtrace/watch_execve - copied, changed from r294548, head/share/dtrace/watch_execve stable/10/share/dtrace/watch_kill - copied, changed from r294548, head/share/dtrace/watch_kill stable/10/share/dtrace/watch_vop_remove - copied unchanged from r294548, head/share/dtrace/watch_vop_remove Modified: stable/10/share/dtrace/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/dtrace/Makefile ============================================================================== --- stable/10/share/dtrace/Makefile Wed Jan 27 04:59:28 2016 (r294887) +++ stable/10/share/dtrace/Makefile Wed Jan 27 05:04:17 2016 (r294888) @@ -12,7 +12,10 @@ SUBDIR= ${_toolkit} _toolkit= toolkit .endif -SCRIPTS= nfsclienttime hotopen +SCRIPTS= nfsclienttime hotopen \ + watch_execve \ + watch_kill \ + watch_vop_remove SCRIPTSDIR= ${SHAREDIR}/dtrace Copied and modified: stable/10/share/dtrace/watch_execve (from r294548, head/share/dtrace/watch_execve) ============================================================================== --- head/share/dtrace/watch_execve Fri Jan 22 07:19:30 2016 (r294548, copy source) +++ stable/10/share/dtrace/watch_execve Wed Jan 27 05:04:17 2016 (r294888) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Title: dtrace(1) script to log process(es) entering vfs::vop_remove $ + * $Title: dtrace(1) script to log process(es) entering syscall::execve $ * $FreeBSD$ */ Copied and modified: stable/10/share/dtrace/watch_kill (from r294548, head/share/dtrace/watch_kill) ============================================================================== --- head/share/dtrace/watch_kill Fri Jan 22 07:19:30 2016 (r294548, copy source) +++ stable/10/share/dtrace/watch_kill Wed Jan 27 05:04:17 2016 (r294888) @@ -1,6 +1,6 @@ #!/usr/sbin/dtrace -s /* - - * Copyright (c) 2014-2015 Devin Teske + * Copyright (c) 2014-2016 Devin Teske * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,11 +40,10 @@ syscall::execve:entry /* probe ID 1 */ /*********************************************************/ -fbt::kill:entry /* probe ID 2 */ +syscall::kill:entry /* probe ID 2 */ { - this->kill_args = (struct kill_args *)arg1; - this->pid_to_kill = this->kill_args->pid; - this->kill_signal = this->kill_args->signum; + this->pid_to_kill = (pid_t)arg0; + this->kill_signal = (int)arg1; /* * Examine process, parent process, and grandparent process details Copied: stable/10/share/dtrace/watch_vop_remove (from r294548, head/share/dtrace/watch_vop_remove) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/dtrace/watch_vop_remove Wed Jan 27 05:04:17 2016 (r294888, copy of r294548, head/share/dtrace/watch_vop_remove) @@ -0,0 +1,476 @@ +#!/usr/sbin/dtrace -s +/* - + * Copyright (c) 2014 Devin Teske + * All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Title: dtrace(1) script to log process(es) entering vfs::vop_remove $ + * $FreeBSD$ + */ + +#pragma D option quiet +#pragma D option dynvarsize=16m +#pragma D option switchrate=10hz + +/*********************************************************/ + +vfs::vop_remove:entry /* probe ID 1 */ +{ + this->vp = (struct vnode *)arg0; + this->ncp = &(this->vp->v_cache_dst) != NULL ? + this->vp->v_cache_dst.tqh_first : 0; + this->fi_name = args[1] ? ( + args[1]->a_cnp != NULL ? + stringof(args[1]->a_cnp->cn_nameptr) : "" + ) : ""; + this->mount = this->vp->v_mount; /* ptr to vfs we are in */ + this->fi_fs = this->mount != 0 ? + stringof(this->mount->mnt_stat.f_fstypename) : ""; + this->fi_mount = this->mount != 0 ? + stringof(this->mount->mnt_stat.f_mntonname) : ""; + this->d_name = args[0]->v_cache_dd != NULL ? + stringof(args[0]->v_cache_dd->nc_name) : ""; +} + +vfs::vop_remove:entry /this->vp == 0 || this->fi_fs == 0 || + this->fi_fs == "devfs" || this->fi_fs == "" || + this->fi_name == ""/ /* probe ID 2 */ +{ + this->ncp = 0; +} + +/*********************************************************/ + +vfs::vop_remove:entry /this->ncp/ /* probe ID 3 (depth 1) */ +{ + this->dvp = this->ncp->nc_dvp != NULL ? ( + &(this->ncp->nc_dvp->v_cache_dst) != NULL ? + this->ncp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name1 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->name1 == 0 || this->fi_fs == 0 || + this->fi_fs == "devfs" || this->fi_fs == "" || + this->name1 == "/" || this->name1 == ""/ /* probe ID 4 */ +{ + this->dvp = 0; +} + +/*********************************************************/ + +/* + * BEGIN Pathname-depth iterators (copy/paste as many times as-desired) + */ + +vfs::vop_remove:entry /this->dvp/ /* probe ID 5 (depth 2) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name2 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 6 (depth 3) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name3 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 7 (depth 4) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name4 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 8 (depth 5) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name5 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 9 (depth 6) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name6 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 10 (depth 7) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name7 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 11 (depth 8) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name8 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 12 (depth 9) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name9 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 13 (depth 10) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name10 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 14 (depth 11) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name11 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 15 (depth 12) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name12 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 16 (depth 13) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name13 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 17 (depth 14) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name14 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 18 (depth 15) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name15 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 19 (depth 16) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name16 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 20 (depth 17) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name17 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 21 (depth 18) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name18 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 22 (depth 19) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name19 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +vfs::vop_remove:entry /this->dvp/ /* probe ID 23 (depth 20) */ +{ + this->dvp = this->dvp->nc_dvp != NULL ? ( + &(this->dvp->nc_dvp->v_cache_dst) != NULL ? + this->dvp->nc_dvp->v_cache_dst.tqh_first : 0 + ) : 0; + this->name20 = this->dvp != 0 ? ( + this->dvp->nc_name != 0 ? stringof(this->dvp->nc_name) : "" + ) : ""; +} + +/* + * END Pathname-depth iterators + */ + +/*********************************************************/ + +vfs::vop_remove:entry /this->fi_mount != 0/ /* probe ID 24 */ +{ + printf("%Y %s[%d]: ", timestamp + 1406598400000000000, execname, pid); + + /* + * Print full path of file to delete + * NB: Up-to but not including the parent directory (printed below) + */ + printf("%s%s", this->fi_mount, this->fi_mount != 0 ? ( + this->fi_mount == "/" ? "" : "/" + ) : "/"); + printf("%s%s", this->name = this->name20, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name19, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name18, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name17, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name16, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name15, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name14, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name13, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name12, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name11, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name10, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name9, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name8, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name7, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name6, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name5, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name4, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name3, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name2, this->name != "" ? "/" : ""); + printf("%s%s", this->name = this->name1, this->name != "" ? "/" : ""); + + /* Print the parent directory name */ + this->name = this->d_name != 0 ? this->d_name : ""; + printf("%s%s", this->name, this->name != "" ? "/" : ""); + + /* Print the entry name */ + this->name = this->fi_name != 0 ? this->fi_name : ""; + printf("%s", this->name); + + printf("\n"); + + /* + * Examine process, parent process, and grandparent process details + */ + + /******************* CURPROC *******************/ + + this->proc = curthread->td_proc; + this->pid0 = this->proc->p_pid; + this->uid0 = this->proc->p_ucred->cr_uid; + this->gid0 = this->proc->p_ucred->cr_rgid; + this->p_args = this->proc->p_args; + this->ar_length = this->p_args ? this->p_args->ar_length : 0; + this->ar_args = (char *)(this->p_args ? this->p_args->ar_args : 0); + + this->arg0_0 = this->ar_length > 0 ? + this->ar_args : stringof(this->proc->p_comm); + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg0_1 = this->ar_length > 0 ? this->ar_args : ""; + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg0_2 = this->ar_length > 0 ? this->ar_args : ""; + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg0_3 = this->ar_length > 0 ? this->ar_args : ""; + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg0_4 = this->ar_length > 0 ? "..." : ""; + + /******************* PPARENT *******************/ + + this->proc = this->proc->p_pptr; + this->pid1 = this->proc->p_pid; + this->uid1 = this->proc->p_ucred->cr_uid; + this->gid1 = this->proc->p_ucred->cr_rgid; + this->p_args = this->proc ? this->proc->p_args : 0; + this->ar_length = this->p_args ? this->p_args->ar_length : 0; + this->ar_args = (char *)(this->p_args ? this->p_args->ar_args : 0); + + this->arg1_0 = this->ar_length > 0 ? + this->ar_args : stringof(this->proc->p_comm); + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg1_1 = this->ar_length > 0 ? this->ar_args : ""; + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg1_2 = this->ar_length > 0 ? this->ar_args : ""; + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg1_3 = this->ar_length > 0 ? this->ar_args : ""; + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg1_4 = this->ar_length > 0 ? "..." : ""; + + /******************* GPARENT *******************/ + + this->proc = this->proc->p_pptr; + this->pid2 = this->proc->p_pid; + this->uid2 = this->proc->p_ucred->cr_uid; + this->gid2 = this->proc->p_ucred->cr_rgid; + this->p_args = this->proc ? this->proc->p_args : 0; + this->ar_length = this->p_args ? this->p_args->ar_length : 0; + this->ar_args = (char *)(this->p_args ? this->p_args->ar_args : 0); + + this->arg2_0 = this->ar_length > 0 ? + this->ar_args : stringof(this->proc->p_comm); + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg2_1 = this->ar_length > 0 ? this->ar_args : ""; + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg2_2 = this->ar_length > 0 ? this->ar_args : ""; + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg2_3 = this->ar_length > 0 ? this->ar_args : ""; + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + this->arg2_4 = this->ar_length > 0 ? "..." : ""; + + /***********************************************/ + + /* + * Print process, parent, and grandparent details + */ + + printf(" -+= %05d %d.%d %s", + this->pid2, this->uid2, this->gid2, this->arg2_0); + printf("%s%s", this->arg2_1 != "" ? " " : "", this->arg2_1); + printf("%s%s", this->arg2_2 != "" ? " " : "", this->arg2_2); + printf("%s%s", this->arg2_3 != "" ? " " : "", this->arg2_3); + printf("%s%s", this->arg2_4 != "" ? " " : "", this->arg2_4); + printf("%s", this->arg2_0 != "" ? "\n" : ""); + + printf(" \-+= %05d %d.%d %s", + this->pid1, this->uid1, this->gid1, this->arg1_0); + printf("%s%s", this->arg1_1 != "" ? " " : "", this->arg1_1); + printf("%s%s", this->arg1_2 != "" ? " " : "", this->arg1_2); + printf("%s%s", this->arg1_3 != "" ? " " : "", this->arg1_3); + printf("%s%s", this->arg1_4 != "" ? " " : "", this->arg1_4); + printf("%s", this->arg1_0 != "" ? "\n" : ""); + + printf(" \-+= %05d %d.%d %s", + this->pid0, this->uid0, this->gid0, this->arg0_0); + printf("%s%s", this->arg0_1 != "" ? " " : "", this->arg0_1); + printf("%s%s", this->arg0_2 != "" ? " " : "", this->arg0_2); + printf("%s%s", this->arg0_3 != "" ? " " : "", this->arg0_3); + printf("%s%s", this->arg0_4 != "" ? " " : "", this->arg0_4); + printf("%s", this->arg0_0 != "" ? "\n" : ""); +} From owner-svn-src-stable-10@freebsd.org Wed Jan 27 05:19:07 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F6D9A6E51D; Wed, 27 Jan 2016 05:19:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 24427117E; Wed, 27 Jan 2016 05:19:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R5J6Ga013085; Wed, 27 Jan 2016 05:19:06 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R5J6Ob013084; Wed, 27 Jan 2016 05:19:06 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201601270519.u0R5J6Ob013084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Jan 2016 05:19:06 +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: r294890 - stable/10/sys/dev/hyperv/storvsc 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.20 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, 27 Jan 2016 05:19:07 -0000 Author: sephe Date: Wed Jan 27 05:19:05 2016 New Revision: 294890 URL: https://svnweb.freebsd.org/changeset/base/294890 Log: MFC r294557: hyperv/stor: Verify returned inquiry data before further dispatching Windows 10 and Window 2016 will return all zero inquiry data for non-existing slots. If we dispatched them, then a lot of useless (0 sized) disks would be created. So we verify the returned inquiry data (valid type, non-empty vendor/product/revision etc.), before further dispatching. Minor white space cleanup and wording fix. Submitted by: Hongjiang Zhang Reviewed by: adrian, sephe, Jun Su Approved by: adrian (mentor) Modified by: sephe Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4928 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Jan 27 05:15:53 2016 (r294889) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Jan 27 05:19:05 2016 (r294890) @@ -1923,6 +1923,66 @@ create_storvsc_request(union ccb *ccb, s return(0); } +/* + * Modified based on scsi_print_inquiry which is responsible to + * print the detail information for scsi_inquiry_data. + * + * Return 1 if it is valid, 0 otherwise. + */ +static inline int +is_inquiry_valid(const struct scsi_inquiry_data *inq_data) +{ + uint8_t type; + char vendor[16], product[48], revision[16]; + + /* + * Check device type and qualifier + */ + if (!(SID_QUAL_IS_VENDOR_UNIQUE(inq_data) || + SID_QUAL(inq_data) == SID_QUAL_LU_CONNECTED)) + return (0); + + type = SID_TYPE(inq_data); + switch (type) { + case T_DIRECT: + case T_SEQUENTIAL: + case T_PRINTER: + case T_PROCESSOR: + case T_WORM: + case T_CDROM: + case T_SCANNER: + case T_OPTICAL: + case T_CHANGER: + case T_COMM: + case T_STORARRAY: + case T_ENCLOSURE: + case T_RBC: + case T_OCRW: + case T_OSD: + case T_ADC: + break; + case T_NODEVICE: + default: + return (0); + } + + /* + * Check vendor, product, and revision + */ + cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), + sizeof(vendor)); + cam_strvis(product, inq_data->product, sizeof(inq_data->product), + sizeof(product)); + cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision), + sizeof(revision)); + if (strlen(vendor) == 0 || + strlen(product) == 0 || + strlen(revision) == 0) + return (0); + + return (1); +} + /** * @brief completion function before returning to CAM * @@ -1993,11 +2053,33 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; if (vm_srb->scsi_status == SCSI_STATUS_OK) { - ccb->ccb_h.status |= CAM_REQ_CMP; - } else { + const struct scsi_generic *cmd; + + /* + * Check whether the data for INQUIRY cmd is valid or + * not. Windows 10 and Windows 2016 send all zero + * inquiry data to VM even for unpopulated slots. + */ + cmd = (const struct scsi_generic *) + ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? + csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); + if (cmd->opcode == INQUIRY && + is_inquiry_valid( + (const struct scsi_inquiry_data *)csio->data_ptr) == 0) { + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + if (bootverbose) { + mtx_lock(&sc->hs_lock); + xpt_print(ccb->ccb_h.path, + "storvsc uninstalled device\n"); + mtx_unlock(&sc->hs_lock); + } + } else { + ccb->ccb_h.status |= CAM_REQ_CMP; + } + } else { mtx_lock(&sc->hs_lock); xpt_print(ccb->ccb_h.path, - "srovsc scsi_status = %d\n", + "storvsc scsi_status = %d\n", vm_srb->scsi_status); mtx_unlock(&sc->hs_lock); ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; From owner-svn-src-stable-10@freebsd.org Wed Jan 27 06:26:01 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39E69A6F9BD; Wed, 27 Jan 2016 06:26:01 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 07D2E14A2; Wed, 27 Jan 2016 06:26:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R6Q0RL033313; Wed, 27 Jan 2016 06:26:00 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R6PxVq033310; Wed, 27 Jan 2016 06:25:59 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270625.u0R6PxVq033310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 06:25:59 +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: r294895 - stable/10/lib/libdpv 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.20 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, 27 Jan 2016 06:26:01 -0000 Author: dteske Date: Wed Jan 27 06:25:59 2016 New Revision: 294895 URL: https://svnweb.freebsd.org/changeset/base/294895 Log: MFC r293868: Default to en_US.ISO8859-1 if no locale Modified: stable/10/lib/libdpv/dpv.c stable/10/lib/libdpv/dpv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libdpv/dpv.c ============================================================================== --- stable/10/lib/libdpv/dpv.c Wed Jan 27 06:24:19 2016 (r294894) +++ stable/10/lib/libdpv/dpv.c Wed Jan 27 06:25:59 2016 (r294895) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -482,6 +483,11 @@ dpv(struct dpv_config *config, struct dp /* Reads: label_size pbar_size pprompt aprompt dpv_nfiles */ /* Inits: dheight and dwidth */ + /* Default localeconv(3) settings for dialog(3) status */ + setlocale(LC_NUMERIC, + getenv("LC_ALL") == NULL && getenv("LC_NUMERIC") == NULL ? + LC_NUMERIC_DEFAULT : ""); + if (!debug) { /* Internally create the initial `--gauge' prompt text */ dprompt_recreate(file_list, (struct dpv_file_node *)NULL, 0); Modified: stable/10/lib/libdpv/dpv.h ============================================================================== --- stable/10/lib/libdpv/dpv.h Wed Jan 27 06:24:19 2016 (r294894) +++ stable/10/lib/libdpv/dpv.h Wed Jan 27 06:25:59 2016 (r294895) @@ -38,6 +38,9 @@ #define FALSE 0 #endif +/* localeconv(3) */ +#define LC_NUMERIC_DEFAULT "en_US.ISO8859-1" + /* Data to process */ extern long long dpv_overall_read; From owner-svn-src-stable-10@freebsd.org Wed Jan 27 06:30:24 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D929CA6FB0F; Wed, 27 Jan 2016 06:30:24 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A59F918D8; Wed, 27 Jan 2016 06:30:24 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R6UN1q033566; Wed, 27 Jan 2016 06:30:23 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R6UNHa033565; Wed, 27 Jan 2016 06:30:23 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270630.u0R6UNHa033565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 06:30:23 +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: r294897 - stable/10/usr.bin/dpv 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.20 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, 27 Jan 2016 06:30:24 -0000 Author: dteske Date: Wed Jan 27 06:30:23 2016 New Revision: 294897 URL: https://svnweb.freebsd.org/changeset/base/294897 Log: MFC r289797: dpv(1) merged to stable/10 before release/10.2.0 Modified: stable/10/usr.bin/dpv/dpv.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/dpv/dpv.1 ============================================================================== --- stable/10/usr.bin/dpv/dpv.1 Wed Jan 27 06:28:56 2016 (r294896) +++ stable/10/usr.bin/dpv/dpv.1 Wed Jan 27 06:30:23 2016 (r294897) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013-2014 Devin Teske +.\" Copyright (c) 2013-2015 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Sep 7, 2014 +.Dd Oct 22, 2015 .Dt DPV 1 .Os .Sh NAME @@ -425,6 +425,6 @@ for additional information. A .Nm utility first appeared in -.Fx 11.0 . +.Fx 10.2 . .Sh AUTHORS .An Devin Teske Aq dteske@FreeBSD.org From owner-svn-src-stable-10@freebsd.org Wed Jan 27 06:38:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DA06A6FFAA; Wed, 27 Jan 2016 06:38:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5D93B1094; Wed, 27 Jan 2016 06:38:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R6c3oY036578; Wed, 27 Jan 2016 06:38:03 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R6c3ww036576; Wed, 27 Jan 2016 06:38:03 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601270638.u0R6c3ww036576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 06:38:03 +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: r294898 - stable/10/usr.sbin/bsdconfig/share 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.20 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, 27 Jan 2016 06:38:04 -0000 Author: dteske Date: Wed Jan 27 06:38:03 2016 New Revision: 294898 URL: https://svnweb.freebsd.org/changeset/base/294898 Log: MFC 293617,294669: Minor fixes r293617: Fix improper duration for f_dialog_pause() API r294669: Fix a typo in a comment Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr stable/10/usr.sbin/bsdconfig/share/strings.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/dialog.subr Wed Jan 27 06:30:23 2016 (r294897) +++ stable/10/usr.sbin/bsdconfig/share/dialog.subr Wed Jan 27 06:38:03 2016 (r294898) @@ -1605,7 +1605,6 @@ f_dialog_pause() $height $width else [ $duration -gt 0 ] && duration=$(( $duration - 1 )) - [ $duration -gt 1 ] && duration=$(( $duration - 1 )) height=$(( $height + 3 )) # Add height for progress bar $DIALOG \ --title "$DIALOG_TITLE" \ Modified: stable/10/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/strings.subr Wed Jan 27 06:30:23 2016 (r294897) +++ stable/10/usr.sbin/bsdconfig/share/strings.subr Wed Jan 27 06:38:03 2016 (r294898) @@ -110,7 +110,7 @@ f_sprintf() # Example 2: # # limit=12 format="%s %s" -# format_args=" 'doghouse' 'foxhound' " +# format_args=" 'doghouse' 'fox' " # # even more spaces added to illustrate escape-method # f_vsnprintf foo $limit "$format" "$format_args" # foo=[doghouse fox] # From owner-svn-src-stable-10@freebsd.org Wed Jan 27 07:28:57 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47172A6F286; Wed, 27 Jan 2016 07:28:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A40F1DD1; Wed, 27 Jan 2016 07:28:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0R7SufV051389; Wed, 27 Jan 2016 07:28:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0R7StLe051386; Wed, 27 Jan 2016 07:28:55 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201601270728.u0R7StLe051386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 27 Jan 2016 07:28:55 +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: r294901 - in stable/10/sys: amd64/linux amd64/linux32 i386/linux 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.20 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, 27 Jan 2016 07:28:57 -0000 Author: delphij Date: Wed Jan 27 07:28:55 2016 New Revision: 294901 URL: https://svnweb.freebsd.org/changeset/base/294901 Log: MFC r294900: Implement AT_SECURE properly. AT_SECURE auxv entry has been added to the Linux 2.5 kernel to pass a boolean flag indicating whether secure mode should be enabled. 1 means that the program has changes its credentials during the execution. Being exported AT_SECURE used by glibc issetugid() call. Submitted by: imp, dchagin Security: FreeBSD-SA-16:10.linux Security: CVE-2016-1883 Modified: stable/10/sys/amd64/linux/linux_sysvec.c stable/10/sys/amd64/linux32/linux32_sysvec.c stable/10/sys/i386/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux/linux_sysvec.c Wed Jan 27 07:20:55 2016 (r294900) +++ stable/10/sys/amd64/linux/linux_sysvec.c Wed Jan 27 07:28:55 2016 (r294901) @@ -271,6 +271,7 @@ elf_linux_fixup(register_t **stack_base, Elf_Addr *pos; struct ps_strings *arginfo; struct proc *p; + int issetugid; p = imgp->proc; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; @@ -281,6 +282,7 @@ elf_linux_fixup(register_t **stack_base, args = (Elf64_Auxargs *)imgp->auxargs; pos = base + (imgp->args->argc + imgp->args->envc + 2); + issetugid = p->p_flag & P_SUGID ? 1 : 0; AUXARGS_ENTRY(pos, LINUX_AT_SYSINFO_EHDR, imgp->proc->p_sysent->sv_shared_page_base); AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature); @@ -296,7 +298,7 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid); - AUXARGS_ENTRY(pos, LINUX_AT_SECURE, 0); + AUXARGS_ENTRY(pos, LINUX_AT_SECURE, issetugid); AUXARGS_ENTRY(pos, LINUX_AT_PLATFORM, PTROUT(linux_platform)); AUXARGS_ENTRY(pos, LINUX_AT_RANDOM, imgp->canary); if (imgp->execpathp != 0) Modified: stable/10/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_sysvec.c Wed Jan 27 07:20:55 2016 (r294900) +++ stable/10/sys/amd64/linux32/linux32_sysvec.c Wed Jan 27 07:28:55 2016 (r294901) @@ -230,6 +230,7 @@ elf_linux_fixup(register_t **stack_base, Elf32_Addr *base; Elf32_Addr *pos; struct linux32_ps_strings *arginfo; + int issetugid; arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS; @@ -239,6 +240,7 @@ elf_linux_fixup(register_t **stack_base, args = (Elf32_Auxargs *)imgp->auxargs; pos = base + (imgp->args->argc + imgp->args->envc + 2); + issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO_EHDR, imgp->proc->p_sysent->sv_shared_page_base); AUXARGS_ENTRY_32(pos, LINUX_AT_SYSINFO, linux32_vsyscall); @@ -261,7 +263,7 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY_32(pos, AT_FLAGS, args->flags); AUXARGS_ENTRY_32(pos, AT_ENTRY, args->entry); AUXARGS_ENTRY_32(pos, AT_BASE, args->base); - AUXARGS_ENTRY_32(pos, LINUX_AT_SECURE, 0); + AUXARGS_ENTRY_32(pos, LINUX_AT_SECURE, issetugid); AUXARGS_ENTRY_32(pos, AT_UID, imgp->proc->p_ucred->cr_ruid); AUXARGS_ENTRY_32(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); AUXARGS_ENTRY_32(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); Modified: stable/10/sys/i386/linux/linux_sysvec.c ============================================================================== --- stable/10/sys/i386/linux/linux_sysvec.c Wed Jan 27 07:20:55 2016 (r294900) +++ stable/10/sys/i386/linux/linux_sysvec.c Wed Jan 27 07:28:55 2016 (r294901) @@ -238,11 +238,13 @@ elf_linux_fixup(register_t **stack_base, Elf32_Addr *uplatform; struct ps_strings *arginfo; register_t *pos; + int issetugid; KASSERT(curthread->td_proc == imgp->proc, ("unsafe elf_linux_fixup(), should be curproc")); p = imgp->proc; + issetugid = imgp->proc->p_flag & P_SUGID ? 1 : 0; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; uplatform = (Elf32_Addr *)((caddr_t)arginfo - linux_szplatform); args = (Elf32_Auxargs *)imgp->auxargs; @@ -270,7 +272,7 @@ elf_linux_fixup(register_t **stack_base, AUXARGS_ENTRY(pos, AT_FLAGS, args->flags); AUXARGS_ENTRY(pos, AT_ENTRY, args->entry); AUXARGS_ENTRY(pos, AT_BASE, args->base); - AUXARGS_ENTRY(pos, LINUX_AT_SECURE, 0); + AUXARGS_ENTRY(pos, LINUX_AT_SECURE, issetugid); AUXARGS_ENTRY(pos, AT_UID, imgp->proc->p_ucred->cr_ruid); AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); From owner-svn-src-stable-10@freebsd.org Wed Jan 27 13:59:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F763A6F2DF; Wed, 27 Jan 2016 13:59:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA31A1C49; Wed, 27 Jan 2016 13:59:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RDxRlx066321; Wed, 27 Jan 2016 13:59:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RDxR2d066320; Wed, 27 Jan 2016 13:59:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601271359.u0RDxR2d066320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 27 Jan 2016 13:59:27 +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: r294910 - stable/10/lib/libc/net 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.20 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, 27 Jan 2016 13:59:29 -0000 Author: tuexen Date: Wed Jan 27 13:59:27 2016 New Revision: 294910 URL: https://svnweb.freebsd.org/changeset/base/294910 Log: MFC r294688: sctp_sendv() needs to fill in the association id on return. Modified: stable/10/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/10/lib/libc/net/sctp_sys_calls.c Wed Jan 27 13:40:44 2016 (r294909) +++ stable/10/lib/libc/net/sctp_sys_calls.c Wed Jan 27 13:59:27 2016 (r294910) @@ -984,6 +984,7 @@ sctp_sendv(int sd, struct sockaddr *addr; struct sockaddr_in *addr_in; struct sockaddr_in6 *addr_in6; + sctp_assoc_t *assoc_id; if ((addrcnt < 0) || (iovcnt < 0) || @@ -1002,6 +1003,7 @@ sctp_sendv(int sd, errno = ENOMEM; return (-1); } + assoc_id = NULL; msg.msg_control = cmsgbuf; msg.msg_controllen = 0; cmsg = (struct cmsghdr *)cmsgbuf; @@ -1025,6 +1027,7 @@ sctp_sendv(int sd, memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_sndinfo)); msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + assoc_id = &(((struct sctp_sndinfo *)info)->snd_assoc_id); break; case SCTP_SENDV_PRINFO: if ((info == NULL) || (infolen < sizeof(struct sctp_prinfo))) { @@ -1066,6 +1069,7 @@ sctp_sendv(int sd, memcpy(CMSG_DATA(cmsg), &spa_info->sendv_sndinfo, sizeof(struct sctp_sndinfo)); msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo)); cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo))); + assoc_id = &(spa_info->sendv_sndinfo.snd_assoc_id); } if (spa_info->sendv_flags & SCTP_SEND_PRINFO_VALID) { cmsg->cmsg_level = IPPROTO_SCTP; @@ -1164,6 +1168,9 @@ sctp_sendv(int sd, msg.msg_flags = 0; ret = sendmsg(sd, &msg, flags); free(cmsgbuf); + if ((ret >= 0) && (addrs != NULL) && (assoc_id != NULL)) { + *assoc_id = sctp_getassocid(sd, addrs); + } return (ret); } From owner-svn-src-stable-10@freebsd.org Wed Jan 27 14:01:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E358A6F472; Wed, 27 Jan 2016 14:01:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0E41E33; Wed, 27 Jan 2016 14:01:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RE1LlW066478; Wed, 27 Jan 2016 14:01:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RE1Lw5066477; Wed, 27 Jan 2016 14:01:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201601271401.u0RE1Lw5066477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 27 Jan 2016 14:01:21 +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: r294911 - stable/10/lib/libc/net 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.20 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, 27 Jan 2016 14:01:22 -0000 Author: tuexen Date: Wed Jan 27 14:01:21 2016 New Revision: 294911 URL: https://svnweb.freebsd.org/changeset/base/294911 Log: MFC r294694: sctp_sendx() needs to provide the assoc_id back. Modified: stable/10/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/10/lib/libc/net/sctp_sys_calls.c Wed Jan 27 13:59:27 2016 (r294910) +++ stable/10/lib/libc/net/sctp_sys_calls.c Wed Jan 27 14:01:21 2016 (r294911) @@ -700,14 +700,19 @@ sctp_sendx(int sd, const void *msg, size #ifdef SYS_sctp_generic_sendmsg if (addrcnt == 1) { socklen_t l; + ssize_t ret; /* * Quick way, we don't need to do a connectx so lets use the * syscall directly. */ l = addrs->sa_len; - return (syscall(SYS_sctp_generic_sendmsg, sd, - msg, msg_len, addrs, l, sinfo, flags)); + ret = syscall(SYS_sctp_generic_sendmsg, sd, + msg, msg_len, addrs, l, sinfo, flags); + if ((ret >= 0) && (sinfo != NULL)) { + sinfo->sinfo_assoc_id = sctp_getassocid(sd, addrs); + } + return (ret); } #endif From owner-svn-src-stable-10@freebsd.org Wed Jan 27 14:12:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B45ADA6F8E1; Wed, 27 Jan 2016 14:12:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 334801CFE; Wed, 27 Jan 2016 14:12:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RECATA072080; Wed, 27 Jan 2016 14:12:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RECAXE072079; Wed, 27 Jan 2016 14:12:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201601271412.u0RECAXE072079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 27 Jan 2016 14:12:10 +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: r294913 - in stable: 10/release/doc/share/xml 9/release/doc/share/xml 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.20 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, 27 Jan 2016 14:12:11 -0000 Author: gjb Date: Wed Jan 27 14:12:10 2016 New Revision: 294913 URL: https://svnweb.freebsd.org/changeset/base/294913 Log: Document SA-16:08, SA-16:09, SA-16:10. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/9/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/security.xml ============================================================================== --- stable/10/release/doc/share/xml/security.xml Wed Jan 27 14:10:50 2016 (r294912) +++ stable/10/release/doc/share/xml/security.xml Wed Jan 27 14:12:10 2016 (r294913) @@ -107,6 +107,21 @@ OpenSSH client information leak + + + FreeBSD-SA-16:09.ntp + 27 January 2016 + Multiple vulnerabilities. + + + + FreeBSD-SA-16:10.linux + 27 January 2016 + &man.issetugid.2; system call + vulnerability. + From owner-svn-src-stable-10@freebsd.org Wed Jan 27 14:55:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 775BAA6F9EB; Wed, 27 Jan 2016 14:55:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 349B01C7B; Wed, 27 Jan 2016 14:55:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0REtgAb084124; Wed, 27 Jan 2016 14:55:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0REtfkZ084121; Wed, 27 Jan 2016 14:55:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601271455.u0REtfkZ084121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 Jan 2016 14:55:41 +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: r294917 - stable/10/sys/dev/mlx5/mlx5_en 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.20 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, 27 Jan 2016 14:55:43 -0000 Author: hselasky Date: Wed Jan 27 14:55:41 2016 New Revision: 294917 URL: https://svnweb.freebsd.org/changeset/base/294917 Log: MFC r294314: Allow RX and TX pause frames to be set through ifconfig. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4817 Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Wed Jan 27 14:47:00 2016 (r294916) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Wed Jan 27 14:55:41 2016 (r294917) @@ -375,11 +375,11 @@ struct mlx5e_params { bool cqe_zipping_en; u32 lro_wqe_sz; u16 rx_hash_log_tbl_sz; + u32 tx_pauseframe_control; + u32 rx_pauseframe_control; }; #define MLX5E_PARAMS(m) \ - m(+1, u64 tx_pauseframe_control, "tx_pauseframe_control", "Set to enable TX pause frames. Clear to disable.") \ - m(+1, u64 rx_pauseframe_control, "rx_pauseframe_control", "Set to enable RX pause frames. Clear to disable.") \ m(+1, u64 tx_queue_size_max, "tx_queue_size_max", "Max send queue size") \ m(+1, u64 rx_queue_size_max, "rx_queue_size_max", "Max receive queue size") \ m(+1, u64 tx_queue_size, "tx_queue_size", "Default send queue size") \ Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Jan 27 14:47:00 2016 (r294916) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Jan 27 14:55:41 2016 (r294917) @@ -113,21 +113,6 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG } priv->params.tx_cq_moderation_pkts = priv->params_ethtool.tx_coalesce_pkts; - if (&priv->params_ethtool.arg[arg2] == &priv->params_ethtool.rx_pauseframe_control || - &priv->params_ethtool.arg[arg2] == &priv->params_ethtool.tx_pauseframe_control) { - /* range check parameters */ - priv->params_ethtool.rx_pauseframe_control = - priv->params_ethtool.rx_pauseframe_control ? 1 : 0; - priv->params_ethtool.tx_pauseframe_control = - priv->params_ethtool.tx_pauseframe_control ? 1 : 0; - - /* update firmware */ - error = -mlx5_set_port_pause(priv->mdev, 1, - priv->params_ethtool.rx_pauseframe_control, - priv->params_ethtool.tx_pauseframe_control); - goto done; - } - was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); if (was_opened) { u64 *xarg = priv->params_ethtool.arg + arg2; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Jan 27 14:47:00 2016 (r294916) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Jan 27 14:55:41 2016 (r294917) @@ -222,8 +222,8 @@ mlx5e_media_status(struct ifnet *dev, st ifmr->ifm_status = priv->media_status_last; ifmr->ifm_active = priv->media_active_last | - (priv->params_ethtool.rx_pauseframe_control ? IFM_ETH_RXPAUSE : 0) | - (priv->params_ethtool.tx_pauseframe_control ? IFM_ETH_TXPAUSE : 0); + (priv->params.rx_pauseframe_control ? IFM_ETH_RXPAUSE : 0) | + (priv->params.tx_pauseframe_control ? IFM_ETH_TXPAUSE : 0); } @@ -250,6 +250,7 @@ mlx5e_media_change(struct ifnet *dev) struct mlx5_core_dev *mdev = priv->mdev; u32 eth_proto_cap; u32 link_mode; + int was_opened; int locked; int error; @@ -263,24 +264,45 @@ mlx5e_media_change(struct ifnet *dev) } link_mode = mlx5e_find_link_mode(IFM_SUBTYPE(priv->media.ifm_media)); + /* query supported capabilities */ error = mlx5_query_port_proto_cap(mdev, ð_proto_cap, MLX5_PTYS_EN); - if (error) { + if (error != 0) { if_printf(dev, "Query port media capability failed\n"); goto done; } - if (IFM_SUBTYPE(priv->media.ifm_media) == IFM_AUTO) + /* check for autoselect */ + if (IFM_SUBTYPE(priv->media.ifm_media) == IFM_AUTO) { link_mode = eth_proto_cap; - else + if (link_mode == 0) { + if_printf(dev, "Port media capability is zero\n"); + error = EINVAL; + goto done; + } + } else { link_mode = link_mode & eth_proto_cap; - - if (!link_mode) { - if_printf(dev, "Not supported link mode requested\n"); - error = EINVAL; - goto done; + if (link_mode == 0) { + if_printf(dev, "Not supported link mode requested\n"); + error = EINVAL; + goto done; + } } + /* update pauseframe control bits */ + priv->params.rx_pauseframe_control = + (priv->media.ifm_media & IFM_ETH_RXPAUSE) ? 1 : 0; + priv->params.tx_pauseframe_control = + (priv->media.ifm_media & IFM_ETH_TXPAUSE) ? 1 : 0; + + /* check if device is opened */ + was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); + + /* reconfigure the hardware */ mlx5_set_port_status(mdev, MLX5_PORT_DOWN); mlx5_set_port_proto(mdev, link_mode, MLX5_PTYS_EN); - mlx5_set_port_status(mdev, MLX5_PORT_UP); + mlx5_set_port_pause(mdev, 1, + priv->params.rx_pauseframe_control, + priv->params.tx_pauseframe_control); + if (was_opened) + mlx5_set_port_status(mdev, MLX5_PORT_UP); done: if (!locked) @@ -2749,6 +2771,56 @@ mlx5e_add_hw_stats(struct mlx5e_priv *pr "Board ID"); } +static void +mlx5e_setup_pauseframes(struct mlx5e_priv *priv) +{ +#if (__FreeBSD_version < 1100000) + char path[64]; + +#endif + /* Only receiving pauseframes is enabled by default */ + priv->params.tx_pauseframe_control = 0; + priv->params.rx_pauseframe_control = 1; + +#if (__FreeBSD_version < 1100000) + /* compute path for sysctl */ + snprintf(path, sizeof(path), "dev.mce.%d.tx_pauseframe_control", + device_get_unit(priv->mdev->pdev->dev.bsddev)); + + /* try to fetch tunable, if any */ + TUNABLE_INT_FETCH(path, &priv->params.tx_pauseframe_control); + + /* compute path for sysctl */ + snprintf(path, sizeof(path), "dev.mce.%d.rx_pauseframe_control", + device_get_unit(priv->mdev->pdev->dev.bsddev)); + + /* try to fetch tunable, if any */ + TUNABLE_INT_FETCH(path, &priv->params.rx_pauseframe_control); +#endif + + /* register pausframe SYSCTLs */ + SYSCTL_ADD_INT(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), + OID_AUTO, "tx_pauseframe_control", CTLFLAG_RDTUN, + &priv->params.tx_pauseframe_control, 0, + "Set to enable TX pause frames. Clear to disable."); + + SYSCTL_ADD_INT(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), + OID_AUTO, "rx_pauseframe_control", CTLFLAG_RDTUN, + &priv->params.rx_pauseframe_control, 0, + "Set to enable RX pause frames. Clear to disable."); + + /* range check */ + priv->params.tx_pauseframe_control = + priv->params.tx_pauseframe_control ? 1 : 0; + priv->params.rx_pauseframe_control = + priv->params.rx_pauseframe_control ? 1 : 0; + + /* update firmware */ + mlx5_set_port_pause(priv->mdev, 1, + priv->params.rx_pauseframe_control, + priv->params.tx_pauseframe_control); +} + static void * mlx5e_create_ifp(struct mlx5_core_dev *mdev) { @@ -2874,11 +2946,11 @@ mlx5e_create_ifp(struct mlx5_core_dev *m /* Set default media status */ priv->media_status_last = IFM_AVALID; - priv->media_active_last = IFM_ETHER | IFM_AUTO; + priv->media_active_last = IFM_ETHER | IFM_AUTO | + IFM_ETH_RXPAUSE | IFM_FDX; - /* Pauseframes are enabled by default */ - priv->params_ethtool.tx_pauseframe_control = 1; - priv->params_ethtool.rx_pauseframe_control = 1; + /* setup default pauseframes configuration */ + mlx5e_setup_pauseframes(priv); err = mlx5_query_port_proto_cap(mdev, ð_proto_cap, MLX5_PTYS_EN); if (err) { @@ -2894,14 +2966,24 @@ mlx5e_create_ifp(struct mlx5_core_dev *m for (i = 0; i < MLX5E_LINK_MODES_NUMBER; ++i) { if (mlx5e_mode_table[i].baudrate == 0) continue; - if (MLX5E_PROT_MASK(i) & eth_proto_cap) + if (MLX5E_PROT_MASK(i) & eth_proto_cap) { ifmedia_add(&priv->media, - IFM_ETHER | mlx5e_mode_table[i].subtype | - IFM_FDX, 0, NULL); + mlx5e_mode_table[i].subtype | + IFM_ETHER, 0, NULL); + ifmedia_add(&priv->media, + mlx5e_mode_table[i].subtype | + IFM_ETHER | IFM_FDX | + IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); + } } ifmedia_add(&priv->media, IFM_ETHER | IFM_AUTO, 0, NULL); - ifmedia_set(&priv->media, IFM_ETHER | IFM_AUTO); + ifmedia_add(&priv->media, IFM_ETHER | IFM_AUTO | IFM_FDX | + IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE, 0, NULL); + + /* Set autoselect by default */ + ifmedia_set(&priv->media, IFM_ETHER | IFM_AUTO | IFM_FDX | + IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE); ether_ifattach(ifp, dev_addr); /* Register for VLAN events */ From owner-svn-src-stable-10@freebsd.org Wed Jan 27 14:57:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D45D7A6FB5E; Wed, 27 Jan 2016 14:57:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A13A91F6D; Wed, 27 Jan 2016 14:57:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0REvbtb084358; Wed, 27 Jan 2016 14:57:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0REvblF084357; Wed, 27 Jan 2016 14:57:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601271457.u0REvblF084357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 Jan 2016 14:57:37 +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: r294918 - stable/10/sys/dev/mlx5/mlx5_en 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.20 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, 27 Jan 2016 14:57:38 -0000 Author: hselasky Date: Wed Jan 27 14:57:37 2016 New Revision: 294918 URL: https://svnweb.freebsd.org/changeset/base/294918 Log: MFC r294317: Declare local variables at top of function. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4939 Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed Jan 27 14:55:41 2016 (r294917) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed Jan 27 14:57:37 2016 (r294918) @@ -100,20 +100,23 @@ mlx5e_lro_update_hdr(struct mbuf *mb, st /* TODO: consider vlans, ip options, ... */ struct ether_header *eh; uint16_t eh_type; + uint16_t tot_len; struct ip6_hdr *ip6 = NULL; struct ip *ip4 = NULL; struct tcphdr *th; uint32_t *ts_ptr; + uint8_t l4_hdr_type; + int tcp_ack; eh = mtod(mb, struct ether_header *); eh_type = ntohs(eh->ether_type); - u8 l4_hdr_type = get_cqe_l4_hdr_type(cqe); - int tcp_ack = ((CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA == l4_hdr_type) || + l4_hdr_type = get_cqe_l4_hdr_type(cqe); + tcp_ack = ((CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA == l4_hdr_type) || (CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA == l4_hdr_type)); /* TODO: consider vlan */ - u16 tot_len = be32_to_cpu(cqe->byte_cnt) - ETHER_HDR_LEN; + tot_len = be32_to_cpu(cqe->byte_cnt) - ETHER_HDR_LEN; switch (eh_type) { case ETHERTYPE_IP: From owner-svn-src-stable-10@freebsd.org Wed Jan 27 14:59:24 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2703CA6FC27; Wed, 27 Jan 2016 14:59:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB63B11AD; Wed, 27 Jan 2016 14:59:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RExM2r084592; Wed, 27 Jan 2016 14:59:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RExMvg084591; Wed, 27 Jan 2016 14:59:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601271459.u0RExMvg084591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 Jan 2016 14:59:22 +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: r294919 - stable/10/sys/dev/mlx5/mlx5_en 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.20 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, 27 Jan 2016 14:59:24 -0000 Author: hselasky Date: Wed Jan 27 14:59:22 2016 New Revision: 294919 URL: https://svnweb.freebsd.org/changeset/base/294919 Log: MFC r294318: Add clarifying comment about CQE zipping. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4940 Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed Jan 27 14:57:37 2016 (r294918) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Wed Jan 27 14:59:22 2016 (r294919) @@ -270,6 +270,11 @@ mlx5e_decompress_cqe(struct mlx5e_cq *cq struct mlx5_mini_cqe8 *mini, u16 wqe_counter, int i) { + /* + * NOTE: The fields which are not set here are copied from the + * initial and common title. See memcpy() in + * mlx5e_write_cqe_slot(). + */ title->byte_cnt = mini->byte_cnt; title->wqe_counter = cpu_to_be16((wqe_counter + i) & cq->wq.sz_m1); title->check_sum = mini->checksum; From owner-svn-src-stable-10@freebsd.org Wed Jan 27 15:01:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CA24A6FEAD; Wed, 27 Jan 2016 15:01:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02F6E13DC; Wed, 27 Jan 2016 15:01:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RF19t3087225; Wed, 27 Jan 2016 15:01:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RF19Ts087224; Wed, 27 Jan 2016 15:01:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201601271501.u0RF19Ts087224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 27 Jan 2016 15:01:09 +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: r294920 - stable/10/sys/dev/mlx5/mlx5_en 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.20 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, 27 Jan 2016 15:01:10 -0000 Author: hselasky Date: Wed Jan 27 15:01:08 2016 New Revision: 294920 URL: https://svnweb.freebsd.org/changeset/base/294920 Log: MFC r294319: Fix an issue where the network adapter could be left in down state after changing the HW LRO sysctl when previously in up state. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4941 Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Jan 27 14:59:22 2016 (r294919) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Jan 27 15:01:08 2016 (r294920) @@ -178,23 +178,21 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params.tx_cq_moderation_mode = priv->params_ethtool.tx_coalesce_mode; /* we always agree to turn off HW LRO - but not always to turn on */ - if (priv->params_ethtool.hw_lro) { - if (priv->params_ethtool.hw_lro != 1) { - priv->params_ethtool.hw_lro = priv->params.hw_lro_en; - error = EINVAL; - goto done; - } - if (priv->ifp->if_capenable & IFCAP_LRO) - priv->params.hw_lro_en = !!MLX5_CAP_ETH(priv->mdev, lro_cap); - else { - /* set the correct (0) value to params_ethtool.hw_lro, issue a warning and return error */ + if (priv->params_ethtool.hw_lro != 0) { + if ((priv->ifp->if_capenable & IFCAP_LRO) && + MLX5_CAP_ETH(priv->mdev, lro_cap)) { + priv->params.hw_lro_en = 1; + priv->params_ethtool.hw_lro = 1; + } else { + priv->params.hw_lro_en = 0; priv->params_ethtool.hw_lro = 0; error = EINVAL; - if_printf(priv->ifp, "Can't set HW_LRO to a device with LRO turned off"); - goto done; + + if_printf(priv->ifp, "Can't enable HW LRO: " + "The HW or SW LRO feature is disabled"); } } else { - priv->params.hw_lro_en = false; + priv->params.hw_lro_en = 0; } if (&priv->params_ethtool.arg[arg2] == @@ -208,7 +206,6 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.cqe_zipping = 0; } } - if (was_opened) mlx5e_open_locked(priv->ifp); done: From owner-svn-src-stable-10@freebsd.org Wed Jan 27 15:19:49 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCFA4A705B0; Wed, 27 Jan 2016 15:19:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9DBE012EE; Wed, 27 Jan 2016 15:19:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RFJmBa090562; Wed, 27 Jan 2016 15:19:48 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RFJmYR090561; Wed, 27 Jan 2016 15:19:48 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201601271519.u0RFJmYR090561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 27 Jan 2016 15:19:48 +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: r294921 - stable/10/sys/boot/forth 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.20 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, 27 Jan 2016 15:19:49 -0000 Author: dteske Date: Wed Jan 27 15:19:48 2016 New Revision: 294921 URL: https://svnweb.freebsd.org/changeset/base/294921 Log: MFC 283933: Add comments r283933: Indicate where the flag for later abort" originates. Modified: stable/10/sys/boot/forth/support.4th Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/support.4th ============================================================================== --- stable/10/sys/boot/forth/support.4th Wed Jan 27 15:01:08 2016 (r294920) +++ stable/10/sys/boot/forth/support.4th Wed Jan 27 15:19:48 2016 (r294921) @@ -1460,12 +1460,12 @@ also builtins abort" Unable to load a kernel!" ; -: load_xen ( -- ) +: load_xen ( -- flag ) s" xen_kernel" getenv dup -1 <> if - 1 1 load + 1 1 load ( c-addr/u flag N -- flag ) else drop - 0 + 0 ( -1 -- flag ) then ; From owner-svn-src-stable-10@freebsd.org Wed Jan 27 22:31:10 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3010A6F880; Wed, 27 Jan 2016 22:31:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7CEFA1372; Wed, 27 Jan 2016 22:31:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RMV9Pd019404; Wed, 27 Jan 2016 22:31:09 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RMV8LW019394; Wed, 27 Jan 2016 22:31:08 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201601272231.u0RMV8LW019394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 27 Jan 2016 22:31:08 +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: r294958 - in stable/10: share/man/man4 sys/dev/e1000 sys/dev/ixgb sys/dev/netmap 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.20 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, 27 Jan 2016 22:31:11 -0000 Author: marius Date: Wed Jan 27 22:31:08 2016 New Revision: 294958 URL: https://svnweb.freebsd.org/changeset/base/294958 Log: Sync the e1000 drivers with what's in head as of r294327, modulo parts that don't apply to stable/10 (driver API, if_inc_counter(), RSS changes etc.) and modulo r287465 (which reportedly breaks igb(4)), i. e. assorted fixes and improvements only: o MFC r267385 (partial): - Don't compare bus_dma map pointers for static DMA allocations against NULL to determine if bus_dmamap_unload() or bus_dmamem_free() should be called. Instead, check the associated bus and virtual addresses. - Don't clear static DMA maps to NULL. o MFC r284933: Delete the refernce to VLAN handling being disabled by default. This is no longer the case. [1] o MFC r285639: Add an adapter CORE lock in the DDB hook em_dump_queue to avoid WITNESS panic in em_init_locked() while debugging. o MFC r285879: - Remove unused txd_saved. - Intialize txd_upper, txd_lower and txd_used at declaration. o MFC r286162: Free mbufs when busdma loading fails. o MFC r286829: Add capability to disable CRC stripping as it breaks IPMI/BMC capabilities on certain adatpers. [2] o MFC r286831: [3] - Increase EM_MAX_SCATTER to 64 such that the size of em_xmit():: segs[EM_MAX_SCATTER] doesn't get overrun by things like NFS that can and do shove more than 32 segs when being used with em(4) and TSO4. - Update tso handling code in em_xmit() with update from jhb@ - Set if_hw_tsomax, if_hw_tsomaxsegcount and if_hw_tsomaxsegsize to appropriate values. - Define a TSO workaround "magic" number of 4 that is used to avoid an alignment issue in hardware. - Change a couple of integer values that were used as booleans to actual bool types. - Ensure that em_enable_intr() enables the appropriate mask of interrupts and not just a hardcoded define of values. o MFC r286832: e1000/if_lem.c bump to 1.1.0 o MFC r286833: Bump all copywrite dates to 2015. o MFC r287112: Style/whitespace cleanup in shared/common code. o MFC r293331: - Switch em(4) to the extended RX descriptor format. - Split rxbuffer and txbuffer apart to support the new RX descriptor format structures. Move rxbuffer manipulation to em_setup_rxdesc() to unify the new behavior changes. - Add a RSSKEYLEN macro for help in generating the RSSKEY data structures in the card. - Change em_receive_checksum() to process the new rxdescriptor format status bit. o MFC r293332: Disable the reuse of checksum offload context descriptors in the case of multiple queues in em(4). Document errata in the code. o MFC r293854: Given that em(4), lem(4) and igb(4) hardware doesn't require the alignment guarantees provided by m_defrag(9), use m_collapse(9) instead for performance reasons. While at it, sanitize the statistics softc members, i. e. retire unused ones and add SYSCTL nodes missing for actually used ones. PR: 118693 [1], 161277 [2], 195078 [3], 199174 [3], 200221 [3] Modified: stable/10/share/man/man4/em.4 stable/10/sys/dev/e1000/e1000_80003es2lan.c stable/10/sys/dev/e1000/e1000_80003es2lan.h stable/10/sys/dev/e1000/e1000_82540.c stable/10/sys/dev/e1000/e1000_82541.c stable/10/sys/dev/e1000/e1000_82541.h stable/10/sys/dev/e1000/e1000_82542.c stable/10/sys/dev/e1000/e1000_82543.c stable/10/sys/dev/e1000/e1000_82543.h stable/10/sys/dev/e1000/e1000_82571.c stable/10/sys/dev/e1000/e1000_82571.h stable/10/sys/dev/e1000/e1000_82575.c stable/10/sys/dev/e1000/e1000_82575.h stable/10/sys/dev/e1000/e1000_api.c stable/10/sys/dev/e1000/e1000_api.h stable/10/sys/dev/e1000/e1000_defines.h stable/10/sys/dev/e1000/e1000_hw.h stable/10/sys/dev/e1000/e1000_i210.c stable/10/sys/dev/e1000/e1000_i210.h stable/10/sys/dev/e1000/e1000_ich8lan.c stable/10/sys/dev/e1000/e1000_ich8lan.h stable/10/sys/dev/e1000/e1000_mac.c stable/10/sys/dev/e1000/e1000_mac.h stable/10/sys/dev/e1000/e1000_manage.c stable/10/sys/dev/e1000/e1000_manage.h stable/10/sys/dev/e1000/e1000_mbx.c stable/10/sys/dev/e1000/e1000_mbx.h stable/10/sys/dev/e1000/e1000_nvm.c stable/10/sys/dev/e1000/e1000_nvm.h stable/10/sys/dev/e1000/e1000_osdep.c stable/10/sys/dev/e1000/e1000_osdep.h stable/10/sys/dev/e1000/e1000_phy.c stable/10/sys/dev/e1000/e1000_phy.h stable/10/sys/dev/e1000/e1000_regs.h stable/10/sys/dev/e1000/e1000_vf.c stable/10/sys/dev/e1000/e1000_vf.h stable/10/sys/dev/e1000/if_em.c stable/10/sys/dev/e1000/if_em.h stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/e1000/if_igb.h stable/10/sys/dev/e1000/if_lem.c stable/10/sys/dev/e1000/if_lem.h stable/10/sys/dev/ixgb/if_ixgb.c stable/10/sys/dev/netmap/if_em_netmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/em.4 ============================================================================== --- stable/10/share/man/man4/em.4 Wed Jan 27 21:37:43 2016 (r294957) +++ stable/10/share/man/man4/em.4 Wed Jan 27 22:31:08 2016 (r294958) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2011 +.Dd August 16, 2015 .Dt EM 4 .Os .Sh NAME @@ -205,6 +205,11 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent +.It Va hw.em.disable_crc_stripping +Disable or enable hardware stripping of CRC field. +This is mostly useful on BMC/IPMI shared interfaces where stripping the CRC +causes remote access over IPMI to fail. +Default 0 (enabled). .It Va hw.em.eee_setting Disable or enable Energy Efficient Ethernet. Default 1 (disabled). @@ -307,10 +312,5 @@ The driver was written by .An Intel Corporation Aq freebsd@intel.com . .Sh BUGS -Hardware-assisted VLAN processing is disabled by default. -You can enable it on an -.Nm -interface using -.Xr ifconfig 8 . .Pp Activating EM_MULTIQUEUE support requires MSI-X features. Modified: stable/10/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_80003es2lan.c Wed Jan 27 21:37:43 2016 (r294957) +++ stable/10/sys/dev/e1000/e1000_80003es2lan.c Wed Jan 27 22:31:08 2016 (r294958) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/dev/e1000/e1000_80003es2lan.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_80003es2lan.h Wed Jan 27 21:37:43 2016 (r294957) +++ stable/10/sys/dev/e1000/e1000_80003es2lan.h Wed Jan 27 22:31:08 2016 (r294958) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2013, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/dev/e1000/e1000_82540.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_82540.c Wed Jan 27 21:37:43 2016 (r294957) +++ stable/10/sys/dev/e1000/e1000_82540.c Wed Jan 27 22:31:08 2016 (r294958) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/10/sys/dev/e1000/e1000_82541.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_82541.c Wed Jan 27 21:37:43 2016 (r294957) +++ stable/10/sys/dev/e1000/e1000_82541.c Wed Jan 27 22:31:08 2016 (r294958) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -49,34 +49,34 @@ static s32 e1000_init_mac_params_82541( static s32 e1000_reset_hw_82541(struct e1000_hw *hw); static s32 e1000_init_hw_82541(struct e1000_hw *hw); static s32 e1000_get_link_up_info_82541(struct e1000_hw *hw, u16 *speed, - u16 *duplex); + u16 *duplex); static s32 e1000_phy_hw_reset_82541(struct e1000_hw *hw); static s32 e1000_setup_copper_link_82541(struct e1000_hw *hw); static s32 e1000_check_for_link_82541(struct e1000_hw *hw); static s32 e1000_get_cable_length_igp_82541(struct e1000_hw *hw); static s32 e1000_set_d3_lplu_state_82541(struct e1000_hw *hw, - bool active); + bool active); static s32 e1000_setup_led_82541(struct e1000_hw *hw); static s32 e1000_cleanup_led_82541(struct e1000_hw *hw); static void e1000_clear_hw_cntrs_82541(struct e1000_hw *hw); static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw); static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw, - bool link_up); + bool link_up); static s32 e1000_phy_init_script_82541(struct e1000_hw *hw); static void e1000_power_down_phy_copper_82541(struct e1000_hw *hw); -static const u16 e1000_igp_cable_length_table[] = - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 25, 25, 25, - 25, 25, 25, 25, 30, 30, 30, 30, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 50, 50, 50, 50, 50, 50, 50, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 70, 70, 70, 70, 70, 70, 80, 80, 80, 80, 80, 80, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120}; +static const u16 e1000_igp_cable_length_table[] = { + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, + 10, 10, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25, 25, 30, 30, 30, 30, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 50, 50, 50, 50, 50, 50, 50, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 70, 70, 70, 70, 70, 70, 80, 80, 80, 80, 80, + 80, 90, 90, 90, 90, 90, 90, 90, 90, 90, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, 100, 100, 100, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120}; #define IGP01E1000_AGC_LENGTH_TABLE_SIZE \ - (sizeof(e1000_igp_cable_length_table) / \ - sizeof(e1000_igp_cable_length_table[0])) + (sizeof(e1000_igp_cable_length_table) / \ + sizeof(e1000_igp_cable_length_table[0])) /** * e1000_init_phy_params_82541 - Init PHY func ptrs. @@ -89,23 +89,23 @@ static s32 e1000_init_phy_params_82541(s DEBUGFUNC("e1000_init_phy_params_82541"); - phy->addr = 1; - phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; - phy->reset_delay_us = 10000; - phy->type = e1000_phy_igp; + phy->addr = 1; + phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; + phy->reset_delay_us = 10000; + phy->type = e1000_phy_igp; /* Function Pointers */ - phy->ops.check_polarity = e1000_check_polarity_igp; - phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; - phy->ops.get_cable_length = e1000_get_cable_length_igp_82541; - phy->ops.get_cfg_done = e1000_get_cfg_done_generic; - phy->ops.get_info = e1000_get_phy_info_igp; - phy->ops.read_reg = e1000_read_phy_reg_igp; - phy->ops.reset = e1000_phy_hw_reset_82541; - phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82541; - phy->ops.write_reg = e1000_write_phy_reg_igp; - phy->ops.power_up = e1000_power_up_phy_copper; - phy->ops.power_down = e1000_power_down_phy_copper_82541; + phy->ops.check_polarity = e1000_check_polarity_igp; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; + phy->ops.get_cable_length = e1000_get_cable_length_igp_82541; + phy->ops.get_cfg_done = e1000_get_cfg_done_generic; + phy->ops.get_info = e1000_get_phy_info_igp; + phy->ops.read_reg = e1000_read_phy_reg_igp; + phy->ops.reset = e1000_phy_hw_reset_82541; + phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82541; + phy->ops.write_reg = e1000_write_phy_reg_igp; + phy->ops.power_up = e1000_power_up_phy_copper; + phy->ops.power_down = e1000_power_down_phy_copper_82541; ret_val = e1000_get_phy_id(hw); if (ret_val) @@ -127,8 +127,8 @@ out: **/ static s32 e1000_init_nvm_params_82541(struct e1000_hw *hw) { - struct e1000_nvm_info *nvm = &hw->nvm; - s32 ret_val = E1000_SUCCESS; + struct e1000_nvm_info *nvm = &hw->nvm; + s32 ret_val = E1000_SUCCESS; u32 eecd = E1000_READ_REG(hw, E1000_EECD); u16 size; @@ -152,28 +152,25 @@ static s32 e1000_init_nvm_params_82541(s eecd &= ~E1000_EECD_SIZE; break; default: - nvm->type = eecd & E1000_EECD_TYPE - ? e1000_nvm_eeprom_spi - : e1000_nvm_eeprom_microwire; + nvm->type = eecd & E1000_EECD_TYPE ? e1000_nvm_eeprom_spi + : e1000_nvm_eeprom_microwire; break; } if (nvm->type == e1000_nvm_eeprom_spi) { - nvm->address_bits = (eecd & E1000_EECD_ADDR_BITS) - ? 16 : 8; - nvm->delay_usec = 1; - nvm->opcode_bits = 8; - nvm->page_size = (eecd & E1000_EECD_ADDR_BITS) - ? 32 : 8; + nvm->address_bits = (eecd & E1000_EECD_ADDR_BITS) ? 16 : 8; + nvm->delay_usec = 1; + nvm->opcode_bits = 8; + nvm->page_size = (eecd & E1000_EECD_ADDR_BITS) ? 32 : 8; /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_generic; - nvm->ops.read = e1000_read_nvm_spi; - nvm->ops.release = e1000_release_nvm_generic; - nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.acquire = e1000_acquire_nvm_generic; + nvm->ops.read = e1000_read_nvm_spi; + nvm->ops.release = e1000_release_nvm_generic; + nvm->ops.update = e1000_update_nvm_checksum_generic; nvm->ops.valid_led_default = e1000_valid_led_default_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.write = e1000_write_nvm_spi; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.write = e1000_write_nvm_spi; /* * nvm->word_size must be discovered after the pointers @@ -196,21 +193,19 @@ static s32 e1000_init_nvm_params_82541(s nvm->word_size = 1 << size; } } else { - nvm->address_bits = (eecd & E1000_EECD_ADDR_BITS) - ? 8 : 6; - nvm->delay_usec = 50; - nvm->opcode_bits = 3; - nvm->word_size = (eecd & E1000_EECD_ADDR_BITS) - ? 256 : 64; + nvm->address_bits = (eecd & E1000_EECD_ADDR_BITS) ? 8 : 6; + nvm->delay_usec = 50; + nvm->opcode_bits = 3; + nvm->word_size = (eecd & E1000_EECD_ADDR_BITS) ? 256 : 64; /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_generic; - nvm->ops.read = e1000_read_nvm_microwire; - nvm->ops.release = e1000_release_nvm_generic; - nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.acquire = e1000_acquire_nvm_generic; + nvm->ops.read = e1000_read_nvm_microwire; + nvm->ops.release = e1000_release_nvm_generic; + nvm->ops.update = e1000_update_nvm_checksum_generic; nvm->ops.valid_led_default = e1000_valid_led_default_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.write = e1000_write_nvm_microwire; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.write = e1000_write_nvm_microwire; } out: @@ -390,11 +385,10 @@ static s32 e1000_init_hw_82541(struct e1 DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ } - + /* Storing the Speed Power Down value for later use */ - ret_val = hw->phy.ops.read_reg(hw, - IGP01E1000_GMII_FIFO, - &dev_spec->spd_default); + ret_val = hw->phy.ops.read_reg(hw, IGP01E1000_GMII_FIFO, + &dev_spec->spd_default); if (ret_val) goto out; @@ -423,7 +417,7 @@ static s32 e1000_init_hw_82541(struct e1 txdctl = E1000_READ_REG(hw, E1000_TXDCTL(0)); txdctl = (txdctl & ~E1000_TXDCTL_WTHRESH) | - E1000_TXDCTL_FULL_TX_DESC_WB; + E1000_TXDCTL_FULL_TX_DESC_WB; E1000_WRITE_REG(hw, E1000_TXDCTL(0), txdctl); /* @@ -447,7 +441,7 @@ out: * Retrieve the current speed and duplex configuration. **/ static s32 e1000_get_link_up_info_82541(struct e1000_hw *hw, u16 *speed, - u16 *duplex) + u16 *duplex) { struct e1000_phy_info *phy = &hw->phy; s32 ret_val; @@ -549,6 +543,7 @@ static s32 e1000_setup_copper_link_82541 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); E1000_WRITE_REG(hw, E1000_CTRL, ctrl); + /* Earlier revs of the IGP phy require us to force MDI. */ if (hw->mac.type == e1000_82541 || hw->mac.type == e1000_82547) { dev_spec->dsp_config = e1000_dsp_config_disabled; @@ -651,9 +646,8 @@ static s32 e1000_check_for_link_82541(st * different link partner. */ ret_val = e1000_config_fc_after_link_up_generic(hw); - if (ret_val) { + if (ret_val) DEBUGOUT("Error configuring flow control\n"); - } out: return ret_val; @@ -671,7 +665,7 @@ out: * gigabit link is achieved to improve link quality. **/ static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw, - bool link_up) + bool link_up) { struct e1000_phy_info *phy = &hw->phy; struct e1000_dev_spec_82541 *dev_spec = &hw->dev_spec._82541; @@ -679,11 +673,11 @@ static s32 e1000_config_dsp_after_link_c u32 idle_errs = 0; u16 phy_data, phy_saved_data, speed, duplex, i; u16 ffe_idle_err_timeout = FFE_IDLE_ERR_COUNT_TIMEOUT_20; - u16 dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = - {IGP01E1000_PHY_AGC_PARAM_A, - IGP01E1000_PHY_AGC_PARAM_B, - IGP01E1000_PHY_AGC_PARAM_C, - IGP01E1000_PHY_AGC_PARAM_D}; + u16 dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = { + IGP01E1000_PHY_AGC_PARAM_A, + IGP01E1000_PHY_AGC_PARAM_B, + IGP01E1000_PHY_AGC_PARAM_C, + IGP01E1000_PHY_AGC_PARAM_D}; DEBUGFUNC("e1000_config_dsp_after_link_change_82541"); @@ -708,16 +702,16 @@ static s32 e1000_config_dsp_after_link_c for (i = 0; i < IGP01E1000_PHY_CHANNEL_NUM; i++) { ret_val = phy->ops.read_reg(hw, - dsp_reg_array[i], - &phy_data); + dsp_reg_array[i], + &phy_data); if (ret_val) goto out; phy_data &= ~IGP01E1000_PHY_EDAC_MU_INDEX; ret_val = phy->ops.write_reg(hw, - dsp_reg_array[i], - phy_data); + dsp_reg_array[i], + phy_data); if (ret_val) goto out; } @@ -737,9 +731,8 @@ static s32 e1000_config_dsp_after_link_c for (i = 0; i < ffe_idle_err_timeout; i++) { usec_delay(1000); - ret_val = phy->ops.read_reg(hw, - PHY_1000T_STATUS, - &phy_data); + ret_val = phy->ops.read_reg(hw, PHY_1000T_STATUS, + &phy_data); if (ret_val) goto out; @@ -748,8 +741,8 @@ static s32 e1000_config_dsp_after_link_c dev_spec->ffe_config = e1000_ffe_config_active; ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_DSP_FFE, - IGP01E1000_PHY_DSP_FFE_CM_CP); + IGP01E1000_PHY_DSP_FFE, + IGP01E1000_PHY_DSP_FFE_CM_CP); if (ret_val) goto out; break; @@ -757,7 +750,7 @@ static s32 e1000_config_dsp_after_link_c if (idle_errs) ffe_idle_err_timeout = - FFE_IDLE_ERR_COUNT_TIMEOUT_100; + FFE_IDLE_ERR_COUNT_TIMEOUT_100; } } else { if (dev_spec->dsp_config == e1000_dsp_config_activated) { @@ -765,9 +758,8 @@ static s32 e1000_config_dsp_after_link_c * Save off the current value of register 0x2F5B * to be restored at the end of the routines. */ - ret_val = phy->ops.read_reg(hw, - 0x2F5B, - &phy_saved_data); + ret_val = phy->ops.read_reg(hw, 0x2F5B, + &phy_saved_data); if (ret_val) goto out; @@ -778,15 +770,14 @@ static s32 e1000_config_dsp_after_link_c msec_delay_irq(20); - ret_val = phy->ops.write_reg(hw, - 0x0000, - IGP01E1000_IEEE_FORCE_GIG); + ret_val = phy->ops.write_reg(hw, 0x0000, + IGP01E1000_IEEE_FORCE_GIG); if (ret_val) goto out; for (i = 0; i < IGP01E1000_PHY_CHANNEL_NUM; i++) { ret_val = phy->ops.read_reg(hw, - dsp_reg_array[i], - &phy_data); + dsp_reg_array[i], + &phy_data); if (ret_val) goto out; @@ -794,24 +785,22 @@ static s32 e1000_config_dsp_after_link_c phy_data |= IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS; ret_val = phy->ops.write_reg(hw, - dsp_reg_array[i], - phy_data); + dsp_reg_array[i], + phy_data); if (ret_val) goto out; } - ret_val = phy->ops.write_reg(hw, - 0x0000, - IGP01E1000_IEEE_RESTART_AUTONEG); + ret_val = phy->ops.write_reg(hw, 0x0000, + IGP01E1000_IEEE_RESTART_AUTONEG); if (ret_val) goto out; msec_delay_irq(20); /* Now enable the transmitter */ - ret_val = phy->ops.write_reg(hw, - 0x2F5B, - phy_saved_data); + ret_val = phy->ops.write_reg(hw, 0x2F5B, + phy_saved_data); if (ret_val) goto out; @@ -838,21 +827,18 @@ static s32 e1000_config_dsp_after_link_c msec_delay_irq(20); - ret_val = phy->ops.write_reg(hw, - 0x0000, - IGP01E1000_IEEE_FORCE_GIG); + ret_val = phy->ops.write_reg(hw, 0x0000, + IGP01E1000_IEEE_FORCE_GIG); if (ret_val) goto out; - ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_DSP_FFE, - IGP01E1000_PHY_DSP_FFE_DEFAULT); + ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_DSP_FFE, + IGP01E1000_PHY_DSP_FFE_DEFAULT); if (ret_val) goto out; - ret_val = phy->ops.write_reg(hw, - 0x0000, - IGP01E1000_IEEE_RESTART_AUTONEG); + ret_val = phy->ops.write_reg(hw, 0x0000, + IGP01E1000_IEEE_RESTART_AUTONEG); if (ret_val) goto out; @@ -889,11 +875,10 @@ static s32 e1000_get_cable_length_igp_82 u16 i, data; u16 cur_agc_value, agc_value = 0; u16 min_agc_value = IGP01E1000_AGC_LENGTH_TABLE_SIZE; - u16 agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = - {IGP01E1000_PHY_AGC_A, - IGP01E1000_PHY_AGC_B, - IGP01E1000_PHY_AGC_C, - IGP01E1000_PHY_AGC_D}; + u16 agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = {IGP01E1000_PHY_AGC_A, + IGP01E1000_PHY_AGC_B, + IGP01E1000_PHY_AGC_C, + IGP01E1000_PHY_AGC_D}; DEBUGFUNC("e1000_get_cable_length_igp_82541"); @@ -929,12 +914,12 @@ static s32 e1000_get_cable_length_igp_82 } phy->min_cable_length = (e1000_igp_cable_length_table[agc_value] > - IGP01E1000_AGC_RANGE) - ? (e1000_igp_cable_length_table[agc_value] - - IGP01E1000_AGC_RANGE) - : 0; + IGP01E1000_AGC_RANGE) + ? (e1000_igp_cable_length_table[agc_value] - + IGP01E1000_AGC_RANGE) + : 0; phy->max_cable_length = e1000_igp_cable_length_table[agc_value] + - IGP01E1000_AGC_RANGE; + IGP01E1000_AGC_RANGE; phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; @@ -992,50 +977,48 @@ static s32 e1000_set_d3_lplu_state_82541 */ if (phy->smart_speed == e1000_smart_speed_on) { ret_val = phy->ops.read_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - &data); + IGP01E1000_PHY_PORT_CONFIG, + &data); if (ret_val) goto out; data |= IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - data); + IGP01E1000_PHY_PORT_CONFIG, + data); if (ret_val) goto out; } else if (phy->smart_speed == e1000_smart_speed_off) { ret_val = phy->ops.read_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - &data); + IGP01E1000_PHY_PORT_CONFIG, + &data); if (ret_val) goto out; data &= ~IGP01E1000_PSCFR_SMART_SPEED; ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - data); + IGP01E1000_PHY_PORT_CONFIG, + data); if (ret_val) goto out; } } else if ((phy->autoneg_advertised == E1000_ALL_SPEED_DUPLEX) || - (phy->autoneg_advertised == E1000_ALL_NOT_GIG) || - (phy->autoneg_advertised == E1000_ALL_10_SPEED)) { + (phy->autoneg_advertised == E1000_ALL_NOT_GIG) || + (phy->autoneg_advertised == E1000_ALL_10_SPEED)) { data |= IGP01E1000_GMII_FLEX_SPD; ret_val = phy->ops.write_reg(hw, IGP01E1000_GMII_FIFO, data); if (ret_val) goto out; /* When LPLU is enabled, we should disable SmartSpeed */ - ret_val = phy->ops.read_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - &data); + ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + &data); if (ret_val) goto out; data &= ~IGP01E1000_PSCFR_SMART_SPEED; - ret_val = phy->ops.write_reg(hw, - IGP01E1000_PHY_PORT_CONFIG, - data); + ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + data); } out: @@ -1056,16 +1039,14 @@ static s32 e1000_setup_led_82541(struct DEBUGFUNC("e1000_setup_led_82541"); - ret_val = hw->phy.ops.read_reg(hw, - IGP01E1000_GMII_FIFO, - &dev_spec->spd_default); + ret_val = hw->phy.ops.read_reg(hw, IGP01E1000_GMII_FIFO, + &dev_spec->spd_default); if (ret_val) goto out; - ret_val = hw->phy.ops.write_reg(hw, - IGP01E1000_GMII_FIFO, - (u16)(dev_spec->spd_default & - ~IGP01E1000_GMII_SPD)); + ret_val = hw->phy.ops.write_reg(hw, IGP01E1000_GMII_FIFO, + (u16)(dev_spec->spd_default & + ~IGP01E1000_GMII_SPD)); if (ret_val) goto out; @@ -1089,9 +1070,8 @@ static s32 e1000_cleanup_led_82541(struc DEBUGFUNC("e1000_cleanup_led_82541"); - ret_val = hw->phy.ops.write_reg(hw, - IGP01E1000_GMII_FIFO, - dev_spec->spd_default); + ret_val = hw->phy.ops.write_reg(hw, IGP01E1000_GMII_FIFO, + dev_spec->spd_default); if (ret_val) goto out; @@ -1178,14 +1158,12 @@ static s32 e1000_phy_init_script_82541(s u16 fused, fine, coarse; /* Move to analog registers page */ - hw->phy.ops.read_reg(hw, - IGP01E1000_ANALOG_SPARE_FUSE_STATUS, - &fused); + hw->phy.ops.read_reg(hw, IGP01E1000_ANALOG_SPARE_FUSE_STATUS, + &fused); if (!(fused & IGP01E1000_ANALOG_SPARE_FUSE_ENABLED)) { - hw->phy.ops.read_reg(hw, - IGP01E1000_ANALOG_FUSE_STATUS, - &fused); + hw->phy.ops.read_reg(hw, IGP01E1000_ANALOG_FUSE_STATUS, + &fused); fine = fused & IGP01E1000_ANALOG_FUSE_FINE_MASK; coarse = fused & IGP01E1000_ANALOG_FUSE_COARSE_MASK; @@ -1194,19 +1172,19 @@ static s32 e1000_phy_init_script_82541(s coarse -= IGP01E1000_ANALOG_FUSE_COARSE_10; fine -= IGP01E1000_ANALOG_FUSE_FINE_1; } else if (coarse == - IGP01E1000_ANALOG_FUSE_COARSE_THRESH) + IGP01E1000_ANALOG_FUSE_COARSE_THRESH) fine -= IGP01E1000_ANALOG_FUSE_FINE_10; fused = (fused & IGP01E1000_ANALOG_FUSE_POLY_MASK) | - (fine & IGP01E1000_ANALOG_FUSE_FINE_MASK) | - (coarse & IGP01E1000_ANALOG_FUSE_COARSE_MASK); + (fine & IGP01E1000_ANALOG_FUSE_FINE_MASK) | + (coarse & IGP01E1000_ANALOG_FUSE_COARSE_MASK); hw->phy.ops.write_reg(hw, - IGP01E1000_ANALOG_FUSE_CONTROL, - fused); + IGP01E1000_ANALOG_FUSE_CONTROL, + fused); hw->phy.ops.write_reg(hw, - IGP01E1000_ANALOG_FUSE_BYPASS, - IGP01E1000_ANALOG_FUSE_ENABLE_SW_CONTROL); + IGP01E1000_ANALOG_FUSE_BYPASS, + IGP01E1000_ANALOG_FUSE_ENABLE_SW_CONTROL); } } Modified: stable/10/sys/dev/e1000/e1000_82541.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_82541.h Wed Jan 27 21:37:43 2016 (r294957) +++ stable/10/sys/dev/e1000/e1000_82541.h Wed Jan 27 22:31:08 2016 (r294958) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -37,55 +37,55 @@ #define NVM_WORD_SIZE_BASE_SHIFT_82541 (NVM_WORD_SIZE_BASE_SHIFT + 1) -#define IGP01E1000_PHY_CHANNEL_NUM 4 +#define IGP01E1000_PHY_CHANNEL_NUM 4 -#define IGP01E1000_PHY_AGC_A 0x1172 -#define IGP01E1000_PHY_AGC_B 0x1272 -#define IGP01E1000_PHY_AGC_C 0x1472 -#define IGP01E1000_PHY_AGC_D 0x1872 - -#define IGP01E1000_PHY_AGC_PARAM_A 0x1171 -#define IGP01E1000_PHY_AGC_PARAM_B 0x1271 -#define IGP01E1000_PHY_AGC_PARAM_C 0x1471 -#define IGP01E1000_PHY_AGC_PARAM_D 0x1871 - -#define IGP01E1000_PHY_EDAC_MU_INDEX 0xC000 -#define IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS 0x8000 - -#define IGP01E1000_PHY_DSP_RESET 0x1F33 - -#define IGP01E1000_PHY_DSP_FFE 0x1F35 -#define IGP01E1000_PHY_DSP_FFE_CM_CP 0x0069 -#define IGP01E1000_PHY_DSP_FFE_DEFAULT 0x002A - -#define IGP01E1000_IEEE_FORCE_GIG 0x0140 -#define IGP01E1000_IEEE_RESTART_AUTONEG 0x3300 - -#define IGP01E1000_AGC_LENGTH_SHIFT 7 -#define IGP01E1000_AGC_RANGE 10 - -#define FFE_IDLE_ERR_COUNT_TIMEOUT_20 20 -#define FFE_IDLE_ERR_COUNT_TIMEOUT_100 100 - -#define IGP01E1000_ANALOG_FUSE_STATUS 0x20D0 -#define IGP01E1000_ANALOG_SPARE_FUSE_STATUS 0x20D1 -#define IGP01E1000_ANALOG_FUSE_CONTROL 0x20DC -#define IGP01E1000_ANALOG_FUSE_BYPASS 0x20DE - -#define IGP01E1000_ANALOG_SPARE_FUSE_ENABLED 0x0100 -#define IGP01E1000_ANALOG_FUSE_FINE_MASK 0x0F80 -#define IGP01E1000_ANALOG_FUSE_COARSE_MASK 0x0070 -#define IGP01E1000_ANALOG_FUSE_COARSE_THRESH 0x0040 -#define IGP01E1000_ANALOG_FUSE_COARSE_10 0x0010 -#define IGP01E1000_ANALOG_FUSE_FINE_1 0x0080 -#define IGP01E1000_ANALOG_FUSE_FINE_10 0x0500 -#define IGP01E1000_ANALOG_FUSE_POLY_MASK 0xF000 +#define IGP01E1000_PHY_AGC_A 0x1172 +#define IGP01E1000_PHY_AGC_B 0x1272 +#define IGP01E1000_PHY_AGC_C 0x1472 +#define IGP01E1000_PHY_AGC_D 0x1872 + +#define IGP01E1000_PHY_AGC_PARAM_A 0x1171 +#define IGP01E1000_PHY_AGC_PARAM_B 0x1271 +#define IGP01E1000_PHY_AGC_PARAM_C 0x1471 +#define IGP01E1000_PHY_AGC_PARAM_D 0x1871 + +#define IGP01E1000_PHY_EDAC_MU_INDEX 0xC000 +#define IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS 0x8000 + +#define IGP01E1000_PHY_DSP_RESET 0x1F33 + +#define IGP01E1000_PHY_DSP_FFE 0x1F35 +#define IGP01E1000_PHY_DSP_FFE_CM_CP 0x0069 +#define IGP01E1000_PHY_DSP_FFE_DEFAULT 0x002A + +#define IGP01E1000_IEEE_FORCE_GIG 0x0140 +#define IGP01E1000_IEEE_RESTART_AUTONEG 0x3300 + +#define IGP01E1000_AGC_LENGTH_SHIFT 7 +#define IGP01E1000_AGC_RANGE 10 + +#define FFE_IDLE_ERR_COUNT_TIMEOUT_20 20 +#define FFE_IDLE_ERR_COUNT_TIMEOUT_100 100 + +#define IGP01E1000_ANALOG_FUSE_STATUS 0x20D0 +#define IGP01E1000_ANALOG_SPARE_FUSE_STATUS 0x20D1 +#define IGP01E1000_ANALOG_FUSE_CONTROL 0x20DC +#define IGP01E1000_ANALOG_FUSE_BYPASS 0x20DE + +#define IGP01E1000_ANALOG_SPARE_FUSE_ENABLED 0x0100 +#define IGP01E1000_ANALOG_FUSE_FINE_MASK 0x0F80 +#define IGP01E1000_ANALOG_FUSE_COARSE_MASK 0x0070 +#define IGP01E1000_ANALOG_FUSE_COARSE_THRESH 0x0040 +#define IGP01E1000_ANALOG_FUSE_COARSE_10 0x0010 +#define IGP01E1000_ANALOG_FUSE_FINE_1 0x0080 +#define IGP01E1000_ANALOG_FUSE_FINE_10 0x0500 +#define IGP01E1000_ANALOG_FUSE_POLY_MASK 0xF000 #define IGP01E1000_ANALOG_FUSE_ENABLE_SW_CONTROL 0x0002 -#define IGP01E1000_MSE_CHANNEL_D 0x000F -#define IGP01E1000_MSE_CHANNEL_C 0x00F0 -#define IGP01E1000_MSE_CHANNEL_B 0x0F00 -#define IGP01E1000_MSE_CHANNEL_A 0xF000 +#define IGP01E1000_MSE_CHANNEL_D 0x000F +#define IGP01E1000_MSE_CHANNEL_C 0x00F0 +#define IGP01E1000_MSE_CHANNEL_B 0x0F00 +#define IGP01E1000_MSE_CHANNEL_A 0xF000 void e1000_init_script_state_82541(struct e1000_hw *hw, bool state); Modified: stable/10/sys/dev/e1000/e1000_82542.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_82542.c Wed Jan 27 21:37:43 2016 (r294957) +++ stable/10/sys/dev/e1000/e1000_82542.c Wed Jan 27 22:31:08 2016 (r294958) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2014, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -62,7 +62,7 @@ static s32 e1000_init_phy_params_82542(s DEBUGFUNC("e1000_init_phy_params_82542"); - phy->type = e1000_phy_none; + phy->type = e1000_phy_none; return ret_val; } @@ -77,18 +77,18 @@ static s32 e1000_init_nvm_params_82542(s DEBUGFUNC("e1000_init_nvm_params_82542"); - nvm->address_bits = 6; - nvm->delay_usec = 50; - nvm->opcode_bits = 3; - nvm->type = e1000_nvm_eeprom_microwire; - nvm->word_size = 64; + nvm->address_bits = 6; + nvm->delay_usec = 50; + nvm->opcode_bits = 3; + nvm->type = e1000_nvm_eeprom_microwire; + nvm->word_size = 64; /* Function Pointers */ - nvm->ops.read = e1000_read_nvm_microwire; - nvm->ops.release = e1000_stop_nvm; - nvm->ops.write = e1000_write_nvm_microwire; - nvm->ops.update = e1000_update_nvm_checksum_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.read = e1000_read_nvm_microwire; + nvm->ops.release = e1000_stop_nvm; + nvm->ops.write = e1000_write_nvm_microwire; + nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; return E1000_SUCCESS; } @@ -124,7 +124,8 @@ static s32 e1000_init_mac_params_82542(s /* link setup */ mac->ops.setup_link = e1000_setup_link_82542; /* phy/fiber/serdes setup */ - mac->ops.setup_physical_interface = e1000_setup_fiber_serdes_link_generic; + mac->ops.setup_physical_interface = + e1000_setup_fiber_serdes_link_generic; /* check for link */ mac->ops.check_for_link = e1000_check_for_fiber_link_generic; /* multicast address update */ @@ -143,7 +144,8 @@ static s32 e1000_init_mac_params_82542(s /* clear hardware counters */ mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82542; /* link info */ - mac->ops.get_link_up_info = e1000_get_speed_and_duplex_fiber_serdes_generic; + mac->ops.get_link_up_info = + e1000_get_speed_and_duplex_fiber_serdes_generic; return E1000_SUCCESS; } @@ -325,7 +327,7 @@ static s32 e1000_setup_link_82542(struct hw->fc.requested_mode &= ~e1000_fc_tx_pause; - if (mac->report_tx_early == 1) + if (mac->report_tx_early) hw->fc.requested_mode &= ~e1000_fc_rx_pause; /* @@ -335,7 +337,7 @@ static s32 e1000_setup_link_82542(struct hw->fc.current_mode = hw->fc.requested_mode; DEBUGOUT1("After fix-ups FlowControl is now = %x\n", - hw->fc.current_mode); + hw->fc.current_mode); /* Call the necessary subroutine to configure the link. */ ret_val = mac->ops.setup_physical_interface(hw); @@ -419,9 +421,8 @@ static int e1000_rar_set_82542(struct e1 * HW expects these in little endian so we reverse the byte order * from network order (big endian) to little endian */ - rar_low = ((u32) addr[0] | - ((u32) addr[1] << 8) | - ((u32) addr[2] << 16) | ((u32) addr[3] << 24)); + rar_low = ((u32) addr[0] | ((u32) addr[1] << 8) | + ((u32) addr[2] << 16) | ((u32) addr[3] << 24)); rar_high = ((u32) addr[4] | ((u32) addr[5] << 8)); @@ -431,6 +432,7 @@ static int e1000_rar_set_82542(struct e1 E1000_WRITE_REG_ARRAY(hw, E1000_RA, (index << 1), rar_low); E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((index << 1) + 1), rar_high); + return E1000_SUCCESS; } Modified: stable/10/sys/dev/e1000/e1000_82543.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_82543.c Wed Jan 27 21:37:43 2016 (r294957) +++ stable/10/sys/dev/e1000/e1000_82543.c Wed Jan 27 22:31:08 2016 (r294958) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2011, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,9 +47,9 @@ static s32 e1000_init_phy_params_82543( static s32 e1000_init_nvm_params_82543(struct e1000_hw *hw); static s32 e1000_init_mac_params_82543(struct e1000_hw *hw); static s32 e1000_read_phy_reg_82543(struct e1000_hw *hw, u32 offset, - u16 *data); + u16 *data); static s32 e1000_write_phy_reg_82543(struct e1000_hw *hw, u32 offset, - u16 data); + u16 data); static s32 e1000_phy_force_speed_duplex_82543(struct e1000_hw *hw); static s32 e1000_phy_hw_reset_82543(struct e1000_hw *hw); static s32 e1000_reset_hw_82543(struct e1000_hw *hw); @@ -62,7 +62,7 @@ static s32 e1000_check_for_fiber_link_8 static s32 e1000_led_on_82543(struct e1000_hw *hw); static s32 e1000_led_off_82543(struct e1000_hw *hw); static void e1000_write_vfta_82543(struct e1000_hw *hw, u32 offset, - u32 value); + u32 value); static void e1000_clear_hw_cntrs_82543(struct e1000_hw *hw); static s32 e1000_config_mac_to_phy_82543(struct e1000_hw *hw); static bool e1000_init_phy_disabled_82543(struct e1000_hw *hw); @@ -71,7 +71,7 @@ static s32 e1000_polarity_reversal_work static void e1000_raise_mdi_clk_82543(struct e1000_hw *hw, u32 *ctrl); static u16 e1000_shift_in_mdi_bits_82543(struct e1000_hw *hw); static void e1000_shift_out_mdi_bits_82543(struct e1000_hw *hw, u32 data, - u16 count); + u16 count); static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw); static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state); static s32 e1000_read_mac_addr_82543(struct e1000_hw *hw); @@ -89,34 +89,34 @@ static s32 e1000_init_phy_params_82543(s DEBUGFUNC("e1000_init_phy_params_82543"); if (hw->phy.media_type != e1000_media_type_copper) { - phy->type = e1000_phy_none; + phy->type = e1000_phy_none; goto out; } else { - phy->ops.power_up = e1000_power_up_phy_copper; - phy->ops.power_down = e1000_power_down_phy_copper; + phy->ops.power_up = e1000_power_up_phy_copper; + phy->ops.power_down = e1000_power_down_phy_copper; } - phy->addr = 1; - phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; - phy->reset_delay_us = 10000; - phy->type = e1000_phy_m88; + phy->addr = 1; + phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; + phy->reset_delay_us = 10000; + phy->type = e1000_phy_m88; /* Function Pointers */ - phy->ops.check_polarity = e1000_check_polarity_m88; - phy->ops.commit = e1000_phy_sw_reset_generic; - phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_82543; - phy->ops.get_cable_length = e1000_get_cable_length_m88; - phy->ops.get_cfg_done = e1000_get_cfg_done_generic; - phy->ops.read_reg = (hw->mac.type == e1000_82543) - ? e1000_read_phy_reg_82543 - : e1000_read_phy_reg_m88; - phy->ops.reset = (hw->mac.type == e1000_82543) - ? e1000_phy_hw_reset_82543 - : e1000_phy_hw_reset_generic; - phy->ops.write_reg = (hw->mac.type == e1000_82543) - ? e1000_write_phy_reg_82543 - : e1000_write_phy_reg_m88; - phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.commit = e1000_phy_sw_reset_generic; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_82543; + phy->ops.get_cable_length = e1000_get_cable_length_m88; + phy->ops.get_cfg_done = e1000_get_cfg_done_generic; + phy->ops.read_reg = (hw->mac.type == e1000_82543) + ? e1000_read_phy_reg_82543 + : e1000_read_phy_reg_m88; + phy->ops.reset = (hw->mac.type == e1000_82543) + ? e1000_phy_hw_reset_82543 + : e1000_phy_hw_reset_generic; + phy->ops.write_reg = (hw->mac.type == e1000_82543) + ? e1000_write_phy_reg_82543 + : e1000_write_phy_reg_m88; + phy->ops.get_info = e1000_get_phy_info_m88; /* * The external PHY of the 82543 can be in a funky state. @@ -170,18 +170,18 @@ static s32 e1000_init_nvm_params_82543(s DEBUGFUNC("e1000_init_nvm_params_82543"); - nvm->type = e1000_nvm_eeprom_microwire; - nvm->word_size = 64; - nvm->delay_usec = 50; - nvm->address_bits = 6; - nvm->opcode_bits = 3; + nvm->type = e1000_nvm_eeprom_microwire; + nvm->word_size = 64; + nvm->delay_usec = 50; + nvm->address_bits = 6; + nvm->opcode_bits = 3; /* Function Pointers */ - nvm->ops.read = e1000_read_nvm_microwire; - nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.read = e1000_read_nvm_microwire; + nvm->ops.update = e1000_update_nvm_checksum_generic; nvm->ops.valid_led_default = e1000_valid_led_default_generic; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.write = e1000_write_nvm_microwire; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.write = e1000_write_nvm_microwire; return E1000_SUCCESS; } @@ -226,19 +226,18 @@ static s32 e1000_init_mac_params_82543(s mac->ops.setup_link = e1000_setup_link_82543; /* physical interface setup */ mac->ops.setup_physical_interface = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_setup_copper_link_82543 - : e1000_setup_fiber_link_82543; + (hw->phy.media_type == e1000_media_type_copper) + ? e1000_setup_copper_link_82543 : e1000_setup_fiber_link_82543; /* check for link */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Wed Jan 27 22:48:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6410AA6FFA7; Wed, 27 Jan 2016 22:48:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 2C4498C; Wed, 27 Jan 2016 22:48:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RMm5Ui025189; Wed, 27 Jan 2016 22:48:05 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RMm5Ia025186; Wed, 27 Jan 2016 22:48:05 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201601272248.u0RMm5Ia025186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 27 Jan 2016 22:48:05 +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: r294959 - in stable/10/sys: dev/uart kern 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.20 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, 27 Jan 2016 22:48:06 -0000 Author: marius Date: Wed Jan 27 22:48:04 2016 New Revision: 294959 URL: https://svnweb.freebsd.org/changeset/base/294959 Log: MFC: r294362, r294414, r294753 - Fix tty_drain() and, thus, TIOCDRAIN of the current tty(4) incarnation to actually wait until the TX FIFOs of UARTs have be drained before returning. This is done by bringing the equivalent of the TS_BUSY flag found in the previous implementation back in an ABI-preserving way. Reported and tested by: Patrick Powell - Make the code consistent with itself style-wise and bring it closer to style(9). - Mark unused arguments as such. - Make the ttystates table const. Modified: stable/10/sys/dev/uart/uart_tty.c stable/10/sys/kern/tty.c stable/10/sys/sys/ttydevsw.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_tty.c ============================================================================== --- stable/10/sys/dev/uart/uart_tty.c Wed Jan 27 22:31:08 2016 (r294958) +++ stable/10/sys/dev/uart/uart_tty.c Wed Jan 27 22:48:04 2016 (r294959) @@ -57,6 +57,16 @@ static cn_putc_t uart_cnputc; static cn_grab_t uart_cngrab; static cn_ungrab_t uart_cnungrab; +static tsw_open_t uart_tty_open; +static tsw_close_t uart_tty_close; +static tsw_outwakeup_t uart_tty_outwakeup; +static tsw_inwakeup_t uart_tty_inwakeup; +static tsw_ioctl_t uart_tty_ioctl; +static tsw_param_t uart_tty_param; +static tsw_modem_t uart_tty_modem; +static tsw_free_t uart_tty_free; +static tsw_busy_t uart_tty_busy; + CONSOLE_DRIVER(uart); static struct uart_devinfo uart_console; @@ -157,7 +167,7 @@ uart_tty_close(struct tty *tp) struct uart_softc *sc; sc = tty_softc(tp); - if (sc == NULL || sc->sc_leaving || !sc->sc_opened) + if (sc == NULL || sc->sc_leaving || !sc->sc_opened) return; if (sc->sc_hwiflow) @@ -169,7 +179,6 @@ uart_tty_close(struct tty *tp) wakeup(sc); sc->sc_opened = 0; - return; } static void @@ -215,7 +224,8 @@ uart_tty_inwakeup(struct tty *tp) } static int -uart_tty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) +uart_tty_ioctl(struct tty *tp, u_long cmd, caddr_t data, + struct thread *td __unused) { struct uart_softc *sc; @@ -262,8 +272,8 @@ uart_tty_param(struct tty *tp, struct te } stopbits = (t->c_cflag & CSTOPB) ? 2 : 1; if (t->c_cflag & PARENB) - parity = (t->c_cflag & PARODD) ? UART_PARITY_ODD - : UART_PARITY_EVEN; + parity = (t->c_cflag & PARODD) ? UART_PARITY_ODD : + UART_PARITY_EVEN; else parity = UART_PARITY_NONE; if (UART_PARAM(sc, t->c_ospeed, databits, stopbits, parity) != 0) @@ -291,7 +301,7 @@ uart_tty_modem(struct tty *tp, int biton sc = tty_softc(tp); if (biton != 0 || bitoff != 0) - UART_SETSIG(sc, SER_DELTA(bitoff|biton) | biton); + UART_SETSIG(sc, SER_DELTA(bitoff | biton) | biton); return (sc->sc_hwsig); } @@ -350,7 +360,7 @@ uart_tty_intr(void *arg) } static void -uart_tty_free(void *arg) +uart_tty_free(void *arg __unused) { /* @@ -361,6 +371,18 @@ uart_tty_free(void *arg) */ } +static bool +uart_tty_busy(struct tty *tp) +{ + struct uart_softc *sc; + + sc = tty_softc(tp); + if (sc == NULL || sc->sc_leaving) + return (FALSE); + + return (sc->sc_txbusy); +} + static struct ttydevsw uart_tty_class = { .tsw_flags = TF_INITLOCK|TF_CALLOUT, .tsw_open = uart_tty_open, @@ -371,6 +393,7 @@ static struct ttydevsw uart_tty_class = .tsw_param = uart_tty_param, .tsw_modem = uart_tty_modem, .tsw_free = uart_tty_free, + .tsw_busy = uart_tty_busy, }; int Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Wed Jan 27 22:31:08 2016 (r294958) +++ stable/10/sys/kern/tty.c Wed Jan 27 22:48:04 2016 (r294959) @@ -132,11 +132,11 @@ tty_drain(struct tty *tp, int leaving) /* buffer is inaccessible */ return (0); - while (ttyoutq_bytesused(&tp->t_outq) > 0) { + while (ttyoutq_bytesused(&tp->t_outq) > 0 || ttydevsw_busy(tp)) { ttydevsw_outwakeup(tp); /* Could be handled synchronously. */ bytesused = ttyoutq_bytesused(&tp->t_outq); - if (bytesused == 0) + if (bytesused == 0 && !ttydevsw_busy(tp)) return (0); /* Wait for data to be drained. */ @@ -175,6 +175,7 @@ tty_drain(struct tty *tp, int leaving) static __inline int ttydev_enter(struct tty *tp) { + tty_lock(tp); if (tty_gone(tp) || !tty_opened(tp)) { @@ -189,6 +190,7 @@ ttydev_enter(struct tty *tp) static void ttydev_leave(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); if (tty_opened(tp) || tp->t_flags & TF_OPENCLOSE) { @@ -234,7 +236,8 @@ ttydev_leave(struct tty *tp) * Operations that are exposed through the character device in /dev. */ static int -ttydev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +ttydev_open(struct cdev *dev, int oflags, int devtype __unused, + struct thread *td) { struct tty *tp; int error = 0; @@ -332,7 +335,8 @@ done: tp->t_flags &= ~TF_OPENCLOSE; } static int -ttydev_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +ttydev_close(struct cdev *dev, int fflag, int devtype __unused, + struct thread *td __unused) { struct tty *tp = dev->si_drv1; @@ -373,6 +377,7 @@ ttydev_close(struct cdev *dev, int fflag static __inline int tty_is_ctty(struct tty *tp, struct proc *p) { + tty_lock_assert(tp, MA_OWNED); return (p->p_session == tp->t_session && p->p_flag & P_CONTROLT); @@ -653,7 +658,7 @@ tty_kqops_read_detach(struct knote *kn) } static int -tty_kqops_read_event(struct knote *kn, long hint) +tty_kqops_read_event(struct knote *kn, long hint __unused) { struct tty *tp = kn->kn_hook; @@ -677,7 +682,7 @@ tty_kqops_write_detach(struct knote *kn) } static int -tty_kqops_write_event(struct knote *kn, long hint) +tty_kqops_write_event(struct knote *kn, long hint __unused) { struct tty *tp = kn->kn_hook; @@ -697,6 +702,7 @@ static struct filterops tty_kqops_read = .f_detach = tty_kqops_read_detach, .f_event = tty_kqops_read_event, }; + static struct filterops tty_kqops_write = { .f_isfd = 1, .f_detach = tty_kqops_write_detach, @@ -752,7 +758,8 @@ static struct cdevsw ttydev_cdevsw = { */ static int -ttyil_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +ttyil_open(struct cdev *dev, int oflags __unused, int devtype __unused, + struct thread *td) { struct tty *tp; int error = 0; @@ -771,14 +778,18 @@ ttyil_open(struct cdev *dev, int oflags, } static int -ttyil_close(struct cdev *dev, int flag, int mode, struct thread *td) +ttyil_close(struct cdev *dev __unused, int flag __unused, int mode __unused, + struct thread *td __unused) { + return (0); } static int -ttyil_rdwr(struct cdev *dev, struct uio *uio, int ioflag) +ttyil_rdwr(struct cdev *dev __unused, struct uio *uio __unused, + int ioflag __unused) { + return (ENODEV); } @@ -875,45 +886,49 @@ tty_init_console(struct tty *tp, speed_t */ static int -ttydevsw_defopen(struct tty *tp) +ttydevsw_defopen(struct tty *tp __unused) { return (0); } static void -ttydevsw_defclose(struct tty *tp) +ttydevsw_defclose(struct tty *tp __unused) { + } static void -ttydevsw_defoutwakeup(struct tty *tp) +ttydevsw_defoutwakeup(struct tty *tp __unused) { panic("Terminal device has output, while not implemented"); } static void -ttydevsw_definwakeup(struct tty *tp) +ttydevsw_definwakeup(struct tty *tp __unused) { + } static int -ttydevsw_defioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) +ttydevsw_defioctl(struct tty *tp __unused, u_long cmd __unused, + caddr_t data __unused, struct thread *td __unused) { return (ENOIOCTL); } static int -ttydevsw_defcioctl(struct tty *tp, int unit, u_long cmd, caddr_t data, struct thread *td) +ttydevsw_defcioctl(struct tty *tp __unused, int unit __unused, + u_long cmd __unused, caddr_t data __unused, struct thread *td __unused) { return (ENOIOCTL); } static int -ttydevsw_defparam(struct tty *tp, struct termios *t) +ttydevsw_defparam(struct tty *tp __unused, struct termios *t) { /* @@ -935,7 +950,8 @@ ttydevsw_defparam(struct tty *tp, struct } static int -ttydevsw_defmodem(struct tty *tp, int sigon, int sigoff) +ttydevsw_defmodem(struct tty *tp __unused, int sigon __unused, + int sigoff __unused) { /* Simulate a carrier to make the TTY layer happy. */ @@ -943,25 +959,34 @@ ttydevsw_defmodem(struct tty *tp, int si } static int -ttydevsw_defmmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr, - int nprot, vm_memattr_t *memattr) +ttydevsw_defmmap(struct tty *tp __unused, vm_ooffset_t offset __unused, + vm_paddr_t *paddr __unused, int nprot __unused, + vm_memattr_t *memattr __unused) { return (-1); } static void -ttydevsw_defpktnotify(struct tty *tp, char event) +ttydevsw_defpktnotify(struct tty *tp __unused, char event __unused) { + } static void -ttydevsw_deffree(void *softc) +ttydevsw_deffree(void *softc __unused) { panic("Terminal device freed without a free-handler"); } +static bool +ttydevsw_defbusy(struct tty *tp __unused) +{ + + return (FALSE); +} + /* * TTY allocation and deallocation. TTY devices can be deallocated when * the driver doesn't use it anymore, when the TTY isn't a session's @@ -996,6 +1021,7 @@ tty_alloc_mutex(struct ttydevsw *tsw, vo PATCH_FUNC(mmap); PATCH_FUNC(pktnotify); PATCH_FUNC(free); + PATCH_FUNC(busy); #undef PATCH_FUNC tp = malloc(sizeof(struct tty), M_TTY, M_WAITOK|M_ZERO); @@ -1082,6 +1108,7 @@ tty_rel_free(struct tty *tp) void tty_rel_pgrp(struct tty *tp, struct pgrp *pg) { + MPASS(tp->t_sessioncnt > 0); tty_lock_assert(tp, MA_OWNED); @@ -1094,6 +1121,7 @@ tty_rel_pgrp(struct tty *tp, struct pgrp void tty_rel_sess(struct tty *tp, struct session *sess) { + MPASS(tp->t_sessioncnt > 0); /* Current session has left. */ @@ -1108,6 +1136,7 @@ tty_rel_sess(struct tty *tp, struct sess void tty_rel_gone(struct tty *tp) { + MPASS(!tty_gone(tp)); /* Simulate carrier removal. */ @@ -1129,6 +1158,7 @@ tty_rel_gone(struct tty *tp) static void tty_to_xtty(struct tty *tp, struct xtty *xt) { + tty_lock_assert(tp, MA_OWNED); xt->xt_size = sizeof(struct xtty); @@ -1380,6 +1410,7 @@ tty_signal_pgrp(struct tty *tp, int sig) void tty_wakeup(struct tty *tp, int flags) { + if (tp->t_flags & TF_ASYNC && tp->t_sigio != NULL) pgsigio(&tp->t_sigio, SIGIO, (tp->t_session != NULL)); @@ -1442,6 +1473,7 @@ tty_timedwait(struct tty *tp, struct cv void tty_flush(struct tty *tp, int flags) { + if (flags & FWRITE) { tp->t_flags &= ~TF_HIWAT_OUT; ttyoutq_flush(&tp->t_outq); @@ -1832,10 +1864,11 @@ tty_ioctl(struct tty *tp, u_long cmd, vo dev_t tty_udev(struct tty *tp) { + if (tp->t_dev) - return dev2udev(tp->t_dev); + return (dev2udev(tp->t_dev)); else - return NODEV; + return (NODEV); } int @@ -1904,8 +1937,8 @@ ttyhook_defrint(struct tty *tp, char c, } int -ttyhook_register(struct tty **rtp, struct proc *p, int fd, - struct ttyhook *th, void *softc) +ttyhook_register(struct tty **rtp, struct proc *p, int fd, struct ttyhook *th, + void *softc) { struct tty *tp; struct file *fp; @@ -2056,7 +2089,7 @@ static struct cdevsw ttyconsdev_cdevsw = }; static void -ttyconsdev_init(void *unused) +ttyconsdev_init(void *unused __unused) { dev_console = make_dev_credf(MAKEDEV_ETERNAL, &ttyconsdev_cdevsw, 0, @@ -2081,7 +2114,7 @@ ttyconsdev_select(const char *name) #include #include -static struct { +static const struct { int flag; char val; } ttystates[] = { @@ -2134,6 +2167,7 @@ static struct { static void _db_show_devsw(const char *sep, const struct ttydevsw *tsw) { + db_printf("%sdevsw: ", sep); db_printsym((db_addr_t)tsw, DB_STGY_ANY); db_printf(" (%p)\n", tsw); @@ -2148,9 +2182,11 @@ _db_show_devsw(const char *sep, const st DB_PRINTSYM(pktnotify, tsw->tsw_pktnotify); DB_PRINTSYM(free, tsw->tsw_free); } + static void _db_show_hooks(const char *sep, const struct ttyhook *th) { + db_printf("%shook: ", sep); db_printsym((db_addr_t)th, DB_STGY_ANY); db_printf(" (%p)\n", th); @@ -2256,17 +2292,13 @@ DB_SHOW_ALL_COMMAND(ttys, db_show_all_tt isiz = tp->t_inq.ti_nblocks * TTYINQ_DATASIZE; osiz = tp->t_outq.to_nblocks * TTYOUTQ_DATASIZE; - db_printf("%p %10s %5zu %4u %4u %4zu %5zu %4u %4zu %5u %5d %5d ", - tp, - tty_devname(tp), - isiz, + db_printf("%p %10s %5zu %4u %4u %4zu %5zu %4u %4zu %5u %5d " + "%5d ", tp, tty_devname(tp), isiz, tp->t_inq.ti_linestart - tp->t_inq.ti_begin, tp->t_inq.ti_end - tp->t_inq.ti_linestart, - isiz - tp->t_inlow, - osiz, + isiz - tp->t_inlow, osiz, tp->t_outq.to_end - tp->t_outq.to_begin, - osiz - tp->t_outlow, - MIN(tp->t_column, 99999), + osiz - tp->t_outlow, MIN(tp->t_column, 99999), tp->t_session ? tp->t_session->s_sid : 0, tp->t_pgrp ? tp->t_pgrp->pg_id : 0); Modified: stable/10/sys/sys/ttydevsw.h ============================================================================== --- stable/10/sys/sys/ttydevsw.h Wed Jan 27 22:31:08 2016 (r294958) +++ stable/10/sys/sys/ttydevsw.h Wed Jan 27 22:48:04 2016 (r294959) @@ -54,6 +54,7 @@ typedef int tsw_mmap_t(struct tty *tp, v vm_paddr_t * paddr, int nprot, vm_memattr_t *memattr); typedef void tsw_pktnotify_t(struct tty *tp, char event); typedef void tsw_free_t(void *softc); +typedef bool tsw_busy_t(struct tty *tp); struct ttydevsw { unsigned int tsw_flags; /* Default TTY flags. */ @@ -74,21 +75,25 @@ struct ttydevsw { tsw_free_t *tsw_free; /* Destructor. */ - void *tsw_spare[4]; /* For future use. */ + tsw_busy_t *tsw_busy; /* Draining output. */ + + void *tsw_spare[3]; /* For future use. */ }; static __inline int ttydevsw_open(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_open(tp); + return (tp->t_devsw->tsw_open(tp)); } static __inline void ttydevsw_close(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); @@ -98,6 +103,7 @@ ttydevsw_close(struct tty *tp) static __inline void ttydevsw_outwakeup(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); @@ -111,6 +117,7 @@ ttydevsw_outwakeup(struct tty *tp) static __inline void ttydevsw_inwakeup(struct tty *tp) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); @@ -124,49 +131,56 @@ ttydevsw_inwakeup(struct tty *tp) static __inline int ttydevsw_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_ioctl(tp, cmd, data, td); + return (tp->t_devsw->tsw_ioctl(tp, cmd, data, td)); } static __inline int -ttydevsw_cioctl(struct tty *tp, int unit, u_long cmd, caddr_t data, struct thread *td) +ttydevsw_cioctl(struct tty *tp, int unit, u_long cmd, caddr_t data, + struct thread *td) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_cioctl(tp, unit, cmd, data, td); + return (tp->t_devsw->tsw_cioctl(tp, unit, cmd, data, td)); } static __inline int ttydevsw_param(struct tty *tp, struct termios *t) { + MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_param(tp, t); + return (tp->t_devsw->tsw_param(tp, t)); } static __inline int ttydevsw_modem(struct tty *tp, int sigon, int sigoff) { + MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_modem(tp, sigon, sigoff); + return (tp->t_devsw->tsw_modem(tp, sigon, sigoff)); } static __inline int ttydevsw_mmap(struct tty *tp, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) { + MPASS(!tty_gone(tp)); - return tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot, memattr); + return (tp->t_devsw->tsw_mmap(tp, offset, paddr, nprot, memattr)); } static __inline void ttydevsw_pktnotify(struct tty *tp, char event) { + tty_lock_assert(tp, MA_OWNED); MPASS(!tty_gone(tp)); @@ -176,9 +190,20 @@ ttydevsw_pktnotify(struct tty *tp, char static __inline void ttydevsw_free(struct tty *tp) { + MPASS(tty_gone(tp)); tp->t_devsw->tsw_free(tty_softc(tp)); } +static __inline bool +ttydevsw_busy(struct tty *tp) +{ + + tty_lock_assert(tp, MA_OWNED); + MPASS(!tty_gone(tp)); + + return (tp->t_devsw->tsw_busy(tp)); +} + #endif /* !_SYS_TTYDEVSW_H_ */ From owner-svn-src-stable-10@freebsd.org Wed Jan 27 22:50:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 439ABA70094; Wed, 27 Jan 2016 22:50:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 1DCED36A; Wed, 27 Jan 2016 22:50:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RMo5a3025412; Wed, 27 Jan 2016 22:50:05 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RMo5Ed025411; Wed, 27 Jan 2016 22:50:05 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201601272250.u0RMo5Ed025411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 27 Jan 2016 22:50:05 +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: r294961 - stable/10/sys/dev/puc 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.20 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, 27 Jan 2016 22:50:06 -0000 Author: marius Date: Wed Jan 27 22:50:04 2016 New Revision: 294961 URL: https://svnweb.freebsd.org/changeset/base/294961 Log: - Add an entry for the SIIG Cyber 2SP1 PCIe adapter, which is based on an Oxford Semiconductor OX16PCI954 but uses only two ports and a non-default clock rate. [1] - Add entries for the more prominent members of the Digi International Neo series, which are based on Exar PCI chips. Tested by: Patrick Powell - Mark some unused parameters as such. - Fix style/whitespace PR: 176407 [1] Modified: stable/10/sys/dev/puc/pucdata.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/puc/pucdata.c ============================================================================== --- stable/10/sys/dev/puc/pucdata.c Wed Jan 27 22:48:52 2016 (r294960) +++ stable/10/sys/dev/puc/pucdata.c Wed Jan 27 22:50:04 2016 (r294961) @@ -64,7 +64,6 @@ static puc_config_f puc_config_timedia; static puc_config_f puc_config_titan; const struct puc_cfg puc_pci_devices[] = { - { 0x0009, 0x7168, 0xffff, 0, "Sunix SUN1889", DEFAULT_RCLK * 8, @@ -179,6 +178,55 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_amc }, + /* + * The following members of the Digi International Neo series are + * based on Exar PCI chips, f. e. the 8 port variants on XR17V258IV. + * Accordingly, the PCIe versions of these cards incorporate a PLX + * PCIe-PCI-bridge. + */ + + { 0x114f, 0x00b0, 0xffff, 0, + "Digi Neo PCI 4 Port", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, -1, + .config_function = puc_config_exar + }, + + { 0x114f, 0x00b1, 0xffff, 0, + "Digi Neo PCI 8 Port", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x10, 0, -1, + .config_function = puc_config_exar + }, + + { 0x114f, 0x00f0, 0xffff, 0, + "Digi Neo PCIe 8 Port", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x10, 0, -1, + .config_function = puc_config_exar + }, + + { 0x114f, 0x00f1, 0xffff, 0, + "Digi Neo PCIe 4 Port", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, -1, + .config_function = puc_config_exar + }, + + { 0x114f, 0x00f2, 0xffff, 0, + "Digi Neo PCIe 4 Port RJ45", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, -1, + .config_function = puc_config_exar + }, + + { 0x114f, 0x00f3, 0xffff, 0, + "Digi Neo PCIe 8 Port RJ45", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x10, 0, -1, + .config_function = puc_config_exar + }, + { 0x11fe, 0x8010, 0xffff, 0, "Comtrol RocketPort 550/8 RJ11 part A", DEFAULT_RCLK * 4, @@ -763,6 +811,12 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x10, 0, 8, }, + { 0x1415, 0x950a, 0x131f, 0x2061, + "SIIG Cyber 2SP1 PCIe", + DEFAULT_RCLK * 10, + PUC_PORT_2S, 0x10, 0, 8, + }, + { 0x1415, 0x950a, 0xffff, 0, "Oxford Semiconductor OX16PCI954 UARTs", DEFAULT_RCLK, @@ -840,9 +894,9 @@ const struct puc_cfg puc_pci_devices[] = */ { 0x1415, 0xc11b, 0xffff, 0, - "Oxford Semiconductor OXPCIe952 1S1P", - DEFAULT_RCLK * 0x22, - PUC_PORT_NONSTANDARD, 0x10, 0, -1, + "Oxford Semiconductor OXPCIe952 1S1P", + DEFAULT_RCLK * 0x22, + PUC_PORT_NONSTANDARD, 0x10, 0, -1, .config_function = puc_config_oxford_pcie }, @@ -1202,9 +1256,10 @@ const struct puc_cfg puc_pci_devices[] = }; static int -puc_config_amc(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, +puc_config_amc(struct puc_softc *sc __unused, enum puc_cfg_cmd cmd, int port, intptr_t *res) { + switch (cmd) { case PUC_CFG_GET_OFS: *res = 8 * (port & 1); @@ -1236,9 +1291,10 @@ puc_config_diva(struct puc_softc *sc, en } static int -puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, - intptr_t *res) +puc_config_exar(struct puc_softc *sc __unused, enum puc_cfg_cmd cmd, + int port, intptr_t *res) { + if (cmd == PUC_CFG_GET_OFS) { *res = port * 0x200; return (0); @@ -1247,9 +1303,10 @@ puc_config_exar(struct puc_softc *sc, en } static int -puc_config_exar_pcie(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, - intptr_t *res) +puc_config_exar_pcie(struct puc_softc *sc __unused, enum puc_cfg_cmd cmd, + int port, intptr_t *res) { + if (cmd == PUC_CFG_GET_OFS) { *res = port * 0x400; return (0); @@ -1258,9 +1315,10 @@ puc_config_exar_pcie(struct puc_softc *s } static int -puc_config_icbook(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, - intptr_t *res) +puc_config_icbook(struct puc_softc *sc __unused, enum puc_cfg_cmd cmd, + int port __unused, intptr_t *res) { + if (cmd == PUC_CFG_GET_ILR) { *res = PUC_ILR_DIGI; return (0); @@ -1272,10 +1330,11 @@ static int puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, intptr_t *res) { - if (cmd == PUC_CFG_GET_OFS) { - const struct puc_cfg *cfg = sc->sc_cfg; + const struct puc_cfg *cfg = sc->sc_cfg; - if (port == 3 && (cfg->device == 0x1045 || cfg->device == 0x1144)) + if (cmd == PUC_CFG_GET_OFS) { + if (port == 3 && (cfg->device == 0x1045 || + cfg->device == 0x1144)) port = 7; *res = port * 0x200; @@ -1285,8 +1344,8 @@ puc_config_moxa(struct puc_softc *sc, en } static int -puc_config_quatech(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, - intptr_t *res) +puc_config_quatech(struct puc_softc *sc, enum puc_cfg_cmd cmd, + int port __unused, intptr_t *res) { const struct puc_cfg *cfg = sc->sc_cfg; struct puc_bar *bar; @@ -1374,8 +1433,8 @@ puc_config_quatech(struct puc_softc *sc, case PUC_CFG_GET_ILR: v0 = (sc->sc_cfg_data >> 8) & 0xff; v1 = sc->sc_cfg_data & 0xff; - *res = (v0 == 0 && v1 == 0x80 + -cfg->clock) - ? PUC_ILR_NONE : PUC_ILR_QUATECH; + *res = (v0 == 0 && v1 == 0x80 + -cfg->clock) ? + PUC_ILR_NONE : PUC_ILR_QUATECH; return (0); default: break; @@ -1687,9 +1746,10 @@ puc_config_sunix(struct puc_softc *sc, e } static int -puc_config_titan(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port, - intptr_t *res) +puc_config_titan(struct puc_softc *sc __unused, enum puc_cfg_cmd cmd, + int port, intptr_t *res) { + switch (cmd) { case PUC_CFG_GET_OFS: *res = (port < 3) ? 0 : (port - 2) << 3; From owner-svn-src-stable-10@freebsd.org Wed Jan 27 22:56:06 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EB9FA703EF; Wed, 27 Jan 2016 22:56:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E51DBC3A; Wed, 27 Jan 2016 22:56:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0RMu4Y3028196; Wed, 27 Jan 2016 22:56:04 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0RMu40O028193; Wed, 27 Jan 2016 22:56:04 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601272256.u0RMu40O028193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 27 Jan 2016 22:56: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: r294963 - in stable/10: lib/libc/gen tools/regression/posixsem2 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.20 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, 27 Jan 2016 22:56:06 -0000 Author: jilles Date: Wed Jan 27 22:56:04 2016 New Revision: 294963 URL: https://svnweb.freebsd.org/changeset/base/294963 Log: MFC r294565: sem: Don't free nameinfo that is still in list when open() fails. This bug could be reproduced easily by calling sem_open() with O_CREAT | O_EXCL on a semaphore that is already open in the process. The struct sem_nameinfo would be freed while still in sem_list and later calls to sem_open() or sem_close() could access freed memory. PR: 206396 Modified: stable/10/lib/libc/gen/sem_new.c stable/10/tools/regression/posixsem2/semtest.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/sem_new.c ============================================================================== --- stable/10/lib/libc/gen/sem_new.c Wed Jan 27 22:52:20 2016 (r294962) +++ stable/10/lib/libc/gen/sem_new.c Wed Jan 27 22:56:04 2016 (r294963) @@ -176,8 +176,10 @@ _sem_open(const char *name, int flags, . if (ni->name != NULL && strcmp(name, ni->name) == 0) { fd = _open(path, flags | O_RDWR | O_CLOEXEC | O_EXLOCK, mode); - if (fd == -1 || _fstat(fd, &sb) == -1) + if (fd == -1 || _fstat(fd, &sb) == -1) { + ni = NULL; goto error; + } if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) || ni->dev != sb.st_dev || ni->ino != sb.st_ino) { Modified: stable/10/tools/regression/posixsem2/semtest.c ============================================================================== --- stable/10/tools/regression/posixsem2/semtest.c Wed Jan 27 22:52:20 2016 (r294962) +++ stable/10/tools/regression/posixsem2/semtest.c Wed Jan 27 22:56:04 2016 (r294963) @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -14,6 +15,7 @@ int test_unnamed(void); int test_named(void); +int test_named2(void); int test_unnamed(void) @@ -94,9 +96,42 @@ test_named(void) } int +test_named2(void) +{ + sem_t *s, *s2, *s3; + + printf("testing named process-shared semaphore, O_EXCL cases\n"); + sem_unlink(SEM_NAME); + s = sem_open(SEM_NAME, O_CREAT | O_EXCL, 0777, 0); + if (s == SEM_FAILED) + err(1, "sem_open failed"); + s2 = sem_open(SEM_NAME, O_CREAT | O_EXCL, 0777, 0); + if (s2 != SEM_FAILED) + errx(2, "second sem_open call wrongly succeeded"); + if (errno != EEXIST) + err(3, "second sem_open call failed with wrong errno"); + + s3 = sem_open(SEM_NAME, 0); + if (s3 == SEM_FAILED) + err(4, "third sem_open call failed"); + if (s != s3) + errx(5, +"two sem_open calls for same semaphore do not return same address"); + if (sem_close(s3)) + err(6, "sem_close failed"); + + if (sem_close(s)) + err(7, "sem_close failed"); + + printf("OK.\n"); + return (0); +} + +int main(void) { test_unnamed(); test_named(); + test_named2(); return (0); } From owner-svn-src-stable-10@freebsd.org Thu Jan 28 00:41:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA5B8A6F44F; Thu, 28 Jan 2016 00:41:08 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 91C4015E2; Thu, 28 Jan 2016 00:41:08 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S0f7H0057253; Thu, 28 Jan 2016 00:41:07 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S0f7tl057252; Thu, 28 Jan 2016 00:41:07 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201601280041.u0S0f7tl057252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Thu, 28 Jan 2016 00:41:07 +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: r294964 - stable/10/etc/rc.d 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.20 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: Thu, 28 Jan 2016 00:41:08 -0000 Author: jamie Date: Thu Jan 28 00:41:07 2016 New Revision: 294964 URL: https://svnweb.freebsd.org/changeset/base/294964 Log: MFC r294749: Allow the (old rc-style) exec_afterstart jail parameters to start numbering at 0, like exec_prestart and the others do. Make param0 optional, i.e. still look for param1. PR: 142973 Modified: stable/10/etc/rc.d/jail Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/jail ============================================================================== --- stable/10/etc/rc.d/jail Wed Jan 27 22:56:04 2016 (r294963) +++ stable/10/etc/rc.d/jail Thu Jan 28 00:41:07 2016 (r294964) @@ -32,7 +32,7 @@ need_dad_wait= # Extract value from ${jail_$jv_$name} or ${jail_$name} and # set it to $param. If not defined, $defval is used. # When $num is [0-9]*, ${jail_$jv_$name$num} are looked up and -# $param is set by using +=. +# $param is set by using +=. $num=0 is optional (params may start at 1). # When $num is YN or NY, the value is interpret as boolean. extract_var() { @@ -72,7 +72,7 @@ extract_var() eval _tmpargs=\"\${$_name1:-\${$_name2:-$_def}}\" if [ -n "$_tmpargs" ]; then echo " $_param += \"$_tmpargs\";" - else + elif [ $i != 0 ]; then break; fi i=$(($i + 1)) @@ -202,7 +202,7 @@ parse_options() extract_var $_jv exec_poststop exec.poststop 0 "" echo " exec.start += \"$_exec_start\";" - extract_var $_jv exec_afterstart exec.start 1 "" + extract_var $_jv exec_afterstart exec.start 0 "" echo " exec.stop = \"$_exec_stop\";" extract_var $_jv consolelog exec.consolelog - \ From owner-svn-src-stable-10@freebsd.org Thu Jan 28 01:45:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8EEFA70DEF; Thu, 28 Jan 2016 01:45:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 961B91A00; Thu, 28 Jan 2016 01:45:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S1jFs7077493; Thu, 28 Jan 2016 01:45:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S1jFYS077492; Thu, 28 Jan 2016 01:45:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601280145.u0S1jFYS077492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 28 Jan 2016 01:45:15 +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: r294969 - 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.20 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: Thu, 28 Jan 2016 01:45:16 -0000 Author: emaste Date: Thu Jan 28 01:45:15 2016 New Revision: 294969 URL: https://svnweb.freebsd.org/changeset/base/294969 Log: MFC r294530: Add STB_GNU_UNIQUE symbol binding definition Red Hat created STB_GNU_UNIQUE to handle certain special cases relating to dynamically loading C++ DSOs[1]. We don't (currently) have support for STB_GNU_UNIQUE, but ought to reserve the value in ELFNN_ST_BIND. This will also be used by an upcoming ELF Tool Chain import. Modified: stable/10/sys/sys/elf_common.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/elf_common.h ============================================================================== --- stable/10/sys/sys/elf_common.h Thu Jan 28 01:19:19 2016 (r294968) +++ stable/10/sys/sys/elf_common.h Thu Jan 28 01:45:15 2016 (r294969) @@ -748,8 +748,9 @@ typedef struct { #define STB_LOCAL 0 /* Local symbol */ #define STB_GLOBAL 1 /* Global symbol */ #define STB_WEAK 2 /* like global - lower precedence */ -#define STB_LOOS 10 /* Reserved range for operating system */ -#define STB_HIOS 12 /* specific semantics. */ +#define STB_LOOS 10 /* Start of operating system reserved range. */ +#define STB_GNU_UNIQUE 10 /* Unique symbol (GNU) */ +#define STB_HIOS 12 /* End of operating system reserved range. */ #define STB_LOPROC 13 /* reserved range for processor */ #define STB_HIPROC 15 /* specific semantics. */ From owner-svn-src-stable-10@freebsd.org Thu Jan 28 02:19:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D514EA6FB4E; Thu, 28 Jan 2016 02:19:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8AB1A1AFA; Thu, 28 Jan 2016 02:19:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S2JlvM086410; Thu, 28 Jan 2016 02:19:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S2Jl4t086409; Thu, 28 Jan 2016 02:19:47 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201601280219.u0S2Jl4t086409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Jan 2016 02:19:47 +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: r294970 - stable/10/sys/fs/ext2fs 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.20 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: Thu, 28 Jan 2016 02:19:48 -0000 Author: pfg Date: Thu Jan 28 02:19:47 2016 New Revision: 294970 URL: https://svnweb.freebsd.org/changeset/base/294970 Log: MFC r294695: ext2fs: passthrough any extra timestamps to the dinode struct. In general we don't trust any of the extended timestamps unless the EXT2F_ROCOMPAT_EXTRA_ISIZE feature is set. However, in the case where we freshly allocated a new inode the information is valid and it is better to pass it along instead of leaving the value undefined. This should have no practical effect but should reduce the amount of garbage if EXT2F_ROCOMPAT_EXTRA_ISIZE is set, like in cases where the filesystem is converted from ext3 to ext4. Modified: stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Thu Jan 28 01:45:15 2016 (r294969) +++ stable/10/sys/fs/ext2fs/ext2_inode_cnv.c Thu Jan 28 02:19:47 2016 (r294970) @@ -149,13 +149,11 @@ ext2_i2ei(struct inode *ip, struct ext2f ei->e2di_atime = ip->i_atime; ei->e2di_mtime = ip->i_mtime; ei->e2di_ctime = ip->i_ctime; - if (E2DI_HAS_XTIME(ip)) { - ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec); - ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec); - ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec); - ei->e2di_crtime = ip->i_birthtime; - ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec); - } + ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec); + ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec); + ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec); + ei->e2di_crtime = ip->i_birthtime; + ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec); ei->e2di_flags = 0; ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0; ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0; From owner-svn-src-stable-10@freebsd.org Thu Jan 28 08:49:22 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBA64A71AB0; Thu, 28 Jan 2016 08:49:22 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9F9F11807; Thu, 28 Jan 2016 08:49:22 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S8nL0n099279; Thu, 28 Jan 2016 08:49:21 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S8nLps099278; Thu, 28 Jan 2016 08:49:21 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601280849.u0S8nLps099278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 08:49:21 +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: r294974 - stable/10/share/mk 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.20 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: Thu, 28 Jan 2016 08:49:22 -0000 Author: smh Date: Thu Jan 28 08:49:21 2016 New Revision: 294974 URL: https://svnweb.freebsd.org/changeset/base/294974 Log: MFC r294968: Allow file specific user-specified flag overrides. Sponsored by: Multiplay Modified: stable/10/share/mk/bsd.sys.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.sys.mk ============================================================================== --- stable/10/share/mk/bsd.sys.mk Thu Jan 28 03:24:06 2016 (r294973) +++ stable/10/share/mk/bsd.sys.mk Thu Jan 28 08:49:21 2016 (r294974) @@ -149,8 +149,9 @@ SSP_CFLAGS?= -fstack-protector CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !IA64 && !ARM && !MIPS -# Allow user-specified additional warning flags -CFLAGS+= ${CWARNFLAGS} +# Allow user-specified additional warning flags and file specific flag +# overrides. +CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${.IMPSRC:T}} # Tell bmake not to mistake standard targets for things to be searched for From owner-svn-src-stable-10@freebsd.org Thu Jan 28 08:51:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C38EA71BD0; Thu, 28 Jan 2016 08:51:02 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 F26981A18; Thu, 28 Jan 2016 08:51:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S8p1m9099420; Thu, 28 Jan 2016 08:51:01 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S8p0f2099419; Thu, 28 Jan 2016 08:51:01 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601280851.u0S8p0f2099419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 08:51: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: r294975 - stable/10/sys/boot/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.20 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: Thu, 28 Jan 2016 08:51:02 -0000 Author: smh Date: Thu Jan 28 08:51:00 2016 New Revision: 294975 URL: https://svnweb.freebsd.org/changeset/base/294975 Log: MFC r294040: Prevent bogus compiler in ZFS boot code. Sponsored by: Multiplay Modified: stable/10/sys/boot/zfs/zfsimpl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/10/sys/boot/zfs/zfsimpl.c Thu Jan 28 08:49:21 2016 (r294974) +++ stable/10/sys/boot/zfs/zfsimpl.c Thu Jan 28 08:51:00 2016 (r294975) @@ -2165,7 +2165,13 @@ zfs_lookup(const struct zfsmount *mount, strcpy(&path[sb.st_size], p); else path[sb.st_size] = 0; - if (sb.st_size + sizeof(znode_phys_t) <= dn.dn_bonuslen) { + /* + * Second test is purely to silence bogus compiler + * warning about accessing past the end of dn_bonus. + */ + if (sb.st_size + sizeof(znode_phys_t) <= + dn.dn_bonuslen && sizeof(znode_phys_t) <= + sizeof(dn.dn_bonus)) { memcpy(path, &dn.dn_bonus[sizeof(znode_phys_t)], sb.st_size); } else { From owner-svn-src-stable-10@freebsd.org Thu Jan 28 09:18:14 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 999DDA70C41; Thu, 28 Jan 2016 09:18:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ED411DDF; Thu, 28 Jan 2016 09:18:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S9ID6M008088; Thu, 28 Jan 2016 09:18:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S9IDn8008084; Thu, 28 Jan 2016 09:18:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601280918.u0S9IDn8008084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jan 2016 09:18:13 +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: r294976 - 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.20 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: Thu, 28 Jan 2016 09:18:14 -0000 Author: kib Date: Thu Jan 28 09:18:12 2016 New Revision: 294976 URL: https://svnweb.freebsd.org/changeset/base/294976 Log: MFC r293346: Provide yet another KPI for cdev creation, make_dev_s(9). Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/make_dev.9 stable/10/sys/kern/kern_conf.c stable/10/sys/sys/conf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Thu Jan 28 08:51:00 2016 (r294975) +++ stable/10/share/man/man9/Makefile Thu Jan 28 09:18:12 2016 (r294976) @@ -850,7 +850,8 @@ MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 make_dev_alias_p.9 \ make_dev.9 make_dev_cred.9 \ make_dev.9 make_dev_credf.9 \ - make_dev.9 make_dev_p.9 + make_dev.9 make_dev_p.9 \ + make_dev.9 make_dev_s.9 MLINKS+=malloc.9 free.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ Modified: stable/10/share/man/man9/make_dev.9 ============================================================================== --- stable/10/share/man/man9/make_dev.9 Thu Jan 28 08:51:00 2016 (r294975) +++ stable/10/share/man/man9/make_dev.9 Thu Jan 28 09:18:12 2016 (r294976) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Dec 22, 2012 +.Dd Jan 3, 2016 .Dt MAKE_DEV 9 .Os .Sh NAME @@ -32,6 +32,7 @@ .Nm make_dev_cred , .Nm make_dev_credf , .Nm make_dev_p , +.Nm make_dev_s , .Nm make_dev_alias , .Nm make_dev_alias_p , .Nm destroy_dev , @@ -45,16 +46,10 @@ and DEVFS registration for devices .Sh SYNOPSIS .In sys/param.h .In sys/conf.h -.Ft struct cdev * -.Fn make_dev "struct cdevsw *cdevsw" "int unit" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... -.Ft struct cdev * -.Fn make_dev_cred "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... -.Ft struct cdev * -.Fn make_dev_credf "int flags" "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... +.Ft void +.Fn make_dev_args_init "struct make_dev_args *args" .Ft int -.Fn make_dev_p "int flags" "struct cdev **cdev" "struct cdevsw *devsw" "struct ucred *cr" "uid_t uid" "gid_t gid" "int mode" "const char *fmt" ... -.Ft struct cdev * -.Fn make_dev_alias "struct cdev *pdev" "const char *fmt" ... +.Fn make_dev_s "struct make_dev_args *args" "struct cdev **cdev" "const char *fmt" ... .Ft int .Fn make_dev_alias_p "int flags" "struct cdev **cdev" "struct cdev *pdev" "const char *fmt" ... .Ft void @@ -67,12 +62,26 @@ and DEVFS registration for devices .Fn destroy_dev_drain "struct cdevsw *csw" .Ft void .Fn dev_depends "struct cdev *pdev" "struct cdev *cdev" +.Pp +LEGACY INTERFACES +.Ft struct cdev * +.Fn make_dev "struct cdevsw *cdevsw" "int unit" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... +.Ft struct cdev * +.Fn make_dev_cred "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... +.Ft struct cdev * +.Fn make_dev_credf "int flags" "struct cdevsw *cdevsw" "int unit" "struct ucred *cr" "uid_t uid" "gid_t gid" "int perms" "const char *fmt" ... +.Ft int +.Fn make_dev_p "int flags" "struct cdev **cdev" "struct cdevsw *devsw" "struct ucred *cr" "uid_t uid" "gid_t gid" "int mode" "const char *fmt" ... +.Ft struct cdev * +.Fn make_dev_alias "struct cdev *pdev" "const char *fmt" ... .Sh DESCRIPTION The -.Fn make_dev_credf +.Fn make_dev_s function creates a .Fa cdev -structure for a new device. +structure for a new device, which is returned into the +.Fa cdev +argument. It also notifies .Xr devfs 5 of the presence of the new device, that causes corresponding nodes @@ -80,10 +89,34 @@ to be created. Besides this, a .Xr devctl 4 notification is sent. -The device will be owned by -.Va uid , +The function takes the structure +.Va struct make_dev_args args , +which specifies the parameters for the device creation: +.Pp +.Bd -literal -offset indent -compact +struct make_dev_args { + size_t mda_size; + int mda_flags; + struct cdevsw *mda_devsw; + struct ucred *mda_cr; + uid_t mda_uid; + gid_t mda_gid; + int mda_mode; + int mda_unit; + void *mda_si_drv1; + void *mda_si_drv2; +}; +.Ed +Before use and filling with the desired values, the structure must be +initialized by the +.Fn make_dev_args_init +function, which ensures that future kernel interface expansion does +not affect driver source code or binary interface. +.Pp +The created device will be owned by +.Va args.mda_uid , with the group ownership as -.Va gid . +.Va args.mda_gid . The name is the expansion of .Va fmt and following arguments as @@ -97,7 +130,7 @@ mount point and may contain slash .Ql / characters to denote subdirectories. The permissions of the file specified in -.Va perms +.Va args.mda_mode are defined in .In sys/stat.h : .Pp @@ -126,29 +159,28 @@ are defined in .Ed .Pp The -.Va cr +.Va args.mda_cr argument specifies credentials that will be stored in the .Fa si_cred member of the initialized .Fa struct cdev . +.Pp The -.Va flags +.Va args.mda_flags argument alters the operation of -.Fn make_dev_credf -or -.Fn make_dev_p . +.Fn make_dev_s. The following values are currently accepted: .Pp -.Bl -tag -width "MAKEDEV_CHECKNAME" -compact -offset indent -.It MAKEDEV_REF +.Bl -tag -width "It Dv MAKEDEV_CHECKNAME" -compact -offset indent +.It Dv MAKEDEV_REF reference the created device -.It MAKEDEV_NOWAIT +.It Dv MAKEDEV_NOWAIT do not sleep, the call may fail -.It MAKEDEV_WAITOK +.It Dv MAKEDEV_WAITOK allow the function to sleep to satisfy malloc -.It MAKEDEV_ETERNAL +.It Dv MAKEDEV_ETERNAL created device will be never destroyed -.It MAKEDEV_CHECKNAME +.It Dv MAKEDEV_CHECKNAME return an error if the device name is invalid or already exists .El .Pp @@ -189,10 +221,49 @@ For the convenience, use the flag for the code that can be compiled into kernel or loaded (and unloaded) as loadable module. .Pp -A panic will occur if the MAKEDEV_CHECKNAME flag is not specified +A panic will occur if the +.Dv MAKEDEV_CHECKNAME +flag is not specified and the device name is invalid or already exists. .Pp The +.Fn make_dev_p +use of the form +.Bd -literal -offset indent +struct cdev *dev; +int res; +res = make_dev_p(flags, &dev, cdevsw, cred, uid, gid, perms, name); +.Ed +is equivalent to the code +.Bd -literal -offset indent +struct cdev *dev; +struct make_dev_args args; +int res; + +make_dev_args_init(&args); +args.mda_flags = flags; +args.mda_devsw = cdevsw; +args.mda_cred = cred; +args.mda_uid = uid; +args.mda_gid = gid; +args.mda_mode = perms; +res = make_dev_s(&args, &dev, name); +.Ed +.Pp +Similarly, the +.Fn make_dev_credf +function call is equivalent to +.Bd -literal -offset indent + (void) make_dev_s(&args, &dev, name); +.Ed +In other words, +.Fn make_dev_credf +does not allow the caller to obtain the return value, and in +kernels compiled with the +.Va INVARIANTS +options, the function asserts that the device creation succeeded. +.Pp +The .Fn make_dev_cred function is equivalent to the call .Bd -literal -offset indent @@ -207,45 +278,55 @@ make_dev_credf(0, cdevsw, unit, NULL, ui .Ed .Pp The -.Fn make_dev_p -function is similar to -.Fn make_dev_credf -but it may return an error number and takes a pointer to the resulting -.Ft *cdev -as an argument. -.Pp -The -.Fn make_dev_alias +.Fn make_dev_alias_p function takes the returned .Ft cdev from .Fn make_dev and makes another (aliased) name for this device. It is an error to call -.Fn make_dev_alias +.Fn make_dev_alias_p prior to calling .Fn make_dev . .Pp -.Fn make_dev_alias_p +The +.Fn make_dev_alias function is similar to .Fn make_dev_alias -but it takes a pointer to the resulting +but it returns the resulting aliasing .Ft *cdev -as an argument and may return an error. +and may not return an error. .Pp The .Fa cdev returned by -.Fn make_dev +.Fn make_dev_s and -.Fn make_dev_alias +.Fn make_dev_alias_p has two fields, .Fa si_drv1 and .Fa si_drv2 , that are available to store state. Both fields are of type -.Ft void * . +.Ft void * , +and can be initialized simultaneously with the +.Va cdev +allocation by filling +.Va args.mda_si_drv1 +and +.Va args.mda_si_drv2 +members of the +.Fn make_dev_s +argument structure, or filled after the +.Va cdev +is allocated, if using legacy interfaces. +In the latter case, the driver should handle the race of +accessing uninitialized +.Va si_drv1 +and +.Va si_drv2 +itself. These are designed to replace the .Fa unit argument to @@ -331,8 +412,10 @@ unload until is actually finished for all of them. .Sh RETURN VALUES If successful, +.Fn make_dev_s +and .Fn make_dev_p -will return 0, otherwise it will return an error. +will return 0, otherwise they will return an error. If successful, .Fn make_dev_credf will return a valid @@ -341,10 +424,11 @@ pointer, otherwise it will return .Dv NULL . .Sh ERRORS The +.Fn make_dev_s , .Fn make_dev_p and .Fn make_dev_alias_p -call will fail and the device will be not registered if: +calls will fail and the device will be not registered if: .Bl -tag -width Er .It Bq Er ENOMEM The @@ -403,3 +487,7 @@ The function .Fn make_dev_p first appeared in .Fx 8.2 . +The function +.Fn make_dev_s +first appeared in +.Fx 11.0 . Modified: stable/10/sys/kern/kern_conf.c ============================================================================== --- stable/10/sys/kern/kern_conf.c Thu Jan 28 08:51:00 2016 (r294975) +++ stable/10/sys/kern/kern_conf.c Thu Jan 28 09:18:12 2016 (r294976) @@ -566,22 +566,26 @@ notify_destroy(struct cdev *dev) } static struct cdev * -newdev(struct cdevsw *csw, int unit, struct cdev *si) +newdev(struct make_dev_args *args, struct cdev *si) { struct cdev *si2; + struct cdevsw *csw; mtx_assert(&devmtx, MA_OWNED); + csw = args->mda_devsw; if (csw->d_flags & D_NEEDMINOR) { /* We may want to return an existing device */ LIST_FOREACH(si2, &csw->d_devs, si_list) { - if (dev2unit(si2) == unit) { + if (dev2unit(si2) == args->mda_unit) { dev_free_devlocked(si); return (si2); } } } - si->si_drv0 = unit; + si->si_drv0 = args->mda_unit; si->si_devsw = csw; + si->si_drv1 = args->mda_si_drv1; + si->si_drv2 = args->mda_si_drv2; LIST_INSERT_HEAD(&csw->d_devs, si, si_list); return (si); } @@ -737,33 +741,46 @@ prep_devname(struct cdev *dev, const cha return (0); } +void +make_dev_args_init_impl(struct make_dev_args *args, size_t sz) +{ + + bzero(args, sz); + args->mda_size = sz; +} + static int -make_dev_credv(int flags, struct cdev **dres, struct cdevsw *devsw, int unit, - struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, - va_list ap) +make_dev_sv(struct make_dev_args *args1, struct cdev **dres, + const char *fmt, va_list ap) { struct cdev *dev, *dev_new; + struct make_dev_args args; int res; - KASSERT((flags & MAKEDEV_WAITOK) == 0 || (flags & MAKEDEV_NOWAIT) == 0, - ("make_dev_credv: both WAITOK and NOWAIT specified")); - dev_new = devfs_alloc(flags); + bzero(&args, sizeof(args)); + if (sizeof(args) < args1->mda_size) + return (EINVAL); + bcopy(args1, &args, args1->mda_size); + KASSERT((args.mda_flags & MAKEDEV_WAITOK) == 0 || + (args.mda_flags & MAKEDEV_NOWAIT) == 0, + ("make_dev_sv: both WAITOK and NOWAIT specified")); + dev_new = devfs_alloc(args.mda_flags); if (dev_new == NULL) return (ENOMEM); dev_lock(); - res = prep_cdevsw(devsw, flags); + res = prep_cdevsw(args.mda_devsw, args.mda_flags); if (res != 0) { dev_unlock(); devfs_free(dev_new); return (res); } - dev = newdev(devsw, unit, dev_new); + dev = newdev(&args, dev_new); if ((dev->si_flags & SI_NAMED) == 0) { res = prep_devname(dev, fmt, ap); if (res != 0) { - if ((flags & MAKEDEV_CHECKNAME) == 0) { + if ((args.mda_flags & MAKEDEV_CHECKNAME) == 0) { panic( - "make_dev_credv: bad si_name (error=%d, si_name=%s)", + "make_dev_sv: bad si_name (error=%d, si_name=%s)", res, dev->si_name); } if (dev == dev_new) { @@ -775,9 +792,9 @@ make_dev_credv(int flags, struct cdev ** return (res); } } - if (flags & MAKEDEV_REF) + if ((args.mda_flags & MAKEDEV_REF) != 0) dev_refl(dev); - if (flags & MAKEDEV_ETERNAL) + if ((args.mda_flags & MAKEDEV_ETERNAL) != 0) dev->si_flags |= SI_ETERNAL; if (dev->si_flags & SI_CHEAPCLONE && dev->si_flags & SI_NAMED) { @@ -792,24 +809,55 @@ make_dev_credv(int flags, struct cdev ** } KASSERT(!(dev->si_flags & SI_NAMED), ("make_dev() by driver %s on pre-existing device (min=%x, name=%s)", - devsw->d_name, dev2unit(dev), devtoname(dev))); + args.mda_devsw->d_name, dev2unit(dev), devtoname(dev))); dev->si_flags |= SI_NAMED; - if (cr != NULL) - dev->si_cred = crhold(cr); - dev->si_uid = uid; - dev->si_gid = gid; - dev->si_mode = mode; + if (args.mda_cr != NULL) + dev->si_cred = crhold(args.mda_cr); + dev->si_uid = args.mda_uid; + dev->si_gid = args.mda_gid; + dev->si_mode = args.mda_mode; devfs_create(dev); clean_unrhdrl(devfs_inos); dev_unlock_and_free(); - notify_create(dev, flags); + notify_create(dev, args.mda_flags); *dres = dev; return (0); } +int +make_dev_s(struct make_dev_args *args, struct cdev **dres, + const char *fmt, ...) +{ + va_list ap; + int res; + + va_start(ap, fmt); + res = make_dev_sv(args, dres, fmt, ap); + va_end(ap); + return (res); +} + +static int +make_dev_credv(int flags, struct cdev **dres, struct cdevsw *devsw, int unit, + struct ucred *cr, uid_t uid, gid_t gid, int mode, const char *fmt, + va_list ap) +{ + struct make_dev_args args; + + make_dev_args_init(&args); + args.mda_flags = flags; + args.mda_devsw = devsw; + args.mda_cr = cr; + args.mda_uid = uid; + args.mda_gid = gid; + args.mda_mode = mode; + args.mda_unit = unit; + return (make_dev_sv(&args, dres, fmt, ap)); +} + struct cdev * make_dev(struct cdevsw *devsw, int unit, uid_t uid, gid_t gid, int mode, const char *fmt, ...) @@ -1247,6 +1295,7 @@ clone_create(struct clonedevs **cdp, str { struct clonedevs *cd; struct cdev *dev, *ndev, *dl, *de; + struct make_dev_args args; int unit, low, u; KASSERT(*cdp != NULL, @@ -1298,7 +1347,10 @@ clone_create(struct clonedevs **cdp, str } if (unit == -1) unit = low & CLONE_UNITMASK; - dev = newdev(csw, unit | extra, ndev); + make_dev_args_init(&args); + args.mda_unit = unit | extra; + args.mda_devsw = csw; + dev = newdev(&args, ndev); if (dev->si_flags & SI_CLONELIST) { printf("dev %p (%s) is on clonelist\n", dev, dev->si_name); printf("unit=%d, low=%d, extra=0x%x\n", unit, low, extra); Modified: stable/10/sys/sys/conf.h ============================================================================== --- stable/10/sys/sys/conf.h Thu Jan 28 08:51:00 2016 (r294975) +++ stable/10/sys/sys/conf.h Thu Jan 28 09:18:12 2016 (r294976) @@ -244,6 +244,28 @@ void clone_cleanup(struct clonedevs **); #define CLONE_FLAG0 (CLONE_UNITMASK + 1) int clone_create(struct clonedevs **, struct cdevsw *, int *unit, struct cdev **dev, int extra); +#define MAKEDEV_REF 0x01 +#define MAKEDEV_WHTOUT 0x02 +#define MAKEDEV_NOWAIT 0x04 +#define MAKEDEV_WAITOK 0x08 +#define MAKEDEV_ETERNAL 0x10 +#define MAKEDEV_CHECKNAME 0x20 +struct make_dev_args { + size_t mda_size; + int mda_flags; + struct cdevsw *mda_devsw; + struct ucred *mda_cr; + uid_t mda_uid; + gid_t mda_gid; + int mda_mode; + int mda_unit; + void *mda_si_drv1; + void *mda_si_drv2; +}; +void make_dev_args_init_impl(struct make_dev_args *_args, size_t _sz); +#define make_dev_args_init(a) \ + make_dev_args_init_impl((a), sizeof(struct make_dev_args)) + int count_dev(struct cdev *_dev); void delist_dev(struct cdev *_dev); void destroy_dev(struct cdev *_dev); @@ -265,12 +287,6 @@ struct cdev *make_dev(struct cdevsw *_de struct cdev *make_dev_cred(struct cdevsw *_devsw, int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _perms, const char *_fmt, ...) __printflike(7, 8); -#define MAKEDEV_REF 0x01 -#define MAKEDEV_WHTOUT 0x02 -#define MAKEDEV_NOWAIT 0x04 -#define MAKEDEV_WAITOK 0x08 -#define MAKEDEV_ETERNAL 0x10 -#define MAKEDEV_CHECKNAME 0x20 struct cdev *make_dev_credf(int _flags, struct cdevsw *_devsw, int _unit, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, @@ -278,6 +294,8 @@ struct cdev *make_dev_credf(int _flags, int make_dev_p(int _flags, struct cdev **_cdev, struct cdevsw *_devsw, struct ucred *_cr, uid_t _uid, gid_t _gid, int _mode, const char *_fmt, ...) __printflike(8, 9); +int make_dev_s(struct make_dev_args *_args, struct cdev **_cdev, + const char *_fmt, ...) __printflike(3, 4); struct cdev *make_dev_alias(struct cdev *_pdev, const char *_fmt, ...) __printflike(2, 3); int make_dev_alias_p(int _flags, struct cdev **_cdev, struct cdev *_pdev, From owner-svn-src-stable-10@freebsd.org Thu Jan 28 09:22:40 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E29BA70F08; Thu, 28 Jan 2016 09:22:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C9F31287; Thu, 28 Jan 2016 09:22:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S9MdeT010987; Thu, 28 Jan 2016 09:22:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S9MdXA010986; Thu, 28 Jan 2016 09:22:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601280922.u0S9MdXA010986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jan 2016 09:22: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: r294977 - 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.20 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: Thu, 28 Jan 2016 09:22:40 -0000 Author: kib Date: Thu Jan 28 09:22:38 2016 New Revision: 294977 URL: https://svnweb.freebsd.org/changeset/base/294977 Log: MFC r293349: Convert tty common code to use make_dev_s(). Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Thu Jan 28 09:18:12 2016 (r294976) +++ stable/10/sys/kern/tty.c Thu Jan 28 09:22:38 2016 (r294977) @@ -240,14 +240,10 @@ ttydev_open(struct cdev *dev, int oflags struct thread *td) { struct tty *tp; - int error = 0; - - while ((tp = dev->si_drv1) == NULL) { - error = tsleep(&dev->si_drv1, PCATCH, "ttdrv1", 1); - if (error != EWOULDBLOCK) - return (error); - } + int error; + tp = dev->si_drv1; + error = 0; tty_lock(tp); if (tty_gone(tp)) { /* Device is already gone. */ @@ -762,13 +758,10 @@ ttyil_open(struct cdev *dev, int oflags struct thread *td) { struct tty *tp; - int error = 0; + int error; - while ((tp = dev->si_drv1) == NULL) { - error = tsleep(&dev->si_drv1, PCATCH, "ttdrv1", 1); - if (error != EWOULDBLOCK) - return (error); - } + tp = dev->si_drv1; + error = 0; tty_lock(tp); if (tty_gone(tp)) error = ENODEV; @@ -1218,6 +1211,7 @@ static int tty_vmakedevf(struct tty *tp, struct ucred *cred, int flags, const char *fmt, va_list ap) { + struct make_dev_args args; struct cdev *dev, *init, *lock, *cua, *cinit, *clock; const char *prefix = "tty"; char name[SPECNAMELEN - 3]; /* for "tty" and "cua". */ @@ -1248,71 +1242,72 @@ tty_vmakedevf(struct tty *tp, struct ucr flags |= MAKEDEV_CHECKNAME; /* Master call-in device. */ - error = make_dev_p(flags, &dev, &ttydev_cdevsw, cred, uid, gid, mode, - "%s%s", prefix, name); - if (error) + make_dev_args_init(&args); + args.mda_flags = flags; + args.mda_devsw = &ttydev_cdevsw; + args.mda_cr = cred; + args.mda_uid = uid; + args.mda_gid = gid; + args.mda_mode = mode; + args.mda_si_drv1 = tp; + error = make_dev_s(&args, &dev, "%s%s", prefix, name); + if (error != 0) return (error); - dev->si_drv1 = tp; - wakeup(&dev->si_drv1); tp->t_dev = dev; init = lock = cua = cinit = clock = NULL; /* Slave call-in devices. */ if (tp->t_flags & TF_INITLOCK) { - error = make_dev_p(flags, &init, &ttyil_cdevsw, cred, uid, - gid, mode, "%s%s.init", prefix, name); - if (error) + args.mda_devsw = &ttyil_cdevsw; + args.mda_unit = TTYUNIT_INIT; + args.mda_si_drv1 = tp; + args.mda_si_drv2 = &tp->t_termios_init_in; + error = make_dev_s(&args, &init, "%s%s.init", prefix, name); + if (error != 0) goto fail; dev_depends(dev, init); - dev2unit(init) = TTYUNIT_INIT; - init->si_drv1 = tp; - wakeup(&init->si_drv1); - init->si_drv2 = &tp->t_termios_init_in; - error = make_dev_p(flags, &lock, &ttyil_cdevsw, cred, uid, - gid, mode, "%s%s.lock", prefix, name); - if (error) + args.mda_unit = TTYUNIT_LOCK; + args.mda_si_drv2 = &tp->t_termios_lock_in; + error = make_dev_s(&args, &lock, "%s%s.lock", prefix, name); + if (error != 0) goto fail; dev_depends(dev, lock); - dev2unit(lock) = TTYUNIT_LOCK; - lock->si_drv1 = tp; - wakeup(&lock->si_drv1); - lock->si_drv2 = &tp->t_termios_lock_in; } /* Call-out devices. */ if (tp->t_flags & TF_CALLOUT) { - error = make_dev_p(flags, &cua, &ttydev_cdevsw, cred, - UID_UUCP, GID_DIALER, 0660, "cua%s", name); - if (error) + make_dev_args_init(&args); + args.mda_flags = flags; + args.mda_devsw = &ttydev_cdevsw; + args.mda_cr = cred; + args.mda_uid = UID_UUCP; + args.mda_gid = GID_DIALER; + args.mda_mode = 0660; + args.mda_unit = TTYUNIT_CALLOUT; + args.mda_si_drv1 = tp; + error = make_dev_s(&args, &cua, "cua%s", name); + if (error != 0) goto fail; dev_depends(dev, cua); - dev2unit(cua) = TTYUNIT_CALLOUT; - cua->si_drv1 = tp; - wakeup(&cua->si_drv1); /* Slave call-out devices. */ if (tp->t_flags & TF_INITLOCK) { - error = make_dev_p(flags, &cinit, &ttyil_cdevsw, cred, - UID_UUCP, GID_DIALER, 0660, "cua%s.init", name); - if (error) + args.mda_devsw = &ttyil_cdevsw; + args.mda_unit = TTYUNIT_CALLOUT | TTYUNIT_INIT; + args.mda_si_drv2 = &tp->t_termios_init_out; + error = make_dev_s(&args, &cinit, "cua%s.init", name); + if (error != 0) goto fail; dev_depends(dev, cinit); - dev2unit(cinit) = TTYUNIT_CALLOUT | TTYUNIT_INIT; - cinit->si_drv1 = tp; - wakeup(&cinit->si_drv1); - cinit->si_drv2 = &tp->t_termios_init_out; - error = make_dev_p(flags, &clock, &ttyil_cdevsw, cred, - UID_UUCP, GID_DIALER, 0660, "cua%s.lock", name); - if (error) + args.mda_unit = TTYUNIT_CALLOUT | TTYUNIT_LOCK; + args.mda_si_drv2 = &tp->t_termios_lock_out; + error = make_dev_s(&args, &clock, "cua%s.lock", name); + if (error != 0) goto fail; dev_depends(dev, clock); - dev2unit(clock) = TTYUNIT_CALLOUT | TTYUNIT_LOCK; - clock->si_drv1 = tp; - wakeup(&clock->si_drv1); - clock->si_drv2 = &tp->t_termios_lock_out; } } From owner-svn-src-stable-10@freebsd.org Thu Jan 28 09:25:18 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2880A70FD8; Thu, 28 Jan 2016 09:25:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3B611437; Thu, 28 Jan 2016 09:25:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0S9PGau011135; Thu, 28 Jan 2016 09:25:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0S9PGQn011128; Thu, 28 Jan 2016 09:25:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601280925.u0S9PGQn011128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 28 Jan 2016 09:25:16 +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: r294978 - in stable/10/sys/cam: ctl scsi 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.20 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: Thu, 28 Jan 2016 09:25:18 -0000 Author: kib Date: Thu Jan 28 09:25:15 2016 New Revision: 294978 URL: https://svnweb.freebsd.org/changeset/base/294978 Log: MFC r293350: Convert sys/cam to use make_dev_s(). Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/scsi/scsi_ch.c stable/10/sys/cam/scsi/scsi_enc.c stable/10/sys/cam/scsi/scsi_pass.c stable/10/sys/cam/scsi/scsi_pt.c stable/10/sys/cam/scsi/scsi_sa.c stable/10/sys/cam/scsi/scsi_sg.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Thu Jan 28 09:22:38 2016 (r294977) +++ stable/10/sys/cam/ctl/ctl.c Thu Jan 28 09:25:15 2016 (r294978) @@ -1780,6 +1780,7 @@ ctl_ha_role_sysctl(SYSCTL_HANDLER_ARGS) static int ctl_init(void) { + struct make_dev_args args; struct ctl_softc *softc; void *other_pool; int i, error; @@ -1787,9 +1788,17 @@ ctl_init(void) softc = control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK | M_ZERO); - softc->dev = make_dev(&ctl_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600, - "cam/ctl"); - softc->dev->si_drv1 = softc; + make_dev_args_init(&args); + args.mda_devsw = &ctl_cdevsw; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = softc; + error = make_dev_s(&args, &softc->dev, "cam/ctl"); + if (error != 0) { + free(control_softc, M_DEVBUF); + return (error); + } sysctl_ctx_init(&softc->sysctl_ctx); softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, Modified: stable/10/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_ch.c Thu Jan 28 09:22:38 2016 (r294977) +++ stable/10/sys/cam/scsi/scsi_ch.c Thu Jan 28 09:25:15 2016 (r294978) @@ -372,6 +372,8 @@ chregister(struct cam_periph *periph, vo struct ch_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; + struct make_dev_args args; + int error; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -431,11 +433,20 @@ chregister(struct cam_periph *periph, vo /* Register the device */ - softc->dev = make_dev(&ch_cdevsw, periph->unit_number, UID_ROOT, - GID_OPERATOR, 0600, "%s%d", periph->periph_name, - periph->unit_number); + make_dev_args_init(&args); + args.mda_devsw = &ch_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + error = make_dev_s(&args, &softc->dev, "%s%d", periph->periph_name, + periph->unit_number); cam_periph_lock(periph); - softc->dev->si_drv1 = periph; + if (error != 0) { + cam_periph_release_locked(periph); + return (CAM_REQ_CMP_ERR); + } /* * Add an async callback so that we get @@ -507,8 +518,6 @@ chclose(struct cdev *dev, int flag, int struct mtx *mtx; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); mtx = cam_periph_mtx(periph); mtx_lock(mtx); @@ -754,9 +763,6 @@ chioctl(struct cdev *dev, u_long cmd, ca int error; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); - cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering chioctl\n")); Modified: stable/10/sys/cam/scsi/scsi_enc.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_enc.c Thu Jan 28 09:22:38 2016 (r294977) +++ stable/10/sys/cam/scsi/scsi_enc.c Thu Jan 28 09:25:15 2016 (r294978) @@ -264,10 +264,6 @@ enc_open(struct cdev *dev, int flags, in int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) { - return (ENXIO); - } - if (cam_periph_acquire(periph) != CAM_REQ_CMP) return (ENXIO); @@ -302,8 +298,6 @@ enc_close(struct cdev *dev, int flag, in struct mtx *mtx; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); mtx = cam_periph_mtx(periph); mtx_lock(mtx); @@ -364,9 +358,6 @@ enc_ioctl(struct cdev *dev, u_long cmd, addr = NULL; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering encioctl\n")); cam_periph_lock(periph); @@ -905,6 +896,7 @@ enc_ctor(struct cam_periph *periph, void enc_softc_t *enc; struct ccb_getdev *cgd; char *tname; + struct make_dev_args args; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -987,12 +979,20 @@ enc_ctor(struct cam_periph *periph, void return (CAM_REQ_CMP_ERR); } - enc->enc_dev = make_dev(&enc_cdevsw, periph->unit_number, - UID_ROOT, GID_OPERATOR, 0600, "%s%d", - periph->periph_name, periph->unit_number); - + make_dev_args_init(&args); + args.mda_devsw = &enc_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + err = make_dev_s(&args, &enc->enc_dev, "%s%d", periph->periph_name, + periph->unit_number); cam_periph_lock(periph); - enc->enc_dev->si_drv1 = periph; + if (err != 0) { + cam_periph_release_locked(periph); + return (CAM_REQ_CMP_ERR); + } enc->enc_flags |= ENC_FLAG_INITIALIZED; Modified: stable/10/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_pass.c Thu Jan 28 09:22:38 2016 (r294977) +++ stable/10/sys/cam/scsi/scsi_pass.c Thu Jan 28 09:25:15 2016 (r294978) @@ -548,7 +548,8 @@ passregister(struct cam_periph *periph, struct pass_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; - int no_tags; + struct make_dev_args args; + int error, no_tags; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -648,9 +649,20 @@ passregister(struct cam_periph *periph, } /* Register the device */ - softc->dev = make_dev(&pass_cdevsw, periph->unit_number, - UID_ROOT, GID_OPERATOR, 0600, "%s%d", - periph->periph_name, periph->unit_number); + make_dev_args_init(&args); + args.mda_devsw = &pass_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + error = make_dev_s(&args, &softc->dev, "%s%d", periph->periph_name, + periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + cam_periph_release_locked(periph); + return (CAM_REQ_CMP_ERR); + } /* * Hold a reference to the periph before we create the physical @@ -664,7 +676,6 @@ passregister(struct cam_periph *periph, } cam_periph_lock(periph); - softc->dev->si_drv1 = periph; TASK_INIT(&softc->add_physpath_task, /*priority*/0, pass_add_physpath, periph); @@ -754,8 +765,6 @@ passclose(struct cdev *dev, int flag, in struct mtx *mtx; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); mtx = cam_periph_mtx(periph); mtx_lock(mtx); @@ -1759,9 +1768,6 @@ passdoioctl(struct cdev *dev, u_long cmd uint32_t priority; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); - cam_periph_lock(periph); softc = (struct pass_softc *)periph->softc; @@ -2068,9 +2074,6 @@ passpoll(struct cdev *dev, int poll_even int revents; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct pass_softc *)periph->softc; revents = poll_events & (POLLOUT | POLLWRNORM); @@ -2095,9 +2098,6 @@ passkqfilter(struct cdev *dev, struct kn struct pass_softc *softc; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct pass_softc *)periph->softc; kn->kn_hook = (caddr_t)periph; Modified: stable/10/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_pt.c Thu Jan 28 09:22:38 2016 (r294977) +++ stable/10/sys/cam/scsi/scsi_pt.c Thu Jan 28 09:25:15 2016 (r294978) @@ -173,9 +173,6 @@ ptclose(struct cdev *dev, int flag, int struct pt_softc *softc; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct pt_softc *)periph->softc; cam_periph_lock(periph); @@ -252,6 +249,8 @@ ptctor(struct cam_periph *periph, void * struct pt_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; + struct make_dev_args args; + int error; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -282,6 +281,21 @@ ptctor(struct cam_periph *periph, void * xpt_action((union ccb *)&cpi); cam_periph_unlock(periph); + + make_dev_args_init(&args); + args.mda_devsw = &pt_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + error = make_dev_s(&args, &softc->dev, "%s%d", periph->periph_name, + periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } + softc->device_stats = devstat_new_entry("pt", periph->unit_number, 0, DEVSTAT_NO_BLOCKSIZE, @@ -289,11 +303,7 @@ ptctor(struct cam_periph *periph, void * XPORT_DEVSTAT_TYPE(cpi.transport), DEVSTAT_PRIORITY_OTHER); - softc->dev = make_dev(&pt_cdevsw, periph->unit_number, UID_ROOT, - GID_OPERATOR, 0600, "%s%d", periph->periph_name, - periph->unit_number); cam_periph_lock(periph); - softc->dev->si_drv1 = periph; /* * Add async callbacks for bus reset and @@ -571,9 +581,6 @@ ptioctl(struct cdev *dev, u_long cmd, ca int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return(ENXIO); - softc = (struct pt_softc *)periph->softc; cam_periph_lock(periph); Modified: stable/10/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sa.c Thu Jan 28 09:22:38 2016 (r294977) +++ stable/10/sys/cam/scsi/scsi_sa.c Thu Jan 28 09:25:15 2016 (r294978) @@ -730,9 +730,6 @@ saclose(struct cdev *dev, int flag, int mode = SAMODE(dev); periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); softc = (struct sa_softc *)periph->softc; @@ -905,10 +902,6 @@ sastrategy(struct bio *bp) return; } periph = (struct cam_periph *)bp->bio_dev->si_drv1; - if (periph == NULL) { - biofinish(bp, NULL, ENXIO); - return; - } cam_periph_lock(periph); softc = (struct sa_softc *)periph->softc; @@ -1516,9 +1509,6 @@ saioctl(struct cdev *dev, u_long cmd, ca spaceop = 0; /* shut up gcc */ periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); softc = (struct sa_softc *)periph->softc; @@ -2284,7 +2274,7 @@ saasync(void *callback_arg, u_int32_t co static void sasetupdev(struct sa_softc *softc, struct cdev *dev) { - dev->si_drv1 = softc->periph; + dev->si_iosize_max = softc->maxio; dev->si_flags |= softc->si_flags; /* @@ -2346,8 +2336,10 @@ saregister(struct cam_periph *periph, vo struct sa_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; + struct make_dev_args args; caddr_t match; char tmpstr[80]; + int error; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -2505,25 +2497,48 @@ saregister(struct cam_periph *periph, vo return (CAM_REQ_CMP_ERR); } - softc->devs.ctl_dev = make_dev(&sa_cdevsw, SAMINOR(SA_CTLDEV, - SA_ATYPE_R), UID_ROOT, GID_OPERATOR, - 0660, "%s%d.ctl", periph->periph_name, periph->unit_number); + make_dev_args_init(&args); + args.mda_devsw = &sa_cdevsw; + args.mda_si_drv1 = softc->periph; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0660; + + args.mda_unit = SAMINOR(SA_CTLDEV, SA_ATYPE_R); + error = make_dev_s(&args, &softc->devs.ctl_dev, "%s%d.ctl", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } sasetupdev(softc, softc->devs.ctl_dev); - softc->devs.r_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV, - SA_ATYPE_R), UID_ROOT, GID_OPERATOR, - 0660, "%s%d", periph->periph_name, periph->unit_number); + args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_R); + error = make_dev_s(&args, &softc->devs.r_dev, "%s%d", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } sasetupdev(softc, softc->devs.r_dev); - softc->devs.nr_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV, - SA_ATYPE_NR), UID_ROOT, GID_OPERATOR, - 0660, "n%s%d", periph->periph_name, periph->unit_number); + args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_NR); + error = make_dev_s(&args, &softc->devs.nr_dev, "n%s%d", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } sasetupdev(softc, softc->devs.nr_dev); - softc->devs.er_dev = make_dev(&sa_cdevsw, SAMINOR(SA_NOT_CTLDEV, - SA_ATYPE_ER), UID_ROOT, GID_OPERATOR, - 0660, "e%s%d", periph->periph_name, periph->unit_number); - sasetupdev(softc, softc->devs.er_dev); + args.mda_unit = SAMINOR(SA_NOT_CTLDEV, SA_ATYPE_ER); + error = make_dev_s(&args, &softc->devs.er_dev, "e%s%d", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } + sasetupdev(softc, softc->devs.er_dev); cam_periph_lock(periph); Modified: stable/10/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sg.c Thu Jan 28 09:22:38 2016 (r294977) +++ stable/10/sys/cam/scsi/scsi_sg.c Thu Jan 28 09:25:15 2016 (r294978) @@ -300,7 +300,8 @@ sgregister(struct cam_periph *periph, vo struct sg_softc *softc; struct ccb_getdev *cgd; struct ccb_pathinq cpi; - int no_tags; + struct make_dev_args args; + int no_tags, error; cgd = (struct ccb_getdev *)arg; if (cgd == NULL) { @@ -361,9 +362,20 @@ sgregister(struct cam_periph *periph, vo } /* Register the device */ - softc->dev = make_dev(&sg_cdevsw, periph->unit_number, - UID_ROOT, GID_OPERATOR, 0600, "%s%d", - periph->periph_name, periph->unit_number); + make_dev_args_init(&args); + args.mda_devsw = &sg_cdevsw; + args.mda_unit = periph->unit_number; + args.mda_uid = UID_ROOT; + args.mda_gid = GID_OPERATOR; + args.mda_mode = 0600; + args.mda_si_drv1 = periph; + error = make_dev_s(&args, &softc->dev, "%s%d", + periph->periph_name, periph->unit_number); + if (error != 0) { + cam_periph_lock(periph); + cam_periph_release_locked(periph); + return (CAM_REQ_CMP_ERR); + } if (periph->unit_number < 26) { (void)make_dev_alias(softc->dev, "sg%c", periph->unit_number + 'a'); @@ -373,7 +385,6 @@ sgregister(struct cam_periph *periph, vo (periph->unit_number % 26) + 'a'); } cam_periph_lock(periph); - softc->dev->si_drv1 = periph; /* * Add as async callback so that we get @@ -429,9 +440,6 @@ sgopen(struct cdev *dev, int flags, int int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - if (cam_periph_acquire(periph) != CAM_REQ_CMP) return (ENXIO); @@ -468,8 +476,6 @@ sgclose(struct cdev *dev, int flag, int struct mtx *mtx; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); mtx = cam_periph_mtx(periph); mtx_lock(mtx); @@ -506,9 +512,6 @@ sgioctl(struct cdev *dev, u_long cmd, ca int dir, error; periph = (struct cam_periph *)dev->si_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); softc = (struct sg_softc *)periph->softc; From owner-svn-src-stable-10@freebsd.org Thu Jan 28 12:03:31 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB881A70B3B; Thu, 28 Jan 2016 12:03:31 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 7A9501DDF; Thu, 28 Jan 2016 12:03:31 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SC3Uvp057101; Thu, 28 Jan 2016 12:03:30 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SC3U2W057100; Thu, 28 Jan 2016 12:03:30 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281203.u0SC3U2W057100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 12:03:30 +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: r294980 - stable/10/release/amd64 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.20 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: Thu, 28 Jan 2016 12:03:31 -0000 Author: smh Date: Thu Jan 28 12:03:30 2016 New Revision: 294980 URL: https://svnweb.freebsd.org/changeset/base/294980 Log: MFC r293831: Increase efiboot.img size used in ISO creation This changes mkisoimages-uefi.sh instead of mkisoimages.sh in r293831 due to refactor not MFC'ed. Sponsored by: Multiplay Modified: stable/10/release/amd64/mkisoimages-uefi.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/amd64/mkisoimages-uefi.sh ============================================================================== --- stable/10/release/amd64/mkisoimages-uefi.sh Thu Jan 28 12:00:17 2016 (r294979) +++ stable/10/release/amd64/mkisoimages-uefi.sh Thu Jan 28 12:03:30 2016 (r294980) @@ -28,7 +28,7 @@ if [ "x$1" = "x-b" ]; then bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" # Make EFI system partition (should be done with makefs in the future) - dd if=/dev/zero of=efiboot.img bs=4k count=100 + dd if=/dev/zero of=efiboot.img bs=4k count=200 device=`mdconfig -a -t vnode -f efiboot.img` newfs_msdos -F 12 -m 0xf8 /dev/$device mkdir efi From owner-svn-src-stable-10@freebsd.org Thu Jan 28 12:11:48 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8950EA70E4D; Thu, 28 Jan 2016 12:11:48 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5216F13E3; Thu, 28 Jan 2016 12:11:48 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SCBlk0058196; Thu, 28 Jan 2016 12:11:47 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SCBhQG058154; Thu, 28 Jan 2016 12:11:43 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281211.u0SCBhQG058154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 12:11: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: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386 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.20 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: Thu, 28 Jan 2016 12:11:48 -0000 Author: smh Date: Thu Jan 28 12:11:42 2016 New Revision: 294981 URL: https://svnweb.freebsd.org/changeset/base/294981 Log: MFC r281169, r293724, r293796, r294029, r294041, r294058 MFC r281169 (by andrew): Make global variabled only used in this file static MFC r294058: Make common boot file_loadraw name parameter const MFC r294041: Remove unused reg param from fdt_fixup_memory MFC r293724: Enable warnings in EFI boot code MFC r293796: Fix typo in libefi.c MFC r294029: Only build EFI components on supported compilers Sponsored by: Multiplay Modified: stable/10/sys/boot/common/bootstrap.h stable/10/sys/boot/common/load_elf.c stable/10/sys/boot/common/load_elf_obj.c stable/10/sys/boot/common/misc.c stable/10/sys/boot/common/module.c stable/10/sys/boot/common/part.c stable/10/sys/boot/common/self_reloc.c stable/10/sys/boot/common/ufsread.c stable/10/sys/boot/efi/Makefile stable/10/sys/boot/efi/boot1/Makefile stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/efi/include/efi_nii.h stable/10/sys/boot/efi/include/efiapi.h stable/10/sys/boot/efi/include/eficon.h stable/10/sys/boot/efi/include/eficonsctl.h stable/10/sys/boot/efi/include/efidevp.h stable/10/sys/boot/efi/include/efierr.h stable/10/sys/boot/efi/include/efifpswa.h stable/10/sys/boot/efi/include/efigop.h stable/10/sys/boot/efi/include/efilib.h stable/10/sys/boot/efi/include/efinet.h stable/10/sys/boot/efi/include/efiprot.h stable/10/sys/boot/efi/include/efipxebc.h stable/10/sys/boot/efi/include/efiser.h stable/10/sys/boot/efi/libefi/Makefile stable/10/sys/boot/efi/libefi/efi_console.c stable/10/sys/boot/efi/libefi/efipart.c stable/10/sys/boot/efi/libefi/libefi.c stable/10/sys/boot/efi/loader/Makefile stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c stable/10/sys/boot/efi/loader/arch/amd64/reloc.c stable/10/sys/boot/efi/loader/autoload.c stable/10/sys/boot/efi/loader/bootinfo.c stable/10/sys/boot/efi/loader/copy.c stable/10/sys/boot/efi/loader/devicename.c stable/10/sys/boot/efi/loader/loader_efi.h stable/10/sys/boot/efi/loader/main.c stable/10/sys/boot/fdt/fdt_loader_cmd.c stable/10/sys/boot/i386/libi386/smbios.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/bootstrap.h ============================================================================== --- stable/10/sys/boot/common/bootstrap.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/common/bootstrap.h Thu Jan 28 12:11:42 2016 (r294981) @@ -233,7 +233,7 @@ int mod_loadkld(const char *name, int struct preloaded_file *file_alloc(void); struct preloaded_file *file_findfile(const char *name, const char *type); struct file_metadata *file_findmetadata(struct preloaded_file *fp, int type); -struct preloaded_file *file_loadraw(char *name, char *type, int insert); +struct preloaded_file *file_loadraw(const char *name, char *type, int insert); void file_discard(struct preloaded_file *fp); void file_addmetadata(struct preloaded_file *fp, int type, size_t size, void *p); int file_addmodule(struct preloaded_file *fp, char *modname, int version, Modified: stable/10/sys/boot/common/load_elf.c ============================================================================== --- stable/10/sys/boot/common/load_elf.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/common/load_elf.c Thu Jan 28 12:11:42 2016 (r294981) @@ -856,7 +856,7 @@ __elfN(parse_modmetadata)(struct preload error = __elfN(reloc_ptr)(fp, ef, v, &md, sizeof(md)); if (error == EOPNOTSUPP) { md.md_cval += ef->off; - md.md_data += ef->off; + md.md_data = (void *)((uintptr_t)md.md_data + ef->off); } else if (error != 0) return (error); #endif Modified: stable/10/sys/boot/common/load_elf_obj.c ============================================================================== --- stable/10/sys/boot/common/load_elf_obj.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/common/load_elf_obj.c Thu Jan 28 12:11:42 2016 (r294981) @@ -519,10 +519,8 @@ __elfN(obj_symaddr)(struct elf_file *ef, { Elf_Sym sym; Elf_Addr base; - int symcnt; - symcnt = ef->e_shdr[ef->symtabindex].sh_size / sizeof(Elf_Sym); - if (symidx >= symcnt) + if (symidx >= ef->e_shdr[ef->symtabindex].sh_size / sizeof(Elf_Sym)) return (0); COPYOUT(ef->e_shdr[ef->symtabindex].sh_addr + symidx * sizeof(Elf_Sym), &sym, sizeof(sym)); Modified: stable/10/sys/boot/common/misc.c ============================================================================== --- stable/10/sys/boot/common/misc.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/common/misc.c Thu Jan 28 12:11:42 2016 (r294981) @@ -118,14 +118,12 @@ kern_bzero(vm_offset_t dest, size_t len) int kern_pread(int fd, vm_offset_t dest, size_t len, off_t off) { - ssize_t nread; if (lseek(fd, off, SEEK_SET) == -1) { printf("\nlseek failed\n"); return (-1); } - nread = archsw.arch_readin(fd, dest, len); - if (nread != len) { + if ((size_t)archsw.arch_readin(fd, dest, len) != len) { printf("\nreadin failed\n"); return (-1); } @@ -140,7 +138,6 @@ void * alloc_pread(int fd, off_t off, size_t len) { void *buf; - ssize_t nread; buf = malloc(len); if (buf == NULL) { @@ -152,8 +149,7 @@ alloc_pread(int fd, off_t off, size_t le free(buf); return (NULL); } - nread = read(fd, buf, len); - if (nread != len) { + if ((size_t)read(fd, buf, len) != len) { printf("\nread failed\n"); free(buf); return (NULL); Modified: stable/10/sys/boot/common/module.c ============================================================================== --- stable/10/sys/boot/common/module.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/common/module.c Thu Jan 28 12:11:42 2016 (r294981) @@ -358,14 +358,14 @@ file_load_dependencies(struct preloaded_ } /* - * We've been asked to load (name) as (type), so just suck it in, + * We've been asked to load (fname) as (type), so just suck it in, * no arguments or anything. */ struct preloaded_file * -file_loadraw(char *name, char *type, int insert) +file_loadraw(const char *fname, char *type, int insert) { struct preloaded_file *fp; - char *cp; + char *name; int fd, got; vm_offset_t laddr; @@ -376,12 +376,11 @@ file_loadraw(char *name, char *type, int } /* locate the file on the load path */ - cp = file_search(name, NULL); - if (cp == NULL) { - sprintf(command_errbuf, "can't find '%s'", name); + name = file_search(fname, NULL); + if (name == NULL) { + sprintf(command_errbuf, "can't find '%s'", fname); return(NULL); } - name = cp; if ((fd = open(name, O_RDONLY)) < 0) { sprintf(command_errbuf, "can't open '%s': %s", name, strerror(errno)); @@ -962,7 +961,7 @@ moduledir_rebuild(void) { struct moduledir *mdp, *mtmp; const char *path, *cp, *ep; - int cplen; + size_t cplen; path = getenv("module_path"); if (path == NULL) Modified: stable/10/sys/boot/common/part.c ============================================================================== --- stable/10/sys/boot/common/part.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/common/part.c Thu Jan 28 12:11:42 2016 (r294981) @@ -102,7 +102,7 @@ static struct parttypes { const char * parttype2str(enum partition_type type) { - int i; + size_t i; for (i = 0; i < sizeof(ptypes) / sizeof(ptypes[0]); i++) if (ptypes[i].type == type) @@ -203,7 +203,7 @@ gpt_checktbl(const struct gpt_hdr *hdr, uint64_t lba_last) { struct gpt_ent *ent; - int i, cnt; + uint32_t i, cnt; cnt = size / hdr->hdr_entsz; if (hdr->hdr_entries <= cnt) { @@ -234,8 +234,8 @@ ptable_gptread(struct ptable *table, voi struct gpt_ent *ent; u_char *buf, *tbl; uint64_t offset; - int pri, sec, i; - size_t size; + int pri, sec; + size_t size, i; buf = malloc(table->sectorsize); if (buf == NULL) @@ -358,7 +358,7 @@ mbr_parttype(uint8_t type) return (PART_UNKNOWN); } -struct ptable* +static struct ptable* ptable_ebrread(struct ptable *table, void *dev, diskread_t dread) { struct dos_partition *dp; @@ -435,7 +435,7 @@ bsd_parttype(uint8_t type) return (PART_UNKNOWN); } -struct ptable* +static struct ptable* ptable_bsdread(struct ptable *table, void *dev, diskread_t dread) { struct disklabel *dl; Modified: stable/10/sys/boot/common/self_reloc.c ============================================================================== --- stable/10/sys/boot/common/self_reloc.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/common/self_reloc.c Thu Jan 28 12:11:42 2016 (r294981) @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); #define RELOC_TYPE_RELATIVE R_386_RELATIVE #endif +void self_reloc(Elf_Addr baseaddr, ElfW_Dyn *dynamic); + /* * A simple elf relocator. */ @@ -118,6 +120,6 @@ self_reloc(Elf_Addr baseaddr, ElfW_Dyn * /* XXX: do we need other relocations ? */ break; } - rel = (ElfW_Rel *) ((caddr_t) rel + relent); + rel = (ElfW_Rel *)(void *)((caddr_t) rel + relent); } } Modified: stable/10/sys/boot/common/ufsread.c ============================================================================== --- stable/10/sys/boot/common/ufsread.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/common/ufsread.c Thu Jan 28 12:11:42 2016 (r294981) @@ -207,7 +207,7 @@ fsread(ufs_ino_t inode, void *buf, size_ #endif ) && fs.fs_bsize <= MAXBSIZE && - fs.fs_bsize >= sizeof(struct fs)) + fs.fs_bsize >= (int32_t)sizeof(struct fs)) break; } if (sblock_try[n] == -1) { @@ -231,10 +231,10 @@ fsread(ufs_ino_t inode, void *buf, size_ sizeof(struct ufs2_dinode)); #else if (fs.fs_magic == FS_UFS1_MAGIC) - memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, sizeof(struct ufs1_dinode)); else - memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, sizeof(struct ufs2_dinode)); #endif inomap = inode; @@ -283,7 +283,7 @@ fsread(ufs_ino_t inode, void *buf, size_ return -1; vbaddr = fsbtodb(&fs, addr2) + (off >> VBLKSHIFT) * DBPERVBLK; vboff = off & VBLKMASK; - n = sblksize(&fs, size, lbn) - (off & ~VBLKMASK); + n = sblksize(&fs, (off_t)size, lbn) - (off & ~VBLKMASK); if (n > VBLKSIZE) n = VBLKSIZE; if (blkmap != vbaddr) { Modified: stable/10/sys/boot/efi/Makefile ============================================================================== --- stable/10/sys/boot/efi/Makefile Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/Makefile Thu Jan 28 12:11:42 2016 (r294981) @@ -1,9 +1,13 @@ # $FreeBSD$ -SUBDIR= libefi +# In-tree GCC does not support __attribute__((ms_abi)). +.if ${COMPILER_TYPE} != "gcc" .if ${MACHINE_CPUARCH} == "amd64" -SUBDIR+= loader boot1 +SUBDIR+= libefi loader boot1 .endif +.endif # ${COMPILER_TYPE} != "gcc" + .include + Modified: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/10/sys/boot/efi/boot1/Makefile Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/boot1/Makefile Thu Jan 28 12:11:42 2016 (r294981) @@ -4,13 +4,11 @@ MAN= .include -# In-tree GCC does not support __attribute__((ms_abi)). -.if ${COMPILER_TYPE} != "gcc" - MK_SSP= no PROG= boot1.sym INTERNALPROG= +WARNS?= 6 # architecture-specific loader code SRCS= boot1.c reloc.c start.S @@ -81,8 +79,6 @@ boot1.efifat: boot1.efi CLEANFILES= boot1.efi boot1.efifat -.endif # ${COMPILER_TYPE} != "gcc" - .include .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 28 12:11:42 2016 (r294981) @@ -36,12 +36,13 @@ __FBSDID("$FreeBSD$"); void panic(const char *fmt, ...) __dead2; void putchar(int c); +EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet); static void load(const char *fname); -EFI_SYSTEM_TABLE *systab; -EFI_HANDLE *image; +static EFI_SYSTEM_TABLE *systab; +static EFI_HANDLE *image; static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; @@ -62,7 +63,7 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E EFI_BOOT_SERVICES *BS; EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; - char *path = _PATH_LOADER; + const char *path = _PATH_LOADER; systab = Xsystab; image = Ximage; @@ -156,7 +157,6 @@ fsstat(ufs_ino_t inode) { #ifndef UFS2_ONLY static struct ufs1_dinode dp1; - ufs1_daddr_t addr1; #endif #ifndef UFS1_ONLY static struct ufs2_dinode dp2; @@ -165,11 +165,8 @@ fsstat(ufs_ino_t inode) static ufs_ino_t inomap; char *blkbuf; void *indbuf; - size_t n, nb, size, off, vboff; - ufs_lbn_t lbn; - ufs2_daddr_t addr2, vbaddr; + size_t n, size; static ufs2_daddr_t blkmap, indmap; - u_int u; blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; @@ -193,7 +190,7 @@ fsstat(ufs_ino_t inode) #endif ) && fs.fs_bsize <= MAXBSIZE && - fs.fs_bsize >= sizeof(struct fs)) + fs.fs_bsize >= (int32_t)sizeof(struct fs)) break; } if (sblock_try[n] == -1) { @@ -217,10 +214,10 @@ fsstat(ufs_ino_t inode) sizeof(struct ufs2_dinode)); #else if (fs.fs_magic == FS_UFS1_MAGIC) - memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, sizeof(struct ufs1_dinode)); else - memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, sizeof(struct ufs2_dinode)); #endif inomap = inode; Modified: stable/10/sys/boot/efi/include/efi_nii.h ============================================================================== --- stable/10/sys/boot/efi/include/efi_nii.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efi_nii.h Thu Jan 28 12:11:42 2016 (r294981) @@ -26,9 +26,9 @@ Revision history: --*/ #define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL \ - { 0xE18541CD, 0xF755, 0x4f73, 0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 } + { 0xE18541CD, 0xF755, 0x4f73, {0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29} } #define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_31 \ - { 0x1ACED566, 0x76ED, 0x4218, 0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 } + { 0x1ACED566, 0x76ED, 0x4218, {0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89} } #define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION 0x00010000 #define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION_31 0x00010001 Modified: stable/10/sys/boot/efi/include/efiapi.h ============================================================================== --- stable/10/sys/boot/efi/include/efiapi.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efiapi.h Thu Jan 28 12:11:42 2016 (r294981) @@ -214,8 +214,8 @@ VOID // EFI platform varibles // -#define EFI_GLOBAL_VARIABLE \ - { 0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C } +#define EFI_GLOBAL_VARIABLE \ + { 0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} } // Variable attributes #define EFI_VARIABLE_NON_VOLATILE 0x00000001 @@ -367,8 +367,8 @@ EFI_STATUS // Image handle -#define LOADED_IMAGE_PROTOCOL \ - { 0x5B1B31A1, 0x9562, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } +#define LOADED_IMAGE_PROTOCOL \ + { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} } #define EFI_LOADED_IMAGE_INFORMATION_REVISION 0x1000 typedef struct { @@ -831,35 +831,35 @@ typedef struct { // EFI Configuration Table and GUID definitions // -#define MPS_TABLE_GUID \ - { 0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define MPS_TABLE_GUID \ + { 0xeb9d2d2f, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } -#define ACPI_TABLE_GUID \ - { 0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define ACPI_TABLE_GUID \ + { 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } -#define ACPI_20_TABLE_GUID \ - { 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } +#define ACPI_20_TABLE_GUID \ + { 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} } -#define SMBIOS_TABLE_GUID \ - { 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define SMBIOS_TABLE_GUID \ + { 0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } -#define SAL_SYSTEM_TABLE_GUID \ - { 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define SAL_SYSTEM_TABLE_GUID \ + { 0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } -#define FDT_TABLE_GUID \ - { 0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } +#define FDT_TABLE_GUID \ + { 0xb1b621d5, 0xf19c, 0x41a5, {0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0} } -#define DXE_SERVICES_TABLE_GUID \ - { 0x5ad34ba, 0x6f02, 0x4214, 0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } +#define DXE_SERVICES_TABLE_GUID \ + { 0x5ad34ba, 0x6f02, 0x4214, {0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9} } -#define HOB_LIST_TABLE_GUID \ - { 0x7739f24c, 0x93d7, 0x11d4, 0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } +#define HOB_LIST_TABLE_GUID \ + { 0x7739f24c, 0x93d7, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } #define MEMORY_TYPE_INFORMATION_TABLE_GUID \ - { 0x4c19049f, 0x4137, 0x4dd3, 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa } + { 0x4c19049f, 0x4137, 0x4dd3, {0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa} } #define DEBUG_IMAGE_INFO_TABLE_GUID \ - { 0x49152e77, 0x1ada, 0x4764, 0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b } + { 0x49152e77, 0x1ada, 0x4764, {0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b} } typedef struct _EFI_CONFIGURATION_TABLE { EFI_GUID VendorGuid; Modified: stable/10/sys/boot/efi/include/eficon.h ============================================================================== --- stable/10/sys/boot/efi/include/eficon.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/eficon.h Thu Jan 28 12:11:42 2016 (r294981) @@ -32,7 +32,7 @@ Revision History // #define SIMPLE_TEXT_OUTPUT_PROTOCOL \ - { 0x387477c2, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } INTERFACE_DECL(_SIMPLE_TEXT_OUTPUT_INTERFACE); @@ -239,8 +239,8 @@ typedef struct _SIMPLE_TEXT_OUTPUT_INTER // Text input protocol // -#define SIMPLE_TEXT_INPUT_PROTOCOL \ - { 0x387477c1, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } +#define SIMPLE_TEXT_INPUT_PROTOCOL \ + { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } INTERFACE_DECL(_SIMPLE_INPUT_INTERFACE); Modified: stable/10/sys/boot/efi/include/eficonsctl.h ============================================================================== --- stable/10/sys/boot/efi/include/eficonsctl.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/eficonsctl.h Thu Jan 28 12:11:42 2016 (r294981) @@ -35,7 +35,7 @@ #define _EFI_CONS_CTL_H #define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ - { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } + { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; Modified: stable/10/sys/boot/efi/include/efidevp.h ============================================================================== --- stable/10/sys/boot/efi/include/efidevp.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efidevp.h Thu Jan 28 12:11:42 2016 (r294981) @@ -110,7 +110,7 @@ typedef struct _VENDOR_DEVICE_PATH { } VENDOR_DEVICE_PATH; #define UNKNOWN_DEVICE_GUID \ - { 0xcf31fac5, 0xc24e, 0x11d2, 0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } + { 0xcf31fac5, 0xc24e, 0x11d2, {0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} } typedef struct _UKNOWN_DEVICE_VENDOR_DP { VENDOR_DEVICE_PATH DevicePath; @@ -274,16 +274,16 @@ typedef struct _UART_DEVICE_PATH { /* Use VENDOR_DEVICE_PATH struct */ #define DEVICE_PATH_MESSAGING_PC_ANSI \ - { 0xe0c14753, 0xf9be, 0x11d2, 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } #define DEVICE_PATH_MESSAGING_VT_100 \ - { 0xdfa66065, 0xb419, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } #define DEVICE_PATH_MESSAGING_VT_100_PLUS \ - { 0x7baec70b, 0x57e0, 0x4c76, 0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } + { 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43} } #define DEVICE_PATH_MESSAGING_VT_UTF8 \ - { 0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } + { 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} } #define MEDIA_DEVICE_PATH 0x04 Modified: stable/10/sys/boot/efi/include/efierr.h ============================================================================== --- stable/10/sys/boot/efi/include/efierr.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efierr.h Thu Jan 28 12:11:42 2016 (r294981) @@ -31,7 +31,7 @@ Revision History #define EFIWARN(a) (a) #define EFI_ERROR(a) (((INTN) a) < 0) -#define EFI_ERROR_CODE(a) (a & ~EFI_ERROR_MASK) +#define EFI_ERROR_CODE(a) (unsigned long)(a & ~EFI_ERROR_MASK) #define EFI_SUCCESS 0 Modified: stable/10/sys/boot/efi/include/efifpswa.h ============================================================================== --- stable/10/sys/boot/efi/include/efifpswa.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efifpswa.h Thu Jan 28 12:11:42 2016 (r294981) @@ -7,7 +7,7 @@ */ #define EFI_INTEL_FPSWA \ - { 0xc41b6531, 0x97b9, 0x11d3, 0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0xc41b6531, 0x97b9, 0x11d3, {0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } INTERFACE_DECL(_FPSWA_INTERFACE); Modified: stable/10/sys/boot/efi/include/efigop.h ============================================================================== --- stable/10/sys/boot/efi/include/efigop.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efigop.h Thu Jan 28 12:11:42 2016 (r294981) @@ -27,9 +27,8 @@ Revision History #ifndef _EFIGOP_H #define _EFIGOP_H -#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ - { 0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, \ - 0x51, 0x6a } +#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ + { 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a} } INTERFACE_DECL(_EFI_GRAPHICS_OUTPUT); Modified: stable/10/sys/boot/efi/include/efilib.h ============================================================================== --- stable/10/sys/boot/efi/include/efilib.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efilib.h Thu Jan 28 12:11:42 2016 (r294981) @@ -50,3 +50,4 @@ time_t efi_time(EFI_TIME *); EFI_STATUS main(int argc, CHAR16 *argv[]); void exit(EFI_STATUS status); +void delay(int usecs); Modified: stable/10/sys/boot/efi/include/efinet.h ============================================================================== --- stable/10/sys/boot/efi/include/efinet.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efinet.h Thu Jan 28 12:11:42 2016 (r294981) @@ -29,7 +29,7 @@ Revision History // #define EFI_SIMPLE_NETWORK_PROTOCOL \ - { 0xA19832B9, 0xAC25, 0x11D3, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } + { 0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} } INTERFACE_DECL(_EFI_SIMPLE_NETWORK); Modified: stable/10/sys/boot/efi/include/efiprot.h ============================================================================== --- stable/10/sys/boot/efi/include/efiprot.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efiprot.h Thu Jan 28 12:11:42 2016 (r294981) @@ -31,8 +31,8 @@ Revision History // Device Path protocol // -#define DEVICE_PATH_PROTOCOL \ - { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } +#define DEVICE_PATH_PROTOCOL \ + { 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } // @@ -40,7 +40,7 @@ Revision History // #define BLOCK_IO_PROTOCOL \ - { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } #define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000 INTERFACE_DECL(_EFI_BLOCK_IO); @@ -116,7 +116,7 @@ typedef struct _EFI_BLOCK_IO { // #define DISK_IO_PROTOCOL \ - { 0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } #define EFI_DISK_IO_INTERFACE_REVISION 0x00010000 INTERFACE_DECL(_EFI_DISK_IO); @@ -155,7 +155,7 @@ typedef struct _EFI_DISK_IO { // #define SIMPLE_FILE_SYSTEM_PROTOCOL \ - { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } INTERFACE_DECL(_EFI_FILE_IO_INTERFACE); INTERFACE_DECL(_EFI_FILE_HANDLE); @@ -290,8 +290,8 @@ typedef struct _EFI_FILE_HANDLE { // File information types // -#define EFI_FILE_INFO_ID \ - { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } +#define EFI_FILE_INFO_ID \ + { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } typedef struct { UINT64 Size; @@ -314,8 +314,8 @@ typedef struct { #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName) -#define EFI_FILE_SYSTEM_INFO_ID \ - { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } +#define EFI_FILE_SYSTEM_INFO_ID \ + { 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } typedef struct { UINT64 Size; @@ -336,8 +336,8 @@ typedef struct { #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel) -#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \ - { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } +#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \ + { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} } typedef struct { CHAR16 VolumeLabel[1]; @@ -351,7 +351,7 @@ typedef struct { #define LOAD_FILE_PROTOCOL \ - { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } + { 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} } INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE); @@ -375,7 +375,7 @@ typedef struct _EFI_LOAD_FILE_INTERFACE // #define DEVICE_IO_PROTOCOL \ - { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE); @@ -485,7 +485,7 @@ typedef struct _EFI_DEVICE_IO_INTERFACE // #define UNICODE_COLLATION_PROTOCOL \ - { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } #define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff) Modified: stable/10/sys/boot/efi/include/efipxebc.h ============================================================================== --- stable/10/sys/boot/efi/include/efipxebc.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efipxebc.h Thu Jan 28 12:11:42 2016 (r294981) @@ -32,7 +32,7 @@ Revision History // #define EFI_PXE_BASE_CODE_PROTOCOL \ - { 0x03c4e603, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } + { 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } INTERFACE_DECL(_EFI_PXE_BASE_CODE); @@ -425,7 +425,7 @@ typedef struct _EFI_PXE_BASE_CODE { // #define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL \ - { 0x245dca21, 0xfb7b, 0x11d3, 0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } + { 0x245dca21, 0xfb7b, 0x11d3, {0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } // // Revision Number Modified: stable/10/sys/boot/efi/include/efiser.h ============================================================================== --- stable/10/sys/boot/efi/include/efiser.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/include/efiser.h Thu Jan 28 12:11:42 2016 (r294981) @@ -30,7 +30,7 @@ Revision History // #define SERIAL_IO_PROTOCOL \ - { 0xBB25CF6F, 0xF1D4, 0x11D2, 0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD } + { 0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD} } INTERFACE_DECL(_SERIAL_IO_INTERFACE); Modified: stable/10/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/10/sys/boot/efi/libefi/Makefile Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/libefi/Makefile Thu Jan 28 12:11:42 2016 (r294981) @@ -2,6 +2,7 @@ LIB= efi INTERNALLIB= +WARNS?= 2 SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ libefi.c time.c Modified: stable/10/sys/boot/efi/libefi/efi_console.c ============================================================================== --- stable/10/sys/boot/efi/libefi/efi_console.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/libefi/efi_console.c Thu Jan 28 12:11:42 2016 (r294981) @@ -47,6 +47,8 @@ static int esc; void get_pos(int *x, int *y); void curs_move(int *_x, int *_y, int x, int y); static void CL(int); +void HO(void); +void end_term(void); #endif static void efi_cons_probe(struct console *); Modified: stable/10/sys/boot/efi/libefi/efipart.c ============================================================================== --- stable/10/sys/boot/efi/libefi/efipart.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/libefi/efipart.c Thu Jan 28 12:11:42 2016 (r294981) @@ -67,7 +67,6 @@ efipart_init(void) EFI_HANDLE *hin, *hout, *aliases, handle; EFI_STATUS status; UINTN sz; - CHAR16 *path; u_int n, nin, nout; int err; size_t devpathlen; Modified: stable/10/sys/boot/efi/libefi/libefi.c ============================================================================== --- stable/10/sys/boot/efi/libefi/libefi.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/libefi/libefi.c Thu Jan 28 12:11:42 2016 (r294981) @@ -179,7 +179,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SY argv = malloc((argc + 1) * sizeof(CHAR16*)); argc = 0; if (addprog) - argv[argc++] = L"loader.efi"; + argv[argc++] = (CHAR16 *)L"loader.efi"; argp = args; while (argp != NULL && *argp != 0) { argp = arg_skipsep(argp); Modified: stable/10/sys/boot/efi/loader/Makefile ============================================================================== --- stable/10/sys/boot/efi/loader/Makefile Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/Makefile Thu Jan 28 12:11:42 2016 (r294981) @@ -4,13 +4,11 @@ MAN= .include -# In-tree GCC does not support __attribute__((ms_abi)). -.if ${COMPILER_TYPE} != "gcc" - MK_SSP= no PROG= loader.sym INTERNALPROG= +WARNS?= 3 # architecture-specific loader code SRCS= autoload.c \ @@ -94,8 +92,6 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a DPADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} ${LDSCRIPT} LDADD= ${LIBFICL} ${LIBEFI} ${LIBSTAND} -.endif # ${COMPILER_TYPE} != "gcc" - .include beforedepend ${OBJS}: machine x86 Modified: stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c ============================================================================== --- stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Thu Jan 28 12:11:42 2016 (r294981) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "platform/acfreebsd.h" #include "acconfig.h" #define ACPI_SYSTEM_XFACE +#define ACPI_USE_SYSTEM_INTTYPES #include "actypes.h" #include "actbl.h" @@ -100,7 +101,6 @@ elf64_exec(struct preloaded_file *fp) ACPI_TABLE_RSDP *rsdp; char buf[24]; int revision; - EFI_STATUS status; rsdp = efi_get_table(&acpi20_guid); if (rsdp == NULL) { Modified: stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/arch/amd64/framebuffer.c Thu Jan 28 12:11:42 2016 (r294981) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "framebuffer.h" + static EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; int Modified: stable/10/sys/boot/efi/loader/arch/amd64/reloc.c ============================================================================== --- stable/10/sys/boot/efi/loader/arch/amd64/reloc.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/arch/amd64/reloc.c Thu Jan 28 12:11:42 2016 (r294981) @@ -42,12 +42,15 @@ __FBSDID("$FreeBSD$"); #define ELFW_R_TYPE ELF64_R_TYPE #endif +EFI_STATUS _reloc(unsigned long ImageBase, ElfW_Dyn *dynamic, EFI_HANDLE image_handle __unused, + EFI_SYSTEM_TABLE *system_table __unused); + /* * A simple relocator for IA32/AMD64 EFI binaries. */ EFI_STATUS -_reloc(unsigned long ImageBase, ElfW_Dyn *dynamic, EFI_HANDLE image_handle, - EFI_SYSTEM_TABLE *system_table) +_reloc(unsigned long ImageBase, ElfW_Dyn *dynamic, EFI_HANDLE image_handle __unused, + EFI_SYSTEM_TABLE *system_table __unused) { unsigned long relsz, relent; unsigned long *newaddr; @@ -100,7 +103,7 @@ _reloc(unsigned long ImageBase, ElfW_Dyn /* XXX: do we need other relocations ? */ break; } - rel = (ElfW_Rel *) ((caddr_t) rel + relent); + rel = (ElfW_Rel *)(void *) ((caddr_t) rel + relent); } return (EFI_SUCCESS); Modified: stable/10/sys/boot/efi/loader/autoload.c ============================================================================== --- stable/10/sys/boot/efi/loader/autoload.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/autoload.c Thu Jan 28 12:11:42 2016 (r294981) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#include "loader_efi.h" + int efi_autoload(void) { Modified: stable/10/sys/boot/efi/loader/bootinfo.c ============================================================================== --- stable/10/sys/boot/efi/loader/bootinfo.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/bootinfo.c Thu Jan 28 12:11:42 2016 (r294981) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include "framebuffer.h" #include "loader_efi.h" +int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); + static const char howto_switches[] = "aCdrgDmphsv"; static int howto_masks[] = { RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE, @@ -113,7 +115,7 @@ bi_copyenv(vm_offset_t start) /* Traverse the environment. */ for (ep = environ; ep != NULL; ep = ep->ev_next) { len = strlen(ep->ev_name); - if (archsw.arch_copyin(ep->ev_name, addr, len) != len) + if ((size_t)archsw.arch_copyin(ep->ev_name, addr, len) != len) break; addr += len; if (archsw.arch_copyin("=", addr, 1) != 1) @@ -121,7 +123,7 @@ bi_copyenv(vm_offset_t start) addr++; if (ep->ev_value != NULL) { len = strlen(ep->ev_value); - if (archsw.arch_copyin(ep->ev_value, addr, len) != len) + if ((size_t)archsw.arch_copyin(ep->ev_value, addr, len) != len) break; addr += len; } Modified: stable/10/sys/boot/efi/loader/copy.c ============================================================================== --- stable/10/sys/boot/efi/loader/copy.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/copy.c Thu Jan 28 12:11:42 2016 (r294981) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "loader_efi.h" + #ifndef EFI_STAGING_SIZE #define EFI_STAGING_SIZE 48 #endif Modified: stable/10/sys/boot/efi/loader/devicename.c ============================================================================== --- stable/10/sys/boot/efi/loader/devicename.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/devicename.c Thu Jan 28 12:11:42 2016 (r294981) @@ -31,11 +31,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include "bootstrap.h" +#include #include #include +#include "loader_efi.h" + static int efi_parsedev(struct devdesc **, const char *, const char **); /* Modified: stable/10/sys/boot/efi/loader/loader_efi.h ============================================================================== --- stable/10/sys/boot/efi/loader/loader_efi.h Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/loader_efi.h Thu Jan 28 12:11:42 2016 (r294981) @@ -31,6 +31,8 @@ #ifndef _LOADER_EFI_COPY_H_ #define _LOADER_EFI_COPY_H_ +#include + int efi_autoload(void); int efi_getdev(void **vdev, const char *devspec, const char **path); Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/efi/loader/main.c Thu Jan 28 12:11:42 2016 (r294981) @@ -67,6 +67,7 @@ main(int argc, CHAR16 *argv[]) EFI_LOADED_IMAGE *img; EFI_GUID *guid; int i, j, vargood; + UINTN k; /* * XXX Chicken-and-egg problem; we want to have console output @@ -154,10 +155,10 @@ main(int argc, CHAR16 *argv[]) archsw.arch_copyout = efi_copyout; archsw.arch_readin = efi_readin; - for (i = 0; i < ST->NumberOfTableEntries; i++) { - guid = &ST->ConfigurationTable[i].VendorGuid; + for (k = 0; k < ST->NumberOfTableEntries; k++) { + guid = &ST->ConfigurationTable[k].VendorGuid; if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { - smbios_detect(ST->ConfigurationTable[i].VendorTable); + smbios_detect(ST->ConfigurationTable[k].VendorTable); break; } } @@ -241,8 +242,9 @@ command_memmap(int argc, char *argv[]) for (i = 0, p = map; i < ndesc; i++, p = NextMemoryDescriptor(p, dsz)) { - printf("%23s %012lx %012lx %08lx ", types[p->Type], - p->PhysicalStart, p->VirtualStart, p->NumberOfPages); + printf("%23s %012jx %012jx %08jx ", types[p->Type], + (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart, + (uintmax_t)p->NumberOfPages); if (p->Attribute & EFI_MEMORY_UC) printf("UC "); if (p->Attribute & EFI_MEMORY_WC) @@ -283,9 +285,10 @@ guid_to_string(EFI_GUID *guid) static int command_configuration(int argc, char *argv[]) { - int i; + UINTN i; - printf("NumberOfTableEntries=%ld\n", ST->NumberOfTableEntries); + printf("NumberOfTableEntries=%lu\n", + (unsigned long)ST->NumberOfTableEntries); for (i = 0; i < ST->NumberOfTableEntries; i++) { EFI_GUID *guid; @@ -379,9 +382,8 @@ command_nvram(int argc, char *argv[]) CHAR16 *data; EFI_STATUS status; EFI_GUID varguid = { 0,0,0,{0,0,0,0,0,0,0,0} }; - UINTN varsz, datasz; + UINTN varsz, datasz, i; SIMPLE_TEXT_OUTPUT_INTERFACE *conout; - int i; conout = ST->ConOut; Modified: stable/10/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/10/sys/boot/fdt/fdt_loader_cmd.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/fdt/fdt_loader_cmd.c Thu Jan 28 12:11:42 2016 (r294981) @@ -464,7 +464,7 @@ fdt_fixup_memory(struct fdt_mem_region * { struct fdt_mem_region *curmr; uint32_t addr_cells, size_cells; - uint32_t *addr_cellsp, *reg, *size_cellsp; + uint32_t *addr_cellsp, *size_cellsp; int err, i, len, memory, root; size_t realmrno; uint8_t *buf, *sb; Modified: stable/10/sys/boot/i386/libi386/smbios.c ============================================================================== --- stable/10/sys/boot/i386/libi386/smbios.c Thu Jan 28 12:03:30 2016 (r294980) +++ stable/10/sys/boot/i386/libi386/smbios.c Thu Jan 28 12:11:42 2016 (r294981) @@ -332,7 +332,7 @@ static caddr_t smbios_find_struct(int type) { caddr_t dmi; - int i; + size_t i; if (smbios.addr == NULL) return (NULL); @@ -402,7 +402,7 @@ smbios_detect(const caddr_t addr) { char buf[16]; caddr_t dmi; - int i; + size_t i; smbios_probe(addr); if (smbios.addr == NULL) From owner-svn-src-stable-10@freebsd.org Thu Jan 28 12:15:52 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33B40A70FFF; Thu, 28 Jan 2016 12:15:52 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0512A173D; Thu, 28 Jan 2016 12:15:51 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SCFper060342; Thu, 28 Jan 2016 12:15:51 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SCFpMt060341; Thu, 28 Jan 2016 12:15:51 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281215.u0SCFpMt060341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 12:15: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: r294982 - stable/10/sys/boot/common 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.20 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: Thu, 28 Jan 2016 12:15:52 -0000 Author: smh Date: Thu Jan 28 12:15:50 2016 New Revision: 294982 URL: https://svnweb.freebsd.org/changeset/base/294982 Log: MFC r294059: Ensure boot fsread correctly probes all partitions Sponsored by: Multiplay Modified: stable/10/sys/boot/common/ufsread.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/ufsread.c ============================================================================== --- stable/10/sys/boot/common/ufsread.c Thu Jan 28 12:11:42 2016 (r294981) +++ stable/10/sys/boot/common/ufsread.c Thu Jan 28 12:15:50 2016 (r294982) @@ -187,8 +187,15 @@ fsread(ufs_ino_t inode, void *buf, size_ blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; - if (!dsk_meta) { + + /* + * Force probe if inode is zero to ensure we have a valid fs, otherwise + * when probing multiple paritions, reads from subsequent parititions + * will incorrectly succeed. + */ + if (!dsk_meta || inode == 0) { inomap = 0; + dsk_meta = 0; for (n = 0; sblock_try[n] != -1; n++) { if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, SBLOCKSIZE / DEV_BSIZE)) From owner-svn-src-stable-10@freebsd.org Thu Jan 28 12:22:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84A60A71236; Thu, 28 Jan 2016 12:22:16 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5377B1C8F; Thu, 28 Jan 2016 12:22:16 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SCMFGg063241; Thu, 28 Jan 2016 12:22:15 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SCMFck063240; Thu, 28 Jan 2016 12:22:15 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281222.u0SCMFck063240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 12:22:15 +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: r294984 - stable/10/sys/boot/common 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.20 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: Thu, 28 Jan 2016 12:22:16 -0000 Author: smh Date: Thu Jan 28 12:22:15 2016 New Revision: 294984 URL: https://svnweb.freebsd.org/changeset/base/294984 Log: MFC r286234 (by trasz): Fix a problem which made loader(8) load non-kld files twice. Sponsored by: Multiplay Modified: stable/10/sys/boot/common/module.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/module.c ============================================================================== --- stable/10/sys/boot/common/module.c Thu Jan 28 12:21:23 2016 (r294983) +++ stable/10/sys/boot/common/module.c Thu Jan 28 12:22:15 2016 (r294984) @@ -101,6 +101,7 @@ COMMAND_SET(load, "load", "load a kernel static int command_load(int argc, char *argv[]) { + struct preloaded_file *fp; char *typestr; int dofile, dokld, ch, error; @@ -138,6 +139,13 @@ command_load(int argc, char *argv[]) command_errmsg = "invalid load type"; return(CMD_ERROR); } + + fp = file_findfile(argv[1], typestr); + if (fp) { + sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); + return (CMD_ERROR); + } + return (file_loadraw(argv[1], typestr, 1) ? CMD_OK : CMD_ERROR); } /* From owner-svn-src-stable-10@freebsd.org Thu Jan 28 12:23:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B758A7134C; Thu, 28 Jan 2016 12:23:27 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0558A1E6B; Thu, 28 Jan 2016 12:23:26 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SCNQMl063338; Thu, 28 Jan 2016 12:23:26 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SCNPXP063335; Thu, 28 Jan 2016 12:23:25 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281223.u0SCNPXP063335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 12:23: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: r294985 - stable/10/sys/boot/common 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.20 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: Thu, 28 Jan 2016 12:23:27 -0000 Author: smh Date: Thu Jan 28 12:23:25 2016 New Revision: 294985 URL: https://svnweb.freebsd.org/changeset/base/294985 Log: MFC r293835: Improve non-interactive forth cmd error reporting Sponsored by: Multiplay Modified: stable/10/sys/boot/common/bootstrap.h stable/10/sys/boot/common/interp_forth.c stable/10/sys/boot/common/module.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/bootstrap.h ============================================================================== --- stable/10/sys/boot/common/bootstrap.h Thu Jan 28 12:22:15 2016 (r294984) +++ stable/10/sys/boot/common/bootstrap.h Thu Jan 28 12:23:25 2016 (r294985) @@ -56,7 +56,10 @@ typedef int (bootblk_cmd_t)(int argc, ch extern char *command_errmsg; extern char command_errbuf[]; /* XXX blah, length */ #define CMD_OK 0 -#define CMD_ERROR 1 +#define CMD_WARN 1 +#define CMD_ERROR 2 +#define CMD_CRIT 3 +#define CMD_FATAL 4 /* interp.c */ void interact(void); Modified: stable/10/sys/boot/common/interp_forth.c ============================================================================== --- stable/10/sys/boot/common/interp_forth.c Thu Jan 28 12:22:15 2016 (r294984) +++ stable/10/sys/boot/common/interp_forth.c Thu Jan 28 12:23:25 2016 (r294985) @@ -138,13 +138,23 @@ bf_command(FICL_VM *vm) } else { result=BF_PARSE; } + + switch (result) { + case CMD_CRIT: + printf("%s\n", command_errmsg); + break; + case CMD_FATAL: + panic("%s\n", command_errmsg); + } + free(line); /* * If there was error during nested ficlExec(), we may no longer have * valid environment to return. Throw all exceptions from here. */ - if (result != 0) + if (result != CMD_OK) vmThrow(vm, result); + /* This is going to be thrown!!! */ stackPushINT(vm->pStack,result); } Modified: stable/10/sys/boot/common/module.c ============================================================================== --- stable/10/sys/boot/common/module.c Thu Jan 28 12:22:15 2016 (r294984) +++ stable/10/sys/boot/common/module.c Thu Jan 28 12:23:25 2016 (r294985) @@ -111,7 +111,7 @@ command_load(int argc, char *argv[]) typestr = NULL; if (argc == 1) { command_errmsg = "no filename specified"; - return(CMD_ERROR); + return (CMD_CRIT); } while ((ch = getopt(argc, argv, "kt:")) != -1) { switch(ch) { @@ -125,7 +125,7 @@ command_load(int argc, char *argv[]) case '?': default: /* getopt has already reported an error */ - return(CMD_OK); + return (CMD_OK); } } argv += (optind - 1); @@ -137,33 +137,46 @@ command_load(int argc, char *argv[]) if (dofile) { if ((argc != 2) || (typestr == NULL) || (*typestr == 0)) { command_errmsg = "invalid load type"; - return(CMD_ERROR); + return (CMD_CRIT); } fp = file_findfile(argv[1], typestr); if (fp) { sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); - return (CMD_ERROR); + return (CMD_WARN); } - return (file_loadraw(argv[1], typestr, 1) ? CMD_OK : CMD_ERROR); + if (file_loadraw(argv[1], typestr, 1) != NULL) + return (CMD_OK); + + /* Failing to load mfs_root is never going to end well! */ + if (strcmp("mfs_root", typestr) == 0) + return (CMD_FATAL); + + return (CMD_ERROR); } /* * Do we have explicit KLD load ? */ if (dokld || file_havepath(argv[1])) { error = mod_loadkld(argv[1], argc - 2, argv + 2); - if (error == EEXIST) + if (error == EEXIST) { sprintf(command_errbuf, "warning: KLD '%s' already loaded", argv[1]); - return (error == 0 ? CMD_OK : CMD_ERROR); + return (CMD_WARN); + } + + return (error == 0 ? CMD_OK : CMD_CRIT); } /* * Looks like a request for a module. */ error = mod_load(argv[1], NULL, argc - 2, argv + 2); - if (error == EEXIST) + if (error == EEXIST) { sprintf(command_errbuf, "warning: module '%s' already loaded", argv[1]); - return (error == 0 ? CMD_OK : CMD_ERROR); + return (CMD_WARN); + } + + return (error == 0 ? CMD_OK : CMD_CRIT); } COMMAND_SET(load_geli, "load_geli", "load a geli key", command_load_geli); From owner-svn-src-stable-10@freebsd.org Thu Jan 28 12:25:29 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35B58A71405; Thu, 28 Jan 2016 12:25:29 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 ED39D1FF4; Thu, 28 Jan 2016 12:25:28 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SCPSta063463; Thu, 28 Jan 2016 12:25:28 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SCPSAd063462; Thu, 28 Jan 2016 12:25:28 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281225.u0SCPSAd063462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 12:25:28 +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: r294986 - stable/10/sys/boot/common 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.20 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: Thu, 28 Jan 2016 12:25:29 -0000 Author: smh Date: Thu Jan 28 12:25:27 2016 New Revision: 294986 URL: https://svnweb.freebsd.org/changeset/base/294986 Log: MFC r294506: Prevent loader.conf load failure due to unknown console entries Sponsored by: Multiplay Modified: stable/10/sys/boot/common/console.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/console.c ============================================================================== --- stable/10/sys/boot/common/console.c Thu Jan 28 12:23:25 2016 (r294985) +++ stable/10/sys/boot/common/console.c Thu Jan 28 12:25:27 2016 (r294986) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); static int cons_set(struct env_var *ev, int flags, const void *value); static int cons_find(const char *name); static int cons_check(const char *string); -static void cons_change(const char *string); +static int cons_change(const char *string); static int twiddle_set(struct env_var *ev, int flags, const void *value); /* @@ -47,12 +47,12 @@ static int twiddle_set(struct env_var *e * as active. Also create the console variable. */ void -cons_probe(void) +cons_probe(void) { int cons; int active; char *prefconsole; - + /* We want a callback to install the new value when this var changes. */ env_setenv("twiddle_divisor", EV_VOLATILE, "1", twiddle_set, env_nounset); @@ -162,54 +162,69 @@ cons_find(const char *name) static int cons_set(struct env_var *ev, int flags, const void *value) { - int cons; + int ret; - if ((value == NULL) || (cons_check(value) == -1)) { - if (value != NULL) - printf("no such console!\n"); - printf("Available consoles:\n"); - for (cons = 0; consoles[cons] != NULL; cons++) - printf(" %s\n", consoles[cons]->c_name); - return(CMD_ERROR); + if ((value == NULL) || (cons_check(value) == 0)) { + /* + * Return CMD_OK instead of CMD_ERROR to prevent forth syntax error, + * which would prevent it processing any further loader.conf entries. + */ + return (CMD_OK); } - cons_change(value); + ret = cons_change(value); + if (ret != CMD_OK) + return (ret); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); - return(CMD_OK); + return (CMD_OK); } /* - * Check that all of the consoles listed in *string are valid consoles + * Check that at least one the consoles listed in *string is valid */ static int cons_check(const char *string) { - int cons; + int cons, found, failed; char *curpos, *dup, *next; dup = next = strdup(string); - cons = -1; + found = failed = 0; while (next != NULL) { curpos = strsep(&next, " ,"); if (*curpos != '\0') { cons = cons_find(curpos); - if (cons == -1) - break; + if (cons == -1) { + printf("console %s is invalid!\n", curpos); + failed++; + } else { + found++; + } } } free(dup); - return (cons); + + if (found == 0) + printf("no valid consoles!\n"); + + if (found == 0 || failed != 0) { + printf("Available consoles:\n"); + for (cons = 0; consoles[cons] != NULL; cons++) + printf(" %s\n", consoles[cons]->c_name); + } + + return (found); } /* - * Activate all of the consoles listed in *string and disable all the others. + * Activate all the valid consoles listed in *string and disable all others. */ -static void +static int cons_change(const char *string) { - int cons; + int cons, active; char *curpos, *dup, *next; /* Disable all consoles */ @@ -219,6 +234,7 @@ cons_change(const char *string) /* Enable selected consoles */ dup = next = strdup(string); + active = 0; while (next != NULL) { curpos = strsep(&next, " ,"); if (*curpos == '\0') @@ -227,14 +243,37 @@ cons_change(const char *string) if (cons >= 0) { consoles[cons]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; consoles[cons]->c_init(0); - if ((consoles[cons]->c_flags & (C_PRESENTIN | C_PRESENTOUT)) != - (C_PRESENTIN | C_PRESENTOUT)) - printf("console %s failed to initialize\n", - consoles[cons]->c_name); + if ((consoles[cons]->c_flags & (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) { + active++; + continue; + } + + if (active != 0) { + /* If no consoles have initialised we wouldn't see this. */ + printf("console %s failed to initialize\n", consoles[cons]->c_name); + } } } free(dup); + + if (active == 0) { + /* All requested consoles failed to initialise, try to recover. */ + for (cons = 0; consoles[cons] != NULL; cons++) { + consoles[cons]->c_flags |= C_ACTIVEIN | C_ACTIVEOUT; + consoles[cons]->c_init(0); + if ((consoles[cons]->c_flags & + (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) + active++; + } + + if (active == 0) + return (CMD_ERROR); /* Recovery failed. */ + } + + return (CMD_OK); } /* From owner-svn-src-stable-10@freebsd.org Thu Jan 28 16:52:04 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94B71A719CA; Thu, 28 Jan 2016 16:52:04 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4E54D138C; Thu, 28 Jan 2016 16:52:04 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SGq3aV039501; Thu, 28 Jan 2016 16:52:03 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SGq2L9039493; Thu, 28 Jan 2016 16:52:02 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281652.u0SGq2L9039493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 16:52:02 +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: r294997 - in stable/10/sys/boot: common efi/boot1 efi/include efi/loader 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.20 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: Thu, 28 Jan 2016 16:52:04 -0000 Author: smh Date: Thu Jan 28 16:52:02 2016 New Revision: 294997 URL: https://svnweb.freebsd.org/changeset/base/294997 Log: MFC r281060, r294060, r294291, r294493, r294284: MFC r281060: Remove an unnecessary space in a printf call MFC r294060: Modularise EFI boot loader MFC r294291 (by andrew): Reset the filesystem cache MFC r294493: Fix EFI UFS caching MFC r294284 (by emaste): boot1: correct typo in error message Sponsored by: Multiplay Added: stable/10/sys/boot/efi/boot1/boot_module.h - copied unchanged from r294060, head/sys/boot/efi/boot1/boot_module.h stable/10/sys/boot/efi/boot1/ufs_module.c - copied, changed from r294060, head/sys/boot/efi/boot1/ufs_module.c Modified: stable/10/sys/boot/common/ufsread.c stable/10/sys/boot/efi/boot1/Makefile stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/efi/include/efilib.h stable/10/sys/boot/efi/loader/devicename.c stable/10/sys/boot/efi/loader/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/common/ufsread.c ============================================================================== --- stable/10/sys/boot/common/ufsread.c Thu Jan 28 16:51:56 2016 (r294996) +++ stable/10/sys/boot/common/ufsread.c Thu Jan 28 16:52:02 2016 (r294997) @@ -165,7 +165,7 @@ static int sblock_try[] = SBLOCKSEARCH; #endif static ssize_t -fsread(ufs_ino_t inode, void *buf, size_t nbyte) +fsread_size(ufs_ino_t inode, void *buf, size_t nbyte, size_t *fsizep) { #ifndef UFS2_ONLY static struct ufs1_dinode dp1; @@ -185,6 +185,10 @@ fsread(ufs_ino_t inode, void *buf, size_ static ufs2_daddr_t blkmap, indmap; u_int u; + /* Basic parameter validation. */ + if ((buf == NULL && nbyte != 0) || dmadat == NULL) + return (-1); + blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; @@ -231,18 +235,18 @@ fsread(ufs_ino_t inode, void *buf, size_ return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) - memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, - sizeof(struct ufs1_dinode)); + memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, + sizeof(dp1)); #elif defined(UFS2_ONLY) - memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, - sizeof(struct ufs2_dinode)); + memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, + sizeof(dp2)); #else if (fs.fs_magic == FS_UFS1_MAGIC) memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, - sizeof(struct ufs1_dinode)); + sizeof(dp1)); else memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, - sizeof(struct ufs2_dinode)); + sizeof(dp2)); #endif inomap = inode; fs_off = 0; @@ -306,5 +310,17 @@ fsread(ufs_ino_t inode, void *buf, size_ fs_off += n; nb -= n; } + + if (fsizep != NULL) + *fsizep = size; + return nbyte; } + +static ssize_t +fsread(ufs_ino_t inode, void *buf, size_t nbyte) +{ + + return fsread_size(inode, buf, nbyte, NULL); +} + Modified: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/10/sys/boot/efi/boot1/Makefile Thu Jan 28 16:51:56 2016 (r294996) +++ stable/10/sys/boot/efi/boot1/Makefile Thu Jan 28 16:52:02 2016 (r294997) @@ -11,7 +11,7 @@ INTERNALPROG= WARNS?= 6 # architecture-specific loader code -SRCS= boot1.c reloc.c start.S +SRCS= boot1.c reloc.c start.S ufs_module.c CFLAGS+= -fPIC CFLAGS+= -I. @@ -19,6 +19,7 @@ CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. +CFLAGS+= -DEFI_UFS_BOOT # Always add MI sources and REGULAR efi loader bits .PATH: ${.CURDIR}/../loader/arch/${MACHINE} Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 28 16:51:56 2016 (r294996) +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 28 16:52:02 2016 (r294997) @@ -5,6 +5,8 @@ * All rights reserved. * Copyright (c) 2014 Nathan Whitehorn * All rights reserved. + * Copyright (c) 2015 Eric McCorkle + * All rights reserved. * * Redistribution and use in source and binary forms are freely * permitted provided that the above copyright notice and this @@ -21,7 +23,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include @@ -29,19 +30,29 @@ __FBSDID("$FreeBSD$"); #include #include +#include "boot_module.h" + #define _PATH_LOADER "/boot/loader.efi" -#define _PATH_KERNEL "/boot/kernel/kernel" -#define BSIZEMAX 16384 +static const boot_module_t *boot_modules[] = +{ +#ifdef EFI_UFS_BOOT + &ufs_module +#endif +}; + +#define NUM_BOOT_MODULES (sizeof(boot_modules) / sizeof(boot_module_t*)) +/* The initial number of handles used to query EFI for partitions. */ +#define NUM_HANDLES_INIT 24 -void panic(const char *fmt, ...) __dead2; void putchar(int c); EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); -static int domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet); -static void load(const char *fname); +static void try_load(const boot_module_t* mod); +static EFI_STATUS probe_handle(EFI_HANDLE h); -static EFI_SYSTEM_TABLE *systab; +EFI_SYSTEM_TABLE *systab; +EFI_BOOT_SERVICES *bs; static EFI_HANDLE *image; static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; @@ -49,27 +60,92 @@ static EFI_GUID DevicePathGUID = DEVICE_ static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; -static EFI_BLOCK_IO *bootdev; -static EFI_DEVICE_PATH *bootdevpath; -static EFI_HANDLE *bootdevhandle; +/* + * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures + * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns from + * EFI methods. + */ +void * +Malloc(size_t len, const char *file __unused, int line __unused) +{ + void *out; + + if (bs->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) + return (out); + + return (NULL); +} + +void +Free(void *buf, const char *file __unused, int line __unused) +{ + (void)bs->FreePool(buf); +} -EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab) +/* + * This function only returns if it fails to load the kernel. If it + * succeeds, it simply boots the kernel. + */ +void +try_load(const boot_module_t *mod) { - EFI_HANDLE handles[128]; - EFI_BLOCK_IO *blkio; - UINTN i, nparts = sizeof(handles), cols, rows, max_dim, best_mode; + size_t bufsize; + void *buf; + dev_info_t *dev; + EFI_HANDLE loaderhandle; + EFI_LOADED_IMAGE *loaded_image; + EFI_STATUS status; + + status = mod->load(_PATH_LOADER, &dev, &buf, &bufsize); + if (status == EFI_NOT_FOUND) + return; + + if (status != EFI_SUCCESS) { + printf("%s failed to load %s (%lu)\n", mod->name, _PATH_LOADER, + EFI_ERROR_CODE(status)); + return; + } + + if ((status = bs->LoadImage(TRUE, image, dev->devpath, buf, bufsize, + &loaderhandle)) != EFI_SUCCESS) { + printf("Failed to load image provided by %s, size: %zu, (%lu)\n", + mod->name, bufsize, EFI_ERROR_CODE(status)); + return; + } + + if ((status = bs->HandleProtocol(loaderhandle, &LoadedImageGUID, + (VOID**)&loaded_image)) != EFI_SUCCESS) { + printf("Failed to query LoadedImage provided by %s (%lu)\n", + mod->name, EFI_ERROR_CODE(status)); + return; + } + + loaded_image->DeviceHandle = dev->devhandle; + + if ((status = bs->StartImage(loaderhandle, NULL, NULL)) != + EFI_SUCCESS) { + printf("Failed to start image provided by %s (%lu)\n", + mod->name, EFI_ERROR_CODE(status)); + return; + } +} + +EFI_STATUS +efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) +{ + EFI_HANDLE *handles; EFI_STATUS status; - EFI_DEVICE_PATH *devpath; - EFI_BOOT_SERVICES *BS; EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; - const char *path = _PATH_LOADER; + UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; + /* Basic initialization*/ systab = Xsystab; image = Ximage; + bs = Xsystab->BootServices; - BS = systab->BootServices; - status = BS->LocateProtocol(&ConsoleControlGUID, NULL, + /* Set up the console, so printf works. */ + status = bs->LocateProtocol(&ConsoleControlGUID, NULL, (VOID **)&ConsoleControl); if (status == EFI_SUCCESS) (void)ConsoleControl->SetMode(ConsoleControl, @@ -94,199 +170,162 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, E conout->EnableCursor(conout, TRUE); conout->ClearScreen(conout); - printf(" \n>> FreeBSD EFI boot block\n"); - printf(" Loader path: %s\n", path); - - status = systab->BootServices->LocateHandle(ByProtocol, - &BlockIoProtocolGUID, NULL, &nparts, handles); - nparts /= sizeof(handles[0]); - - for (i = 0; i < nparts; i++) { - status = systab->BootServices->HandleProtocol(handles[i], - &DevicePathGUID, (void **)&devpath); - if (EFI_ERROR(status)) + printf("\n>> FreeBSD EFI boot block\n"); + printf(" Loader path: %s\n\n", _PATH_LOADER); + printf(" Initializing modules:"); + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] == NULL) continue; - while (!IsDevicePathEnd(NextDevicePathNode(devpath))) - devpath = NextDevicePathNode(devpath); + printf(" %s", boot_modules[i]->name); + if (boot_modules[i]->init != NULL) + boot_modules[i]->init(); + } + putchar('\n'); - status = systab->BootServices->HandleProtocol(handles[i], - &BlockIoProtocolGUID, (void **)&blkio); - if (EFI_ERROR(status)) - continue; + /* Get all the device handles */ + hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); + if ((status = bs->AllocatePool(EfiLoaderData, hsize, (void **)&handles)) + != EFI_SUCCESS) + panic("Failed to allocate %d handles (%lu)", NUM_HANDLES_INIT, + EFI_ERROR_CODE(status)); - if (!blkio->Media->LogicalPartition) - continue; + status = bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, + &hsize, handles); + switch (status) { + case EFI_SUCCESS: + break; + case EFI_BUFFER_TOO_SMALL: + (void)bs->FreePool(handles); + if ((status = bs->AllocatePool(EfiLoaderData, hsize, + (void **)&handles) != EFI_SUCCESS)) { + panic("Failed to allocate %zu handles (%lu)", hsize / + sizeof(*handles), EFI_ERROR_CODE(status)); + } + status = bs->LocateHandle(ByProtocol, &BlockIoProtocolGUID, + NULL, &hsize, handles); + if (status != EFI_SUCCESS) + panic("Failed to get device handles (%lu)\n", + EFI_ERROR_CODE(status)); + break; + default: + panic("Failed to get device handles (%lu)", + EFI_ERROR_CODE(status)); + } - if (domount(devpath, blkio, 1) >= 0) + /* Scan all partitions, probing with all modules. */ + nhandles = hsize / sizeof(*handles); + printf(" Probing %zu block devices...", nhandles); + for (i = 0; i < nhandles; i++) { + status = probe_handle(handles[i]); + switch (status) { + case EFI_UNSUPPORTED: + printf("."); + break; + case EFI_SUCCESS: + printf("+"); + break; + default: + printf("x"); break; + } } + printf(" done\n"); - if (i == nparts) - panic("No bootable partition found"); - - bootdevhandle = handles[i]; - load(path); + /* Status summary. */ + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] != NULL) { + printf(" "); + boot_modules[i]->status(); + } + } - panic("Load failed"); + /* Select a partition to boot by trying each module in order. */ + for (i = 0; i < NUM_BOOT_MODULES; i++) + if (boot_modules[i] != NULL) + try_load(boot_modules[i]); - return EFI_SUCCESS; + /* If we get here, we're out of luck... */ + panic("No bootable partitions found!"); } -static int -dskread(void *buf, u_int64_t lba, int nblk) +static EFI_STATUS +probe_handle(EFI_HANDLE h) { + dev_info_t *devinfo; + EFI_BLOCK_IO *blkio; + EFI_DEVICE_PATH *devpath; EFI_STATUS status; - int size; + UINTN i; - lba = lba / (bootdev->Media->BlockSize / DEV_BSIZE); - size = nblk * DEV_BSIZE; - status = bootdev->ReadBlocks(bootdev, bootdev->Media->MediaId, lba, - size, buf); + /* Figure out if we're dealing with an actual partition. */ + status = bs->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + if (status == EFI_UNSUPPORTED) + return (status); - if (EFI_ERROR(status)) - return (-1); + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } - return (0); -} + while (!IsDevicePathEnd(NextDevicePathNode(devpath))) + devpath = NextDevicePathNode(devpath); -#include "ufsread.c" + status = bs->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + if (status == EFI_UNSUPPORTED) + return (status); -static ssize_t -fsstat(ufs_ino_t inode) -{ -#ifndef UFS2_ONLY - static struct ufs1_dinode dp1; -#endif -#ifndef UFS1_ONLY - static struct ufs2_dinode dp2; -#endif - static struct fs fs; - static ufs_ino_t inomap; - char *blkbuf; - void *indbuf; - size_t n, size; - static ufs2_daddr_t blkmap, indmap; - - blkbuf = dmadat->blkbuf; - indbuf = dmadat->indbuf; - if (!dsk_meta) { - inomap = 0; - for (n = 0; sblock_try[n] != -1; n++) { - if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, - SBLOCKSIZE / DEV_BSIZE)) - return -1; - memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); - if (( -#if defined(UFS1_ONLY) - fs.fs_magic == FS_UFS1_MAGIC -#elif defined(UFS2_ONLY) - (fs.fs_magic == FS_UFS2_MAGIC && - fs.fs_sblockloc == sblock_try[n]) -#else - fs.fs_magic == FS_UFS1_MAGIC || - (fs.fs_magic == FS_UFS2_MAGIC && - fs.fs_sblockloc == sblock_try[n]) -#endif - ) && - fs.fs_bsize <= MAXBSIZE && - fs.fs_bsize >= (int32_t)sizeof(struct fs)) - break; - } - if (sblock_try[n] == -1) { - return -1; - } - dsk_meta++; - } else - memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); - if (!inode) - return 0; - if (inomap != inode) { - n = IPERVBLK(&fs); - if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) - return -1; - n = INO_TO_VBO(n, inode); -#if defined(UFS1_ONLY) - memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, - sizeof(struct ufs1_dinode)); -#elif defined(UFS2_ONLY) - memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, - sizeof(struct ufs2_dinode)); -#else - if (fs.fs_magic == FS_UFS1_MAGIC) - memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, - sizeof(struct ufs1_dinode)); - else - memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, - sizeof(struct ufs2_dinode)); -#endif - inomap = inode; - fs_off = 0; - blkmap = indmap = 0; - } - size = DIP(di_size); - n = size - fs_off; - return (n); -} + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } -static struct dmadat __dmadat; + if (!blkio->Media->LogicalPartition) + return (EFI_UNSUPPORTED); -static int -domount(EFI_DEVICE_PATH *device, EFI_BLOCK_IO *blkio, int quiet) -{ + /* Run through each module, see if it can load this partition */ + for (i = 0; i < NUM_BOOT_MODULES; i++) { + if (boot_modules[i] == NULL) + continue; + + if ((status = bs->AllocatePool(EfiLoaderData, + sizeof(*devinfo), (void **)&devinfo)) != + EFI_SUCCESS) { + DPRINTF("\nFailed to allocate devinfo (%lu)\n", + EFI_ERROR_CODE(status)); + continue; + } + devinfo->dev = blkio; + devinfo->devpath = devpath; + devinfo->devhandle = h; + devinfo->devdata = NULL; + devinfo->next = NULL; + + status = boot_modules[i]->probe(devinfo); + if (status == EFI_SUCCESS) + return (EFI_SUCCESS); + (void)bs->FreePool(devinfo); + } - dmadat = &__dmadat; - bootdev = blkio; - bootdevpath = device; - if (fsread(0, NULL, 0)) { - if (!quiet) - printf("domount: can't read superblock\n"); - return (-1); - } - if (!quiet) - printf("Succesfully mounted UFS filesystem\n"); - return (0); + return (EFI_UNSUPPORTED); } -static void -load(const char *fname) +void +add_device(dev_info_t **devinfop, dev_info_t *devinfo) { - ufs_ino_t ino; - EFI_STATUS status; - EFI_HANDLE loaderhandle; - EFI_LOADED_IMAGE *loaded_image; - void *buffer; - size_t bufsize; + dev_info_t *dev; - if ((ino = lookup(fname)) == 0) { - printf("File %s not found\n", fname); + if (*devinfop == NULL) { + *devinfop = devinfo; return; } - bufsize = fsstat(ino); - status = systab->BootServices->AllocatePool(EfiLoaderData, - bufsize, &buffer); - fsread(ino, buffer, bufsize); - - /* XXX: For secure boot, we need our own loader here */ - status = systab->BootServices->LoadImage(TRUE, image, bootdevpath, - buffer, bufsize, &loaderhandle); - if (EFI_ERROR(status)) - printf("LoadImage failed with error %lu\n", - EFI_ERROR_CODE(status)); - - status = systab->BootServices->HandleProtocol(loaderhandle, - &LoadedImageGUID, (VOID**)&loaded_image); - if (EFI_ERROR(status)) - printf("HandleProtocol failed with error %lu\n", - EFI_ERROR_CODE(status)); + for (dev = *devinfop; dev->next != NULL; dev = dev->next) + ; - loaded_image->DeviceHandle = bootdevhandle; - - status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); - if (EFI_ERROR(status)) - printf("StartImage failed with error %lu\n", - EFI_ERROR_CODE(status)); + dev->next = devinfo; } void Copied: stable/10/sys/boot/efi/boot1/boot_module.h (from r294060, head/sys/boot/efi/boot1/boot_module.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/efi/boot1/boot_module.h Thu Jan 28 16:52:02 2016 (r294997, copy of r294060, head/sys/boot/efi/boot1/boot_module.h) @@ -0,0 +1,110 @@ +/*- + * Copyright (c) 2015 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _BOOT_MODULE_H_ +#define _BOOT_MODULE_H_ + +#include + +#include +#include +#include + +#ifdef EFI_DEBUG +#define DPRINTF(fmt, args...) \ + do { \ + printf(fmt, ##args) \ + } while (0) +#else +#define DPRINTF(fmt, args...) {} +#endif + +/* EFI device info */ +typedef struct dev_info +{ + EFI_BLOCK_IO *dev; + EFI_DEVICE_PATH *devpath; + EFI_HANDLE *devhandle; + void *devdata; + struct dev_info *next; +} dev_info_t; + +/* + * A boot loader module. + * + * This is a standard interface for filesystem modules in the EFI system. + */ +typedef struct boot_module_t +{ + const char *name; + + /* init is the optional initialiser for the module. */ + void (*init)(); + + /* + * probe checks to see if the module can handle dev. + * + * Return codes: + * EFI_SUCCESS = The module can handle the device. + * EFI_NOT_FOUND = The module can not handle the device. + * Other = The module encountered an error. + */ + EFI_STATUS (*probe)(dev_info_t* dev); + + /* + * load should select the best out of a set of devices that probe + * indicated were loadable and load it. + * + * Return codes: + * EFI_SUCCESS = The module can handle the device. + * EFI_NOT_FOUND = The module can not handle the device. + * Other = The module encountered an error. + */ + EFI_STATUS (*load)(const char *loader_path, dev_info_t **devinfo, + void **buf, size_t *bufsize); + + /* status outputs information about the probed devices. */ + void (*status)(); + +} boot_module_t; + +/* Standard boot modules. */ +#ifdef EFI_UFS_BOOT +extern const boot_module_t ufs_module; +#endif + +/* Functions available to modules. */ +extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); +extern void panic(const char *fmt, ...) __dead2; +extern int printf(const char *fmt, ...); +extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); + +extern EFI_SYSTEM_TABLE *systab; +extern EFI_BOOT_SERVICES *bs; + +#endif Copied and modified: stable/10/sys/boot/efi/boot1/ufs_module.c (from r294060, head/sys/boot/efi/boot1/ufs_module.c) ============================================================================== --- head/sys/boot/efi/boot1/ufs_module.c Fri Jan 15 01:22:36 2016 (r294060, copy source) +++ stable/10/sys/boot/efi/boot1/ufs_module.c Thu Jan 28 16:52:02 2016 (r294997) @@ -68,93 +68,23 @@ dskread(void *buf, u_int64_t lba, int nb #include "ufsread.c" -static ssize_t -fsstat(ufs_ino_t inode) +static struct dmadat __dmadat; + +static int +init_dev(dev_info_t* dev) { -#ifndef UFS2_ONLY - static struct ufs1_dinode dp1; -#endif -#ifndef UFS1_ONLY - static struct ufs2_dinode dp2; -#endif - static struct fs fs; - static ufs_ino_t inomap; - char *blkbuf; - void *indbuf; - size_t n, size; - static ufs2_daddr_t blkmap, indmap; - - blkbuf = dmadat->blkbuf; - indbuf = dmadat->indbuf; - if (!dsk_meta) { - inomap = 0; - for (n = 0; sblock_try[n] != -1; n++) { - if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, - SBLOCKSIZE / DEV_BSIZE)) - return (-1); - memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); - if (( -#if defined(UFS1_ONLY) - fs.fs_magic == FS_UFS1_MAGIC -#elif defined(UFS2_ONLY) - (fs.fs_magic == FS_UFS2_MAGIC && - fs.fs_sblockloc == sblock_try[n]) -#else - fs.fs_magic == FS_UFS1_MAGIC || - (fs.fs_magic == FS_UFS2_MAGIC && - fs.fs_sblockloc == sblock_try[n]) -#endif - ) && - fs.fs_bsize <= MAXBSIZE && - fs.fs_bsize >= (int32_t)sizeof(struct fs)) - break; - } - if (sblock_try[n] == -1) { - return (-1); - } - dsk_meta++; - } else - memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); - if (!inode) - return (0); - if (inomap != inode) { - n = IPERVBLK(&fs); - if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) - return (-1); - n = INO_TO_VBO(n, inode); -#if defined(UFS1_ONLY) - memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, - sizeof(struct ufs1_dinode)); -#elif defined(UFS2_ONLY) - memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, - sizeof(struct ufs2_dinode)); -#else - if (fs.fs_magic == FS_UFS1_MAGIC) - memcpy(&dp1, (struct ufs1_dinode *)(void *)blkbuf + n, - sizeof(struct ufs1_dinode)); - else - memcpy(&dp2, (struct ufs2_dinode *)(void *)blkbuf + n, - sizeof(struct ufs2_dinode)); -#endif - inomap = inode; - fs_off = 0; - blkmap = indmap = 0; - } - size = DIP(di_size); - n = size - fs_off; - return (n); -} + devinfo = dev; + dmadat = &__dmadat; -static struct dmadat __dmadat; + return fsread(0, NULL, 0); +} static EFI_STATUS probe(dev_info_t* dev) { - devinfo = dev; - dmadat = &__dmadat; - if (fsread(0, NULL, 0) < 0) + if (init_dev(dev) < 0) return (EFI_UNSUPPORTED); add_device(&devices, dev); @@ -171,13 +101,15 @@ try_load(dev_info_t *dev, const char *lo ssize_t read; void *buf; - devinfo = dev; + if (init_dev(dev) < 0) + return (EFI_UNSUPPORTED); + if ((ino = lookup(loader_path)) == 0) return (EFI_NOT_FOUND); - size = fsstat(ino); - if (size <= 0) { - printf("Failed to fsstat %s ino: %d\n", loader_path, ino); + if (fsread_size(ino, NULL, 0, &size) < 0 || size <= 0) { + printf("Failed to read size of '%s' ino: %d\n", loader_path, + ino); return (EFI_INVALID_PARAMETER); } @@ -190,7 +122,7 @@ try_load(dev_info_t *dev, const char *lo read = fsread(ino, buf, size); if ((size_t)read != size) { - printf("Failed to read %s (%zd != %zu)\n", loader_path, read, + printf("Failed to read '%s' (%zd != %zu)\n", loader_path, read, size); (void)bs->FreePool(buf); return (EFI_INVALID_PARAMETER); Modified: stable/10/sys/boot/efi/include/efilib.h ============================================================================== --- stable/10/sys/boot/efi/include/efilib.h Thu Jan 28 16:51:56 2016 (r294996) +++ stable/10/sys/boot/efi/include/efilib.h Thu Jan 28 16:52:02 2016 (r294997) @@ -39,7 +39,6 @@ extern struct devsw efinet_dev; extern struct netif_driver efinetif; void *efi_get_table(EFI_GUID *tbl); -void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table); int efi_register_handles(struct devsw *, EFI_HANDLE *, EFI_HANDLE *, int); EFI_HANDLE efi_find_handle(struct devsw *, int); Modified: stable/10/sys/boot/efi/loader/devicename.c ============================================================================== --- stable/10/sys/boot/efi/loader/devicename.c Thu Jan 28 16:51:56 2016 (r294996) +++ stable/10/sys/boot/efi/loader/devicename.c Thu Jan 28 16:52:02 2016 (r294997) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -86,7 +87,7 @@ efi_parsedev(struct devdesc **dev, const struct devsw *dv; char *cp; const char *np; - int i, err; + int i; /* minimum length check */ if (strlen(devspec) < 2) @@ -101,24 +102,26 @@ efi_parsedev(struct devdesc **dev, const if (devsw[i] == NULL) return (ENOENT); - idev = malloc(sizeof(struct devdesc)); - if (idev == NULL) - return (ENOMEM); - - idev->d_dev = dv; - idev->d_type = dv->dv_type; - idev->d_unit = -1; - - err = 0; np = devspec + strlen(dv->dv_name); - if (*np != '\0' && *np != ':') { - idev->d_unit = strtol(np, &cp, 0); - if (cp == np) { - idev->d_unit = -1; - free(idev); - return (EUNIT); + + { + idev = malloc(sizeof(struct devdesc)); + if (idev == NULL) + return (ENOMEM); + + idev->d_dev = dv; + idev->d_type = dv->dv_type; + idev->d_unit = -1; + if (*np != '\0' && *np != ':') { + idev->d_unit = strtol(np, &cp, 0); + if (cp == np) { + idev->d_unit = -1; + free(idev); + return (EUNIT); + } } } + if (*cp != '\0' && *cp != ':') { free(idev); return (EINVAL); @@ -137,7 +140,7 @@ char * efi_fmtdev(void *vdev) { struct devdesc *dev = (struct devdesc *)vdev; - static char buf[32]; /* XXX device length constant? */ + static char buf[SPECNAMELEN + 1]; switch(dev->d_type) { case DEVT_NONE: Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Thu Jan 28 16:51:56 2016 (r294996) +++ stable/10/sys/boot/efi/loader/main.c Thu Jan 28 16:52:02 2016 (r294997) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -45,7 +46,6 @@ extern char bootprog_rev[]; extern char bootprog_date[]; extern char bootprog_maker[]; -struct devdesc currdev; /* our current device */ struct arch_switch archsw; /* MI/MD interface boundary */ EFI_GUID acpi = ACPI_TABLE_GUID; @@ -60,15 +60,36 @@ EFI_GUID hoblist = HOB_LIST_TABLE_GUID; EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; +/* + * Need this because EFI uses UTF-16 unicode string constants, but we + * use UTF-8. We can't use printf due to the possiblity of \0 and we + * don't support support wide characters either. + */ +static void +print_str16(const CHAR16 *str) +{ + int i; + + for (i = 0; str[i]; i++) + printf("%c", (char)str[i]); +} + EFI_STATUS main(int argc, CHAR16 *argv[]) { char var[128]; EFI_LOADED_IMAGE *img; EFI_GUID *guid; - int i, j, vargood; + int i, j, vargood, unit; + struct devsw *dev; UINTN k; + archsw.arch_autoload = efi_autoload; + archsw.arch_getdev = efi_getdev; + archsw.arch_copyin = efi_copyin; + archsw.arch_copyout = efi_copyout; + archsw.arch_readin = efi_readin; + /* * XXX Chicken-and-egg problem; we want to have console output * early, but some console attributes may depend on reading from @@ -115,6 +136,13 @@ main(int argc, CHAR16 *argv[]) /* Get our loaded image protocol interface structure. */ BS->HandleProtocol(IH, &imgid, (VOID**)&img); + printf("Command line arguments:"); + for (i = 0; i < argc; i++) { + printf(" "); + print_str16(argv[i]); + } + printf("\n"); + printf("Image base: 0x%lx\n", (u_long)img->ImageBase); printf("EFI version: %d.%02d\n", ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0xffff); @@ -128,9 +156,6 @@ main(int argc, CHAR16 *argv[]) printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); - efi_handle_lookup(img->DeviceHandle, &currdev.d_dev, &currdev.d_unit); - currdev.d_type = currdev.d_dev->dv_type; - /* * Disable the watchdog timer. By default the boot manager sets * the timer to 5 minutes before invoking a boot option. If we @@ -142,18 +167,26 @@ main(int argc, CHAR16 *argv[]) */ BS->SetWatchdogTimer(0, 0, 0, NULL); - env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev), - efi_setcurrdev, env_nounset); - env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset, - env_nounset); + if (efi_handle_lookup(img->DeviceHandle, &dev, &unit) != 0) + return (EFI_NOT_FOUND); - setenv("LINES", "24", 1); /* optional */ + switch (dev->dv_type) { + default: { + struct devdesc currdev; + + currdev.d_dev = dev; + currdev.d_unit = unit; + currdev.d_opendata = NULL; + currdev.d_type = currdev.d_dev->dv_type; + env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev), + efi_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Jan 28 17:24:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F67DA7094A; Thu, 28 Jan 2016 17:24:43 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 0AA5D1B8B; Thu, 28 Jan 2016 17:24:42 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SHOgdC050291; Thu, 28 Jan 2016 17:24:42 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SHOfgn050280; Thu, 28 Jan 2016 17:24:41 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601281724.u0SHOfgn050280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 28 Jan 2016 17:24:41 +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: r294999 - in stable/10/sys/boot/efi: boot1 include libefi loader 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.20 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: Thu, 28 Jan 2016 17:24:43 -0000 Author: smh Date: Thu Jan 28 17:24:40 2016 New Revision: 294999 URL: https://svnweb.freebsd.org/changeset/base/294999 Log: MFC r294068, r294265 MFC r294068: Add EFI ZFS boot support MFC r294265: Fix broken DPRINTF and wire up EFI_DEBUG so -DEFI_DEBUG to make works. Relnotes: Yes Sponsored by: Multiplay Added: stable/10/sys/boot/efi/boot1/zfs_module.c - copied, changed from r294068, head/sys/boot/efi/boot1/zfs_module.c Modified: stable/10/sys/boot/efi/boot1/Makefile stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/efi/boot1/boot_module.h stable/10/sys/boot/efi/include/efilib.h stable/10/sys/boot/efi/libefi/handles.c stable/10/sys/boot/efi/loader/Makefile stable/10/sys/boot/efi/loader/conf.c stable/10/sys/boot/efi/loader/devicename.c stable/10/sys/boot/efi/loader/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/10/sys/boot/efi/boot1/Makefile Thu Jan 28 16:58:49 2016 (r294998) +++ stable/10/sys/boot/efi/boot1/Makefile Thu Jan 28 17:24:40 2016 (r294999) @@ -10,8 +10,22 @@ PROG= boot1.sym INTERNALPROG= WARNS?= 6 +.if ${MK_ZFS} != "no" +# Disable warnings that are currently incompatible with the zfs boot code +CWARNFLAGS.zfs_module.c += -Wno-array-bounds +CWARNFLAGS.zfs_module.c += -Wno-cast-align +CWARNFLAGS.zfs_module.c += -Wno-cast-qual +CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes +CWARNFLAGS.zfs_module.c += -Wno-sign-compare +CWARNFLAGS.zfs_module.c += -Wno-unused-parameter +CWARNFLAGS.zfs_module.c += -Wno-unused-function +.endif + # architecture-specific loader code SRCS= boot1.c reloc.c start.S ufs_module.c +.if ${MK_ZFS} != "no" +SRCS+= zfs_module.c +.endif CFLAGS+= -fPIC CFLAGS+= -I. @@ -20,6 +34,15 @@ CFLAGS+= -I${.CURDIR}/../include/${MACHI CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -DEFI_UFS_BOOT +.ifdef(EFI_DEBUG) +CFLAGS+= -DEFI_DEBUG +.endif + +.if ${MK_ZFS} != "no" +CFLAGS+= -I${.CURDIR}/../../zfs/ +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ +CFLAGS+= -DEFI_ZFS_BOOT +.endif # Always add MI sources and REGULAR efi loader bits .PATH: ${.CURDIR}/../loader/arch/${MACHINE} Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 28 16:58:49 2016 (r294998) +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 28 17:24:40 2016 (r294999) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); static const boot_module_t *boot_modules[] = { +#ifdef EFI_ZFS_BOOT + &zfs_module, +#endif #ifdef EFI_UFS_BOOT &ufs_module #endif Modified: stable/10/sys/boot/efi/boot1/boot_module.h ============================================================================== --- stable/10/sys/boot/efi/boot1/boot_module.h Thu Jan 28 16:58:49 2016 (r294998) +++ stable/10/sys/boot/efi/boot1/boot_module.h Thu Jan 28 17:24:40 2016 (r294999) @@ -36,12 +36,9 @@ #include #ifdef EFI_DEBUG -#define DPRINTF(fmt, args...) \ - do { \ - printf(fmt, ##args) \ - } while (0) +#define DPRINTF(fmt, ...) printf(fmt, __VA_ARGS__) #else -#define DPRINTF(fmt, args...) {} +#define DPRINTF(fmt, ...) {} #endif /* EFI device info */ @@ -97,6 +94,9 @@ typedef struct boot_module_t #ifdef EFI_UFS_BOOT extern const boot_module_t ufs_module; #endif +#ifdef EFI_ZFS_BOOT +extern const boot_module_t zfs_module; +#endif /* Functions available to modules. */ extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); Copied and modified: stable/10/sys/boot/efi/boot1/zfs_module.c (from r294068, head/sys/boot/efi/boot1/zfs_module.c) ============================================================================== --- head/sys/boot/efi/boot1/zfs_module.c Fri Jan 15 02:33:47 2016 (r294068, copy source) +++ stable/10/sys/boot/efi/boot1/zfs_module.c Thu Jan 28 17:24:40 2016 (r294999) @@ -53,9 +53,9 @@ vdev_read(vdev_t *vdev, void *priv, off_ status = devinfo->dev->ReadBlocks(devinfo->dev, devinfo->dev->Media->MediaId, lba, bytes, buf); if (status != EFI_SUCCESS) { - DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %lu, size: %d," + DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %zu, size: %zu," " status: %lu\n", devinfo->dev, - devinfo->dev->Media->MediaId, lba, size, + devinfo->dev->Media->MediaId, lba, bytes, EFI_ERROR_CODE(status)); return (-1); } Modified: stable/10/sys/boot/efi/include/efilib.h ============================================================================== --- stable/10/sys/boot/efi/include/efilib.h Thu Jan 28 16:58:49 2016 (r294998) +++ stable/10/sys/boot/efi/include/efilib.h Thu Jan 28 17:24:40 2016 (r294999) @@ -42,7 +42,8 @@ void *efi_get_table(EFI_GUID *tbl); int efi_register_handles(struct devsw *, EFI_HANDLE *, EFI_HANDLE *, int); EFI_HANDLE efi_find_handle(struct devsw *, int); -int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *); +int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *, uint64_t *); +int efi_handle_update_dev(EFI_HANDLE, struct devsw *, int, uint64_t); int efi_status_to_errno(EFI_STATUS); time_t efi_time(EFI_TIME *); Modified: stable/10/sys/boot/efi/libefi/handles.c ============================================================================== --- stable/10/sys/boot/efi/libefi/handles.c Thu Jan 28 16:58:49 2016 (r294998) +++ stable/10/sys/boot/efi/libefi/handles.c Thu Jan 28 17:24:40 2016 (r294999) @@ -35,6 +35,7 @@ struct entry { EFI_HANDLE alias; struct devsw *dev; int unit; + uint64_t extra; }; struct entry *entry; @@ -79,7 +80,7 @@ efi_find_handle(struct devsw *dev, int u } int -efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit) +efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit, uint64_t *extra) { int idx; @@ -90,7 +91,28 @@ efi_handle_lookup(EFI_HANDLE h, struct d *dev = entry[idx].dev; if (unit != NULL) *unit = entry[idx].unit; + if (extra != NULL) + *extra = entry[idx].extra; return (0); } return (ENOENT); } + +int +efi_handle_update_dev(EFI_HANDLE h, struct devsw *dev, int unit, + uint64_t guid) +{ + int idx; + + for (idx = 0; idx < nentries; idx++) { + if (entry[idx].handle != h) + continue; + entry[idx].dev = dev; + entry[idx].unit = unit; + entry[idx].alias = NULL; + entry[idx].extra = guid; + return (0); + } + + return (ENOENT); +} Modified: stable/10/sys/boot/efi/loader/Makefile ============================================================================== --- stable/10/sys/boot/efi/loader/Makefile Thu Jan 28 16:58:49 2016 (r294998) +++ stable/10/sys/boot/efi/loader/Makefile Thu Jan 28 17:24:40 2016 (r294999) @@ -20,6 +20,16 @@ SRCS= autoload.c \ smbios.c \ vers.c +.if ${MK_ZFS} != "no" +SRCS+= zfs.c +.PATH: ${.CURDIR}/../../zfs + +# Disable warnings that are currently incompatible with the zfs boot code +CWARNFLAGS.zfs.c+= -Wno-sign-compare +CWARNFLAGS.zfs.c+= -Wno-array-bounds +CWARNFLAGS.zfs.c+= -Wno-missing-prototypes +.endif + .PATH: ${.CURDIR}/arch/${MACHINE} # For smbios.c .PATH: ${.CURDIR}/../../i386/libi386 @@ -33,6 +43,11 @@ CFLAGS+= -I${.CURDIR}/../include/${MACHI CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../i386/libi386 +.if ${MK_ZFS} != "no" +CFLAGS+= -I${.CURDIR}/../../zfs +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -DEFI_ZFS_BOOT +.endif CFLAGS+= -DNO_PCI -DEFI .if ${MK_FORTH} != "no" Modified: stable/10/sys/boot/efi/loader/conf.c ============================================================================== --- stable/10/sys/boot/efi/loader/conf.c Thu Jan 28 16:58:49 2016 (r294998) +++ stable/10/sys/boot/efi/loader/conf.c Thu Jan 28 17:24:40 2016 (r294999) @@ -31,14 +31,23 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef EFI_ZFS_BOOT +#include +#endif struct devsw *devsw[] = { &efipart_dev, &efinet_dev, +#ifdef EFI_ZFS_BOOT + &zfs_dev, +#endif NULL }; struct fs_ops *file_system[] = { +#ifdef EFI_ZFS_BOOT + &zfs_fsops, +#endif &dosfs_fsops, &ufs_fsops, &cd9660_fsops, Modified: stable/10/sys/boot/efi/loader/devicename.c ============================================================================== --- stable/10/sys/boot/efi/loader/devicename.c Thu Jan 28 16:58:49 2016 (r294998) +++ stable/10/sys/boot/efi/loader/devicename.c Thu Jan 28 17:24:40 2016 (r294999) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef EFI_ZFS_BOOT +#include +#endif #include #include @@ -104,6 +107,23 @@ efi_parsedev(struct devdesc **dev, const np = devspec + strlen(dv->dv_name); +#ifdef EFI_ZFS_BOOT + if (dv->dv_type == DEVT_ZFS) { + int err; + + idev = malloc(sizeof(struct zfs_devdesc)); + if (idev == NULL) + return (ENOMEM); + + err = zfs_parsedev((struct zfs_devdesc*)idev, np, path); + if (err != 0) { + free(idev); + return (err); + } + *dev = idev; + cp = strchr(np + 1, ':'); + } else +#endif { idev = malloc(sizeof(struct devdesc)); if (idev == NULL) @@ -143,6 +163,10 @@ efi_fmtdev(void *vdev) static char buf[SPECNAMELEN + 1]; switch(dev->d_type) { +#ifdef EFI_ZFS_BOOT + case DEVT_ZFS: + return (zfs_fmtdev(dev)); +#endif case DEVT_NONE: strcpy(buf, "(no device)"); break; Modified: stable/10/sys/boot/efi/loader/main.c ============================================================================== --- stable/10/sys/boot/efi/loader/main.c Thu Jan 28 16:58:49 2016 (r294998) +++ stable/10/sys/boot/efi/loader/main.c Thu Jan 28 17:24:40 2016 (r294999) @@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EFI_ZFS_BOOT +#include +#endif + #include "loader_efi.h" extern char bootprog_name[]; @@ -60,6 +64,10 @@ EFI_GUID hoblist = HOB_LIST_TABLE_GUID; EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; +#ifdef EFI_ZFS_BOOT +static void efi_zfs_probe(void); +#endif + /* * Need this because EFI uses UTF-16 unicode string constants, but we * use UTF-8. We can't use printf due to the possiblity of \0 and we @@ -82,6 +90,7 @@ main(int argc, CHAR16 *argv[]) EFI_GUID *guid; int i, j, vargood, unit; struct devsw *dev; + uint64_t pool_guid; UINTN k; archsw.arch_autoload = efi_autoload; @@ -89,6 +98,10 @@ main(int argc, CHAR16 *argv[]) archsw.arch_copyin = efi_copyin; archsw.arch_copyout = efi_copyout; archsw.arch_readin = efi_readin; +#ifdef EFI_ZFS_BOOT + /* Note this needs to be set before ZFS init. */ + archsw.arch_zfs_probe = efi_zfs_probe; +#endif /* * XXX Chicken-and-egg problem; we want to have console output @@ -167,10 +180,27 @@ main(int argc, CHAR16 *argv[]) */ BS->SetWatchdogTimer(0, 0, 0, NULL); - if (efi_handle_lookup(img->DeviceHandle, &dev, &unit) != 0) + if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &pool_guid) != 0) return (EFI_NOT_FOUND); switch (dev->dv_type) { +#ifdef EFI_ZFS_BOOT + case DEVT_ZFS: { + struct zfs_devdesc currdev; + + currdev.d_dev = dev; + currdev.d_unit = unit; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_opendata = NULL; + currdev.pool_guid = pool_guid; + currdev.root_guid = 0; + env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev), + efi_setcurrdev, env_nounset); + env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset, + env_nounset); + break; + } +#endif default: { struct devdesc currdev; @@ -452,3 +482,46 @@ command_nvram(int argc, char *argv[]) return (CMD_OK); } + +#ifdef EFI_ZFS_BOOT +COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", + command_lszfs); + +static int +command_lszfs(int argc, char *argv[]) +{ + int err; + + if (argc != 2) { + command_errmsg = "wrong number of arguments"; + return (CMD_ERROR); + } + + err = zfs_list(argv[1]); + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + return (CMD_OK); +} +#endif + +#ifdef EFI_ZFS_BOOT +static void +efi_zfs_probe(void) +{ + EFI_HANDLE h; + u_int unit; + int i; + char dname[SPECNAMELEN + 1]; + uint64_t guid; + + unit = 0; + h = efi_find_handle(&efipart_dev, 0); + for (i = 0; h != NULL; h = efi_find_handle(&efipart_dev, ++i)) { + snprintf(dname, sizeof(dname), "%s%d:", efipart_dev.dv_name, i); + if (zfs_probe_dev(dname, &guid) == 0) + (void)efi_handle_update_dev(h, &zfs_dev, unit++, guid); + } +} +#endif From owner-svn-src-stable-10@freebsd.org Thu Jan 28 18:25:56 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CE85A700E4; Thu, 28 Jan 2016 18:25:56 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3E3AF1350; Thu, 28 Jan 2016 18:25:56 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SIPtxt067698; Thu, 28 Jan 2016 18:25:55 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SIPtYH067697; Thu, 28 Jan 2016 18:25:55 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201601281825.u0SIPtYH067697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 28 Jan 2016 18:25:55 +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: r295000 - stable/10/share/man/man4 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.20 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: Thu, 28 Jan 2016 18:25:56 -0000 Author: jimharris Date: Thu Jan 28 18:25:55 2016 New Revision: 295000 URL: https://svnweb.freebsd.org/changeset/base/295000 Log: MFC r293678: Update ismt(4) man page to reflect inclusion in upcoming 10.3 release. Modified: stable/10/share/man/man4/ismt.4 Modified: stable/10/share/man/man4/ismt.4 ============================================================================== --- stable/10/share/man/man4/ismt.4 Thu Jan 28 17:24:40 2016 (r294999) +++ stable/10/share/man/man4/ismt.4 Thu Jan 28 18:25:55 2016 (r295000) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2014 +.Dd January 11, 2016 .Dt ISMT 4 .Os .Sh NAME @@ -54,6 +54,6 @@ in the Intel Atom S1200 and C2000 CPUs. The .Nm driver first appeared in -.Fx 11.0 . +.Fx 10.3 . .Sh AUTHORS .An Jim Harris Aq jimharris@FreeBSD.org From owner-svn-src-stable-10@freebsd.org Thu Jan 28 19:03:14 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1114EA71014; Thu, 28 Jan 2016 19:03:14 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84CF31D21; Thu, 28 Jan 2016 19:03:13 +0000 (UTC) (envelope-from kraduk@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id l66so38453093wml.0; Thu, 28 Jan 2016 11:03:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3xDt1j8CTwZRzTUnMUJoqWds7M76zNqKBIJKMB8rQpY=; b=m9wU9zT8NrBEFE4/59zIBLoTXMEQPD5eFen0nE6wtjLQi93L9wyvVRamAVviwfVNIo yhTpmAQsWLnQM5048+oVS1lKQQF65FCl/Fl/0W/CZMOczkxZplS4jUyBqXiNrjUfa24P 7Lssg5tHfO7wRIbsd7tqTdCI/pp28auQVS677Ytji2iCvHH3N7CzX0VxulmPwsZSA6g+ h9wgOyz757Q/0vH2whR/hJou+T7/WhqAP+ryDutnccBMx+I0fl90sKOdObuqwlXGAdmQ ZaDkiBTQLioVZftfzL1ZMwW+W8jKi7Cbpcz2/NNbguP0I4kaLQeD+b7D3gXvHnzMuva4 WqLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=3xDt1j8CTwZRzTUnMUJoqWds7M76zNqKBIJKMB8rQpY=; b=Hqe/lwSNHDQ46yRE7v6oXi0BFBD8rvKBJb4GAKsZbXG94oU1efOyA1U7nUH1KQM6HZ 3Qi7sOvrGFqWDFP+7NuE0BNIh8NZKppXzvWpVrgzfPAgU59STbL3iR3+PaNNe86b6cBD Ms+o7SyPurnJxmx1pWmBLnD8s01ukWqfH9jX0QQUfcC5lZQq+KJkuyqM+GyM1Klmm2zs U8oCJQ8pvG8KBnnrnNPxaXzAUYPM7ttOzrUC0L0S3ncyYAZ8VQuNh3H82LtV57hopFC/ ZM++jE6hraCJTZOQcstG/R/bx3dZOvGyMwM+2KSpMy4ryd9m4I5ywPtHpu1Pn6LV2Wd9 mjtQ== X-Gm-Message-State: AG10YOR2R6Mts9p0/4wRGExvxq+yk8ns3RUoPxXo8+BMP5KCcsAKDHSJnn3XdQlZcAGlBsMYFjtDtNtkHIzQmA== MIME-Version: 1.0 X-Received: by 10.28.179.84 with SMTP id c81mr4863707wmf.30.1454007791966; Thu, 28 Jan 2016 11:03:11 -0800 (PST) Received: by 10.28.55.132 with HTTP; Thu, 28 Jan 2016 11:03:11 -0800 (PST) In-Reply-To: <201601281724.u0SHOfgn050280@repo.freebsd.org> References: <201601281724.u0SHOfgn050280@repo.freebsd.org> Date: Thu, 28 Jan 2016 19:03:11 +0000 Message-ID: Subject: Re: svn commit: r294999 - in stable/10/sys/boot/efi: boot1 include libefi loader From: krad To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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: Thu, 28 Jan 2016 19:03:14 -0000 Just built 10-stable and upgraded my intel NUC 2820 and it boots fine on the rootonzfs pool. This is on the old v32 firmware. I will test on the newer firmware later tonight. On 28 January 2016 at 17:24, Steven Hartland wrote: > Author: smh > Date: Thu Jan 28 17:24:40 2016 > New Revision: 294999 > URL: https://svnweb.freebsd.org/changeset/base/294999 > > Log: > MFC r294068, r294265 > > MFC r294068: > Add EFI ZFS boot support > > MFC r294265: > Fix broken DPRINTF and wire up EFI_DEBUG so -DEFI_DEBUG to make works. > > Relnotes: Yes > Sponsored by: Multiplay > > Added: > stable/10/sys/boot/efi/boot1/zfs_module.c > - copied, changed from r294068, head/sys/boot/efi/boot1/zfs_module.c > Modified: > stable/10/sys/boot/efi/boot1/Makefile > stable/10/sys/boot/efi/boot1/boot1.c > stable/10/sys/boot/efi/boot1/boot_module.h > stable/10/sys/boot/efi/include/efilib.h > stable/10/sys/boot/efi/libefi/handles.c > stable/10/sys/boot/efi/loader/Makefile > stable/10/sys/boot/efi/loader/conf.c > stable/10/sys/boot/efi/loader/devicename.c > stable/10/sys/boot/efi/loader/main.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/boot/efi/boot1/Makefile > > ============================================================================== > --- stable/10/sys/boot/efi/boot1/Makefile Thu Jan 28 16:58:49 2016 > (r294998) > +++ stable/10/sys/boot/efi/boot1/Makefile Thu Jan 28 17:24:40 2016 > (r294999) > @@ -10,8 +10,22 @@ PROG= boot1.sym > INTERNALPROG= > WARNS?= 6 > > +.if ${MK_ZFS} != "no" > +# Disable warnings that are currently incompatible with the zfs boot code > +CWARNFLAGS.zfs_module.c += -Wno-array-bounds > +CWARNFLAGS.zfs_module.c += -Wno-cast-align > +CWARNFLAGS.zfs_module.c += -Wno-cast-qual > +CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes > +CWARNFLAGS.zfs_module.c += -Wno-sign-compare > +CWARNFLAGS.zfs_module.c += -Wno-unused-parameter > +CWARNFLAGS.zfs_module.c += -Wno-unused-function > +.endif > + > # architecture-specific loader code > SRCS= boot1.c reloc.c start.S ufs_module.c > +.if ${MK_ZFS} != "no" > +SRCS+= zfs_module.c > +.endif > > CFLAGS+= -fPIC > CFLAGS+= -I. > @@ -20,6 +34,15 @@ CFLAGS+= -I${.CURDIR}/../include/${MACHI > CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include > CFLAGS+= -I${.CURDIR}/../../.. > CFLAGS+= -DEFI_UFS_BOOT > +.ifdef(EFI_DEBUG) > +CFLAGS+= -DEFI_DEBUG > +.endif > + > +.if ${MK_ZFS} != "no" > +CFLAGS+= -I${.CURDIR}/../../zfs/ > +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ > +CFLAGS+= -DEFI_ZFS_BOOT > +.endif > > # Always add MI sources and REGULAR efi loader bits > .PATH: ${.CURDIR}/../loader/arch/${MACHINE} > > Modified: stable/10/sys/boot/efi/boot1/boot1.c > > ============================================================================== > --- stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 28 16:58:49 2016 > (r294998) > +++ stable/10/sys/boot/efi/boot1/boot1.c Thu Jan 28 17:24:40 2016 > (r294999) > @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); > > static const boot_module_t *boot_modules[] = > { > +#ifdef EFI_ZFS_BOOT > + &zfs_module, > +#endif > #ifdef EFI_UFS_BOOT > &ufs_module > #endif > > Modified: stable/10/sys/boot/efi/boot1/boot_module.h > > ============================================================================== > --- stable/10/sys/boot/efi/boot1/boot_module.h Thu Jan 28 16:58:49 2016 > (r294998) > +++ stable/10/sys/boot/efi/boot1/boot_module.h Thu Jan 28 17:24:40 2016 > (r294999) > @@ -36,12 +36,9 @@ > #include > > #ifdef EFI_DEBUG > -#define DPRINTF(fmt, args...) \ > - do { \ > - printf(fmt, ##args) \ > - } while (0) > +#define DPRINTF(fmt, ...) printf(fmt, __VA_ARGS__) > #else > -#define DPRINTF(fmt, args...) {} > +#define DPRINTF(fmt, ...) {} > #endif > > /* EFI device info */ > @@ -97,6 +94,9 @@ typedef struct boot_module_t > #ifdef EFI_UFS_BOOT > extern const boot_module_t ufs_module; > #endif > +#ifdef EFI_ZFS_BOOT > +extern const boot_module_t zfs_module; > +#endif > > /* Functions available to modules. */ > extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); > > Copied and modified: stable/10/sys/boot/efi/boot1/zfs_module.c (from > r294068, head/sys/boot/efi/boot1/zfs_module.c) > > ============================================================================== > --- head/sys/boot/efi/boot1/zfs_module.c Fri Jan 15 02:33:47 2016 > (r294068, copy source) > +++ stable/10/sys/boot/efi/boot1/zfs_module.c Thu Jan 28 17:24:40 2016 > (r294999) > @@ -53,9 +53,9 @@ vdev_read(vdev_t *vdev, void *priv, off_ > status = devinfo->dev->ReadBlocks(devinfo->dev, > devinfo->dev->Media->MediaId, lba, bytes, buf); > if (status != EFI_SUCCESS) { > - DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %lu, > size: %d," > + DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %zu, > size: %zu," > " status: %lu\n", devinfo->dev, > - devinfo->dev->Media->MediaId, lba, size, > + devinfo->dev->Media->MediaId, lba, bytes, > EFI_ERROR_CODE(status)); > return (-1); > } > > Modified: stable/10/sys/boot/efi/include/efilib.h > > ============================================================================== > --- stable/10/sys/boot/efi/include/efilib.h Thu Jan 28 16:58:49 2016 > (r294998) > +++ stable/10/sys/boot/efi/include/efilib.h Thu Jan 28 17:24:40 2016 > (r294999) > @@ -42,7 +42,8 @@ void *efi_get_table(EFI_GUID *tbl); > > int efi_register_handles(struct devsw *, EFI_HANDLE *, EFI_HANDLE *, int); > EFI_HANDLE efi_find_handle(struct devsw *, int); > -int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *); > +int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *, uint64_t *); > +int efi_handle_update_dev(EFI_HANDLE, struct devsw *, int, uint64_t); > > int efi_status_to_errno(EFI_STATUS); > time_t efi_time(EFI_TIME *); > > Modified: stable/10/sys/boot/efi/libefi/handles.c > > ============================================================================== > --- stable/10/sys/boot/efi/libefi/handles.c Thu Jan 28 16:58:49 2016 > (r294998) > +++ stable/10/sys/boot/efi/libefi/handles.c Thu Jan 28 17:24:40 2016 > (r294999) > @@ -35,6 +35,7 @@ struct entry { > EFI_HANDLE alias; > struct devsw *dev; > int unit; > + uint64_t extra; > }; > > struct entry *entry; > @@ -79,7 +80,7 @@ efi_find_handle(struct devsw *dev, int u > } > > int > -efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit) > +efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit, uint64_t > *extra) > { > int idx; > > @@ -90,7 +91,28 @@ efi_handle_lookup(EFI_HANDLE h, struct d > *dev = entry[idx].dev; > if (unit != NULL) > *unit = entry[idx].unit; > + if (extra != NULL) > + *extra = entry[idx].extra; > return (0); > } > return (ENOENT); > } > + > +int > +efi_handle_update_dev(EFI_HANDLE h, struct devsw *dev, int unit, > + uint64_t guid) > +{ > + int idx; > + > + for (idx = 0; idx < nentries; idx++) { > + if (entry[idx].handle != h) > + continue; > + entry[idx].dev = dev; > + entry[idx].unit = unit; > + entry[idx].alias = NULL; > + entry[idx].extra = guid; > + return (0); > + } > + > + return (ENOENT); > +} > > Modified: stable/10/sys/boot/efi/loader/Makefile > > ============================================================================== > --- stable/10/sys/boot/efi/loader/Makefile Thu Jan 28 16:58:49 2016 > (r294998) > +++ stable/10/sys/boot/efi/loader/Makefile Thu Jan 28 17:24:40 2016 > (r294999) > @@ -20,6 +20,16 @@ SRCS= autoload.c \ > smbios.c \ > vers.c > > +.if ${MK_ZFS} != "no" > +SRCS+= zfs.c > +.PATH: ${.CURDIR}/../../zfs > + > +# Disable warnings that are currently incompatible with the zfs boot code > +CWARNFLAGS.zfs.c+= -Wno-sign-compare > +CWARNFLAGS.zfs.c+= -Wno-array-bounds > +CWARNFLAGS.zfs.c+= -Wno-missing-prototypes > +.endif > + > .PATH: ${.CURDIR}/arch/${MACHINE} > # For smbios.c > .PATH: ${.CURDIR}/../../i386/libi386 > @@ -33,6 +43,11 @@ CFLAGS+= -I${.CURDIR}/../include/${MACHI > CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/include > CFLAGS+= -I${.CURDIR}/../../.. > CFLAGS+= -I${.CURDIR}/../../i386/libi386 > +.if ${MK_ZFS} != "no" > +CFLAGS+= -I${.CURDIR}/../../zfs > +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs > +CFLAGS+= -DEFI_ZFS_BOOT > +.endif > CFLAGS+= -DNO_PCI -DEFI > > .if ${MK_FORTH} != "no" > > Modified: stable/10/sys/boot/efi/loader/conf.c > > ============================================================================== > --- stable/10/sys/boot/efi/loader/conf.c Thu Jan 28 16:58:49 2016 > (r294998) > +++ stable/10/sys/boot/efi/loader/conf.c Thu Jan 28 17:24:40 2016 > (r294999) > @@ -31,14 +31,23 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef EFI_ZFS_BOOT > +#include > +#endif > > struct devsw *devsw[] = { > &efipart_dev, > &efinet_dev, > +#ifdef EFI_ZFS_BOOT > + &zfs_dev, > +#endif > NULL > }; > > struct fs_ops *file_system[] = { > +#ifdef EFI_ZFS_BOOT > + &zfs_fsops, > +#endif > &dosfs_fsops, > &ufs_fsops, > &cd9660_fsops, > > Modified: stable/10/sys/boot/efi/loader/devicename.c > > ============================================================================== > --- stable/10/sys/boot/efi/loader/devicename.c Thu Jan 28 16:58:49 2016 > (r294998) > +++ stable/10/sys/boot/efi/loader/devicename.c Thu Jan 28 17:24:40 2016 > (r294999) > @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef EFI_ZFS_BOOT > +#include > +#endif > > #include > #include > @@ -104,6 +107,23 @@ efi_parsedev(struct devdesc **dev, const > > np = devspec + strlen(dv->dv_name); > > +#ifdef EFI_ZFS_BOOT > + if (dv->dv_type == DEVT_ZFS) { > + int err; > + > + idev = malloc(sizeof(struct zfs_devdesc)); > + if (idev == NULL) > + return (ENOMEM); > + > + err = zfs_parsedev((struct zfs_devdesc*)idev, np, path); > + if (err != 0) { > + free(idev); > + return (err); > + } > + *dev = idev; > + cp = strchr(np + 1, ':'); > + } else > +#endif > { > idev = malloc(sizeof(struct devdesc)); > if (idev == NULL) > @@ -143,6 +163,10 @@ efi_fmtdev(void *vdev) > static char buf[SPECNAMELEN + 1]; > > switch(dev->d_type) { > +#ifdef EFI_ZFS_BOOT > + case DEVT_ZFS: > + return (zfs_fmtdev(dev)); > +#endif > case DEVT_NONE: > strcpy(buf, "(no device)"); > break; > > Modified: stable/10/sys/boot/efi/loader/main.c > > ============================================================================== > --- stable/10/sys/boot/efi/loader/main.c Thu Jan 28 16:58:49 2016 > (r294998) > +++ stable/10/sys/boot/efi/loader/main.c Thu Jan 28 17:24:40 2016 > (r294999) > @@ -39,6 +39,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#ifdef EFI_ZFS_BOOT > +#include > +#endif > + > #include "loader_efi.h" > > extern char bootprog_name[]; > @@ -60,6 +64,10 @@ EFI_GUID hoblist = HOB_LIST_TABLE_GUID; > EFI_GUID memtype = MEMORY_TYPE_INFORMATION_TABLE_GUID; > EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; > > +#ifdef EFI_ZFS_BOOT > +static void efi_zfs_probe(void); > +#endif > + > /* > * Need this because EFI uses UTF-16 unicode string constants, but we > * use UTF-8. We can't use printf due to the possiblity of \0 and we > @@ -82,6 +90,7 @@ main(int argc, CHAR16 *argv[]) > EFI_GUID *guid; > int i, j, vargood, unit; > struct devsw *dev; > + uint64_t pool_guid; > UINTN k; > > archsw.arch_autoload = efi_autoload; > @@ -89,6 +98,10 @@ main(int argc, CHAR16 *argv[]) > archsw.arch_copyin = efi_copyin; > archsw.arch_copyout = efi_copyout; > archsw.arch_readin = efi_readin; > +#ifdef EFI_ZFS_BOOT > + /* Note this needs to be set before ZFS init. */ > + archsw.arch_zfs_probe = efi_zfs_probe; > +#endif > > /* > * XXX Chicken-and-egg problem; we want to have console output > @@ -167,10 +180,27 @@ main(int argc, CHAR16 *argv[]) > */ > BS->SetWatchdogTimer(0, 0, 0, NULL); > > - if (efi_handle_lookup(img->DeviceHandle, &dev, &unit) != 0) > + if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &pool_guid) > != 0) > return (EFI_NOT_FOUND); > > switch (dev->dv_type) { > +#ifdef EFI_ZFS_BOOT > + case DEVT_ZFS: { > + struct zfs_devdesc currdev; > + > + currdev.d_dev = dev; > + currdev.d_unit = unit; > + currdev.d_type = currdev.d_dev->dv_type; > + currdev.d_opendata = NULL; > + currdev.pool_guid = pool_guid; > + currdev.root_guid = 0; > + env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev), > + efi_setcurrdev, env_nounset); > + env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), > env_noset, > + env_nounset); > + break; > + } > +#endif > default: { > struct devdesc currdev; > > @@ -452,3 +482,46 @@ command_nvram(int argc, char *argv[]) > > return (CMD_OK); > } > + > +#ifdef EFI_ZFS_BOOT > +COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", > + command_lszfs); > + > +static int > +command_lszfs(int argc, char *argv[]) > +{ > + int err; > + > + if (argc != 2) { > + command_errmsg = "wrong number of arguments"; > + return (CMD_ERROR); > + } > + > + err = zfs_list(argv[1]); > + if (err != 0) { > + command_errmsg = strerror(err); > + return (CMD_ERROR); > + } > + return (CMD_OK); > +} > +#endif > + > +#ifdef EFI_ZFS_BOOT > +static void > +efi_zfs_probe(void) > +{ > + EFI_HANDLE h; > + u_int unit; > + int i; > + char dname[SPECNAMELEN + 1]; > + uint64_t guid; > + > + unit = 0; > + h = efi_find_handle(&efipart_dev, 0); > + for (i = 0; h != NULL; h = efi_find_handle(&efipart_dev, ++i)) { > + snprintf(dname, sizeof(dname), "%s%d:", > efipart_dev.dv_name, i); > + if (zfs_probe_dev(dname, &guid) == 0) > + (void)efi_handle_update_dev(h, &zfs_dev, unit++, > guid); > + } > +} > +#endif > _______________________________________________ > svn-src-stable-10@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 > To unsubscribe, send any mail to " > svn-src-stable-10-unsubscribe@freebsd.org" > From owner-svn-src-stable-10@freebsd.org Thu Jan 28 19:21:02 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77FE3A71499; Thu, 28 Jan 2016 19:21:02 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 3A3ED15A5; Thu, 28 Jan 2016 19:21:02 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SJL1AN083481; Thu, 28 Jan 2016 19:21:01 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SJL1G5083479; Thu, 28 Jan 2016 19:21:01 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201601281921.u0SJL1G5083479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 28 Jan 2016 19:21:01 +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: r295008 - in stable/10/sys/dev: ixgbe netmap 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.20 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: Thu, 28 Jan 2016 19:21:02 -0000 Author: sbruno Date: Thu Jan 28 19:21:01 2016 New Revision: 295008 URL: https://svnweb.freebsd.org/changeset/base/295008 Log: Fixed up version of r294061 that was reverted due to breakage of features (netmap) and architectures(i386). r283883 -- update to 3.1.0 r283893 -- update SRIOV API changes related to future possible MFC of SRIOV work r285590 -- Fix ixgbe(4) SRIOV VF initialization bugs r285591 -- Remove version check for FLOWID r285592 -- Update netmap support for ixgbe SRIOV VFs. r286238 -- Fixup MTU zeroing if INET/INET6 are undefined. Submitted by: kevin bowling Differential Revision: https://reviews.freebsd.org/D4273 Modified: stable/10/sys/dev/ixgbe/if_ix.c stable/10/sys/dev/ixgbe/if_ixv.c stable/10/sys/dev/ixgbe/ix_txrx.c stable/10/sys/dev/ixgbe/ixgbe.h stable/10/sys/dev/ixgbe/ixgbe_mbx.h stable/10/sys/dev/ixgbe/ixgbe_vf.c stable/10/sys/dev/netmap/ixgbe_netmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Thu Jan 28 19:18:33 2016 (r295007) +++ stable/10/sys/dev/ixgbe/if_ix.c Thu Jan 28 19:21:01 2016 (r295008) @@ -40,6 +40,11 @@ #include "ixgbe.h" +#ifdef RSS +#include +#include +#endif + /********************************************************************* * Set this to one to display debug statistics *********************************************************************/ @@ -48,7 +53,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.8.3"; +char ixgbe_driver_version[] = "3.1.0"; /********************************************************************* * PCI Device ID Table @@ -132,6 +137,7 @@ static int ixgbe_setup_msix(struct adapt static void ixgbe_free_pci_resources(struct adapter *); static void ixgbe_local_timer(void *); static int ixgbe_setup_interface(device_t, struct adapter *); +static void ixgbe_config_gpie(struct adapter *); static void ixgbe_config_dmac(struct adapter *); static void ixgbe_config_delay_values(struct adapter *); static void ixgbe_config_link(struct adapter *); @@ -200,6 +206,18 @@ static void ixgbe_handle_phy(void *, int static void ixgbe_reinit_fdir(void *, int); #endif +#ifdef PCI_IOV +static void ixgbe_ping_all_vfs(struct adapter *); +static void ixgbe_handle_mbx(void *, int); +static int ixgbe_init_iov(device_t, u16, const nvlist_t *); +static void ixgbe_uninit_iov(device_t); +static int ixgbe_add_vf(device_t, u16, const nvlist_t *); +static void ixgbe_initialize_iov(struct adapter *); +static void ixgbe_recalculate_max_frame(struct adapter *); +static void ixgbe_init_vf(struct adapter *, struct ixgbe_vf *); +#endif /* PCI_IOV */ + + /********************************************************************* * FreeBSD Device Interface Entry Points *********************************************************************/ @@ -212,6 +230,11 @@ static device_method_t ix_methods[] = { DEVMETHOD(device_shutdown, ixgbe_shutdown), DEVMETHOD(device_suspend, ixgbe_suspend), DEVMETHOD(device_resume, ixgbe_resume), +#ifdef PCI_IOV + DEVMETHOD(pci_iov_init, ixgbe_init_iov), + DEVMETHOD(pci_iov_uninit, ixgbe_uninit_iov), + DEVMETHOD(pci_iov_add_vf, ixgbe_add_vf), +#endif /* PCI_IOV */ DEVMETHOD_END }; @@ -224,6 +247,9 @@ DRIVER_MODULE(ix, pci, ix_driver, ix_dev MODULE_DEPEND(ix, pci, 1, 1, 1); MODULE_DEPEND(ix, ether, 1, 1, 1); +#ifdef DEV_NETMAP +MODULE_DEPEND(ix, netmap, 1, 1, 1); +#endif /* DEV_NETMAP */ /* ** TUNEABLE PARAMETERS: @@ -291,8 +317,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix static int ixgbe_num_queues = 0; TUNABLE_INT("hw.ix.num_queues", &ixgbe_num_queues); SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, - "Number of queues to configure up to a maximum of 8; " - "0 indicates autoconfigure"); + "Number of queues to configure, 0 indicates autoconfigure"); /* ** Number of TX descriptors per ring, @@ -344,6 +369,8 @@ static int fdir_pballoc = 1; #include #endif /* DEV_NETMAP */ +static MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations"); + /********************************************************************* * Device identification routine * @@ -484,7 +511,7 @@ ixgbe_attach(device_t dev) } /* Allocate multicast array memory. */ - adapter->mta = malloc(sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * + adapter->mta = malloc(sizeof(*adapter->mta) * MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); if (adapter->mta == NULL) { device_printf(dev, "Can not allocate multicast setup array\n"); @@ -566,9 +593,32 @@ ixgbe_attach(device_t dev) /* Check PCIE slot type/speed/width */ ixgbe_get_slot_info(hw); + /* Set an initial default flow control value */ adapter->fc = ixgbe_fc_full; +#ifdef PCI_IOV + if ((hw->mac.type != ixgbe_mac_82598EB) && (adapter->msix > 1)) { + nvlist_t *pf_schema, *vf_schema; + + hw->mbx.ops.init_params(hw); + pf_schema = pci_iov_schema_alloc_node(); + vf_schema = pci_iov_schema_alloc_node(); + pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); + pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", + IOV_SCHEMA_HASDEFAULT, TRUE); + pci_iov_schema_add_bool(vf_schema, "allow-set-mac", + IOV_SCHEMA_HASDEFAULT, FALSE); + pci_iov_schema_add_bool(vf_schema, "allow-promisc", + IOV_SCHEMA_HASDEFAULT, FALSE); + error = pci_iov_attach(dev, pf_schema, vf_schema); + if (error != 0) { + device_printf(dev, + "Error %d setting up SR-IOV\n", error); + } + } +#endif /* PCI_IOV */ + /* Check for certain supported features */ ixgbe_check_wol_support(adapter); ixgbe_check_eee_support(adapter); @@ -625,6 +675,13 @@ ixgbe_detach(device_t dev) return (EBUSY); } +#ifdef PCI_IOV + if (pci_iov_detach(dev) != 0) { + device_printf(dev, "SR-IOV in use; detach first.\n"); + return (EBUSY); + } +#endif /* PCI_IOV */ + /* Stop the adapter */ IXGBE_CORE_LOCK(adapter); ixgbe_setup_low_power_mode(adapter); @@ -645,6 +702,9 @@ ixgbe_detach(device_t dev) taskqueue_drain(adapter->tq, &adapter->link_task); taskqueue_drain(adapter->tq, &adapter->mod_task); taskqueue_drain(adapter->tq, &adapter->msf_task); +#ifdef PCI_IOV + taskqueue_drain(adapter->tq, &adapter->mbx_task); +#endif taskqueue_drain(adapter->tq, &adapter->phy_task); #ifdef IXGBE_FDIR taskqueue_drain(adapter->tq, &adapter->fdir_task); @@ -821,6 +881,9 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c adapter->max_frame_size = ifp->if_mtu + IXGBE_MTU_HDR; ixgbe_init_locked(adapter); +#ifdef PCI_IOV + ixgbe_recalculate_max_frame(adapter); +#endif IXGBE_CORE_UNLOCK(adapter); } break; @@ -936,22 +999,36 @@ ixgbe_init_locked(struct adapter *adapte struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; struct ixgbe_hw *hw = &adapter->hw; - u32 k, txdctl, mhadd, gpie; + struct tx_ring *txr; + struct rx_ring *rxr; + u32 txdctl, mhadd; u32 rxdctl, rxctrl; +#ifdef PCI_IOV + enum ixgbe_iov_mode mode; +#endif mtx_assert(&adapter->core_mtx, MA_OWNED); INIT_DEBUGOUT("ixgbe_init_locked: begin"); + hw->adapter_stopped = FALSE; ixgbe_stop_adapter(hw); callout_stop(&adapter->timer); +#ifdef PCI_IOV + mode = ixgbe_get_iov_mode(adapter); + adapter->pool = ixgbe_max_vfs(mode); + /* Queue indices may change with IOV mode */ + for (int i = 0; i < adapter->num_queues; i++) { + adapter->rx_rings[i].me = ixgbe_pf_que_index(mode, i); + adapter->tx_rings[i].me = ixgbe_pf_que_index(mode, i); + } +#endif /* reprogram the RAR[0] in case user changed it. */ - ixgbe_set_rar(hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); + ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, IXGBE_RAH_AV); /* Get the latest mac address, User can use a LAA */ - bcopy(IF_LLADDR(adapter->ifp), hw->mac.addr, - IXGBE_ETH_LENGTH_OF_ADDRESS); - ixgbe_set_rar(hw, 0, hw->mac.addr, 0, 1); + bcopy(IF_LLADDR(ifp), hw->mac.addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + ixgbe_set_rar(hw, 0, hw->mac.addr, adapter->pool, 1); hw->addr_ctrl.rar_used_count = 1; /* Set the various hardware offload abilities */ @@ -974,6 +1051,9 @@ ixgbe_init_locked(struct adapter *adapte } ixgbe_init_hw(hw); +#ifdef PCI_IOV + ixgbe_initialize_iov(adapter); +#endif ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -983,14 +1063,10 @@ ixgbe_init_locked(struct adapter *adapte ** Determine the correct mbuf pool ** for doing jumbo frames */ - if (adapter->max_frame_size <= 2048) + if (adapter->max_frame_size <= MCLBYTES) adapter->rx_mbuf_sz = MCLBYTES; - else if (adapter->max_frame_size <= 4096) - adapter->rx_mbuf_sz = MJUMPAGESIZE; - else if (adapter->max_frame_size <= 9216) - adapter->rx_mbuf_sz = MJUM9BYTES; else - adapter->rx_mbuf_sz = MJUM16BYTES; + adapter->rx_mbuf_sz = MJUMPAGESIZE; /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { @@ -1002,31 +1078,8 @@ ixgbe_init_locked(struct adapter *adapte /* Configure RX settings */ ixgbe_initialize_receive_units(adapter); - gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE); - - /* Enable Fan Failure Interrupt */ - gpie |= IXGBE_SDP1_GPIEN_BY_MAC(hw); - - /* Add for Module detection */ - if (hw->mac.type == ixgbe_mac_82599EB) - gpie |= IXGBE_SDP2_GPIEN; - - /* - * Thermal Failure Detection (X540) - * Link Detection (X552) - */ - if (hw->mac.type == ixgbe_mac_X540 || - hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || - hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) - gpie |= IXGBE_SDP0_GPIEN_X540; - - if (adapter->msix > 1) { - /* Enable Enhanced MSIX mode */ - gpie |= IXGBE_GPIE_MSIX_MODE; - gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | - IXGBE_GPIE_OCD; - } - IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); + /* Enable SDP & MSIX interrupts based on adapter */ + ixgbe_config_gpie(adapter); /* Set MTU size */ if (ifp->if_mtu > ETHERMTU) { @@ -1039,7 +1092,8 @@ ixgbe_init_locked(struct adapter *adapte /* Now enable all the queues */ for (int i = 0; i < adapter->num_queues; i++) { - txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i)); + txr = &adapter->tx_rings[i]; + txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txr->me)); txdctl |= IXGBE_TXDCTL_ENABLE; /* Set WTHRESH to 8, burst writeback */ txdctl |= (8 << 16); @@ -1051,11 +1105,12 @@ ixgbe_init_locked(struct adapter *adapte * Prefetching enables tx line rate even with 1 queue. */ txdctl |= (32 << 0) | (1 << 8); - IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); + IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txr->me), txdctl); } - for (int i = 0; i < adapter->num_queues; i++) { - rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); + for (int i = 0, j = 0; i < adapter->num_queues; i++) { + rxr = &adapter->rx_rings[i]; + rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)); if (hw->mac.type == ixgbe_mac_82598EB) { /* ** PTHRESH = 21 @@ -1066,9 +1121,9 @@ ixgbe_init_locked(struct adapter *adapte rxdctl |= 0x080420; } rxdctl |= IXGBE_RXDCTL_ENABLE; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), rxdctl); - for (k = 0; k < 10; k++) { - if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)) & + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), rxdctl); + for (; j < 10; j++) { + if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)) & IXGBE_RXDCTL_ENABLE) break; else @@ -1097,10 +1152,10 @@ ixgbe_init_locked(struct adapter *adapte struct netmap_kring *kring = &na->rx_rings[i]; int t = na->num_rx_desc - 1 - nm_kr_rxspace(kring); - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), t); + IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), t); } else #endif /* DEV_NETMAP */ - IXGBE_WRITE_REG(hw, IXGBE_RDT(i), adapter->num_rx_desc - 1); + IXGBE_WRITE_REG(hw, IXGBE_RDT(rxr->me), adapter->num_rx_desc - 1); } /* Enable Receive engine */ @@ -1139,9 +1194,9 @@ ixgbe_init_locked(struct adapter *adapte #endif /* - ** Check on any SFP devices that - ** need to be kick-started - */ + * Check on any SFP devices that + * need to be kick-started + */ if (hw->phy.type == ixgbe_phy_none) { int err = hw->phy.ops.identify(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { @@ -1155,8 +1210,7 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Configure Energy Efficient Ethernet for supported devices */ - if (adapter->eee_support) - ixgbe_setup_eee(hw, adapter->eee_enabled); + ixgbe_setup_eee(hw, adapter->eee_enabled); /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -1176,6 +1230,15 @@ ixgbe_init_locked(struct adapter *adapte /* And now turn on interrupts */ ixgbe_enable_intr(adapter); +#ifdef PCI_IOV + /* Enable the use of the MBX by the VF's */ + { + u32 reg = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); + reg |= IXGBE_CTRL_EXT_PFRSTD; + IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, reg); + } +#endif + /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -1194,6 +1257,51 @@ ixgbe_init(void *arg) } static void +ixgbe_config_gpie(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + u32 gpie; + + gpie = IXGBE_READ_REG(hw, IXGBE_GPIE); + + /* Fan Failure Interrupt */ + if (hw->device_id == IXGBE_DEV_ID_82598AT) + gpie |= IXGBE_SDP1_GPIEN; + + /* + * Module detection (SDP2) + * Media ready (SDP1) + */ + if (hw->mac.type == ixgbe_mac_82599EB) { + gpie |= IXGBE_SDP2_GPIEN; + if (hw->device_id != IXGBE_DEV_ID_82599_QSFP_SF_QP) + gpie |= IXGBE_SDP1_GPIEN; + } + + /* + * Thermal Failure Detection (X540) + * Link Detection (X557) + */ + if (hw->mac.type == ixgbe_mac_X540 || + hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP || + hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) + gpie |= IXGBE_SDP0_GPIEN_X540; + + if (adapter->msix > 1) { + /* Enable Enhanced MSIX mode */ + gpie |= IXGBE_GPIE_MSIX_MODE; + gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | + IXGBE_GPIE_OCD; + } + + IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); + return; +} + +/* + * Requires adapter->max_frame_size to be set. + */ +static void ixgbe_config_delay_values(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; @@ -1287,10 +1395,9 @@ ixgbe_handle_que(void *context, int pend struct adapter *adapter = que->adapter; struct tx_ring *txr = que->txr; struct ifnet *ifp = adapter->ifp; - bool more; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - more = ixgbe_rxeof(que); + ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX @@ -1352,8 +1459,8 @@ ixgbe_legacy_irq(void *arg) IXGBE_TX_UNLOCK(txr); /* Check for fan failure */ - if ((hw->phy.media_type == ixgbe_media_type_copper) && - (reg_eicr & IXGBE_EICR_GPI_SDP1_BY_MAC(hw))) { + if ((hw->device_id == IXGBE_DEV_ID_82598AT) && + (reg_eicr & IXGBE_EICR_GPI_SDP1)) { device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! " "REPLACE IMMEDIATELY!!\n"); IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); @@ -1392,6 +1499,7 @@ ixgbe_msix_que(void *arg) bool more; u32 newitr = 0; + /* Protect against spurious interrupts */ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; @@ -1515,6 +1623,10 @@ ixgbe_msix_link(void *arg) device_printf(adapter->dev, "System shutdown required!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); } +#ifdef PCI_IOV + if (reg_eicr & IXGBE_EICR_MAILBOX) + taskqueue_enqueue(adapter->tq, &adapter->mbx_task); +#endif } /* Pluggable optics-related interrupt */ @@ -1580,7 +1692,7 @@ ixgbe_media_status(struct ifnet * ifp, s } ifmr->ifm_status |= IFM_ACTIVE; - layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer; if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T || layer & IXGBE_PHYSICAL_LAYER_1000BASE_T || @@ -1813,18 +1925,17 @@ ixgbe_set_promisc(struct adapter *adapte static void ixgbe_set_multi(struct adapter *adapter) { - u32 fctrl; - u8 *mta; - u8 *update_ptr; - struct ifmultiaddr *ifma; - int mcnt = 0; - struct ifnet *ifp = adapter->ifp; + u32 fctrl; + u8 *update_ptr; + struct ifmultiaddr *ifma; + struct ixgbe_mc_addr *mta; + int mcnt = 0; + struct ifnet *ifp = adapter->ifp; IOCTL_DEBUGOUT("ixgbe_set_multi: begin"); mta = adapter->mta; - bzero(mta, sizeof(u8) * IXGBE_ETH_LENGTH_OF_ADDRESS * - MAX_NUM_MULTICAST_ADDRESSES); + bzero(mta, sizeof(*mta) * MAX_NUM_MULTICAST_ADDRESSES); #if __FreeBSD_version < 800000 IF_ADDR_LOCK(ifp); @@ -1837,8 +1948,8 @@ ixgbe_set_multi(struct adapter *adapter) if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) break; bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), - &mta[mcnt * IXGBE_ETH_LENGTH_OF_ADDRESS], - IXGBE_ETH_LENGTH_OF_ADDRESS); + mta[mcnt].addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + mta[mcnt].vmdq = adapter->pool; mcnt++; } #if __FreeBSD_version < 800000 @@ -1861,7 +1972,7 @@ ixgbe_set_multi(struct adapter *adapter) IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, fctrl); if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) { - update_ptr = mta; + update_ptr = (u8 *)mta; ixgbe_update_mc_addr_list(&adapter->hw, update_ptr, mcnt, ixgbe_mc_array_itr, TRUE); } @@ -1877,13 +1988,13 @@ ixgbe_set_multi(struct adapter *adapter) static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *hw, u8 **update_ptr, u32 *vmdq) { - u8 *addr = *update_ptr; - u8 *newptr; - *vmdq = 0; - - newptr = addr + IXGBE_ETH_LENGTH_OF_ADDRESS; - *update_ptr = newptr; - return addr; + struct ixgbe_mc_addr *mta; + + mta = (struct ixgbe_mc_addr *)*update_ptr; + *vmdq = mta->vmdq; + + *update_ptr = (u8*)(mta + 1);; + return (mta->addr); } @@ -1965,6 +2076,7 @@ watchdog: ixgbe_init_locked(adapter); } + /* ** Note: this routine updates the OS on the link state ** the real check of the hardware only happens with @@ -1988,6 +2100,9 @@ ixgbe_update_link_status(struct adapter /* Update DMA coalescing config */ ixgbe_config_dmac(adapter); if_link_state_change(ifp, LINK_STATE_UP); +#ifdef PCI_IOV + ixgbe_ping_all_vfs(adapter); +#endif } } else { /* Link down */ if (adapter->link_active == TRUE) { @@ -1995,6 +2110,9 @@ ixgbe_update_link_status(struct adapter device_printf(dev,"Link is Down\n"); if_link_state_change(ifp, LINK_STATE_DOWN); adapter->link_active = FALSE; +#ifdef PCI_IOV + ixgbe_ping_all_vfs(adapter); +#endif } } @@ -2094,7 +2212,7 @@ ixgbe_setup_optics(struct adapter *adapt struct ixgbe_hw *hw = &adapter->hw; int layer; - layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) { adapter->optics = IFM_10G_T; @@ -2223,6 +2341,31 @@ ixgbe_allocate_msix(struct adapter *adap struct tx_ring *txr = adapter->tx_rings; int error, rid, vector = 0; int cpu_id = 0; +#ifdef RSS + cpuset_t cpu_mask; +#endif + +#ifdef RSS + /* + * If we're doing RSS, the number of queues needs to + * match the number of RSS buckets that are configured. + * + * + If there's more queues than RSS buckets, we'll end + * up with queues that get no traffic. + * + * + If there's more RSS buckets than queues, we'll end + * up having multiple RSS buckets map to the same queue, + * so there'll be some contention. + */ + if (adapter->num_queues != rss_getnumbuckets()) { + device_printf(dev, + "%s: number of queues (%d) != number of RSS buckets (%d)" + "; performance will be impacted.\n", + __func__, + adapter->num_queues, + rss_getnumbuckets()); + } +#endif for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) { rid = vector + 1; @@ -2247,6 +2390,14 @@ ixgbe_allocate_msix(struct adapter *adap #endif que->msix = vector; adapter->active_queues |= (u64)(1 << que->msix); +#ifdef RSS + /* + * The queue ID is used as the RSS layer bucket ID. + * We look up the queue ID -> RSS CPU ID and select + * that. + */ + cpu_id = rss_getcpu(i % rss_getnumbuckets()); +#else /* * Bind the msix vector, and thus the * rings to the corresponding cpu. @@ -2256,9 +2407,21 @@ ixgbe_allocate_msix(struct adapter *adap */ if (adapter->num_queues > 1) cpu_id = i; - +#endif if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, cpu_id); +#ifdef IXGBE_DEBUG +#ifdef RSS + device_printf(dev, + "Bound RSS bucket %d to CPU %d\n", + i, cpu_id); +#else + device_printf(dev, + "Bound queue %d to cpu %d\n", + i, cpu_id); +#endif +#endif /* IXGBE_DEBUG */ + #ifndef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); @@ -2266,8 +2429,17 @@ ixgbe_allocate_msix(struct adapter *adap TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); que->tq = taskqueue_create_fast("ixgbe_que", M_NOWAIT, taskqueue_thread_enqueue, &que->tq); +#ifdef RSS + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET, + &cpu_mask, + "%s (bucket %d)", + device_get_nameunit(adapter->dev), + cpu_id); +#else taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", device_get_nameunit(adapter->dev)); +#endif } /* and Link */ @@ -2296,6 +2468,9 @@ ixgbe_allocate_msix(struct adapter *adap TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); +#ifdef PCI_IOV + TASK_INIT(&adapter->mbx_task, 0, ixgbe_handle_mbx, adapter); +#endif TASK_INIT(&adapter->phy_task, 0, ixgbe_handle_phy, adapter); #ifdef IXGBE_FDIR TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); @@ -2343,11 +2518,14 @@ ixgbe_setup_msix(struct adapter *adapter /* Figure out a reasonable auto config value */ queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; +#ifdef RSS + /* If we're doing RSS, clamp at the number of RSS buckets */ + if (queues > rss_getnumbuckets()) + queues = rss_getnumbuckets(); +#endif + if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; - /* Set max queues to 8 when autoconfiguring */ - else if ((ixgbe_num_queues == 0) && (queues > 8)) - queues = 8; /* reflect correct sysctl value */ ixgbe_num_queues = queues; @@ -2516,10 +2694,15 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixgbe_ioctl; +#if __FreeBSD_version >= 1100036 + if_setgetcounterfn(ifp, ixgbe_get_counter); +#endif +#if __FreeBSD_version >= 1100045 /* TSO parameters */ ifp->if_hw_tsomax = 65518; ifp->if_hw_tsomaxsegcount = IXGBE_82599_SCATTER; ifp->if_hw_tsomaxsegsize = 2048; +#endif #ifndef IXGBE_LEGACY_TX ifp->if_transmit = ixgbe_mq_start; ifp->if_qflush = ixgbe_qflush; @@ -2581,7 +2764,7 @@ ixgbe_add_media_types(struct adapter *ad device_t dev = adapter->dev; int layer; - layer = ixgbe_get_supported_physical_layer(hw); + layer = adapter->phy_layer = ixgbe_get_supported_physical_layer(hw); /* Media types with matching FreeBSD media defines */ if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_T) @@ -2692,40 +2875,41 @@ ixgbe_initialize_transmit_units(struct a for (int i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; u32 txctrl = 0; + int j = txr->me; - IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), + IXGBE_WRITE_REG(hw, IXGBE_TDBAL(j), (tdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_TDLEN(i), + IXGBE_WRITE_REG(hw, IXGBE_TDBAH(j), (tdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_TDLEN(j), adapter->num_tx_desc * sizeof(union ixgbe_adv_tx_desc)); /* Setup the HW Tx Head and Tail descriptor pointers */ - IXGBE_WRITE_REG(hw, IXGBE_TDH(i), 0); - IXGBE_WRITE_REG(hw, IXGBE_TDT(i), 0); + IXGBE_WRITE_REG(hw, IXGBE_TDH(j), 0); + IXGBE_WRITE_REG(hw, IXGBE_TDT(j), 0); /* Cache the tail address */ - txr->tail = IXGBE_TDT(txr->me); + txr->tail = IXGBE_TDT(j); /* Disable Head Writeback */ switch (hw->mac.type) { case ixgbe_mac_82598EB: - txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(j)); break; case ixgbe_mac_82599EB: case ixgbe_mac_X540: default: - txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(j)); break; } txctrl &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; switch (hw->mac.type) { case ixgbe_mac_82598EB: - IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl); + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(j), txctrl); break; case ixgbe_mac_82599EB: case ixgbe_mac_X540: default: - IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), txctrl); + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(j), txctrl); break; } @@ -2733,6 +2917,9 @@ ixgbe_initialize_transmit_units(struct a if (hw->mac.type != ixgbe_mac_82598EB) { u32 dmatxctl, rttdcs; +#ifdef PCI_IOV + enum ixgbe_iov_mode mode = ixgbe_get_iov_mode(adapter); +#endif dmatxctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); dmatxctl |= IXGBE_DMATXCTL_TE; IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, dmatxctl); @@ -2740,7 +2927,11 @@ ixgbe_initialize_transmit_units(struct a rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS); rttdcs |= IXGBE_RTTDCS_ARBDIS; IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); +#ifdef PCI_IOV + IXGBE_WRITE_REG(hw, IXGBE_MTQC, ixgbe_get_mtqc(mode)); +#else IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB); +#endif rttdcs &= ~IXGBE_RTTDCS_ARBDIS; IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); } @@ -2752,17 +2943,22 @@ static void ixgbe_initialise_rss_mapping(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; - uint32_t reta; - int i, j, queue_id, table_size; - int index_mult; - uint32_t rss_key[10]; - uint32_t mrqc; - - /* Setup RSS */ - reta = 0; + u32 reta = 0, mrqc, rss_key[10]; + int queue_id, table_size, index_mult; +#ifdef RSS + u32 rss_hash_config; +#endif +#ifdef PCI_IOV + enum ixgbe_iov_mode mode; +#endif +#ifdef RSS + /* Fetch the configured RSS key */ + rss_getkey((uint8_t *) &rss_key); +#else /* set up random bits */ arc4rand(&rss_key, sizeof(rss_key), 0); +#endif /* Set multiplier for RETA setup and table size based on MAC */ index_mult = 0x1; @@ -2780,9 +2976,19 @@ ixgbe_initialise_rss_mapping(struct adap } /* Set up the redirection table */ - for (i = 0, j = 0; i < table_size; i++, j++) { + for (int i = 0, j = 0; i < table_size; i++, j++) { if (j == adapter->num_queues) j = 0; +#ifdef RSS + /* + * Fetch the RSS bucket id for the given indirection entry. + * Cap it at the number of configured buckets (which is + * num_queues.) + */ + queue_id = rss_get_indirection_to_bucket(i); + queue_id = queue_id % adapter->num_queues; +#else queue_id = (j * index_mult); +#endif /* * The low 8 bits are for hash value (n+0); * The next 8 bits are for hash value (n+1), etc. @@ -2803,6 +3009,32 @@ ixgbe_initialise_rss_mapping(struct adap IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), rss_key[i]); /* Perform hash on these packet types */ +#ifdef RSS + mrqc = IXGBE_MRQC_RSSEN; + rss_hash_config = rss_gethashconfig(); + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4; + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_TCP; + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6; + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_TCP; + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX; + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6_EX) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP; + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4_EX) + device_printf(adapter->dev, + "%s: RSS_HASHTYPE_RSS_UDP_IPV4_EX defined, " + "but not supported\n", __func__); + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6_EX) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP; +#else /* * Disable UDP - IP fragments aren't currently being handled * and so we end up with a mix of 2-tuple and 4-tuple @@ -2811,18 +3043,16 @@ ixgbe_initialise_rss_mapping(struct adap mrqc = IXGBE_MRQC_RSSEN | IXGBE_MRQC_RSS_FIELD_IPV4 | IXGBE_MRQC_RSS_FIELD_IPV4_TCP -#if 0 - | IXGBE_MRQC_RSS_FIELD_IPV4_UDP -#endif | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP | IXGBE_MRQC_RSS_FIELD_IPV6_EX | IXGBE_MRQC_RSS_FIELD_IPV6 | IXGBE_MRQC_RSS_FIELD_IPV6_TCP -#if 0 - | IXGBE_MRQC_RSS_FIELD_IPV6_UDP - | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP -#endif ; +#endif /* RSS */ +#ifdef PCI_IOV + mode = ixgbe_get_iov_mode(adapter); + mrqc |= ixgbe_get_mrqc(mode); +#endif IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); } @@ -2881,16 +3111,17 @@ ixgbe_initialize_receive_units(struct ad for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; + int j = rxr->me; /* Setup the Base and Length of the Rx Descriptor Ring */ - IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i), + IXGBE_WRITE_REG(hw, IXGBE_RDBAL(j), (rdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_RDBAH(i), (rdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_RDLEN(i), + IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j), adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc)); /* Set up the SRRCTL register */ - srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); + srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(j)); srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK; srrctl &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; srrctl |= bufsz; @@ -3026,9 +3257,9 @@ ixgbe_setup_vlan_hw_support(struct adapt rxr = &adapter->rx_rings[i]; /* On 82599 the VLAN enable is per/queue in RXDCTL */ if (hw->mac.type != ixgbe_mac_82598EB) { - ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); + ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)); ctrl |= IXGBE_RXDCTL_VME; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), ctrl); + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl); } rxr->vtag_strip = TRUE; } @@ -3078,6 +3309,9 @@ ixgbe_enable_intr(struct adapter *adapte #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif +#ifdef PCI_IOV + mask |= IXGBE_EIMS_MAILBOX; +#endif break; case ixgbe_mac_X540: /* Detect if Thermal Sensor is enabled */ @@ -3101,6 +3335,9 @@ ixgbe_enable_intr(struct adapter *adapte #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif +#ifdef PCI_IOV + mask |= IXGBE_EIMS_MAILBOX; +#endif /* falls through */ default: break; @@ -3114,6 +3351,9 @@ ixgbe_enable_intr(struct adapter *adapte /* Don't autoclear Link */ mask &= ~IXGBE_EIMS_OTHER; mask &= ~IXGBE_EIMS_LSC; +#ifdef PCI_IOV + mask &= ~IXGBE_EIMS_MAILBOX; +#endif IXGBE_WRITE_REG(hw, IXGBE_EIAC, mask); } @@ -3312,8 +3552,8 @@ ixgbe_set_ivar(struct adapter *adapter, static void ixgbe_configure_ivars(struct adapter *adapter) { - struct ix_queue *que = adapter->queues; - u32 newitr; + struct ix_queue *que = adapter->queues; + u32 newitr; if (ixgbe_max_interrupt_rate > 0) newitr = (4000000 / ixgbe_max_interrupt_rate) & 0x0FF8; @@ -3327,10 +3567,12 @@ ixgbe_configure_ivars(struct adapter *ad } for (int i = 0; i < adapter->num_queues; i++, que++) { + struct rx_ring *rxr = &adapter->rx_rings[i]; + struct tx_ring *txr = &adapter->tx_rings[i]; /* First the RX queue entry */ - ixgbe_set_ivar(adapter, i, que->msix, 0); + ixgbe_set_ivar(adapter, rxr->me, que->msix, 0); /* ... and the TX */ - ixgbe_set_ivar(adapter, i, que->msix, 1); + ixgbe_set_ivar(adapter, txr->me, que->msix, 1); /* Set an Initial EITR value */ IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix), newitr); @@ -3344,7 +3586,8 @@ ixgbe_configure_ivars(struct adapter *ad ** ixgbe_sfp_probe - called in the local timer to ** determine if a port had optics inserted. */ -static bool ixgbe_sfp_probe(struct adapter *adapter) +static bool +ixgbe_sfp_probe(struct adapter *adapter) { struct ixgbe_hw *hw = &adapter->hw; device_t dev = adapter->dev; @@ -3404,6 +3647,7 @@ ixgbe_handle_mod(void *context, int pend "Unsupported SFP+ module type was detected.\n"); return; } + err = hw->mac.ops.setup_sfp(hw); if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Jan 28 21:30:51 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 628B8A71A58; Thu, 28 Jan 2016 21:30:51 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 39B831ED6; Thu, 28 Jan 2016 21:30:51 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SLUoYT022954; Thu, 28 Jan 2016 21:30:50 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SLUnYs022950; Thu, 28 Jan 2016 21:30:49 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201601282130.u0SLUnYs022950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Thu, 28 Jan 2016 21:30:49 +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: r295015 - stable/10/sys/netinet 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.20 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: Thu, 28 Jan 2016 21:30:51 -0000 Author: hiren Date: Thu Jan 28 21:30:49 2016 New Revision: 295015 URL: https://svnweb.freebsd.org/changeset/base/295015 Log: MFC r294840 Persist timers TCPTV_PERSMIN and TCPTV_PERSMAX are hardcoded with 5 seconds and 60 seconds, respectively. Turn them into sysctls that can be tuned live. The default values of 5 seconds and 60 seconds have been retained. Modified: stable/10/sys/netinet/tcp_output.c stable/10/sys/netinet/tcp_subr.c stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_output.c ============================================================================== --- stable/10/sys/netinet/tcp_output.c Thu Jan 28 20:42:29 2016 (r295014) +++ stable/10/sys/netinet/tcp_output.c Thu Jan 28 21:30:49 2016 (r295015) @@ -1608,7 +1608,7 @@ tcp_setpersist(struct tcpcb *tp) * Start/restart persistance timer. */ TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift], - TCPTV_PERSMIN, TCPTV_PERSMAX); + tcp_persmin, tcp_persmax); tcp_timer_activate(tp, TT_PERSIST, tt); if (tp->t_rxtshift < TCP_MAXRXTSHIFT) tp->t_rxtshift++; Modified: stable/10/sys/netinet/tcp_subr.c ============================================================================== --- stable/10/sys/netinet/tcp_subr.c Thu Jan 28 20:42:29 2016 (r295014) +++ stable/10/sys/netinet/tcp_subr.c Thu Jan 28 21:30:49 2016 (r295015) @@ -400,6 +400,8 @@ tcp_init(void) tcp_rexmit_min = TCPTV_MIN; if (tcp_rexmit_min < 1) tcp_rexmit_min = 1; + tcp_persmin = TCPTV_PERSMIN; + tcp_persmax = TCPTV_PERSMAX; tcp_rexmit_slop = TCPTV_CPU_VAR; tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT; tcp_tcbhashsize = hashsize; Modified: stable/10/sys/netinet/tcp_timer.c ============================================================================== --- stable/10/sys/netinet/tcp_timer.c Thu Jan 28 20:42:29 2016 (r295014) +++ stable/10/sys/netinet/tcp_timer.c Thu Jan 28 21:30:49 2016 (r295015) @@ -71,6 +71,14 @@ __FBSDID("$FreeBSD$"); #include #endif +int tcp_persmin; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmin, CTLTYPE_INT|CTLFLAG_RW, + &tcp_persmin, 0, sysctl_msec_to_ticks, "I", "minimum persistence interval"); + +int tcp_persmax; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmax, CTLTYPE_INT|CTLFLAG_RW, + &tcp_persmax, 0, sysctl_msec_to_ticks, "I", "maximum persistence interval"); + int tcp_keepinit; SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, CTLTYPE_INT|CTLFLAG_RW, &tcp_keepinit, 0, sysctl_msec_to_ticks, "I", "time to establish connection"); Modified: stable/10/sys/netinet/tcp_timer.h ============================================================================== --- stable/10/sys/netinet/tcp_timer.h Thu Jan 28 20:42:29 2016 (r295014) +++ stable/10/sys/netinet/tcp_timer.h Thu Jan 28 21:30:49 2016 (r295015) @@ -78,7 +78,7 @@ #define TCPTV_RTOBASE ( 3*hz) /* assumed RTO if no info */ #define TCPTV_SRTTDFLT ( 3*hz) /* assumed RTT if no info */ -#define TCPTV_PERSMIN ( 5*hz) /* retransmit persistence */ +#define TCPTV_PERSMIN ( 5*hz) /* minimum persist interval */ #define TCPTV_PERSMAX ( 60*hz) /* maximum persist interval */ #define TCPTV_KEEP_INIT ( 75*hz) /* initial connect keepalive */ @@ -174,6 +174,8 @@ struct tcp_timer { #define TP_KEEPCNT(tp) ((tp)->t_keepcnt ? (tp)->t_keepcnt : tcp_keepcnt) #define TP_MAXIDLE(tp) (TP_KEEPCNT(tp) * TP_KEEPINTVL(tp)) +extern int tcp_persmin; /* minimum persist interval */ +extern int tcp_persmax; /* maximum persist interval */ extern int tcp_keepinit; /* time to establish connection */ extern int tcp_keepidle; /* time before keepalive probes begin */ extern int tcp_keepintvl; /* time between keepalive probes */ From owner-svn-src-stable-10@freebsd.org Thu Jan 28 21:42:16 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA6CCA6E249; Thu, 28 Jan 2016 21:42:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7799AAE1; Thu, 28 Jan 2016 21:42:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SLgFLk028720; Thu, 28 Jan 2016 21:42:15 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SLgA10028669; Thu, 28 Jan 2016 21:42:10 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201601282142.u0SLgA10028669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 28 Jan 2016 21:42:10 +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: r295016 - in stable/10: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/camel... 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.20 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: Thu, 28 Jan 2016 21:42:17 -0000 Author: jkim Date: Thu Jan 28 21:42:10 2016 New Revision: 295016 URL: https://svnweb.freebsd.org/changeset/base/295016 Log: Merge OpenSSL 1.0.1r. Relnotes: yes Added: stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod - copied unchanged from r295003, vendor-crypto/openssl/dist-1.0.1/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod stable/10/crypto/openssl/util/pod2mantest - copied unchanged from r295003, vendor-crypto/openssl/dist-1.0.1/util/pod2mantest stable/10/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 (contents, props changed) Modified: stable/10/crypto/openssl/ACKNOWLEDGMENTS stable/10/crypto/openssl/CHANGES stable/10/crypto/openssl/Configure stable/10/crypto/openssl/INSTALL stable/10/crypto/openssl/LICENSE stable/10/crypto/openssl/Makefile stable/10/crypto/openssl/Makefile.org stable/10/crypto/openssl/NEWS stable/10/crypto/openssl/README stable/10/crypto/openssl/apps/engine.c stable/10/crypto/openssl/apps/ocsp.c stable/10/crypto/openssl/apps/pkcs12.c stable/10/crypto/openssl/apps/speed.c stable/10/crypto/openssl/apps/x509.c stable/10/crypto/openssl/crypto/aes/aes.h stable/10/crypto/openssl/crypto/aes/aes_cbc.c stable/10/crypto/openssl/crypto/aes/aes_cfb.c stable/10/crypto/openssl/crypto/aes/aes_core.c stable/10/crypto/openssl/crypto/aes/aes_ctr.c stable/10/crypto/openssl/crypto/aes/aes_ecb.c stable/10/crypto/openssl/crypto/aes/aes_ige.c stable/10/crypto/openssl/crypto/aes/aes_locl.h stable/10/crypto/openssl/crypto/aes/aes_misc.c stable/10/crypto/openssl/crypto/aes/aes_ofb.c stable/10/crypto/openssl/crypto/aes/aes_x86core.c stable/10/crypto/openssl/crypto/bio/bio.h stable/10/crypto/openssl/crypto/bio/bss_bio.c stable/10/crypto/openssl/crypto/bio/bss_conn.c stable/10/crypto/openssl/crypto/bio/bss_dgram.c stable/10/crypto/openssl/crypto/bn/bn_exp.c stable/10/crypto/openssl/crypto/bn/exptest.c stable/10/crypto/openssl/crypto/camellia/camellia.c stable/10/crypto/openssl/crypto/camellia/camellia.h stable/10/crypto/openssl/crypto/camellia/cmll_cbc.c stable/10/crypto/openssl/crypto/camellia/cmll_cfb.c stable/10/crypto/openssl/crypto/camellia/cmll_ctr.c stable/10/crypto/openssl/crypto/camellia/cmll_ecb.c stable/10/crypto/openssl/crypto/camellia/cmll_locl.h stable/10/crypto/openssl/crypto/camellia/cmll_misc.c stable/10/crypto/openssl/crypto/camellia/cmll_ofb.c stable/10/crypto/openssl/crypto/camellia/cmll_utl.c stable/10/crypto/openssl/crypto/des/des_old.c stable/10/crypto/openssl/crypto/des/des_old.h stable/10/crypto/openssl/crypto/des/des_old2.c stable/10/crypto/openssl/crypto/dsa/dsa_ossl.c stable/10/crypto/openssl/crypto/dso/dso.h stable/10/crypto/openssl/crypto/dso/dso_dl.c stable/10/crypto/openssl/crypto/dso/dso_dlfcn.c stable/10/crypto/openssl/crypto/dso/dso_lib.c stable/10/crypto/openssl/crypto/ec/ectest.c stable/10/crypto/openssl/crypto/engine/eng_all.c stable/10/crypto/openssl/crypto/evp/e_camellia.c stable/10/crypto/openssl/crypto/evp/e_old.c stable/10/crypto/openssl/crypto/evp/e_seed.c stable/10/crypto/openssl/crypto/mem_clr.c stable/10/crypto/openssl/crypto/o_dir.c stable/10/crypto/openssl/crypto/o_dir.h stable/10/crypto/openssl/crypto/o_dir_test.c stable/10/crypto/openssl/crypto/o_str.c stable/10/crypto/openssl/crypto/o_str.h stable/10/crypto/openssl/crypto/o_time.c stable/10/crypto/openssl/crypto/o_time.h stable/10/crypto/openssl/crypto/opensslv.h stable/10/crypto/openssl/crypto/rc4/rc4_utl.c stable/10/crypto/openssl/crypto/rsa/rsa_chk.c stable/10/crypto/openssl/crypto/rsa/rsa_sign.c stable/10/crypto/openssl/crypto/seed/seed_cbc.c stable/10/crypto/openssl/crypto/seed/seed_cfb.c stable/10/crypto/openssl/crypto/seed/seed_ecb.c stable/10/crypto/openssl/crypto/seed/seed_ofb.c stable/10/crypto/openssl/crypto/sha/sha1test.c stable/10/crypto/openssl/crypto/store/store.h stable/10/crypto/openssl/crypto/store/str_lib.c stable/10/crypto/openssl/crypto/store/str_locl.h stable/10/crypto/openssl/crypto/store/str_mem.c stable/10/crypto/openssl/crypto/store/str_meth.c stable/10/crypto/openssl/crypto/ts/ts_rsp_verify.c stable/10/crypto/openssl/crypto/ui/ui.h stable/10/crypto/openssl/crypto/ui/ui_compat.c stable/10/crypto/openssl/crypto/ui/ui_compat.h stable/10/crypto/openssl/crypto/ui/ui_lib.c stable/10/crypto/openssl/crypto/ui/ui_locl.h stable/10/crypto/openssl/crypto/ui/ui_openssl.c stable/10/crypto/openssl/crypto/ui/ui_util.c stable/10/crypto/openssl/crypto/x509/x509_vfy.c stable/10/crypto/openssl/crypto/x509/x509_vfy.h stable/10/crypto/openssl/crypto/x509v3/v3_pci.c stable/10/crypto/openssl/crypto/x509v3/v3_pcia.c stable/10/crypto/openssl/doc/apps/s_time.pod stable/10/crypto/openssl/doc/crypto/BIO_s_connect.pod stable/10/crypto/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod stable/10/crypto/openssl/engines/e_chil.c stable/10/crypto/openssl/ssl/d1_both.c stable/10/crypto/openssl/ssl/kssl.c stable/10/crypto/openssl/ssl/kssl.h stable/10/crypto/openssl/ssl/kssl_lcl.h stable/10/crypto/openssl/ssl/s2_srvr.c stable/10/crypto/openssl/ssl/s3_clnt.c stable/10/crypto/openssl/ssl/s3_lib.c stable/10/crypto/openssl/ssl/s3_srvr.c stable/10/crypto/openssl/ssl/ssl.h stable/10/crypto/openssl/ssl/ssl_sess.c stable/10/crypto/openssl/ssl/t1_enc.c stable/10/crypto/openssl/ssl/t1_lib.c stable/10/crypto/openssl/util/pl/VC-32.pl stable/10/secure/lib/libcrypto/Makefile.inc stable/10/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/10/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/10/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/10/secure/lib/libcrypto/man/BIO_ctrl.3 stable/10/secure/lib/libcrypto/man/BIO_f_base64.3 stable/10/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/10/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/10/secure/lib/libcrypto/man/BIO_f_md.3 stable/10/secure/lib/libcrypto/man/BIO_f_null.3 stable/10/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/10/secure/lib/libcrypto/man/BIO_find_type.3 stable/10/secure/lib/libcrypto/man/BIO_new.3 stable/10/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/10/secure/lib/libcrypto/man/BIO_push.3 stable/10/secure/lib/libcrypto/man/BIO_read.3 stable/10/secure/lib/libcrypto/man/BIO_s_accept.3 stable/10/secure/lib/libcrypto/man/BIO_s_bio.3 stable/10/secure/lib/libcrypto/man/BIO_s_connect.3 stable/10/secure/lib/libcrypto/man/BIO_s_fd.3 stable/10/secure/lib/libcrypto/man/BIO_s_file.3 stable/10/secure/lib/libcrypto/man/BIO_s_mem.3 stable/10/secure/lib/libcrypto/man/BIO_s_null.3 stable/10/secure/lib/libcrypto/man/BIO_s_socket.3 stable/10/secure/lib/libcrypto/man/BIO_set_callback.3 stable/10/secure/lib/libcrypto/man/BIO_should_retry.3 stable/10/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_new.3 stable/10/secure/lib/libcrypto/man/BN_CTX_start.3 stable/10/secure/lib/libcrypto/man/BN_add.3 stable/10/secure/lib/libcrypto/man/BN_add_word.3 stable/10/secure/lib/libcrypto/man/BN_bn2bin.3 stable/10/secure/lib/libcrypto/man/BN_cmp.3 stable/10/secure/lib/libcrypto/man/BN_copy.3 stable/10/secure/lib/libcrypto/man/BN_generate_prime.3 stable/10/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/10/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/10/secure/lib/libcrypto/man/BN_new.3 stable/10/secure/lib/libcrypto/man/BN_num_bytes.3 stable/10/secure/lib/libcrypto/man/BN_rand.3 stable/10/secure/lib/libcrypto/man/BN_set_bit.3 stable/10/secure/lib/libcrypto/man/BN_swap.3 stable/10/secure/lib/libcrypto/man/BN_zero.3 stable/10/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/10/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/10/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/10/secure/lib/libcrypto/man/CMS_compress.3 stable/10/secure/lib/libcrypto/man/CMS_decrypt.3 stable/10/secure/lib/libcrypto/man/CMS_encrypt.3 stable/10/secure/lib/libcrypto/man/CMS_final.3 stable/10/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/10/secure/lib/libcrypto/man/CMS_get0_type.3 stable/10/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/10/secure/lib/libcrypto/man/CMS_sign.3 stable/10/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/10/secure/lib/libcrypto/man/CMS_uncompress.3 stable/10/secure/lib/libcrypto/man/CMS_verify.3 stable/10/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/10/secure/lib/libcrypto/man/CONF_modules_free.3 stable/10/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/10/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 stable/10/secure/lib/libcrypto/man/DH_generate_key.3 stable/10/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DH_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DH_new.3 stable/10/secure/lib/libcrypto/man/DH_set_method.3 stable/10/secure/lib/libcrypto/man/DH_size.3 stable/10/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/10/secure/lib/libcrypto/man/DSA_do_sign.3 stable/10/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/10/secure/lib/libcrypto/man/DSA_generate_key.3 stable/10/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/10/secure/lib/libcrypto/man/DSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/DSA_new.3 stable/10/secure/lib/libcrypto/man/DSA_set_method.3 stable/10/secure/lib/libcrypto/man/DSA_sign.3 stable/10/secure/lib/libcrypto/man/DSA_size.3 stable/10/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/10/secure/lib/libcrypto/man/ERR_clear_error.3 stable/10/secure/lib/libcrypto/man/ERR_error_string.3 stable/10/secure/lib/libcrypto/man/ERR_get_error.3 stable/10/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/10/secure/lib/libcrypto/man/ERR_load_strings.3 stable/10/secure/lib/libcrypto/man/ERR_print_errors.3 stable/10/secure/lib/libcrypto/man/ERR_put_error.3 stable/10/secure/lib/libcrypto/man/ERR_remove_state.3 stable/10/secure/lib/libcrypto/man/ERR_set_mark.3 stable/10/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/10/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/10/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/10/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/10/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/10/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/10/secure/lib/libcrypto/man/EVP_SealInit.3 stable/10/secure/lib/libcrypto/man/EVP_SignInit.3 stable/10/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/10/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/10/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/10/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/10/secure/lib/libcrypto/man/OPENSSL_config.3 stable/10/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/10/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/10/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/10/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/10/secure/lib/libcrypto/man/PKCS12_create.3 stable/10/secure/lib/libcrypto/man/PKCS12_parse.3 stable/10/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign.3 stable/10/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/10/secure/lib/libcrypto/man/PKCS7_verify.3 stable/10/secure/lib/libcrypto/man/RAND_add.3 stable/10/secure/lib/libcrypto/man/RAND_bytes.3 stable/10/secure/lib/libcrypto/man/RAND_cleanup.3 stable/10/secure/lib/libcrypto/man/RAND_egd.3 stable/10/secure/lib/libcrypto/man/RAND_load_file.3 stable/10/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/10/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/10/secure/lib/libcrypto/man/RSA_check_key.3 stable/10/secure/lib/libcrypto/man/RSA_generate_key.3 stable/10/secure/lib/libcrypto/man/RSA_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/RSA_new.3 stable/10/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/10/secure/lib/libcrypto/man/RSA_print.3 stable/10/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/10/secure/lib/libcrypto/man/RSA_set_method.3 stable/10/secure/lib/libcrypto/man/RSA_sign.3 stable/10/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/10/secure/lib/libcrypto/man/RSA_size.3 stable/10/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/10/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/10/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/10/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/10/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/10/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/10/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/10/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/10/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/10/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/10/secure/lib/libcrypto/man/X509_new.3 stable/10/secure/lib/libcrypto/man/X509_verify_cert.3 stable/10/secure/lib/libcrypto/man/bio.3 stable/10/secure/lib/libcrypto/man/blowfish.3 stable/10/secure/lib/libcrypto/man/bn.3 stable/10/secure/lib/libcrypto/man/bn_internal.3 stable/10/secure/lib/libcrypto/man/buffer.3 stable/10/secure/lib/libcrypto/man/crypto.3 stable/10/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 stable/10/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 stable/10/secure/lib/libcrypto/man/d2i_DHparams.3 stable/10/secure/lib/libcrypto/man/d2i_DSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_ECPrivateKey.3 stable/10/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 stable/10/secure/lib/libcrypto/man/d2i_RSAPublicKey.3 stable/10/secure/lib/libcrypto/man/d2i_X509.3 stable/10/secure/lib/libcrypto/man/d2i_X509_ALGOR.3 stable/10/secure/lib/libcrypto/man/d2i_X509_CRL.3 stable/10/secure/lib/libcrypto/man/d2i_X509_NAME.3 stable/10/secure/lib/libcrypto/man/d2i_X509_REQ.3 stable/10/secure/lib/libcrypto/man/d2i_X509_SIG.3 stable/10/secure/lib/libcrypto/man/des.3 stable/10/secure/lib/libcrypto/man/dh.3 stable/10/secure/lib/libcrypto/man/dsa.3 stable/10/secure/lib/libcrypto/man/ecdsa.3 stable/10/secure/lib/libcrypto/man/engine.3 stable/10/secure/lib/libcrypto/man/err.3 stable/10/secure/lib/libcrypto/man/evp.3 stable/10/secure/lib/libcrypto/man/hmac.3 stable/10/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/10/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/10/secure/lib/libcrypto/man/lh_stats.3 stable/10/secure/lib/libcrypto/man/lhash.3 stable/10/secure/lib/libcrypto/man/md5.3 stable/10/secure/lib/libcrypto/man/mdc2.3 stable/10/secure/lib/libcrypto/man/pem.3 stable/10/secure/lib/libcrypto/man/rand.3 stable/10/secure/lib/libcrypto/man/rc4.3 stable/10/secure/lib/libcrypto/man/ripemd.3 stable/10/secure/lib/libcrypto/man/rsa.3 stable/10/secure/lib/libcrypto/man/sha.3 stable/10/secure/lib/libcrypto/man/threads.3 stable/10/secure/lib/libcrypto/man/ui.3 stable/10/secure/lib/libcrypto/man/ui_compat.3 stable/10/secure/lib/libcrypto/man/x509.3 stable/10/secure/lib/libssl/Makefile.man stable/10/secure/lib/libssl/man/SSL_CIPHER_get_name.3 stable/10/secure/lib/libssl/man/SSL_COMP_add_compression_method.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 stable/10/secure/lib/libssl/man/SSL_CTX_add_session.3 stable/10/secure/lib/libssl/man/SSL_CTX_ctrl.3 stable/10/secure/lib/libssl/man/SSL_CTX_flush_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_free.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 stable/10/secure/lib/libssl/man/SSL_CTX_new.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_number.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 stable/10/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_sessions.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_store.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_info_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_options.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_timeout.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 stable/10/secure/lib/libssl/man/SSL_CTX_set_verify.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_certificate.3 stable/10/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 stable/10/secure/lib/libssl/man/SSL_SESSION_free.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_SESSION_get_time.3 stable/10/secure/lib/libssl/man/SSL_accept.3 stable/10/secure/lib/libssl/man/SSL_alert_type_string.3 stable/10/secure/lib/libssl/man/SSL_clear.3 stable/10/secure/lib/libssl/man/SSL_connect.3 stable/10/secure/lib/libssl/man/SSL_do_handshake.3 stable/10/secure/lib/libssl/man/SSL_free.3 stable/10/secure/lib/libssl/man/SSL_get_SSL_CTX.3 stable/10/secure/lib/libssl/man/SSL_get_ciphers.3 stable/10/secure/lib/libssl/man/SSL_get_client_CA_list.3 stable/10/secure/lib/libssl/man/SSL_get_current_cipher.3 stable/10/secure/lib/libssl/man/SSL_get_default_timeout.3 stable/10/secure/lib/libssl/man/SSL_get_error.3 stable/10/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 stable/10/secure/lib/libssl/man/SSL_get_ex_new_index.3 stable/10/secure/lib/libssl/man/SSL_get_fd.3 stable/10/secure/lib/libssl/man/SSL_get_peer_cert_chain.3 stable/10/secure/lib/libssl/man/SSL_get_peer_certificate.3 stable/10/secure/lib/libssl/man/SSL_get_psk_identity.3 stable/10/secure/lib/libssl/man/SSL_get_rbio.3 stable/10/secure/lib/libssl/man/SSL_get_session.3 stable/10/secure/lib/libssl/man/SSL_get_verify_result.3 stable/10/secure/lib/libssl/man/SSL_get_version.3 stable/10/secure/lib/libssl/man/SSL_library_init.3 stable/10/secure/lib/libssl/man/SSL_load_client_CA_file.3 stable/10/secure/lib/libssl/man/SSL_new.3 stable/10/secure/lib/libssl/man/SSL_pending.3 stable/10/secure/lib/libssl/man/SSL_read.3 stable/10/secure/lib/libssl/man/SSL_rstate_string.3 stable/10/secure/lib/libssl/man/SSL_session_reused.3 stable/10/secure/lib/libssl/man/SSL_set_bio.3 stable/10/secure/lib/libssl/man/SSL_set_connect_state.3 stable/10/secure/lib/libssl/man/SSL_set_fd.3 stable/10/secure/lib/libssl/man/SSL_set_session.3 stable/10/secure/lib/libssl/man/SSL_set_shutdown.3 stable/10/secure/lib/libssl/man/SSL_set_verify_result.3 stable/10/secure/lib/libssl/man/SSL_shutdown.3 stable/10/secure/lib/libssl/man/SSL_state_string.3 stable/10/secure/lib/libssl/man/SSL_want.3 stable/10/secure/lib/libssl/man/SSL_write.3 stable/10/secure/lib/libssl/man/d2i_SSL_SESSION.3 stable/10/secure/lib/libssl/man/ssl.3 stable/10/secure/usr.bin/openssl/man/CA.pl.1 stable/10/secure/usr.bin/openssl/man/asn1parse.1 stable/10/secure/usr.bin/openssl/man/c_rehash.1 stable/10/secure/usr.bin/openssl/man/ca.1 stable/10/secure/usr.bin/openssl/man/ciphers.1 stable/10/secure/usr.bin/openssl/man/cms.1 stable/10/secure/usr.bin/openssl/man/crl.1 stable/10/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/10/secure/usr.bin/openssl/man/dgst.1 stable/10/secure/usr.bin/openssl/man/dhparam.1 stable/10/secure/usr.bin/openssl/man/dsa.1 stable/10/secure/usr.bin/openssl/man/dsaparam.1 stable/10/secure/usr.bin/openssl/man/ec.1 stable/10/secure/usr.bin/openssl/man/ecparam.1 stable/10/secure/usr.bin/openssl/man/enc.1 stable/10/secure/usr.bin/openssl/man/errstr.1 stable/10/secure/usr.bin/openssl/man/gendsa.1 stable/10/secure/usr.bin/openssl/man/genpkey.1 stable/10/secure/usr.bin/openssl/man/genrsa.1 stable/10/secure/usr.bin/openssl/man/nseq.1 stable/10/secure/usr.bin/openssl/man/ocsp.1 stable/10/secure/usr.bin/openssl/man/openssl.1 stable/10/secure/usr.bin/openssl/man/passwd.1 stable/10/secure/usr.bin/openssl/man/pkcs12.1 stable/10/secure/usr.bin/openssl/man/pkcs7.1 stable/10/secure/usr.bin/openssl/man/pkcs8.1 stable/10/secure/usr.bin/openssl/man/pkey.1 stable/10/secure/usr.bin/openssl/man/pkeyparam.1 stable/10/secure/usr.bin/openssl/man/pkeyutl.1 stable/10/secure/usr.bin/openssl/man/rand.1 stable/10/secure/usr.bin/openssl/man/req.1 stable/10/secure/usr.bin/openssl/man/rsa.1 stable/10/secure/usr.bin/openssl/man/rsautl.1 stable/10/secure/usr.bin/openssl/man/s_client.1 stable/10/secure/usr.bin/openssl/man/s_server.1 stable/10/secure/usr.bin/openssl/man/s_time.1 stable/10/secure/usr.bin/openssl/man/sess_id.1 stable/10/secure/usr.bin/openssl/man/smime.1 stable/10/secure/usr.bin/openssl/man/speed.1 stable/10/secure/usr.bin/openssl/man/spkac.1 stable/10/secure/usr.bin/openssl/man/ts.1 stable/10/secure/usr.bin/openssl/man/tsget.1 stable/10/secure/usr.bin/openssl/man/verify.1 stable/10/secure/usr.bin/openssl/man/version.1 stable/10/secure/usr.bin/openssl/man/x509.1 stable/10/secure/usr.bin/openssl/man/x509v3_config.1 Modified: stable/10/crypto/openssl/ACKNOWLEDGMENTS ============================================================================== --- stable/10/crypto/openssl/ACKNOWLEDGMENTS Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/ACKNOWLEDGMENTS Thu Jan 28 21:42:10 2016 (r295016) @@ -1,30 +1,2 @@ -The OpenSSL project depends on volunteer efforts and financial support from -the end user community. That support comes in the form of donations and paid -sponsorships, software support contracts, paid consulting services -and commissioned software development. - -Since all these activities support the continued development and improvement -of OpenSSL we consider all these clients and customers as sponsors of the -OpenSSL project. - -We would like to identify and thank the following such sponsors for their past -or current significant support of the OpenSSL project: - -Major support: - - Qualys http://www.qualys.com/ - -Very significant support: - - OpenGear: http://www.opengear.com/ - -Significant support: - - PSW Group: http://www.psw.net/ - Acano Ltd. http://acano.com/ - -Please note that we ask permission to identify sponsors and that some sponsors -we consider eligible for inclusion here have requested to remain anonymous. - -Additional sponsorship or financial support is always welcome: for more -information please contact the OpenSSL Software Foundation. +Please https://www.openssl.org/community/thanks.html for the current +acknowledgements. Modified: stable/10/crypto/openssl/CHANGES ============================================================================== --- stable/10/crypto/openssl/CHANGES Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/CHANGES Thu Jan 28 21:42:10 2016 (r295016) @@ -2,6 +2,30 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1q and 1.0.1r [28 Jan 2016] + + *) Protection for DH small subgroup attacks + + As a precautionary measure the SSL_OP_SINGLE_DH_USE option has been + switched on by default and cannot be disabled. This could have some + performance impact. + [Matt Caswell] + + *) SSLv2 doesn't block disabled ciphers + + A malicious client can negotiate SSLv2 ciphers that have been disabled on + the server and complete SSLv2 handshakes even if all SSLv2 ciphers have + been disabled, provided that the SSLv2 protocol was not also disabled via + SSL_OP_NO_SSLv2. + + This issue was reported to OpenSSL on 26th December 2015 by Nimrod Aviram + and Sebastian Schinzel. + (CVE-2015-3197) + [Viktor Dukhovni] + + *) Reject DH handshakes with parameters shorter than 1024 bits. + [Kurt Roeckx] + Changes between 1.0.1p and 1.0.1q [3 Dec 2015] *) Certificate verify crash with missing PSS parameter Modified: stable/10/crypto/openssl/Configure ============================================================================== --- stable/10/crypto/openssl/Configure Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/Configure Thu Jan 28 21:42:10 2016 (r295016) @@ -105,6 +105,9 @@ my $usage="Usage: Configure [no- my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED"; +# Warn that "make depend" should be run? +my $warn_make_depend = 0; + my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments"; my $strict_warnings = 0; @@ -1446,7 +1449,7 @@ if ($target =~ /\-icc$/) # Intel C compi # linker only when --prefix is not /usr. if ($target =~ /^BSD\-/) { - $shared_ldflag.=" -Wl,-rpath,\$(LIBRPATH)" if ($prefix !~ m|^/usr[/]*$|); + $shared_ldflag.=" -Wl,-rpath,\$\$(LIBRPATH)" if ($prefix !~ m|^/usr[/]*$|); } if ($sys_id ne "") @@ -1953,14 +1956,8 @@ EOF &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s'); } if ($depflags ne $default_depflags && !$make_depend) { - print < (note that your message will be recorded in the request tracker publicly readable - via http://www.openssl.org/support/rt.html and will be forwarded to a - public mailing list). Include the output of "make report" in your message. - Please check out the request tracker. Maybe the bug was already - reported or has already been fixed. + at https://www.openssl.org/community/index.html#bugs and will be + forwarded to a public mailing list). Include the output of "make + report" in your message. Please check out the request tracker. Maybe + the bug was already reported or has already been fixed. [If you encounter assembler error messages, try the "no-asm" configuration option as an immediate fix.] Modified: stable/10/crypto/openssl/LICENSE ============================================================================== --- stable/10/crypto/openssl/LICENSE Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/LICENSE Thu Jan 28 21:42:10 2016 (r295016) @@ -12,7 +12,7 @@ --------------- /* ==================================================================== - * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2016 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: stable/10/crypto/openssl/Makefile ============================================================================== --- stable/10/crypto/openssl/Makefile Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/Makefile Thu Jan 28 21:42:10 2016 (r295016) @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1q +VERSION=1.0.1r MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 @@ -181,8 +181,7 @@ SHARED_LDFLAGS= GENERAL= Makefile BASENAME= openssl NAME= $(BASENAME)-$(VERSION) -TARFILE= $(NAME).tar -WTARFILE= $(NAME)-win.tar +TARFILE= ../$(NAME).tar EXHEADER= e_os2.h HEADER= e_os.h @@ -501,38 +500,35 @@ TABLE: Configure # would occur. Therefore the list of files is temporarily stored into a file # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # tar does not support the --files-from option. -TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \ - --owner openssl:0 --group openssl:0 \ - --transform 's|^|openssl-$(VERSION)/|' \ +TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \ + --owner 0 --group 0 \ + --transform 's|^|$(NAME)/|' \ -cvf - -../$(TARFILE).list: +$(TARFILE).list: find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \ \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \ - \! -name '*test' \! -name '.#*' \! -name '*~' \ - | sort > ../$(TARFILE).list + \( \! -name '*test' -o -name bctest -o -name pod2mantest \) \ + \! -name '.#*' \! -name '*~' \! -type l \ + | sort > $(TARFILE).list -tar: ../$(TARFILE).list +tar: $(TARFILE).list find . -type d -print | xargs chmod 755 find . -type f -print | xargs chmod a+r find . -type f -perm -0100 -print | xargs chmod a+x - $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz - rm -f ../$(TARFILE).list - ls -l ../$(TARFILE).gz - -tar-snap: ../$(TARFILE).list - $(TAR_COMMAND) > ../$(TARFILE) - rm -f ../$(TARFILE).list - ls -l ../$(TARFILE) + $(TAR_COMMAND) | gzip --best > $(TARFILE).gz + rm -f $(TARFILE).list + ls -l $(TARFILE).gz + +tar-snap: $(TARFILE).list + $(TAR_COMMAND) > $(TARFILE) + rm -f $(TARFILE).list + ls -l $(TARFILE) dist: $(PERL) Configure dist - @$(MAKE) dist_pem_h @$(MAKE) SDIRS='$(SDIRS)' clean - @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar - -dist_pem_h: - (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) + @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar install: all install_docs install_sw Modified: stable/10/crypto/openssl/Makefile.org ============================================================================== --- stable/10/crypto/openssl/Makefile.org Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/Makefile.org Thu Jan 28 21:42:10 2016 (r295016) @@ -179,8 +179,7 @@ SHARED_LDFLAGS= GENERAL= Makefile BASENAME= openssl NAME= $(BASENAME)-$(VERSION) -TARFILE= $(NAME).tar -WTARFILE= $(NAME)-win.tar +TARFILE= ../$(NAME).tar EXHEADER= e_os2.h HEADER= e_os.h @@ -499,38 +498,35 @@ TABLE: Configure # would occur. Therefore the list of files is temporarily stored into a file # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # tar does not support the --files-from option. -TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \ - --owner openssl:0 --group openssl:0 \ - --transform 's|^|openssl-$(VERSION)/|' \ +TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \ + --owner 0 --group 0 \ + --transform 's|^|$(NAME)/|' \ -cvf - -../$(TARFILE).list: +$(TARFILE).list: find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \ \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \ - \! -name '*test' \! -name '.#*' \! -name '*~' \ - | sort > ../$(TARFILE).list + \( \! -name '*test' -o -name bctest -o -name pod2mantest \) \ + \! -name '.#*' \! -name '*~' \! -type l \ + | sort > $(TARFILE).list -tar: ../$(TARFILE).list +tar: $(TARFILE).list find . -type d -print | xargs chmod 755 find . -type f -print | xargs chmod a+r find . -type f -perm -0100 -print | xargs chmod a+x - $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz - rm -f ../$(TARFILE).list - ls -l ../$(TARFILE).gz - -tar-snap: ../$(TARFILE).list - $(TAR_COMMAND) > ../$(TARFILE) - rm -f ../$(TARFILE).list - ls -l ../$(TARFILE) + $(TAR_COMMAND) | gzip --best > $(TARFILE).gz + rm -f $(TARFILE).list + ls -l $(TARFILE).gz + +tar-snap: $(TARFILE).list + $(TAR_COMMAND) > $(TARFILE) + rm -f $(TARFILE).list + ls -l $(TARFILE) dist: $(PERL) Configure dist - @$(MAKE) dist_pem_h @$(MAKE) SDIRS='$(SDIRS)' clean - @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar - -dist_pem_h: - (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) + @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar install: all install_docs install_sw Modified: stable/10/crypto/openssl/NEWS ============================================================================== --- stable/10/crypto/openssl/NEWS Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/NEWS Thu Jan 28 21:42:10 2016 (r295016) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.1q and OpenSSL 1.0.1r [28 Jan 2016] + + o Protection for DH small subgroup attacks + o SSLv2 doesn't block disabled ciphers (CVE-2015-3197) + Major changes between OpenSSL 1.0.1p and OpenSSL 1.0.1q [3 Dec 2015] o Certificate verify crash with missing PSS parameter (CVE-2015-3194) Modified: stable/10/crypto/openssl/README ============================================================================== --- stable/10/crypto/openssl/README Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/README Thu Jan 28 21:42:10 2016 (r295016) @@ -1,5 +1,5 @@ - OpenSSL 1.0.1q 3 Dec 2015 + OpenSSL 1.0.1r 28 Jan 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson @@ -90,11 +90,12 @@ In order to avoid spam, this is a moderated mailing list, and it might take a day for the ticket to show up. (We also scan posts to make sure - that security disclosures aren't publically posted by mistake.) Mail to - this address is recorded in the public RT (request tracker) database (see - https://www.openssl.org/support/rt.html for details) and also forwarded - the public openssl-dev mailing list. Confidential mail may be sent to - openssl-security@openssl.org (PGP key available from the key servers). + that security disclosures aren't publically posted by mistake.) Mail + to this address is recorded in the public RT (request tracker) database + (see https://www.openssl.org/community/index.html#bugs for details) and + also forwarded the public openssl-dev mailing list. Confidential mail + may be sent to openssl-security@openssl.org (PGP key available from the + key servers). Please do NOT use this for general assistance or support queries. Just because something doesn't work the way you expect does not mean it Modified: stable/10/crypto/openssl/apps/engine.c ============================================================================== --- stable/10/crypto/openssl/apps/engine.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/apps/engine.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* apps/engine.c -*- mode: C; c-file-style: "eay" -*- */ +/* apps/engine.c */ /* * Written by Richard Levitte for the OpenSSL project * 2000. Modified: stable/10/crypto/openssl/apps/ocsp.c ============================================================================== --- stable/10/crypto/openssl/apps/ocsp.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/apps/ocsp.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1003,7 +1003,7 @@ static int make_ocsp_response(OCSP_RESPO bs = OCSP_BASICRESP_new(); thisupd = X509_gmtime_adj(NULL, 0); if (ndays != -1) - nextupd = X509_gmtime_adj(NULL, nmin * 60 + ndays * 3600 * 24); + nextupd = X509_time_adj_ex(NULL, ndays, nmin * 60, NULL); /* Examine each certificate id in the request */ for (i = 0; i < id_count; i++) { Modified: stable/10/crypto/openssl/apps/pkcs12.c ============================================================================== --- stable/10/crypto/openssl/apps/pkcs12.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/apps/pkcs12.c Thu Jan 28 21:42:10 2016 (r295016) @@ -79,7 +79,8 @@ const EVP_CIPHER *enc; # define CLCERTS 0x8 # define CACERTS 0x10 -int get_cert_chain(X509 *cert, X509_STORE *store, STACK_OF(X509) **chain); +static int get_cert_chain(X509 *cert, X509_STORE *store, + STACK_OF(X509) **chain); int dump_certs_keys_p12(BIO *out, PKCS12 *p12, char *pass, int passlen, int options, char *pempass); int dump_certs_pkeys_bags(BIO *out, STACK_OF(PKCS12_SAFEBAG) *bags, @@ -594,7 +595,7 @@ int MAIN(int argc, char **argv) vret = get_cert_chain(ucert, store, &chain2); X509_STORE_free(store); - if (!vret) { + if (vret == X509_V_OK) { /* Exclude verified certificate */ for (i = 1; i < sk_X509_num(chain2); i++) sk_X509_push(certs, sk_X509_value(chain2, i)); @@ -602,7 +603,7 @@ int MAIN(int argc, char **argv) X509_free(sk_X509_value(chain2, 0)); sk_X509_free(chain2); } else { - if (vret >= 0) + if (vret != X509_V_ERR_UNSPECIFIED) BIO_printf(bio_err, "Error %s getting chain.\n", X509_verify_cert_error_string(vret)); else @@ -906,36 +907,25 @@ int dump_certs_pkeys_bag(BIO *out, PKCS1 /* Given a single certificate return a verified chain or NULL if error */ -/* Hope this is OK .... */ - -int get_cert_chain(X509 *cert, X509_STORE *store, STACK_OF(X509) **chain) +static int get_cert_chain(X509 *cert, X509_STORE *store, + STACK_OF(X509) **chain) { X509_STORE_CTX store_ctx; - STACK_OF(X509) *chn; + STACK_OF(X509) *chn = NULL; int i = 0; - /* - * FIXME: Should really check the return status of X509_STORE_CTX_init - * for an error, but how that fits into the return value of this function - * is less obvious. - */ - X509_STORE_CTX_init(&store_ctx, store, cert, NULL); - if (X509_verify_cert(&store_ctx) <= 0) { - i = X509_STORE_CTX_get_error(&store_ctx); - if (i == 0) - /* - * avoid returning 0 if X509_verify_cert() did not set an - * appropriate error value in the context - */ - i = -1; - chn = NULL; - goto err; - } else + if (!X509_STORE_CTX_init(&store_ctx, store, cert, NULL)) { + *chain = NULL; + return X509_V_ERR_UNSPECIFIED; + } + + if (X509_verify_cert(&store_ctx) > 0) chn = X509_STORE_CTX_get1_chain(&store_ctx); - err: + else if ((i = X509_STORE_CTX_get_error(&store_ctx)) == 0) + i = X509_V_ERR_UNSPECIFIED; + X509_STORE_CTX_cleanup(&store_ctx); *chain = chn; - return i; } Modified: stable/10/crypto/openssl/apps/speed.c ============================================================================== --- stable/10/crypto/openssl/apps/speed.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/apps/speed.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* apps/speed.c -*- mode:C; c-file-style: "eay" -*- */ +/* apps/speed.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * Modified: stable/10/crypto/openssl/apps/x509.c ============================================================================== --- stable/10/crypto/openssl/apps/x509.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/apps/x509.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1170,12 +1170,7 @@ static int sign(X509 *x, EVP_PKEY *pkey, if (X509_gmtime_adj(X509_get_notBefore(x), 0) == NULL) goto err; - /* Lets just make it 12:00am GMT, Jan 1 1970 */ - /* memcpy(x->cert_info->validity->notBefore,"700101120000Z",13); */ - /* 28 days to be certified */ - - if (X509_gmtime_adj(X509_get_notAfter(x), (long)60 * 60 * 24 * days) == - NULL) + if (X509_time_adj_ex(X509_get_notAfter(x), days, 0, NULL) == NULL) goto err; if (!X509_set_pubkey(x, pkey)) Modified: stable/10/crypto/openssl/crypto/aes/aes.h ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes.h Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes.h Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes.h */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/aes/aes_cbc.c ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_cbc.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_cbc.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_cbc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_cbc.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/aes/aes_cfb.c ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_cfb.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_cfb.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_cfb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_cfb.c */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/aes/aes_core.c ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_core.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_core.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_core.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_core.c */ /** * rijndael-alg-fst.c * Modified: stable/10/crypto/openssl/crypto/aes/aes_ctr.c ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_ctr.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_ctr.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ctr.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ctr.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/aes/aes_ecb.c ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_ecb.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_ecb.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ecb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ecb.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/aes/aes_ige.c ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_ige.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_ige.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ige.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ige.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/aes/aes_locl.h ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_locl.h Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_locl.h Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes.h */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/aes/aes_misc.c ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_misc.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_misc.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_misc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_misc.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/aes/aes_ofb.c ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_ofb.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_ofb.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ofb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ofb.c */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/aes/aes_x86core.c ============================================================================== --- stable/10/crypto/openssl/crypto/aes/aes_x86core.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/aes/aes_x86core.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/aes/aes_core.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_core.c */ /** * rijndael-alg-fst.c * Modified: stable/10/crypto/openssl/crypto/bio/bio.h ============================================================================== --- stable/10/crypto/openssl/crypto/bio/bio.h Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/bio/bio.h Thu Jan 28 21:42:10 2016 (r295016) @@ -478,11 +478,11 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) # define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) # define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) -# define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0) +# define BIO_get_conn_int_port(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,0,NULL) # define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) -/* BIO_s_accept_socket() */ +/* BIO_s_accept() */ # define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) # define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) /* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ @@ -495,6 +495,7 @@ struct bio_dgram_sctp_prinfo { # define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) # define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) +/* BIO_s_accept() and BIO_s_connect() */ # define BIO_do_connect(b) BIO_do_handshake(b) # define BIO_do_accept(b) BIO_do_handshake(b) # define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) @@ -514,12 +515,15 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url)) # define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL) +/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */ # define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) # define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) +/* BIO_s_file() */ # define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) # define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) +/* BIO_s_fd() and BIO_s_file() */ # define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) # define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) Modified: stable/10/crypto/openssl/crypto/bio/bss_bio.c ============================================================================== --- stable/10/crypto/openssl/crypto/bio/bss_bio.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/bio/bss_bio.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/bio/bss_bio.c -*- Mode: C; c-file-style: "eay" -*- */ +/* crypto/bio/bss_bio.c */ /* ==================================================================== * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/bio/bss_conn.c ============================================================================== --- stable/10/crypto/openssl/crypto/bio/bss_conn.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/bio/bss_conn.c Thu Jan 28 21:42:10 2016 (r295016) @@ -419,7 +419,7 @@ static long conn_ctrl(BIO *b, int cmd, l { BIO *dbio; int *ip; - const char **pptr; + const char **pptr = NULL; long ret = 1; BIO_CONNECT *data; @@ -442,19 +442,28 @@ static long conn_ctrl(BIO *b, int cmd, l case BIO_C_GET_CONNECT: if (ptr != NULL) { pptr = (const char **)ptr; - if (num == 0) { - *pptr = data->param_hostname; + } - } else if (num == 1) { - *pptr = data->param_port; - } else if (num == 2) { - *pptr = (char *)&(data->ip[0]); - } else if (num == 3) { - *((int *)ptr) = data->port; + if (b->init) { + if (pptr != NULL) { + ret = 1; + if (num == 0) { + *pptr = data->param_hostname; + } else if (num == 1) { + *pptr = data->param_port; + } else if (num == 2) { + *pptr = (char *)&(data->ip[0]); + } else { + ret = 0; + } + } + if (num == 3) { + ret = data->port; } - if ((!b->init) || (ptr == NULL)) + } else { + if (pptr != NULL) *pptr = "not initialized"; - ret = 1; + ret = 0; } break; case BIO_C_SET_CONNECT: Modified: stable/10/crypto/openssl/crypto/bio/bss_dgram.c ============================================================================== --- stable/10/crypto/openssl/crypto/bio/bss_dgram.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/bio/bss_dgram.c Thu Jan 28 21:42:10 2016 (r295016) @@ -515,10 +515,8 @@ static long dgram_ctrl(BIO *b, int cmd, switch (cmd) { case BIO_CTRL_RESET: num = 0; - case BIO_C_FILE_SEEK: ret = 0; break; - case BIO_C_FILE_TELL: case BIO_CTRL_INFO: ret = 0; break; Modified: stable/10/crypto/openssl/crypto/bn/bn_exp.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/bn_exp.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/bn/bn_exp.c Thu Jan 28 21:42:10 2016 (r295016) @@ -271,9 +271,14 @@ int BN_mod_exp_recp(BIGNUM *r, const BIG } bits = BN_num_bits(p); - if (bits == 0) { - ret = BN_one(r); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(r); + } else { + ret = BN_one(r); + } return ret; } @@ -407,7 +412,13 @@ int BN_mod_exp_mont(BIGNUM *rr, const BI } bits = BN_num_bits(p); if (bits == 0) { - ret = BN_one(rr); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(rr); + } else { + ret = BN_one(rr); + } return ret; } @@ -579,7 +590,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBU * precomputation memory layout to limit data-dependency to a minimum to * protect secret exponents (cf. the hyper-threading timing attacks pointed * out by Colin Percival, - * http://www.daemong-consideredperthreading-considered-harmful/) + * http://www.daemonology.net/hyperthreading-considered-harmful/) */ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, @@ -608,7 +619,13 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr bits = BN_num_bits(p); if (bits == 0) { - ret = BN_one(rr); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(rr); + } else { + ret = BN_one(rr); + } return ret; } @@ -908,8 +925,9 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ if (BN_is_one(m)) { ret = 1; BN_zero(rr); - } else + } else { ret = BN_one(rr); + } return ret; } if (a == 0) { @@ -1023,9 +1041,14 @@ int BN_mod_exp_simple(BIGNUM *r, const B } bits = BN_num_bits(p); - - if (bits == 0) { - ret = BN_one(r); + if (bits == 0) { + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(r); + } else { + ret = BN_one(r); + } return ret; } Modified: stable/10/crypto/openssl/crypto/bn/exptest.c ============================================================================== --- stable/10/crypto/openssl/crypto/bn/exptest.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/bn/exptest.c Thu Jan 28 21:42:10 2016 (r295016) @@ -73,14 +73,34 @@ static const char rnd_seed[] = "string to make the random number generator think it has entropy"; /* + * Test that r == 0 in test_exp_mod_zero(). Returns one on success, + * returns zero and prints debug output otherwise. + */ +static int a_is_zero_mod_one(const char *method, const BIGNUM *r, + const BIGNUM *a) { + if (!BN_is_zero(r)) { + fprintf(stderr, "%s failed:\n", method); + fprintf(stderr, "a ** 0 mod 1 = r (should be 0)\n"); + fprintf(stderr, "a = "); + BN_print_fp(stderr, a); + fprintf(stderr, "\nr = "); + BN_print_fp(stderr, r); + fprintf(stderr, "\n"); + return 0; + } + return 1; +} + +/* * test_exp_mod_zero tests that x**0 mod 1 == 0. It returns zero on success. */ static int test_exp_mod_zero() { BIGNUM a, p, m; BIGNUM r; + BN_ULONG one_word = 1; BN_CTX *ctx = BN_CTX_new(); - int ret = 1; + int ret = 1, failed = 0; BN_init(&m); BN_one(&m); @@ -92,21 +112,65 @@ static int test_exp_mod_zero() BN_zero(&p); BN_init(&r); - BN_mod_exp(&r, &a, &p, &m, ctx); - BN_CTX_free(ctx); - if (BN_is_zero(&r)) - ret = 0; - else { - printf("1**0 mod 1 = "); - BN_print_fp(stdout, &r); - printf(", should be 0\n"); + if (!BN_rand(&a, 1024, 0, 0)) + goto err; + + if (!BN_mod_exp(&r, &a, &p, &m, ctx)) + goto err; + + if (!a_is_zero_mod_one("BN_mod_exp", &r, &a)) + failed = 1; + + if (!BN_mod_exp_recp(&r, &a, &p, &m, ctx)) + goto err; + + if (!a_is_zero_mod_one("BN_mod_exp_recp", &r, &a)) + failed = 1; + + if (!BN_mod_exp_simple(&r, &a, &p, &m, ctx)) + goto err; + + if (!a_is_zero_mod_one("BN_mod_exp_simple", &r, &a)) + failed = 1; + + if (!BN_mod_exp_mont(&r, &a, &p, &m, ctx, NULL)) + goto err; + + if (!a_is_zero_mod_one("BN_mod_exp_mont", &r, &a)) + failed = 1; + + if (!BN_mod_exp_mont_consttime(&r, &a, &p, &m, ctx, NULL)) { + goto err; + } + + if (!a_is_zero_mod_one("BN_mod_exp_mont_consttime", &r, &a)) + failed = 1; + + /* + * A different codepath exists for single word multiplication + * in non-constant-time only. + */ + if (!BN_mod_exp_mont_word(&r, one_word, &p, &m, ctx, NULL)) + goto err; + + if (!BN_is_zero(&r)) { + fprintf(stderr, "BN_mod_exp_mont_word failed:\n"); + fprintf(stderr, "1 ** 0 mod 1 = r (should be 0)\n"); + fprintf(stderr, "r = "); + BN_print_fp(stderr, &r); + fprintf(stderr, "\n"); + return 0; } + ret = failed; + + err: BN_free(&r); BN_free(&a); BN_free(&p); BN_free(&m); + BN_CTX_free(ctx); return ret; } Modified: stable/10/crypto/openssl/crypto/camellia/camellia.c ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/camellia.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/camellia.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia.c */ /* ==================================================================== * Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) . * ALL RIGHTS RESERVED. @@ -67,7 +67,7 @@ /* * Algorithm Specification - * http://info.isl.llia/specicrypt/eng/camellia/specifications.html + * http://info.isl.ntt.co.jp/crypt/eng/camellia/specifications.html */ /* Modified: stable/10/crypto/openssl/crypto/camellia/camellia.h ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/camellia.h Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/camellia.h Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia.h */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/camellia/cmll_cbc.c ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/cmll_cbc.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/cmll_cbc.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_cbc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_cbc.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/camellia/cmll_cfb.c ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/cmll_cfb.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/cmll_cfb.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_cfb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_cfb.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/camellia/cmll_ctr.c ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/cmll_ctr.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/cmll_ctr.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_ctr.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_ctr.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/camellia/cmll_ecb.c ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/cmll_ecb.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/cmll_ecb.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_ecb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_ecb.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/camellia/cmll_locl.h ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/cmll_locl.h Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/cmll_locl.h Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_locl.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_locl.h */ /* ==================================================================== * Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) . * ALL RIGHTS RESERVED. Modified: stable/10/crypto/openssl/crypto/camellia/cmll_misc.c ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/cmll_misc.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/cmll_misc.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_misc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_misc.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/camellia/cmll_ofb.c ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/cmll_ofb.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/cmll_ofb.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_ofb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_ofb.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/camellia/cmll_utl.c ============================================================================== --- stable/10/crypto/openssl/crypto/camellia/cmll_utl.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/camellia/cmll_utl.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/camellia/cmll_utl.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/cmll_utl.c */ /* ==================================================================== * Copyright (c) 2011 The OpenSSL Project. All rights reserved. * Modified: stable/10/crypto/openssl/crypto/des/des_old.c ============================================================================== --- stable/10/crypto/openssl/crypto/des/des_old.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/des/des_old.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/des/des_old.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/des/des_old.c */ /*- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING Modified: stable/10/crypto/openssl/crypto/des/des_old.h ============================================================================== --- stable/10/crypto/openssl/crypto/des/des_old.h Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/des/des_old.h Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/des/des_old.h */ /*- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING Modified: stable/10/crypto/openssl/crypto/des/des_old2.c ============================================================================== --- stable/10/crypto/openssl/crypto/des/des_old2.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/des/des_old2.c Thu Jan 28 21:42:10 2016 (r295016) @@ -1,4 +1,4 @@ -/* crypto/des/des_old.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/des/des_old.c */ /* * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING The Modified: stable/10/crypto/openssl/crypto/dsa/dsa_ossl.c ============================================================================== --- stable/10/crypto/openssl/crypto/dsa/dsa_ossl.c Thu Jan 28 21:30:49 2016 (r295015) +++ stable/10/crypto/openssl/crypto/dsa/dsa_ossl.c Thu Jan 28 21:42:10 2016 (r295016) @@ -187,9 +187,6 @@ static DSA_SIG *dsa_do_sign(const unsign if (!BN_mod_mul(s, s, kinv, dsa->q, ctx)) goto err; - ret = DSA_SIG_new(); - if (ret == NULL) - goto err; /* * Redo if r or s is zero as required by FIPS 186-3: this is very * unlikely. @@ -201,11 +198,14 @@ static DSA_SIG *dsa_do_sign(const unsign } goto redo; } + ret = DSA_SIG_new(); + if (ret == NULL) + goto err; ret->r = r; ret->s = s; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Jan 28 22:08:43 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6AF5A7041C; Thu, 28 Jan 2016 22:08:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8101DB2; Thu, 28 Jan 2016 22:08:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SM8gRE035156; Thu, 28 Jan 2016 22:08:42 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SM8gv9035154; Thu, 28 Jan 2016 22:08:42 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601282208.u0SM8gv9035154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 28 Jan 2016 22:08: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: r295018 - stable/10/share/man/man4 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.20 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: Thu, 28 Jan 2016 22:08:43 -0000 Author: brooks Date: Thu Jan 28 22:08:42 2016 New Revision: 295018 URL: https://svnweb.freebsd.org/changeset/base/295018 Log: MFC r294452: Add a simple manpage for the cfi(4) and associated cfid(4) drivers. Sponsored by: DARPA, AFRL Added: stable/10/share/man/man4/cfi.4 - copied unchanged from r294452, head/share/man/man4/cfi.4 Modified: stable/10/share/man/man4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Thu Jan 28 21:45:25 2016 (r295017) +++ stable/10/share/man/man4/Makefile Thu Jan 28 22:08:42 2016 (r295018) @@ -94,6 +94,7 @@ MAN= aac.4 \ ${_ccd.4} \ cd.4 \ cdce.4 \ + cfi.4 \ ch.4 \ ciss.4 \ cm.4 \ @@ -575,6 +576,7 @@ MLINKS+=bwn.4 if_bwn.4 MLINKS+=${_bxe.4} ${_if_bxe.4} MLINKS+=cas.4 if_cas.4 MLINKS+=cdce.4 if_cdce.4 +MLINKS+=cfi.4 cfid.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=cxgb.4 if_cxgb.4 Copied: stable/10/share/man/man4/cfi.4 (from r294452, head/share/man/man4/cfi.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/cfi.4 Thu Jan 28 22:08:42 2016 (r295018, copy of r294452, head/share/man/man4/cfi.4) @@ -0,0 +1,94 @@ +.\"- +.\" Copyright (c) 2015-2016 SRI International +.\" All rights reserved. +.\" +.\" This software was developed by SRI International and the University of +.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) +.\" ("CTSRD"), as part of the DARPA CRASH research programme. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 20, 2016 +.Dt CFI 4 +.Os +.Sh NAME +.Nm cfi , +.Nm cfid +.Nd driver for Common Flash Interface (CFI) NOR flash +.Sh SYNOPSIS +.Cd "device cfi" +.Cd "device cfid" +.Cd "options CFI_SUPPORT_STRATAFLASH" +.Cd "options CFI_ARMEDANDDANGEROUS" +.Pp +In +.Pa /boot/device.hints : +.Cd hint.cfi.0.at="nexus0" +.Cd hint.cfi.0.maddr=0x74000000 +.Cd hint.cfi.0.msize=0x4000000 +.Pp +In DTS file: +.Cd flash@74000000 { +.Cd " compatible =" Qo cfi-flash Qc ; +.Cd " reg = <0x74000000 0x4000000>;" +.Cd }; +.Sh DESCRIPTION +The +.Nm +device driver provides a management interface to NOR flash devices supporting +the Common Flash Interface (CFI) specification. +Its companion device +.Nm cfid +provides a +.Xr geom 4 +disk interface to the device. +.Pp +Special support for features of the Intel StrataFlash line are available +with the +.Cd CFI_SUPPORT_STRATAFLASH +kernel option. +Additional support for write-once bits to switch part of Intel StrataFlash +devices to read-only can be enabled by the +.Cd CFI_ARMEDANDDANGEROUS +kernel option. +.El +.Sh SEE ALSO +.Xr led 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 8.0 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Juniper Networks +with StrataFlash support by +.An Sam Leffler . +This manual page was written by SRI International and the University of +Cambridge Computer Laboratory under DARPA/AFRL contract +.Pq FA8750-10-C-0237 +.Pq Do CTSRD Dc , +as part of the DARPA CRASH research programme. From owner-svn-src-stable-10@freebsd.org Thu Jan 28 22:34:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4CF7A712EA; Thu, 28 Jan 2016 22:34:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91AA812A7; Thu, 28 Jan 2016 22:34:30 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SMYTdW044141; Thu, 28 Jan 2016 22:34:29 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SMYT5Y044140; Thu, 28 Jan 2016 22:34:29 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601282234.u0SMYT5Y044140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 28 Jan 2016 22:34:29 +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: r295019 - stable/10/sys/mips/include 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.20 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: Thu, 28 Jan 2016 22:34:30 -0000 Author: brooks Date: Thu Jan 28 22:34:29 2016 New Revision: 295019 URL: https://svnweb.freebsd.org/changeset/base/295019 Log: MFC r294463: Shift saved floating point registers up in jmp_buf. sigmask_t is 128-bits so requires two slots. Obtained from: CheriBSD (93699cb9b6e73980ac369e379cea9772c9494ccc) Sponsored by: DARPA, AFRL Modified: stable/10/sys/mips/include/asm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/mips/include/asm.h ============================================================================== --- stable/10/sys/mips/include/asm.h Thu Jan 28 22:08:42 2016 (r295018) +++ stable/10/sys/mips/include/asm.h Thu Jan 28 22:34:29 2016 (r295019) @@ -706,20 +706,21 @@ _C_LABEL(x): /* Only valid with the _JB_MAGIC_SETJMP magic */ #define _JB_SIGMASK 13 +#define __JB_SIGMASK_REMAINDER 14 /* sigmask_t is 128-bits */ -#define _JB_FPREG_F20 14 -#define _JB_FPREG_F21 15 -#define _JB_FPREG_F22 16 -#define _JB_FPREG_F23 17 -#define _JB_FPREG_F24 18 -#define _JB_FPREG_F25 19 -#define _JB_FPREG_F26 20 -#define _JB_FPREG_F27 21 -#define _JB_FPREG_F28 22 -#define _JB_FPREG_F29 23 -#define _JB_FPREG_F30 24 -#define _JB_FPREG_F31 25 -#define _JB_FPREG_FCSR 26 +#define _JB_FPREG_F20 15 +#define _JB_FPREG_F21 16 +#define _JB_FPREG_F22 17 +#define _JB_FPREG_F23 18 +#define _JB_FPREG_F24 19 +#define _JB_FPREG_F25 20 +#define _JB_FPREG_F26 21 +#define _JB_FPREG_F27 22 +#define _JB_FPREG_F28 23 +#define _JB_FPREG_F29 24 +#define _JB_FPREG_F30 25 +#define _JB_FPREG_F31 26 +#define _JB_FPREG_FCSR 27 /* * Various macros for dealing with TLB hazards From owner-svn-src-stable-10@freebsd.org Thu Jan 28 22:57:11 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8792FA71FBA; Thu, 28 Jan 2016 22:57:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B2A9613; Thu, 28 Jan 2016 22:57:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0SMvAM3051003; Thu, 28 Jan 2016 22:57:10 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0SMvAhg051002; Thu, 28 Jan 2016 22:57:10 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201601282257.u0SMvAhg051002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 28 Jan 2016 22:57:10 +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: r295020 - stable/10/lib/libc/mips 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.20 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: Thu, 28 Jan 2016 22:57:11 -0000 Author: brooks Date: Thu Jan 28 22:57:09 2016 New Revision: 295020 URL: https://svnweb.freebsd.org/changeset/base/295020 Log: MFC r294515: Fix the implementations of PSEUDO_NOERROR and PSEUDO. The PSEUDO* macros should not declare , only _ and __sys_. This was causing the interposing C wrappers to be ignored due to link order. Reviewed by: kib Obtained from: CheriBSD (4e8e13c90fc6a80e1520de44a6864cfd78b3b56d) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D4097 Modified: stable/10/lib/libc/mips/SYS.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/mips/SYS.h ============================================================================== --- stable/10/lib/libc/mips/SYS.h Thu Jan 28 22:34:29 2016 (r295019) +++ stable/10/lib/libc/mips/SYS.h Thu Jan 28 22:57:09 2016 (r295020) @@ -100,13 +100,31 @@ * Do a syscall that cannot fail (sync, get{p,u,g,eu,eg)id) */ #define RSYSCALL_NOERROR(x) \ - PSEUDO_NOERROR(x) +LEAF(__sys_ ## x); \ + .weak _C_LABEL(x); \ + _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \ + .weak _C_LABEL(__CONCAT(_,x)); \ + _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \ + SYSTRAP(x); \ + j ra; \ +END(__sys_ ## x) /* * Do a normal syscall. */ #define RSYSCALL(x) \ - PSEUDO(x) +LEAF(__sys_ ## x); \ + .weak _C_LABEL(x); \ + _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \ + .weak _C_LABEL(__CONCAT(_,x)); \ + _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \ + PIC_PROLOGUE(__sys_ ## x); \ + SYSTRAP(x); \ + bne a3,zero,err; \ + PIC_RETURN(); \ +err: \ + PIC_TAILCALL(__cerror); \ +END(__sys_ ## x) /* * Do a renamed or pseudo syscall (e.g., _exit()), where the entrypoint @@ -114,18 +132,14 @@ */ #define PSEUDO_NOERROR(x) \ LEAF(__sys_ ## x); \ - .weak _C_LABEL(x); \ - _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \ .weak _C_LABEL(__CONCAT(_,x)); \ _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \ SYSTRAP(x); \ j ra; \ - END(__sys_ ## x) +END(__sys_ ## x) #define PSEUDO(x) \ LEAF(__sys_ ## x); \ - .weak _C_LABEL(x); \ - _C_LABEL(x) = _C_LABEL(__CONCAT(__sys_,x)); \ .weak _C_LABEL(__CONCAT(_,x)); \ _C_LABEL(__CONCAT(_,x)) = _C_LABEL(__CONCAT(__sys_,x)); \ PIC_PROLOGUE(__sys_ ## x); \ From owner-svn-src-stable-10@freebsd.org Fri Jan 29 09:16:09 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79846A71034; Fri, 29 Jan 2016 09:16:09 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 4A5601F8F; Fri, 29 Jan 2016 09:16:09 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0T9G8tV034299; Fri, 29 Jan 2016 09:16:08 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0T9G8Nr034297; Fri, 29 Jan 2016 09:16:08 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601290916.u0T9G8Nr034297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 29 Jan 2016 09:16:08 +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: r295035 - stable/10/sys/dev/ixgbe 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.20 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: Fri, 29 Jan 2016 09:16:09 -0000 Author: smh Date: Fri Jan 29 09:16:08 2016 New Revision: 295035 URL: https://svnweb.freebsd.org/changeset/base/295035 Log: MFC r294578: Fix ix advertise value after media change Approved by: re (gjb) Sponsored by: Multiplay Modified: stable/10/sys/dev/ixgbe/if_ix.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/10/sys/dev/ixgbe/if_ix.c Fri Jan 29 03:10:22 2016 (r295034) +++ stable/10/sys/dev/ixgbe/if_ix.c Fri Jan 29 09:16:08 2016 (r295035) @@ -1855,10 +1855,16 @@ ixgbe_media_change(struct ifnet * ifp) hw->mac.autotry_restart = TRUE; hw->mac.ops.setup_link(hw, speed, TRUE); - adapter->advertise = - ((speed & IXGBE_LINK_SPEED_10GB_FULL) << 2) | - ((speed & IXGBE_LINK_SPEED_1GB_FULL) << 1) | - ((speed & IXGBE_LINK_SPEED_100_FULL) << 0); + if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) { + adapter->advertise = 0; + } else { + if ((speed & IXGBE_LINK_SPEED_10GB_FULL) != 0) + adapter->advertise |= 1 << 2; + if ((speed & IXGBE_LINK_SPEED_1GB_FULL) != 0) + adapter->advertise |= 1 << 1; + if ((speed & IXGBE_LINK_SPEED_100_FULL) != 0) + adapter->advertise |= 1 << 0; + } return (0); From owner-svn-src-stable-10@freebsd.org Fri Jan 29 17:33:38 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B6BAA7237C; Fri, 29 Jan 2016 17:33:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 5C9E61E80; Fri, 29 Jan 2016 17:33:38 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0THXb4e081186; Fri, 29 Jan 2016 17:33:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0THXb5T081185; Fri, 29 Jan 2016 17:33:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201601291733.u0THXb5T081185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 29 Jan 2016 17:33:37 +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: r295048 - stable/10/share/mk 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.20 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: Fri, 29 Jan 2016 17:33:38 -0000 Author: bdrewery Date: Fri Jan 29 17:33:37 2016 New Revision: 295048 URL: https://svnweb.freebsd.org/changeset/base/295048 Log: MFC r295006: Fix -include .depend hack from r294370 for headers not in .PATH. Approved by: re (gjb) Modified: stable/10/share/mk/bsd.dep.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.dep.mk ============================================================================== --- stable/10/share/mk/bsd.dep.mk Fri Jan 29 17:20:59 2016 (r295047) +++ stable/10/share/mk/bsd.dep.mk Fri Jan 29 17:33:37 2016 (r295048) @@ -165,12 +165,13 @@ depend: beforedepend ${DEPENDFILE} after _CFLAGS_INCLUDES= ${CFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} _CXXFLAGS_INCLUDES= ${CXXFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} # XXX: Temporary hack to workaround .depend files not tracking -include -.if !empty(_CFLAGS_INCLUDES) -${OBJS} ${POBJS} ${SOBJS}: ${_CFLAGS_INCLUDES:M*.h} -.endif -.if !empty(_CXXFLAGS_INCLUDES) -${OBJS} ${POBJS} ${SOBJS}: ${_CXXFLAGS_INCLUDES:M*.h} +_hdrincludes=${_CFLAGS_INCLUDES:M*.h} ${_CXXFLAGS_INCLUDES:M*.h} +.for _hdr in ${_hdrincludes:O:u} +.if exists(${_hdr}) +${OBJS} ${POBJS} ${SOBJS}: ${_hdr} .endif +.endfor +.undef _hdrincludes # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. From owner-svn-src-stable-10@freebsd.org Fri Jan 29 23:54:37 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B162A714C9 for ; Fri, 29 Jan 2016 23:54:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADF2D1598 for ; Fri, 29 Jan 2016 23:54:36 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f52.google.com with SMTP id s81so56505744lfd.0 for ; Fri, 29 Jan 2016 15:54:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=y559P3JjmaUb9D1w2XgxnUlMWQAjNt/Vnm7FrU83eiI=; b=bbEYouNeBMdXFlAHrqnNL5DL/dGvxxa/ocxC0goeQsPE9JgkzUX+e+k52QS93dvrVo TD1YOv6qf1mIuqKOys5Yc/Atw2+Pxl92rxm03DoB3OK2Osw9ptMK3q+sgKj663hMIiCX aiQBNPvoRzwCG5vmr2uvpEXfnc+LEG7Zwx1C+olAAAOmkdfFUZApaa+2dZ0uEln3BoAL U7Dd9Zig/qKliRe89+c5oG1eWMYnICcru42SbZZC575tgGV9MeQqhJGHu66333pLdsdB WmAjrHu/ufEPfGXLi4G7gjhj+L0hr83pV7TCjbvZdmpSPwPrt68CUuOACougdM1Y6iim mvVQ== X-Gm-Message-State: AG10YORzJdNArQolQmvuDfp/4uICm9HGVAbGv3gPKGAaNa7OtZ5FYvXCvLhmNXNUhWUtLg== X-Received: by 10.25.207.3 with SMTP id f3mr4432494lfg.20.1454111273485; Fri, 29 Jan 2016 15:47:53 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id n185sm2321795lfd.27.2016.01.29.15.47.52 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 15:47:53 -0800 (PST) Subject: Re: svn commit: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386 To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201601281211.u0SCBhQG058154@repo.freebsd.org> <56ABF762.7010103@freebsd.org> From: Andrey Chernov Message-ID: <56ABFA28.1000207@freebsd.org> Date: Sat, 30 Jan 2016 02:47:52 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56ABF762.7010103@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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: Fri, 29 Jan 2016 23:54:37 -0000 On 30.01.2016 2:36, Andrey Chernov wrote: > I am not sure this is exact commit which cause this, but any operation > in /sys/boot/efi ends like this (by hand, not from buildworld): > (i386-stable machine, clang compiler) > > ===> efi (obj) > make[1]: "/usr/src/sys/boot/efi/Makefile" line 4: Malformed conditional > (${COMPILER_TYPE} != "gcc") > make[1]: Fatal errors encountered -- cannot continue > make[1]: stopped in /usr/src/sys/boot/efi > *** Error code 1 > > Stop. > make: stopped in /usr/src/sys/boot > As Makefile shows, there is no include to pick COMPILER_TYPE and it is undefined. You need at least to move bsd.subdir.mk up. # $FreeBSD: stable/10/sys/boot/efi/Makefile 294981 2016-01-28 12:11:42Z smh $ # In-tree GCC does not support __attribute__((ms_abi)). .if ${COMPILER_TYPE} != "gcc" .if ${MACHINE_CPUARCH} == "amd64" SUBDIR+= libefi loader boot1 .endif .endif # ${COMPILER_TYPE} != "gcc" .include -- http://ache.vniz.net/ From owner-svn-src-stable-10@freebsd.org Sat Jan 30 00:09:32 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DFF7A71D21; Sat, 30 Jan 2016 00:09:32 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 167A21BA3; Sat, 30 Jan 2016 00:09:32 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0U09Vti096551; Sat, 30 Jan 2016 00:09:31 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U09V8w096550; Sat, 30 Jan 2016 00:09:31 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201601300009.u0U09V8w096550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sat, 30 Jan 2016 00:09:31 +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: r295055 - stable/10/lib/libc/gen 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.20 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: Sat, 30 Jan 2016 00:09:32 -0000 Author: sobomax Date: Sat Jan 30 00:09:30 2016 New Revision: 295055 URL: https://svnweb.freebsd.org/changeset/base/295055 Log: MFC r294691: Fix readpassphrase(3) when it's called with stdin being closed. Approved by: re (delphij) Modified: stable/10/lib/libc/gen/readpassphrase.c Modified: stable/10/lib/libc/gen/readpassphrase.c ============================================================================== --- stable/10/lib/libc/gen/readpassphrase.c Fri Jan 29 21:42:27 2016 (r295054) +++ stable/10/lib/libc/gen/readpassphrase.c Sat Jan 30 00:09:30 2016 (r295055) @@ -46,7 +46,7 @@ char * readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) { ssize_t nr; - int input, output, save_errno, i, need_restart; + int input, output, save_errno, i, need_restart, input_is_tty; char ch, *p, *end; struct termios term, oterm; struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; @@ -68,12 +68,20 @@ restart: * Read and write to /dev/tty if available. If not, read from * stdin and write to stderr unless a tty is required. */ - if ((flags & RPP_STDIN) || - (input = output = _open(_PATH_TTY, O_RDWR | O_CLOEXEC)) == -1) { - if (flags & RPP_REQUIRE_TTY) { - errno = ENOTTY; - return(NULL); + input_is_tty = 0; + if (!(flags & RPP_STDIN)) { + input = output = _open(_PATH_TTY, O_RDWR | O_CLOEXEC); + if (input == -1) { + if (flags & RPP_REQUIRE_TTY) { + errno = ENOTTY; + return(NULL); + } + input = STDIN_FILENO; + output = STDERR_FILENO; + } else { + input_is_tty = 1; } + } else { input = STDIN_FILENO; output = STDERR_FILENO; } @@ -83,7 +91,7 @@ restart: * If we are using a tty but are not the foreground pgrp this will * generate SIGTTOU, so do it *before* installing the signal handlers. */ - if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) { + if (input_is_tty && tcgetattr(input, &oterm) == 0) { memcpy(&term, &oterm, sizeof(term)); if (!(flags & RPP_ECHO_ON)) term.c_lflag &= ~(ECHO | ECHONL); @@ -152,7 +160,7 @@ restart: (void)__libc_sigaction(SIGTSTP, &savetstp, NULL); (void)__libc_sigaction(SIGTTIN, &savettin, NULL); (void)__libc_sigaction(SIGTTOU, &savettou, NULL); - if (input != STDIN_FILENO) + if (input_is_tty) (void)_close(input); /* From owner-svn-src-stable-10@freebsd.org Sat Jan 30 00:27:12 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FE16A723AE for ; Sat, 30 Jan 2016 00:27:12 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8AF66DD for ; Sat, 30 Jan 2016 00:27:11 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f66.google.com with SMTP id e36so1175191lfi.0 for ; Fri, 29 Jan 2016 16:27:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=aicyi1SRAWUCUp5d0qKan6Xt22i+H4ekXTIkDpGEl+k=; b=WRGdM/X6amxXTPs8rGXyUhJQXgOaaYSMpXggREa20uzqnMcPXSCLj4Fkz8ioG4wloe AJPWg+BhtXs6dUBZCuPe2LbrpJyxvbJOFawJgfO+RTbt4kW8rotrfCTGvYiiclSmDsU9 vyO6xVbwNMcGAF7mUkNJ6dQC7Jj26w0v97qAEkVgBpUzqdOygFUaYWFMuwHb9kiMGgqy gJ+PTD1LD87iub6oAWrdCTCEDmNf0ptbTOmwuIcd5wFmlsdPRDSNDK0CtipFYIeKQWoc +t9xNNAeyXyV7snCCE1KJxrEBHKyqLu4U0XOtEfqo9C2/OBM46vd3FbtjuhbaCgadEO6 pl+g== X-Gm-Message-State: AG10YOTXl5aJA3RBMYwI7RHUi3/EDdKT+z9tmwNj4ejWRR0D7vdLjUNsN9aGJYYEYjNQQw== X-Received: by 10.25.10.200 with SMTP id 191mr4517256lfk.116.1454110564015; Fri, 29 Jan 2016 15:36:04 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id 84sm2349408lfp.17.2016.01.29.15.36.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 15:36:03 -0800 (PST) Subject: Re: svn commit: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386 To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201601281211.u0SCBhQG058154@repo.freebsd.org> From: Andrey Chernov Message-ID: <56ABF762.7010103@freebsd.org> Date: Sat, 30 Jan 2016 02:36:02 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201601281211.u0SCBhQG058154@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 30 Jan 2016 00:27:12 -0000 I am not sure this is exact commit which cause this, but any operation in /sys/boot/efi ends like this (by hand, not from buildworld): (i386-stable machine, clang compiler) ===> efi (obj) make[1]: "/usr/src/sys/boot/efi/Makefile" line 4: Malformed conditional (${COMPILER_TYPE} != "gcc") make[1]: Fatal errors encountered -- cannot continue make[1]: stopped in /usr/src/sys/boot/efi *** Error code 1 Stop. make: stopped in /usr/src/sys/boot -- http://ache.vniz.net/ From owner-svn-src-stable-10@freebsd.org Sat Jan 30 01:22:27 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF69EA73601 for ; Sat, 30 Jan 2016 01:22:27 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63B46118 for ; Sat, 30 Jan 2016 01:22:27 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x229.google.com with SMTP id l66so3754076wml.0 for ; Fri, 29 Jan 2016 17:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=l7645j7O+/GPdV9iYPpTzC9eoHprFKx2pTHypkyr4P8=; b=iec6v+qCMSU3wEjsYeWN0RrzQJ6/IrzzwGg9Dm5NmFmEg294ZFvss4bbJaOCLzTXwB bKcbaAfsUy1hy1kwtXYjQWLsALlKyHkmAMHuvIJy5uk0TUJdPEAGaPY6ttAQquD33cXG 2rwTCbEC1jWb15q45pJgH62W09h95ysmIEJjWoLU5NNy20I8GH+srFn7dZhLy7ORXwG+ ct/UZ5XV3IjTxkeVpJLHq4JPtB5cXNsVUqf7K9ZJt/vVb+1QhqzLQMGSOv817YgWwX3V w9BmVj/9GN6nJkpbMPusGA8iJvzadRYSib4IoWWWtn8/RPHaNL2YUI0ZiwfdiCCmCz+o yz1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=l7645j7O+/GPdV9iYPpTzC9eoHprFKx2pTHypkyr4P8=; b=BfVwVUCnDVlAH77FYOWFSg36/k8xjVc4dFYviIguT/3WFvYmUytiH4A9qaZ2A5E6QG 4L6+0N+Li3osbhyzjyWAAb3U/B+pgb8ecsQobtS3mePo4ZGSdx6hkmW1mKF/0GI49Tj4 HjbT2TSJA9NpnuqHBghxlWICyVydg04nUfZBg+RpuQ9e+mHxM54sSR6lShyYNBBmODT+ HYoZybe8gNUZtAHycA3u9FZxm35fA1kez+Nrsp/2rbXbI9n8XamIOF/XITkNxhtFmkkW BFcgSrP7MCUEmGamj5Ypn98SJgeD0fNOQlr4WbGW/fMcVg3vS7WZdoG6/phs4I2XZR1h tnUA== X-Gm-Message-State: AG10YOTXX6rPnwsuzP5NnUL4J3LVbDAHcB3jM+y70BtwXozgT7oSOC7IUHFnEunajFynVrF8 X-Received: by 10.194.235.4 with SMTP id ui4mr11124997wjc.177.1454116945666; Fri, 29 Jan 2016 17:22:25 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id r10sm17946962wjz.24.2016.01.29.17.22.24 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 17:22:24 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386 To: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201601281211.u0SCBhQG058154@repo.freebsd.org> <56ABF762.7010103@freebsd.org> Message-ID: <56AC1061.3030904@freebsd.org> Date: Sat, 30 Jan 2016 01:22:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56ABF762.7010103@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 30 Jan 2016 01:22:27 -0000 Yep I have a request in with re@ for the direct commit required to fix this. On 29/01/2016 23:36, Andrey Chernov wrote: > I am not sure this is exact commit which cause this, but any operation > in /sys/boot/efi ends like this (by hand, not from buildworld): > (i386-stable machine, clang compiler) > > ===> efi (obj) > make[1]: "/usr/src/sys/boot/efi/Makefile" line 4: Malformed conditional > (${COMPILER_TYPE} != "gcc") > make[1]: Fatal errors encountered -- cannot continue > make[1]: stopped in /usr/src/sys/boot/efi > *** Error code 1 > > Stop. > make: stopped in /usr/src/sys/boot > From owner-svn-src-stable-10@freebsd.org Sat Jan 30 01:27:30 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC4EA7382A; Sat, 30 Jan 2016 01:27:30 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8CAB46B6; Sat, 30 Jan 2016 01:27:30 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0U1RTl5019945; Sat, 30 Jan 2016 01:27:29 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0U1RTV0019944; Sat, 30 Jan 2016 01:27:29 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201601300127.u0U1RTV0019944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sat, 30 Jan 2016 01:27:29 +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: r295057 - stable/10/sys/boot/efi 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.20 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: Sat, 30 Jan 2016 01:27:30 -0000 Author: smh Date: Sat Jan 30 01:27:29 2016 New Revision: 295057 URL: https://svnweb.freebsd.org/changeset/base/295057 Log: Fix clean target for sys/boot/efi Fix clean target breakage of sys/boot/efi introduced by r294981 specifically the MFC of r294029 without the related change introduced by r281114. This is direct commit to stable/10 as head uses src.opts.mk. Approved by: re (glebius) Sponsored by: Multiplay Modified: stable/10/sys/boot/efi/Makefile Modified: stable/10/sys/boot/efi/Makefile ============================================================================== --- stable/10/sys/boot/efi/Makefile Sat Jan 30 01:00:54 2016 (r295056) +++ stable/10/sys/boot/efi/Makefile Sat Jan 30 01:27:29 2016 (r295057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + # In-tree GCC does not support __attribute__((ms_abi)). .if ${COMPILER_TYPE} != "gcc" From owner-svn-src-stable-10@freebsd.org Sat Jan 30 01:33:08 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E86C9A73A42 for ; Sat, 30 Jan 2016 01:33:07 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C844AA6 for ; Sat, 30 Jan 2016 01:33:07 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-wm0-x22b.google.com with SMTP id p63so2379413wmp.1 for ; Fri, 29 Jan 2016 17:33:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=J8Z0FGFzoIoSSNH1cviNI0bRK8l4HTdz1bnXAP7K4eY=; b=DtAO8oYiUD8PEv/HmTvKAqMYDbl7cXpWLif5M493lcMaRVxuk+gDSSdw8Lhh3p4NlO f21hAH8nU1dAHCFHJAjCLI5KdNRDmTaMtQJoA4dazxaIURqufZo2+NuNyw9CD0dh9E2w NNTLdfA1wqcyPFe+CbdGucoSM2Lr9eR8J7ZWnG1jOvddzaqZBKaTSMBFNJvZmRkNCx99 VS5rv+DTMy68Iml51HylTCS+k9viTaB4cZK9AxIwe4PMX65eIE6ipCZxVts1o3jMYTgO aaIzHbRZgLBB1vxI+GHg8LTo6qI945v1ik3veBqNOAMcyPgtB/NBZmHQq+3dEfh26wFU Uy3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=J8Z0FGFzoIoSSNH1cviNI0bRK8l4HTdz1bnXAP7K4eY=; b=IeNZR4jV2lHhrIn5A9iJdGEuhGz5CzjHNRIvluG7n5BxaN0qJdjWPkXFnYJ8HN45va TttpDgANY3cVSMTiddiuBuoyGPkAyrn8IA9UvxKUu/t0UAypjz/DFQjdz8oPOrbjfA4w UfDAdpi1/qzzgps+wceVyiHL959JpGqikK/dLb8oq7NOdsdiOXHM7MqXuyULhHg0INK3 yMxIxmJt/eMqpLMytnDovWAtxJKXU/8r9Ed05H34vOwHFhFF8k4PAquA0j1AbJSx/N7a MCZTXKxQJLrStnN4Vt51IcIoxOT3EprUVvsoBO8Uz6deT+p8ES4ZFFz9twSZHZ5F5f5O 5K+g== X-Gm-Message-State: AG10YOR8us+gGjohfHMDS93twsisgQHdIVz0eZQ6vEfPj2872dYpx8wR4eqVNncstojQyRIO X-Received: by 10.28.146.145 with SMTP id u139mr338231wmd.81.1454117586008; Fri, 29 Jan 2016 17:33:06 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id qs1sm17950502wjc.2.2016.01.29.17.33.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 17:33:04 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r294981 - in stable/10/sys/boot: common efi efi/boot1 efi/include efi/libefi efi/loader efi/loader/arch/amd64 fdt i386/libi386 To: Andrey Chernov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201601281211.u0SCBhQG058154@repo.freebsd.org> <56ABF762.7010103@freebsd.org> <56ABFA28.1000207@freebsd.org> Message-ID: <56AC12E2.6010001@freebsd.org> Date: Sat, 30 Jan 2016 01:33:22 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56ABFA28.1000207@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 30 Jan 2016 01:33:08 -0000 Just spotted the reply from re@ which came in a hour or so ago (thanks glebius) so this is fixed as of r295057 On 29/01/2016 23:47, Andrey Chernov wrote: > On 30.01.2016 2:36, Andrey Chernov wrote: >> I am not sure this is exact commit which cause this, but any operation >> in /sys/boot/efi ends like this (by hand, not from buildworld): >> (i386-stable machine, clang compiler) >> >> ===> efi (obj) >> make[1]: "/usr/src/sys/boot/efi/Makefile" line 4: Malformed conditional >> (${COMPILER_TYPE} != "gcc") >> make[1]: Fatal errors encountered -- cannot continue >> make[1]: stopped in /usr/src/sys/boot/efi >> *** Error code 1 >> >> Stop. >> make: stopped in /usr/src/sys/boot >> > As Makefile shows, there is no include to pick COMPILER_TYPE and it is > undefined. You need at least to move bsd.subdir.mk up. > > # $FreeBSD: stable/10/sys/boot/efi/Makefile 294981 2016-01-28 12:11:42Z > smh $ > > # In-tree GCC does not support __attribute__((ms_abi)). > .if ${COMPILER_TYPE} != "gcc" > > .if ${MACHINE_CPUARCH} == "amd64" > SUBDIR+= libefi loader boot1 > .endif > > .endif # ${COMPILER_TYPE} != "gcc" > > .include > > >