From owner-svn-src-all@freebsd.org Sun Nov 5 00:11:19 2017 Return-Path: Delivered-To: svn-src-all@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 87260E5AC7A; Sun, 5 Nov 2017 00:11:19 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 368EE63E05; Sun, 5 Nov 2017 00:11:19 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTPS id vA50BHkq017016 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Nov 2017 17:11:17 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Date: Sat, 4 Nov 2017 17:11:16 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r325404 - head/share/mk To: Bryan Drewery cc: Cy Schubert , "O. Hartmann" , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org In-Reply-To: Message-ID: References: <201711042230.vA4MUhjw014138@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:11:19 -0000 On 4 Nov, Bryan Drewery wrote: > On 11/4/2017 3:30 PM, Cy Schubert wrote: >> In message <0fc7e918-dcf8-0197-6b50-5936dee23d87@FreeBSD.org>, Bryan >> Drewery wr >> ites: >>> This is an OpenPGP/MIME signed message (RFC 4880 and 3156) >>> --dokLDw6wDnv1gUfKm3uwMSMnWeibN2RaD >>> Content-Type: multipart/mixed; boundary="MKHGkKGfLlBFL1Vl1W5AEj2BccB14C28h"; >>> protected-headers="v1" >>> From: Bryan Drewery >>> To: "O. Hartmann" , "Simon J. Gerraty" >>> >>> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, >>> src-committers@freebsd.org >>> Message-ID: <0fc7e918-dcf8-0197-6b50-5936dee23d87@FreeBSD.org> >>> Subject: Re: svn commit: r325404 - head/share/mk >>> References: <201711042102.vA4L2RuR063978@repo.freebsd.org> >>> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> >>> <20171104223650.77c06a52@thor.intern.walstatt.dynvpn.de> >>> In-Reply-To: <20171104223650.77c06a52@thor.intern.walstatt.dynvpn.de> >>> >>> --MKHGkKGfLlBFL1Vl1W5AEj2BccB14C28h >>> Content-Type: text/plain; charset=utf-8 >>> Content-Language: en-US >>> Content-Transfer-Encoding: quoted-printable >>> >>> On 11/4/2017 2:36 PM, O. Hartmann wrote: >>>> Am Sat, 4 Nov 2017 22:31:33 +0100 >>>> "O. Hartmann" schrieb: >>>> =20 >>>>> Am Sat, 4 Nov 2017 21:02:27 +0000 (UTC) >>>>> "Simon J. Gerraty" schrieb: >>>>> >>>>>> Author: sjg >>>>>> Date: Sat Nov 4 21:02:26 2017 >>>>>> New Revision: 325404 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/325404 >>>>>> >>>>>> Log: >>>>>> Ensure .OBJDIR has known value >>>>>> =20 >>>>>> If for any reason we cannot set .OBJDIR=3D=3D_objdir as desired >>>>>> use .CURDIR so that at least the classic >>>>>> .if ${.OBJDIR} !=3D ${.CURDIR} >>>>>> works and dangerous misstakes can be avoided. >>>>>> =20 >>>>>> Reviewed by: bdrewery >>>>>> >>>>>> Modified: >>>>>> head/share/mk/auto.obj.mk >>>>>> >>>>>> Modified: head/share/mk/auto.obj.mk >>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= >>> =3D=3D=3D=3D=3D >>>>>> --- head/share/mk/auto.obj.mk Sat Nov 4 16:23:34 2017 (r32540 >>> 3) >>>>>> +++ head/share/mk/auto.obj.mk Sat Nov 4 21:02:26 2017 (r32540 >>> 4) >>>>>> @@ -61,11 +61,17 @@ __objdir_made !=3D echo ${__objdir}/; umask ${OBJ= >>> DIR_UMA >>>>>> .endif >>>>>> # This causes make to use the specified directory as .OBJDIR >>>>>> .OBJDIR: ${__objdir} >>>>>> -.if ${.OBJDIR:tA} !=3D ${__objdir:tA} && ${__objdir_made:Uno:M${__ob= >>> jdir}/*} !=3D "" >>>>>> +.if ${.OBJDIR:tA} !=3D ${__objdir:tA} >>>>>> +# we did not get what we want - do we care? >>>>>> +.if ${__objdir_made:Uno:M${__objdir}/*} !=3D "" >>>>>> # watch out for __objdir being relative path >>>>>> .if !(${__objdir:M/*} =3D=3D "" && ${.OBJDIR:tA} =3D=3D ${${.CURDIR}= >>> /${__objdir}:L:tA}) >>>>>> .error could not use ${__objdir}: .OBJDIR=3D${.OBJDIR} >>>>>> .endif >>>>>> +.endif >>>>>> +# apparently we can live with it >>>>>> +# make sure we know what we have >>>>>> +.OBJDIR: ${.CURDIR} >>>>>> .endif >>>>>> .endif >>>>>> .endif >>>>>> _______________________________________________ >>>>>> svn-src-head@freebsd.org mailing list >>>>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>>>>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.or= >>> g" =20 >>>>> >>>>> With the recent patches, nvidia driver x11/nvidia-driver fails tobuild= >>> with the error >>>>> shown below: >>>>> >>>>> [...] >>>>> =3D=3D=3D> src/nvidia (all) =20 >>>>> make[7]: "/usr/src/share/mk/bsd.obj.mk" line 87: Malformed conditional= >>> >>>>> (${CANONICALOBJDIR} =3D=3D /${RELDIR} || ${.OBJDIR} =3D=3D /${RELDIR})= >>> make[7]: Fatal errors >>>>> encountered -- cannot continue >>>>> [...] >>>> =20 >>>> The very same with emulators/virtualbox-ose-kmod: >>>> =20 >>>> [...] >>>> kBuild: >>>> Installing /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/vi= >>> rtualbox-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src= >>> /vboxdrv/Makefile >>>> =3D=3D=3D Building 'vboxdrv' module =3D=3D=3D make[6]: "/usr/src/share/= >>> mk/bsd.obj.mk" line 87: >>>> Malformed conditional (${CANONICALOBJDIR} =3D=3D /${RELDIR} || ${.OBJDI= >>> R} =3D=3D /${RELDIR}) >>>> make[6]: Fatal errors encountered -- cannot continue make[6]: stopped >>>> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualbox= >>> -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vboxdrv= >>> >>>> *** Error code 1 >>>> =20 >>>> Stop. >>>> make[5]: stopped >>>> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualbox= >>> -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src >>>> =3D=3D=3D> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE= >>> =3Dyes and rebuild before >>>> reporting the failure to the maintainer. >>>> *** Error code 1 >>>> =20 >>>> =20 >>> >>> It was r325405 ... fixed in r325408. >> >> >> Not really, mergemaster output. >> >> *** Creating the temporary root environment in /tmp/temproot >> *** /tmp/temproot ready for use >> *** Creating and populating directory structure in /tmp/temproot >> >> make[3]: "/opt/src/svn-current/share/mk/bsd.obj.mk" line 89: .OBJDIR >> incorrectly set to /etc/autofs >> >> *** FATAL ERROR: Cannot 'cd' to /opt/src/svn-current and install files to >> the temproot environment >> >> > > That's actually a good thing. What command did you run? I got the following when attempting to update a poudriere jail to r325409: --- obj_subdir_sys --- make[5]: "/var/poudriere/jails/120CURRENTamd64/usr/src/share/mk/bsd.obj.mk" line 89: .OBJDIR incorrectly set to /sys/boot/libsa *** [obj_subdir_sys/boot/libsa] Error code 1 make[4]: stopped in /var/poudriere/jails/120CURRENTamd64/usr/src/sys/boot From owner-svn-src-all@freebsd.org Sun Nov 5 00:11:49 2017 Return-Path: Delivered-To: svn-src-all@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 28876E5AD6E; Sun, 5 Nov 2017 00:11:49 +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 EC4C063FC4; Sun, 5 Nov 2017 00:11:48 +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 vA50Bm4P042710; Sun, 5 Nov 2017 00:11:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50BmCW042709; Sun, 5 Nov 2017 00:11:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050011.vA50BmCW042709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325411 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:11:49 -0000 Author: bdrewery Date: Sun Nov 5 00:11:47 2017 New Revision: 325411 URL: https://svnweb.freebsd.org/changeset/base/325411 Log: Set OBJROOT/OBJTOP as make arguments. Missed in r325329. Sponsored by: Dell EMC Isilon Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Sat Nov 4 23:28:02 2017 (r325410) +++ head/Makefile.libcompat Sun Nov 5 00:11:47 2017 (r325411) @@ -108,8 +108,6 @@ LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/inclu # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= \ - OBJTOP=${LIBCOMPAT_OBJTOP} \ - OBJROOT='$${OBJTOP}/' \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} \ SYSROOT=${LIBCOMPATTMP} \ @@ -129,6 +127,8 @@ LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ -DNO_LINT \ MK_TESTS=no LIBCOMPATWMAKE+= ${LIBCOMPATWMAKEENV} ${MAKE} ${LIBCOMPATWMAKEFLAGS} \ + OBJTOP=${LIBCOMPAT_OBJTOP} \ + OBJROOT='$${OBJTOP}/' \ MK_MAN=no MK_HTML=no LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*} \ MK_TOOLCHAIN=no ${IMAKE_INSTALL} \ @@ -185,9 +185,9 @@ build${libcompat}: .PHONY ${_+_}cd ${.CURDIR}/${_dir}; \ WORLDTMP=${WORLDTMP} \ MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ + ${MAKE} SSP_CFLAGS= DESTDIR= \ OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ - ${MAKE} SSP_CFLAGS= DESTDIR= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ build-tools .endfor From owner-svn-src-all@freebsd.org Sun Nov 5 00:11:53 2017 Return-Path: Delivered-To: svn-src-all@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 2311AE5AD97; Sun, 5 Nov 2017 00:11:53 +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 F294C63FD9; Sun, 5 Nov 2017 00:11:52 +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 vA50Bq5H042760; Sun, 5 Nov 2017 00:11:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50BpCS042756; Sun, 5 Nov 2017 00:11:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050011.vA50BpCS042756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325412 - in head: . targets/pseudo/bootstrap-tools X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: . targets/pseudo/bootstrap-tools X-SVN-Commit-Revision: 325412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:11:53 -0000 Author: bdrewery Date: Sun Nov 5 00:11:51 2017 New Revision: 325412 URL: https://svnweb.freebsd.org/changeset/base/325412 Log: Fix nested MAKEOBJDIRPREFIX breaking various release/buildworld/toolchain targets. This problem was caused by r325329 and r325350. For the release(7) targets, some will run mm-mtree.sh which itself runs make with a MAKEOBJDIRPREFIX. The execution of that script leaks OBJROOT, MAKEOBJDIR, and MAKELEVEL=1 in the environment. This causes the mm-mtree makes to not do some basic setup of OBJROOT and only use this special MAKEOBJDIRPREFIX case which fails to empty out MAKEOBJDIRPREFIX for further nested makes, such as a tree walk. If that tree walk sets OBJROOT/OBJTOP such as r325329 is doing, then the wrong OBJDIRs end up being used due to the unemptied MAKEOBJDIRPREFIX being preferred over the proper MAKEOBJDIR. Pointyhat to: bdrewery Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 head/Makefile.libcompat head/targets/pseudo/bootstrap-tools/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Nov 5 00:11:47 2017 (r325411) +++ head/Makefile.inc1 Sun Nov 5 00:11:51 2017 (r325412) @@ -523,6 +523,7 @@ BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ BSARGS= DESTDIR= \ OBJTOP='${WORLDTMP}/obj-tools' \ OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${OSRELDATE} \ BWPHASE=${.TARGET:C,^_,,} \ SSP_CFLAGS= \ @@ -565,6 +566,7 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} \ DESTDIR= \ OBJTOP='${WORLDTMP}/obj-kernel-tools' \ OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ MK_HTML=no -DNO_LINT MK_MAN=no \ Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Sun Nov 5 00:11:47 2017 (r325411) +++ head/Makefile.libcompat Sun Nov 5 00:11:51 2017 (r325412) @@ -129,6 +129,7 @@ LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ LIBCOMPATWMAKE+= ${LIBCOMPATWMAKEENV} ${MAKE} ${LIBCOMPATWMAKEFLAGS} \ OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ MK_MAN=no MK_HTML=no LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*} \ MK_TOOLCHAIN=no ${IMAKE_INSTALL} \ @@ -188,6 +189,7 @@ build${libcompat}: .PHONY ${MAKE} SSP_CFLAGS= DESTDIR= \ OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ build-tools .endfor Modified: head/targets/pseudo/bootstrap-tools/Makefile ============================================================================== --- head/targets/pseudo/bootstrap-tools/Makefile Sun Nov 5 00:11:47 2017 (r325411) +++ head/targets/pseudo/bootstrap-tools/Makefile Sun Nov 5 00:11:51 2017 (r325412) @@ -36,6 +36,7 @@ OSRELDATE?= 0 BSARGS= DESTDIR= \ OBJTOP='${WORLDTMP}/obj-tools' \ OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ BOOTSTRAPPING=${OSRELDATE} \ BWPHASE=${.TARGET} \ SSP_CFLAGS= \ From owner-svn-src-all@freebsd.org Sun Nov 5 00:11:56 2017 Return-Path: Delivered-To: svn-src-all@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 A14E1E5ADB4; Sun, 5 Nov 2017 00:11:56 +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 6C27264031; Sun, 5 Nov 2017 00:11:56 +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 vA50Btst042806; Sun, 5 Nov 2017 00:11:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50Btxp042805; Sun, 5 Nov 2017 00:11:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050011.vA50Btxp042805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325413 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:11:56 -0000 Author: bdrewery Date: Sun Nov 5 00:11:55 2017 New Revision: 325413 URL: https://svnweb.freebsd.org/changeset/base/325413 Log: Simplify location of bootstrap make. Sponsored by: Dell EMC Isilon Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Nov 5 00:11:51 2017 (r325412) +++ head/Makefile Sun Nov 5 00:11:55 2017 (r325413) @@ -209,7 +209,7 @@ WANT_MAKE_VERSION= 20160604 # 20160220 - support .dinclude for FAST_DEPEND. WANT_MAKE_VERSION= 20160220 .endif -MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE} +MYMAKE= ${OBJROOT}make.${MACHINE}/${WANT_MAKE} .if defined(.PARSEDIR) HAVE_MAKE= bmake .else @@ -407,10 +407,13 @@ upgrade_checks: .PHONY # headers, libraries and tools. Also, allow the location of # the system bsdmake-like utility to be overridden. # -MMAKEENV= MAKEOBJDIRPREFIX=${MYMAKE:H} \ +MMAKEENV= \ DESTDIR= \ INSTALL="sh ${.CURDIR}/tools/install.sh" MMAKE= ${MMAKEENV} ${MAKE} \ + OBJTOP=${MYMAKE:H}/obj \ + OBJROOT='$${OBJTOP}/' \ + MAKEOBJDIRPREFIX= \ MAN= -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WERROR \ -DNO_SUBDIR \ From owner-svn-src-all@freebsd.org Sun Nov 5 00:12:00 2017 Return-Path: Delivered-To: svn-src-all@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 329B8E5ADEE; Sun, 5 Nov 2017 00:12:00 +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 F3BFC640A6; Sun, 5 Nov 2017 00:11:59 +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 vA50BxFg042853; Sun, 5 Nov 2017 00:11:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50Bx2j042851; Sun, 5 Nov 2017 00:11:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050011.vA50Bx2j042851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325414 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:12:00 -0000 Author: bdrewery Date: Sun Nov 5 00:11:58 2017 New Revision: 325414 URL: https://svnweb.freebsd.org/changeset/base/325414 Log: AUTO_OBJ: Set .OBJDIR=.CURDIR earlier for NO_OBJ Makefiles. auto.obj.mk is loaded before the Makefile which may have NO_OBJ set inside of it. In that case we can't avoid creating the OBJDIR but we do need to avoid using it. Fixing .OBJDIR in bsd.init.mk at least fixes all of the build .mk files to have a proper .OBJDIR. It does not fix the Makefile itself but usually if they have NO_OBJ set they are not inspecting ${.OBJDIR} anyhow. It is ideal to only have this in bsd.init.mk and to remove it from bsd.obj.mk, but then bsd.obj.mk would need to include bsd.init.mk. Doing something like that would require more testing. It has been proposed that bsd.obj.mk not be included directly but it has been possible for too long to do so to change it at this point. Note too that it may make sense to fix .OBJDIR even when AUTO_OBJ is not enabled but the historical behavior has always been that NO_OBJ just avoids running 'make obj', so .OBJDIR should already be .CURDIR. Also while NO_OBJ seems like it should be removed at this point, it is not always possible to fix Makefiles to properly use an .OBJDIR. The cost of keeping NO_OBJ support is minimal. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.init.mk head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Sun Nov 5 00:11:55 2017 (r325413) +++ head/share/mk/bsd.init.mk Sun Nov 5 00:11:58 2017 (r325414) @@ -10,6 +10,14 @@ ____: .include .-include "local.init.mk" + +.if ${MK_AUTO_OBJ} == "yes" +# This is also done in bsd.obj.mk +.if defined(NO_OBJ) +.OBJDIR: ${.CURDIR} +.endif +.endif + .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Sun Nov 5 00:11:55 2017 (r325413) +++ head/share/mk/bsd.obj.mk Sun Nov 5 00:11:58 2017 (r325414) @@ -47,6 +47,7 @@ ____: objwarn: obj: CANONICALOBJDIR= ${.OBJDIR} +# This is also done in bsd.init.mk .if defined(NO_OBJ) # but this makefile does not want it! .OBJDIR: ${.CURDIR} From owner-svn-src-all@freebsd.org Sun Nov 5 00:12:03 2017 Return-Path: Delivered-To: svn-src-all@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 D4866E5AE2B; Sun, 5 Nov 2017 00:12:03 +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 9E50864129; Sun, 5 Nov 2017 00:12:03 +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 vA50C2Vs042904; Sun, 5 Nov 2017 00:12:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50C2kQ042903; Sun, 5 Nov 2017 00:12:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050012.vA50C2kQ042903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325415 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:12:04 -0000 Author: bdrewery Date: Sun Nov 5 00:12:02 2017 New Revision: 325415 URL: https://svnweb.freebsd.org/changeset/base/325415 Log: Validate MAKEOBJDIR after the MAKEOBJDIRPREFIX override. Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Sun Nov 5 00:11:58 2017 (r325414) +++ head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:02 2017 (r325415) @@ -77,13 +77,6 @@ OBJTOP:= ${OBJROOT}${TARGET:D${TARGET}.${TARGET_ARCH}: OBJTOP:= ${OBJROOT:H} .endif # ${MK_UNIFIED_OBJDIR} == "yes" -# Wait to validate MAKEOBJDIR until OBJTOP is set. -.if defined(MAKEOBJDIR) -.if ${MAKEOBJDIR:M/*} == "" -.error Cannot use MAKEOBJDIR=${MAKEOBJDIR}${.newline}Unset MAKEOBJDIR to get default: MAKEOBJDIR='${_default_makeobjdir}' -.endif -.endif - # Fixup OBJROOT/OBJTOP if using MAKEOBJDIRPREFIX but leave it alone # for DIRDEPS_BUILD which really wants to know the absolute top at # all times. This intenionally comes after adding TARGET.TARGET_ARCH @@ -92,6 +85,13 @@ OBJTOP:= ${OBJROOT:H} .if !empty(MAKEOBJDIRPREFIX) && ${MK_DIRDEPS_BUILD} == "no" OBJTOP:= ${MAKEOBJDIRPREFIX}${SRCTOP} OBJROOT:= ${OBJTOP}/ +.endif + +# Wait to validate MAKEOBJDIR until OBJTOP is set. +.if defined(MAKEOBJDIR) +.if ${MAKEOBJDIR:M/*} == "" +.error Cannot use MAKEOBJDIR=${MAKEOBJDIR}${.newline}Unset MAKEOBJDIR to get default: MAKEOBJDIR='${_default_makeobjdir}' +.endif .endif # Try to enable MK_AUTO_OBJ by default if we can write to the OBJROOT. Only From owner-svn-src-all@freebsd.org Sun Nov 5 00:12:07 2017 Return-Path: Delivered-To: svn-src-all@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 58699E5AE7E; Sun, 5 Nov 2017 00:12:07 +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 21689641A2; Sun, 5 Nov 2017 00:12:07 +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 vA50C6gp042949; Sun, 5 Nov 2017 00:12:06 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50C6m8042948; Sun, 5 Nov 2017 00:12:06 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050012.vA50C6m8042948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325416 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:12:07 -0000 Author: bdrewery Date: Sun Nov 5 00:12:05 2017 New Revision: 325416 URL: https://svnweb.freebsd.org/changeset/base/325416 Log: Always try to set .OBJDIR, even if AUTO_OBJ is enabled, and fallback to .CURDIR. When AUTO_OBJ is enabled this change becomes redundant with the auto.obj.mk check added in r325404. However, it is possible that new code is added at some point between src.sys.obj.mk and auto.obj.mk that disables AUTO_OBJ. That could leave make with a bogus and unsafe .OBJDIR in some cases. Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:02 2017 (r325415) +++ head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:05 2017 (r325416) @@ -154,9 +154,8 @@ MK_AUTO_OBJ:= ${OBJDIR_WRITABLE} .export MK_AUTO_OBJ .endif # ${MK_AUTO_OBJ} == "no" && ... -# Assign this directory as .OBJDIR if possible after determining if AUTO_OBJ -# can be enabled by default. -.if ${MK_AUTO_OBJ} == "no" +# Assign this directory as .OBJDIR if possible. +# # The expected OBJDIR already exists, set it as .OBJDIR. .if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}${.CURDIR}) .OBJDIR: ${MAKEOBJDIRPREFIX}${.CURDIR} @@ -169,5 +168,10 @@ MK_AUTO_OBJ:= ${OBJDIR_WRITABLE} .elif ${MAKE_VERSION} <= 20170720 && \ ${.CURDIR} == ${SRCTOP} && ${.OBJDIR} == ${SRCTOP}/ .OBJDIR: ${.CURDIR} +.else +# The OBJDIR we wanted does not yet exist, ensure we default to safe .CURDIR +# in case make started with a bogus MAKEOBJDIR, that expanded before OBJTOP +# was set, that happened to match some unexpected directory. Either +# auto.obj.mk or bsd.obj.mk will create the directory and fix .OBJDIR later. +.OBJDIR: ${.CURDIR} .endif -.endif # ${MK_AUTO_OBJ} == "no" From owner-svn-src-all@freebsd.org Sun Nov 5 00:12:10 2017 Return-Path: Delivered-To: svn-src-all@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 B6EBFE5AEB8; Sun, 5 Nov 2017 00:12:10 +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 651716421A; Sun, 5 Nov 2017 00:12:10 +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 vA50C9hh042998; Sun, 5 Nov 2017 00:12:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50C9wD042997; Sun, 5 Nov 2017 00:12:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050012.vA50C9wD042997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325417 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:12:11 -0000 Author: bdrewery Date: Sun Nov 5 00:12:09 2017 New Revision: 325417 URL: https://svnweb.freebsd.org/changeset/base/325417 Log: Set the expected __objdir for auto.obj.mk to try. This avoids some future discrepency that might cause auto.obj.mk to use the wrong OBJDIR. Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:05 2017 (r325416) +++ head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:09 2017 (r325417) @@ -94,9 +94,17 @@ OBJROOT:= ${OBJTOP}/ .endif .endif -# Try to enable MK_AUTO_OBJ by default if we can write to the OBJROOT. Only -# do this if AUTO_OBJ is not disabled by the user, not cleaning, and this -# is the first make ran. +# __objdir is the expected .OBJDIR we want to use and that auto.obj.mk will +# try to create. +.if !empty(MAKEOBJDIRPREFIX) +__objdir:= ${MAKEOBJDIRPREFIX}${.CURDIR} +.elif !empty(MAKEOBJDIR) +__objdir:= ${MAKEOBJDIR} +.endif + +# Try to enable MK_AUTO_OBJ by default if we can write to the __objdir. Only +# do this if AUTO_OBJ is not disabled by the user, not cleaning, and this is +# the first make ran. .if 0 && ${.MAKE.LEVEL} == 0 && \ ${MK_AUTO_OBJ} == "no" && empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) && \ !defined(WITHOUT_AUTO_OBJ) && !make(showconfig) && !make(print-dir) && \ @@ -138,15 +146,13 @@ CheckAutoObj() { \ echo no; \ fi; \ } -.if !empty(MAKEOBJDIRPREFIX) -WANTED_OBJDIR= ${MAKEOBJDIRPREFIX}${.CURDIR} -.else -WANTED_OBJDIR= ${MAKEOBJDIR} +.if !empty(__objdir) +__objdir_writable!= \ + ${CheckAutoObj}; CheckAutoObj "${__objdir}" || echo no .endif -OBJDIR_WRITABLE!= \ - ${CheckAutoObj}; CheckAutoObj "${WANTED_OBJDIR}" || echo no +__objdir_writable?= no # Export the decision to sub-makes. -MK_AUTO_OBJ:= ${OBJDIR_WRITABLE} +MK_AUTO_OBJ:= ${__objdir_writable} .export MK_AUTO_OBJ .elif make(showconfig) # Need to export for showconfig internally running make -dg1. It is enabled @@ -157,10 +163,8 @@ MK_AUTO_OBJ:= ${OBJDIR_WRITABLE} # Assign this directory as .OBJDIR if possible. # # The expected OBJDIR already exists, set it as .OBJDIR. -.if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}${.CURDIR}) -.OBJDIR: ${MAKEOBJDIRPREFIX}${.CURDIR} -.elif exists(${MAKEOBJDIR}) -.OBJDIR: ${MAKEOBJDIR} +.if !empty(__objdir) && exists(${__objdir}) +.OBJDIR: ${__objdir} # Special case to work around bmake bug. If the top-level .OBJDIR does not yet # exist and MAKEOBJDIR is passed into environment and yield a blank value, # bmake will incorrectly set .OBJDIR=${SRCTOP}/ rather than the expected From owner-svn-src-all@freebsd.org Sun Nov 5 00:12:14 2017 Return-Path: Delivered-To: svn-src-all@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 76F85E5AFF4; Sun, 5 Nov 2017 00:12:14 +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 35F4A642B2; Sun, 5 Nov 2017 00:12:14 +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 vA50CDI6043897; Sun, 5 Nov 2017 00:12:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50CDcW043892; Sun, 5 Nov 2017 00:12:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050012.vA50CDcW043892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325418 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:12:14 -0000 Author: bdrewery Date: Sun Nov 5 00:12:12 2017 New Revision: 325418 URL: https://svnweb.freebsd.org/changeset/base/325418 Log: AUTO_OBJ: Allow 'make cleandir obj all' combinations. The cleanobj target will not really remove the OBJDIR in this case, it will only remove the OBJDIR if only clean targets are ran. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.init.mk head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sun Nov 5 00:12:09 2017 (r325417) +++ head/share/mk/bsd.dep.mk Sun Nov 5 00:12:12 2017 (r325418) @@ -327,6 +327,10 @@ cleandepend: .endif .ORDER: cleandepend all .ORDER: cleandepend depend +.if ${MK_AUTO_OBJ} == "yes" +.ORDER: cleanobj depend +.ORDER: cleandir depend +.endif .if !target(checkdpadd) && (defined(DPADD) || defined(LDADD)) _LDADD_FROM_DPADD= ${DPADD:R:T:C;^lib(.*)$;-l\1;g} Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Sun Nov 5 00:12:09 2017 (r325417) +++ head/share/mk/bsd.init.mk Sun Nov 5 00:12:12 2017 (r325418) @@ -64,7 +64,8 @@ _SKIP_BUILD= not building at level 0 ${.TARGETS:M*install*} == ${.TARGETS} || \ ${.TARGETS:Mclean*} == ${.TARGETS} || \ ${.TARGETS:Mdestroy*} == ${.TARGETS} || \ - make(obj) || make(analyze) || make(print-dir) + ${.TARGETS:Mobj} == ${.TARGETS} || \ + make(analyze) || make(print-dir) # Skip building, but don't show a warning. _SKIP_BUILD= .endif Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Sun Nov 5 00:12:09 2017 (r325417) +++ head/share/mk/bsd.obj.mk Sun Nov 5 00:12:12 2017 (r325418) @@ -164,7 +164,8 @@ whereobj: .endif # Same check in bsd.progs.mk -.if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) +.if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) && \ + (${MK_AUTO_OBJ} == "no" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} == "") cleanobj: -rm -rf ${CANONICALOBJDIR} .else @@ -188,6 +189,10 @@ clean: .endif .endif .ORDER: clean all +.if ${MK_AUTO_OBJ} == "yes" +.ORDER: cleanobj all +.ORDER: cleandir all +.endif .include From owner-svn-src-all@freebsd.org Sun Nov 5 00:13:34 2017 Return-Path: Delivered-To: svn-src-all@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 17029E5B220; Sun, 5 Nov 2017 00:13:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF166649D0; Sun, 5 Nov 2017 00:13:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id DD57E16574; Sun, 5 Nov 2017 00:12:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 1EA4291BC; Sun, 5 Nov 2017 00:12:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id GUxMct79ZDAA; Sun, 5 Nov 2017 00:12:35 +0000 (UTC) Subject: Re: svn commit: r325404 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 1437291B4 From: Bryan Drewery To: Cy Schubert Cc: "O. Hartmann" , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201711042230.vA4MUhjw014138@slippy.cwsent.com> Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Sat, 4 Nov 2017 17:12:36 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jd5aa1W7povpBFPr1nqjb2xhVAv2QJAJI" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:13:34 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jd5aa1W7povpBFPr1nqjb2xhVAv2QJAJI Content-Type: multipart/mixed; boundary="a4v8qebmubPimsLtRnfCw0RINtwFC8x8D"; protected-headers="v1" From: Bryan Drewery To: Cy Schubert Cc: "O. Hartmann" , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: Subject: Re: svn commit: r325404 - head/share/mk References: <201711042230.vA4MUhjw014138@slippy.cwsent.com> In-Reply-To: --a4v8qebmubPimsLtRnfCw0RINtwFC8x8D Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/4/2017 4:57 PM, Bryan Drewery wrote: > On 11/4/2017 3:30 PM, Cy Schubert wrote: >> In message <0fc7e918-dcf8-0197-6b50-5936dee23d87@FreeBSD.org>, Bryan=20 >> Drewery wr >> ites: >>> This is an OpenPGP/MIME signed message (RFC 4880 and 3156) >>> --dokLDw6wDnv1gUfKm3uwMSMnWeibN2RaD >>> Content-Type: multipart/mixed; boundary=3D"MKHGkKGfLlBFL1Vl1W5AEj2Bcc= B14C28h"; >>> protected-headers=3D"v1" >>> From: Bryan Drewery >>> To: "O. Hartmann" , "Simon J. Gerraty" >>> >>> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, >>> src-committers@freebsd.org >>> Message-ID: <0fc7e918-dcf8-0197-6b50-5936dee23d87@FreeBSD.org> >>> Subject: Re: svn commit: r325404 - head/share/mk >>> References: <201711042102.vA4L2RuR063978@repo.freebsd.org> >>> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> >>> <20171104223650.77c06a52@thor.intern.walstatt.dynvpn.de> >>> In-Reply-To: <20171104223650.77c06a52@thor.intern.walstatt.dynvpn.de>= >>> >>> --MKHGkKGfLlBFL1Vl1W5AEj2BccB14C28h >>> Content-Type: text/plain; charset=3Dutf-8 >>> Content-Language: en-US >>> Content-Transfer-Encoding: quoted-printable >>> >>> On 11/4/2017 2:36 PM, O. Hartmann wrote: >>>> Am Sat, 4 Nov 2017 22:31:33 +0100 >>>> "O. Hartmann" schrieb: >>>> =3D20 >>>>> Am Sat, 4 Nov 2017 21:02:27 +0000 (UTC) >>>>> "Simon J. Gerraty" schrieb: >>>>> >>>>>> Author: sjg >>>>>> Date: Sat Nov 4 21:02:26 2017 >>>>>> New Revision: 325404 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/325404 >>>>>> >>>>>> Log: >>>>>> Ensure .OBJDIR has known value >>>>>> =3D20 >>>>>> If for any reason we cannot set .OBJDIR=3D3D=3D3D_objdir as desi= red >>>>>> use .CURDIR so that at least the classic >>>>>> .if ${.OBJDIR} !=3D3D ${.CURDIR} >>>>>> works and dangerous misstakes can be avoided. >>>>>> =3D20 >>>>>> Reviewed by: bdrewery >>>>>> >>>>>> Modified: >>>>>> head/share/mk/auto.obj.mk >>>>>> >>>>>> Modified: head/share/mk/auto.obj.mk >>>>>> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D= 3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >>> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3= D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >>> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3= D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >>> =3D3D=3D3D=3D3D=3D3D=3D3D >>>>>> --- head/share/mk/auto.obj.mk Sat Nov 4 16:23:34 2017 (r32540 >>> 3) >>>>>> +++ head/share/mk/auto.obj.mk Sat Nov 4 21:02:26 2017 (r32540 >>> 4) >>>>>> @@ -61,11 +61,17 @@ __objdir_made !=3D3D echo ${__objdir}/; umask = ${OBJ=3D >>> DIR_UMA >>>>>> .endif >>>>>> # This causes make to use the specified directory as .OBJDIR >>>>>> .OBJDIR: ${__objdir} >>>>>> -.if ${.OBJDIR:tA} !=3D3D ${__objdir:tA} && ${__objdir_made:Uno:M$= {__ob=3D >>> jdir}/*} !=3D3D "" >>>>>> +.if ${.OBJDIR:tA} !=3D3D ${__objdir:tA} >>>>>> +# we did not get what we want - do we care? >>>>>> +.if ${__objdir_made:Uno:M${__objdir}/*} !=3D3D "" >>>>>> # watch out for __objdir being relative path >>>>>> .if !(${__objdir:M/*} =3D3D=3D3D "" && ${.OBJDIR:tA} =3D3D=3D3D $= {${.CURDIR}=3D >>> /${__objdir}:L:tA}) >>>>>> .error could not use ${__objdir}: .OBJDIR=3D3D${.OBJDIR} >>>>>> .endif >>>>>> +.endif >>>>>> +# apparently we can live with it >>>>>> +# make sure we know what we have >>>>>> +.OBJDIR: ${.CURDIR} >>>>>> .endif >>>>>> .endif >>>>>> .endif >>>>>> _______________________________________________ >>>>>> svn-src-head@freebsd.org mailing list >>>>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>>>>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd= =2Eor=3D >>> g" =3D20 >>>>> >>>>> With the recent patches, nvidia driver x11/nvidia-driver fails tobu= ild=3D >>> with the error >>>>> shown below: >>>>> >>>>> [...] >>>>> =3D3D=3D3D=3D3D> src/nvidia (all) =3D20 >>>>> make[7]: "/usr/src/share/mk/bsd.obj.mk" line 87: Malformed conditio= nal=3D >>> >>>>> (${CANONICALOBJDIR} =3D3D=3D3D /${RELDIR} || ${.OBJDIR} =3D3D=3D3D = /${RELDIR})=3D >>> make[7]: Fatal errors >>>>> encountered -- cannot continue >>>>> [...] >>>> =3D20 >>>> The very same with emulators/virtualbox-ose-kmod: >>>> =3D20 >>>> [...] >>>> kBuild: >>>> Installing /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators= /vi=3D >>> rtualbox-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin= /src=3D >>> /vboxdrv/Makefile >>>> =3D3D=3D3D=3D3D Building 'vboxdrv' module =3D3D=3D3D=3D3D make[6]: "= /usr/src/share/=3D >>> mk/bsd.obj.mk" line 87: >>>> Malformed conditional (${CANONICALOBJDIR} =3D3D=3D3D /${RELDIR} || $= {.OBJDI=3D >>> R} =3D3D=3D3D /${RELDIR}) >>>> make[6]: Fatal errors encountered -- cannot continue make[6]: stoppe= d >>>> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtual= box=3D >>> -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vbo= xdrv=3D >>> >>>> *** Error code 1 >>>> =3D20 >>>> Stop. >>>> make[5]: stopped >>>> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtual= box=3D >>> -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src >>>> =3D3D=3D3D=3D3D> Compilation failed unexpectedly. Try to set MAKE_JO= BS_UNSAFE=3D >>> =3D3Dyes and rebuild before >>>> reporting the failure to the maintainer. >>>> *** Error code 1 >>>> =3D20 >>>> =3D20 >>> >>> It was r325405 ... fixed in r325408. >> >> >> Not really, mergemaster output. >> >> *** Creating the temporary root environment in /tmp/temproot >> *** /tmp/temproot ready for use >> *** Creating and populating directory structure in /tmp/temproot >> >> make[3]: "/opt/src/svn-current/share/mk/bsd.obj.mk" line 89: .OBJDIR=20 >> incorrectly set to /etc/autofs >> >> *** FATAL ERROR: Cannot 'cd' to /opt/src/svn-current and install fil= es to >> the temproot environment >> >> >=20 > That's actually a good thing. What command did you run? >=20 I got ahead of myself with the assertion in r325405 since the bug wasn't fully fixed yet, but I'm glad the assertion works properly. The mergemaster issue is now fixed in r325416. --=20 Regards, Bryan Drewery --a4v8qebmubPimsLtRnfCw0RINtwFC8x8D-- --jd5aa1W7povpBFPr1nqjb2xhVAv2QJAJI 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 iQEcBAEBAgAGBQJZ/ld1AAoJEDXXcbtuRpfP1LMIAIpDK5umQfzgeOJ658IFYLMT uxjby14K+m6u0pU7ZpPY3aGLYgD0qQ1KMqFu+9FMFJH5UnLwGyxNMTk/jx6K8TiF Y23QwmN9bKMsGsoR1BC2ZBuE8G3oWeXYu4dZ6Sf7OdqXUwCwl20nOIdlfLCQ+rz4 mgHsVih5PddUDkJjuS+tiVKRpWwipprFnf6kDzk+PK1dkvamDuYDidqyLiwTRKUD sCqy9Lpus2tahQ3UXnkC0kneoZFkd1biBYxov47pX+v6Y1FZo8gisLcj+oBNT+wO JzE2s92+6BvAxCn/1UPF1/R0IrT3ZSIoexu0zoSr+10PtKXiqtZwRGsnP/QdkhI= =36uU -----END PGP SIGNATURE----- --jd5aa1W7povpBFPr1nqjb2xhVAv2QJAJI-- From owner-svn-src-all@freebsd.org Sun Nov 5 00:13:45 2017 Return-Path: Delivered-To: svn-src-all@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 13A35E5B260; Sun, 5 Nov 2017 00:13:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C490F64AC7; Sun, 5 Nov 2017 00:13:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 042291665D; Sun, 5 Nov 2017 00:13:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 490E391DA; Sun, 5 Nov 2017 00:13:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ZhPWb9S9iG8p; Sun, 5 Nov 2017 00:13:15 +0000 (UTC) Subject: Re: svn commit: r325404 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7F4BE91D3 To: Don Lewis Cc: Cy Schubert , "O. Hartmann" , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201711042230.vA4MUhjw014138@slippy.cwsent.com> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <4622f043-cdb2-4929-eb59-9c82dc9afeaf@FreeBSD.org> Date: Sat, 4 Nov 2017 17:13:17 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eJpwhFHhVPSB1RfC4GtbBAnUmKcIJPhLf" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:13:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eJpwhFHhVPSB1RfC4GtbBAnUmKcIJPhLf Content-Type: multipart/mixed; boundary="cVSGP9cfXLpwphhM0vl8JmLIKLonIrpDu"; protected-headers="v1" From: Bryan Drewery To: Don Lewis Cc: Cy Schubert , "O. Hartmann" , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <4622f043-cdb2-4929-eb59-9c82dc9afeaf@FreeBSD.org> Subject: Re: svn commit: r325404 - head/share/mk References: <201711042230.vA4MUhjw014138@slippy.cwsent.com> In-Reply-To: --cVSGP9cfXLpwphhM0vl8JmLIKLonIrpDu Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/4/2017 5:11 PM, Don Lewis wrote: > On 4 Nov, Bryan Drewery wrote: >> On 11/4/2017 3:30 PM, Cy Schubert wrote: >>> In message <0fc7e918-dcf8-0197-6b50-5936dee23d87@FreeBSD.org>, Bryan = >>> Drewery wr >>> ites: >>>> This is an OpenPGP/MIME signed message (RFC 4880 and 3156) >>>> --dokLDw6wDnv1gUfKm3uwMSMnWeibN2RaD >>>> Content-Type: multipart/mixed; boundary=3D"MKHGkKGfLlBFL1Vl1W5AEj2Bc= cB14C28h"; >>>> protected-headers=3D"v1" >>>> From: Bryan Drewery >>>> To: "O. Hartmann" , "Simon J. Gerraty" >>>> >>>> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, >>>> src-committers@freebsd.org >>>> Message-ID: <0fc7e918-dcf8-0197-6b50-5936dee23d87@FreeBSD.org> >>>> Subject: Re: svn commit: r325404 - head/share/mk >>>> References: <201711042102.vA4L2RuR063978@repo.freebsd.org> >>>> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> >>>> <20171104223650.77c06a52@thor.intern.walstatt.dynvpn.de> >>>> In-Reply-To: <20171104223650.77c06a52@thor.intern.walstatt.dynvpn.de= > >>>> >>>> --MKHGkKGfLlBFL1Vl1W5AEj2BccB14C28h >>>> Content-Type: text/plain; charset=3Dutf-8 >>>> Content-Language: en-US >>>> Content-Transfer-Encoding: quoted-printable >>>> >>>> On 11/4/2017 2:36 PM, O. Hartmann wrote: >>>>> Am Sat, 4 Nov 2017 22:31:33 +0100 >>>>> "O. Hartmann" schrieb: >>>>> =3D20 >>>>>> Am Sat, 4 Nov 2017 21:02:27 +0000 (UTC) >>>>>> "Simon J. Gerraty" schrieb: >>>>>> >>>>>>> Author: sjg >>>>>>> Date: Sat Nov 4 21:02:26 2017 >>>>>>> New Revision: 325404 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/325404 >>>>>>> >>>>>>> Log: >>>>>>> Ensure .OBJDIR has known value >>>>>>> =3D20 >>>>>>> If for any reason we cannot set .OBJDIR=3D3D=3D3D_objdir as des= ired >>>>>>> use .CURDIR so that at least the classic >>>>>>> .if ${.OBJDIR} !=3D3D ${.CURDIR} >>>>>>> works and dangerous misstakes can be avoided. >>>>>>> =3D20 >>>>>>> Reviewed by: bdrewery >>>>>>> >>>>>>> Modified: >>>>>>> head/share/mk/auto.obj.mk >>>>>>> >>>>>>> Modified: head/share/mk/auto.obj.mk >>>>>>> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >>>> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D= 3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >>>> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D= 3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D >>>> =3D3D=3D3D=3D3D=3D3D=3D3D >>>>>>> --- head/share/mk/auto.obj.mk Sat Nov 4 16:23:34 2017 (r32540 >>>> 3) >>>>>>> +++ head/share/mk/auto.obj.mk Sat Nov 4 21:02:26 2017 (r32540 >>>> 4) >>>>>>> @@ -61,11 +61,17 @@ __objdir_made !=3D3D echo ${__objdir}/; umask= ${OBJ=3D >>>> DIR_UMA >>>>>>> .endif >>>>>>> # This causes make to use the specified directory as .OBJDIR >>>>>>> .OBJDIR: ${__objdir} >>>>>>> -.if ${.OBJDIR:tA} !=3D3D ${__objdir:tA} && ${__objdir_made:Uno:M= ${__ob=3D >>>> jdir}/*} !=3D3D "" >>>>>>> +.if ${.OBJDIR:tA} !=3D3D ${__objdir:tA} >>>>>>> +# we did not get what we want - do we care? >>>>>>> +.if ${__objdir_made:Uno:M${__objdir}/*} !=3D3D "" >>>>>>> # watch out for __objdir being relative path >>>>>>> .if !(${__objdir:M/*} =3D3D=3D3D "" && ${.OBJDIR:tA} =3D3D=3D3D = ${${.CURDIR}=3D >>>> /${__objdir}:L:tA}) >>>>>>> .error could not use ${__objdir}: .OBJDIR=3D3D${.OBJDIR} >>>>>>> .endif >>>>>>> +.endif >>>>>>> +# apparently we can live with it >>>>>>> +# make sure we know what we have >>>>>>> +.OBJDIR: ${.CURDIR} >>>>>>> .endif >>>>>>> .endif >>>>>>> .endif >>>>>>> _______________________________________________ >>>>>>> svn-src-head@freebsd.org mailing list >>>>>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>>>>>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebs= d.or=3D >>>> g" =3D20 >>>>>> >>>>>> With the recent patches, nvidia driver x11/nvidia-driver fails tob= uild=3D >>>> with the error >>>>>> shown below: >>>>>> >>>>>> [...] >>>>>> =3D3D=3D3D=3D3D> src/nvidia (all) =3D20 >>>>>> make[7]: "/usr/src/share/mk/bsd.obj.mk" line 87: Malformed conditi= onal=3D >>>> >>>>>> (${CANONICALOBJDIR} =3D3D=3D3D /${RELDIR} || ${.OBJDIR} =3D3D=3D3D= /${RELDIR})=3D >>>> make[7]: Fatal errors >>>>>> encountered -- cannot continue >>>>>> [...] >>>>> =3D20 >>>>> The very same with emulators/virtualbox-ose-kmod: >>>>> =3D20 >>>>> [...] >>>>> kBuild: >>>>> Installing /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulator= s/vi=3D >>>> rtualbox-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bi= n/src=3D >>>> /vboxdrv/Makefile >>>>> =3D3D=3D3D=3D3D Building 'vboxdrv' module =3D3D=3D3D=3D3D make[6]: = "/usr/src/share/=3D >>>> mk/bsd.obj.mk" line 87: >>>>> Malformed conditional (${CANONICALOBJDIR} =3D3D=3D3D /${RELDIR} || = ${.OBJDI=3D >>>> R} =3D3D=3D3D /${RELDIR}) >>>>> make[6]: Fatal errors encountered -- cannot continue make[6]: stopp= ed >>>>> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtua= lbox=3D >>>> -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vb= oxdrv=3D >>>> >>>>> *** Error code 1 >>>>> =3D20 >>>>> Stop. >>>>> make[5]: stopped >>>>> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtua= lbox=3D >>>> -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src >>>>> =3D3D=3D3D=3D3D> Compilation failed unexpectedly. Try to set MAKE_J= OBS_UNSAFE=3D >>>> =3D3Dyes and rebuild before >>>>> reporting the failure to the maintainer. >>>>> *** Error code 1 >>>>> =3D20 >>>>> =3D20 >>>> >>>> It was r325405 ... fixed in r325408. >>> >>> >>> Not really, mergemaster output. >>> >>> *** Creating the temporary root environment in /tmp/temproot >>> *** /tmp/temproot ready for use >>> *** Creating and populating directory structure in /tmp/temproot >>> >>> make[3]: "/opt/src/svn-current/share/mk/bsd.obj.mk" line 89: .OBJDIR = >>> incorrectly set to /etc/autofs >>> >>> *** FATAL ERROR: Cannot 'cd' to /opt/src/svn-current and install fi= les to >>> the temproot environment >>> >>> >> >> That's actually a good thing. What command did you run? >=20 > I got the following when attempting to update a poudriere jail to > r325409: >=20 > --- obj_subdir_sys --- > make[5]: "/var/poudriere/jails/120CURRENTamd64/usr/src/share/mk/bsd.obj= =2Emk" line 89: .OBJDIR incorrectly set to /sys/boot/libsa > *** [obj_subdir_sys/boot/libsa] Error code 1 >=20 > make[4]: stopped in /var/poudriere/jails/120CURRENTamd64/usr/src/sys/bo= ot >=20 >=20 Should be fixed in r325416. --=20 Regards, Bryan Drewery --cVSGP9cfXLpwphhM0vl8JmLIKLonIrpDu-- --eJpwhFHhVPSB1RfC4GtbBAnUmKcIJPhLf 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 iQEcBAEBAgAGBQJZ/ledAAoJEDXXcbtuRpfPIAwIALDhX7l8dTjqf8xocy1RpCHV jgaxbDy6ShSnkC7O4TIhLEehKhJcCxZ3EVLCsqwJpm5WWU3bMa0q3iAMLq+S99/D d/7beZDqNYoFYj17PSwj7386KtLnY0dxaqNxGMBDa+SRFFlNU/bEZSeY4iugZAL2 DQnuxF4UWIL6XmlSLyabAmnArrqXJtESifPrnVByhNrnTOHAM3yf9uUNnfhdlYm6 1Mbd6VQtxUTqbfnBNajrb3J0XamKDCC87h6oBXDTVqZPjPba6fcjsTJVrETxjn6P P/eehMQEWcwPK/Ve9LKU0Hrt62vfZhwB33T+xINmMyb7ehW+nqo79gmZPXV/MD4= =r8aS -----END PGP SIGNATURE----- --eJpwhFHhVPSB1RfC4GtbBAnUmKcIJPhLf-- From owner-svn-src-all@freebsd.org Sun Nov 5 00:26:29 2017 Return-Path: Delivered-To: svn-src-all@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 D419FE5B8F7; Sun, 5 Nov 2017 00:26:29 +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 A03816533A; Sun, 5 Nov 2017 00:26:29 +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 vA50QSEi051085; Sun, 5 Nov 2017 00:26:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50QSwW051084; Sun, 5 Nov 2017 00:26:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711050026.vA50QSwW051084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 00:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325419 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:26:29 -0000 Author: bdrewery Date: Sun Nov 5 00:26:28 2017 New Revision: 325419 URL: https://svnweb.freebsd.org/changeset/base/325419 Log: Avoid trying to remove a fullpath directory in CLEANDIRS. Let CLEANDIRS work relative since make is already in .OBJDIR. MFC after: 2 weeks X-MFC-With: r322511 Sponsored by: Dell EMC Isilon Modified: head/share/mk/suite.test.mk Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Sun Nov 5 00:12:12 2017 (r325418) +++ head/share/mk/suite.test.mk Sun Nov 5 00:26:28 2017 (r325419) @@ -101,11 +101,11 @@ realcheck: .PHONY fi @env ${TESTS_ENV:Q} ${KYUA} test -k ${DESTDIR}${TESTSDIR}/Kyuafile -MAKE_CHECK_SANDBOX_DIR= ${.OBJDIR}/checkdir +MAKE_CHECK_SANDBOX_DIR= checkdir CLEANDIRS+= ${MAKE_CHECK_SANDBOX_DIR} .if ${MK_MAKE_CHECK_USE_SANDBOX} != "no" && make(check) -DESTDIR:= ${MAKE_CHECK_SANDBOX_DIR} +DESTDIR:= ${.OBJDIR}/${MAKE_CHECK_SANDBOX_DIR} beforecheck: .for t in clean depend all From owner-svn-src-all@freebsd.org Sun Nov 5 00:44:42 2017 Return-Path: Delivered-To: svn-src-all@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 44130E5BDD5; Sun, 5 Nov 2017 00:44:42 +0000 (UTC) (envelope-from srs0=133k=cd=sigsegv.be=kristof@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB51265A6F; Sun, 5 Nov 2017 00:44:41 +0000 (UTC) (envelope-from srs0=133k=cd=sigsegv.be=kristof@codepro.be) Received: from [192.168.228.1] (n219078030071.netvigator.com [219.78.30.71]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id CEE104DAF2; Sun, 5 Nov 2017 01:44:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sigsegv.be; s=mail; t=1509842678; bh=h+Hlrmdy86wgHTYOhdOwOOJ2K6JA0n2k9Y8WWf6i8Qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=aUM+LuxVOj4x0qNdfC6xsCzCMIo4+ljxPLBwu8M+PIslSyPDeA9hC4/UJvVyuAZsc aq2l8d08V0DJdzgGrF6+XQGUdUtoUQ/D3PiDEiauHpHwveWQPYtf2WDew56f7wm+pL PesAaHXnAF6gCNqutvXpvGprOcxL+2AjLKkFVj0c= From: "Kristof Provost" To: "Andriy Voskoboinyk" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324657 - head/usr.sbin/wlandebug Date: Sun, 05 Nov 2017 08:45:30 +0800 Message-ID: <9057DDCF-F38A-45F5-A3CB-3ED9F5C00111@sigsegv.be> In-Reply-To: <201710160701.v9G71RHX065541@repo.freebsd.org> References: <201710160701.v9G71RHX065541@repo.freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate (2.0BETAr6093) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:44:42 -0000 On 16 Oct 2017, at 15:01, Andriy Voskoboinyk wrote: > Author: avos > Date: Mon Oct 16 07:01:27 2017 > New Revision: 324657 > URL: https://svnweb.freebsd.org/changeset/base/324657 > > Log: > wlandebug(8): obtain original interface name via > ifconfig_get_orig_name() > > Modified: > head/usr.sbin/wlandebug/Makefile > head/usr.sbin/wlandebug/wlandebug.c > This appears to have broken bsdbox: /usr/home/kp/tplink/src/contrib/netcat/netcat.c:351: warning: warning: mktemp() possibly used unsafely; consider using mkstemp() wlandebug.lo: In function `get_orig_iface_name': /usr/home/kp/tplink/src/usr.sbin/wlandebug/wlandebug.c:171: undefined reference to `ifconfig_open' /usr/home/kp/tplink/src/usr.sbin/wlandebug/wlandebug.c:172: undefined reference to `ifconfig_get_orig_name' /usr/home/kp/tplink/src/usr.sbin/wlandebug/wlandebug.c:173: undefined reference to `ifconfig_err_errno' /usr/home/kp/tplink/src/usr.sbin/wlandebug/wlandebug.c:178: undefined reference to `ifconfig_close' collect2: error: ld returned 1 exit status --- bsdbox --- *** [bsdbox] Error code 1 make[4]: stopped in /usr/home/kp/tplink/obj/mips_ap/usr/home/kp/tplink/src/mips.mips/tools/bsdbox This is a freebsd-wifi-build driven cross-compile for mips. bsdbox now requires libifconfig. I’ve had a quick try to teach it how to include that, but haven’t managed to get that to work yet. Regards, Kristof From owner-svn-src-all@freebsd.org Sun Nov 5 00:51:54 2017 Return-Path: Delivered-To: svn-src-all@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 813EFE5BFEA; Sun, 5 Nov 2017 00:51:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47E3765DFC; Sun, 5 Nov 2017 00:51:54 +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 vA50prrM060473; Sun, 5 Nov 2017 00:51:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA50prZc060472; Sun, 5 Nov 2017 00:51:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711050051.vA50prZc060472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Nov 2017 00:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325420 - head/contrib/llvm/lib/Support/Unix X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/lib/Support/Unix X-SVN-Commit-Revision: 325420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 00:51:54 -0000 Author: emaste Date: Sun Nov 5 00:51:53 2017 New Revision: 325420 URL: https://svnweb.freebsd.org/changeset/base/325420 Log: lld: accept EINVAL to indicate posix_fallocate is unsupported As of r325320 posix_fallocate on a ZFS filesystem returns EINVAL to indicate that the operation is not supported. (I think this is a strange choice of errno on the part of POSIX.) PR: 223383, 223440 Reported by: Mark Millard Tested by: Mark Millard MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/contrib/llvm/lib/Support/Unix/Path.inc Modified: head/contrib/llvm/lib/Support/Unix/Path.inc ============================================================================== --- head/contrib/llvm/lib/Support/Unix/Path.inc Sun Nov 5 00:26:28 2017 (r325419) +++ head/contrib/llvm/lib/Support/Unix/Path.inc Sun Nov 5 00:51:53 2017 (r325420) @@ -427,7 +427,7 @@ std::error_code resize_file(int FD, uint64_t Size) { // If we have posix_fallocate use it. Unlike ftruncate it always allocates // space, so we get an error if the disk is full. if (int Err = ::posix_fallocate(FD, 0, Size)) { - if (Err != EOPNOTSUPP) + if (Err != EINVAL && Err != EOPNOTSUPP) return std::error_code(Err, std::generic_category()); } #endif From owner-svn-src-all@freebsd.org Sun Nov 5 01:27:49 2017 Return-Path: Delivered-To: svn-src-all@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 30019E5CF5B; Sun, 5 Nov 2017 01:27:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B51A66E06; Sun, 5 Nov 2017 01:27:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 293C51733A; Sun, 5 Nov 2017 01:27:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 2311E931A; Sun, 5 Nov 2017 01:27:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 92FfUp09zqmP; Sun, 5 Nov 2017 01:27:44 +0000 (UTC) Content-Type: text/plain; charset=utf-8 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com C6C949317 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r325416 - head/share/mk From: Bryan Drewery X-Mailer: iPhone Mail (15B93) In-Reply-To: <201711050012.vA50C6m8042948@repo.freebsd.org> Date: Sat, 4 Nov 2017 18:27:38 -0700 Cc: peter@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2AE40414-7976-4B43-90B2-41C32026A2B7@FreeBSD.org> References: <201711050012.vA50C6m8042948@repo.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 01:27:49 -0000 Pretty sure this fixes /etc host files being used in =E2=80=98make distribut= ion=E2=80=99 (without AUTO_OBJ) as the source files to install to DESTDIR si= nce many of the etc dirs use NO_OBJ. I am away from computer for a while so cannot confirm but some basic tests b= efore I left showed it was possible and Peter has run into such a case. I=E2=80=99ll look more when I get home and mail current@ if it did fix it. I= t would have regressed since the src.sys.obj.mk commit the other day. Regards, Bryan Drewery > On Nov 4, 2017, at 17:12, Bryan Drewery wrote: >=20 > Author: bdrewery > Date: Sun Nov 5 00:12:05 2017 > New Revision: 325416 > URL: https://svnweb.freebsd.org/changeset/base/325416 >=20 > Log: > Always try to set .OBJDIR, even if AUTO_OBJ is enabled, and fallback to .= CURDIR. >=20 > When AUTO_OBJ is enabled this change becomes redundant with the auto.obj.= mk > check added in r325404. However, it is possible that new code is added > at some point between src.sys.obj.mk and auto.obj.mk that disables AUTO_O= BJ. > That could leave make with a bogus and unsafe .OBJDIR in some cases. >=20 > Sponsored by: Dell EMC Isilon >=20 > Modified: > head/share/mk/src.sys.obj.mk >=20 > Modified: head/share/mk/src.sys.obj.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:02 2017 (r325415) > +++ head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:05 2017 (r325416) > @@ -154,9 +154,8 @@ MK_AUTO_OBJ:=3D ${OBJDIR_WRITABLE} > .export MK_AUTO_OBJ > .endif # ${MK_AUTO_OBJ} =3D=3D "no" && ... >=20 > -# Assign this directory as .OBJDIR if possible after determining if AUTO_= OBJ > -# can be enabled by default. > -.if ${MK_AUTO_OBJ} =3D=3D "no" > +# Assign this directory as .OBJDIR if possible. > +# > # The expected OBJDIR already exists, set it as .OBJDIR. > .if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}${.CURDIR}) > .OBJDIR: ${MAKEOBJDIRPREFIX}${.CURDIR} > @@ -169,5 +168,10 @@ MK_AUTO_OBJ:=3D ${OBJDIR_WRITABLE} > .elif ${MAKE_VERSION} <=3D 20170720 && \ > ${.CURDIR} =3D=3D ${SRCTOP} && ${.OBJDIR} =3D=3D ${SRCTOP}/ > .OBJDIR: ${.CURDIR} > +.else > +# The OBJDIR we wanted does not yet exist, ensure we default to safe .CUR= DIR > +# in case make started with a bogus MAKEOBJDIR, that expanded before OBJT= OP > +# was set, that happened to match some unexpected directory. Either > +# auto.obj.mk or bsd.obj.mk will create the directory and fix .OBJDIR lat= er. > +.OBJDIR: ${.CURDIR} > .endif > -.endif # ${MK_AUTO_OBJ} =3D=3D "no" >=20 From owner-svn-src-all@freebsd.org Sun Nov 5 01:36:16 2017 Return-Path: Delivered-To: svn-src-all@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 59713E5D2B2; Sun, 5 Nov 2017 01:36:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33594672BD; Sun, 5 Nov 2017 01:36:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 3290C1750C; Sun, 5 Nov 2017 01:36:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 5F4B7932D; Sun, 5 Nov 2017 01:36:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id eYOfRkcYPgE8; Sun, 5 Nov 2017 01:36:11 +0000 (UTC) Content-Type: text/plain; charset=utf-8 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 361989329 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r325416 - head/share/mk From: Bryan Drewery X-Mailer: iPhone Mail (15B93) In-Reply-To: <2AE40414-7976-4B43-90B2-41C32026A2B7@FreeBSD.org> Date: Sat, 4 Nov 2017 18:36:09 -0700 Cc: peter@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2264A0FB-9B5B-4E38-88D7-D0F7B3C0C3CC@FreeBSD.org> References: <201711050012.vA50C6m8042948@repo.freebsd.org> <2AE40414-7976-4B43-90B2-41C32026A2B7@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 01:36:16 -0000 > On Nov 4, 2017, at 18:27, Bryan Drewery wrote: >=20 > Pretty sure this fixes /etc host files being used in =E2=80=98make distrib= ution=E2=80=99 (without AUTO_OBJ) as the source files to install to DESTDIR s= ince many of the etc dirs use NO_OBJ. > I am away from computer for a while so cannot confirm but some basic tests= before I left showed it was possible and Peter has run into such a case. > I=E2=80=99ll look more when I get home and mail current@ if it did fix it.= It would have regressed since the src.sys.obj.mk commit the other day. >=20 If it wasn=E2=80=99t clear, any such case is definitely fixed by this commit= and=20 r325405 would assert it doesn=E2=80=99t happen again. I=E2=80=99m just not sure if the above is a possible failure case yet. >=20 > Regards, > Bryan Drewery >=20 >> On Nov 4, 2017, at 17:12, Bryan Drewery wrote: >>=20 >> Author: bdrewery >> Date: Sun Nov 5 00:12:05 2017 >> New Revision: 325416 >> URL: https://svnweb.freebsd.org/changeset/base/325416 >>=20 >> Log: >> Always try to set .OBJDIR, even if AUTO_OBJ is enabled, and fallback to .= CURDIR. >>=20 >> When AUTO_OBJ is enabled this change becomes redundant with the auto.obj.= mk >> check added in r325404. However, it is possible that new code is added >> at some point between src.sys.obj.mk and auto.obj.mk that disables AUTO_O= BJ. >> That could leave make with a bogus and unsafe .OBJDIR in some cases. >>=20 >> Sponsored by: Dell EMC Isilon >>=20 >> Modified: >> head/share/mk/src.sys.obj.mk >>=20 >> Modified: head/share/mk/src.sys.obj.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> --- head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:02 2017 (r325415)= >> +++ head/share/mk/src.sys.obj.mk Sun Nov 5 00:12:05 2017 (r325416)= >> @@ -154,9 +154,8 @@ MK_AUTO_OBJ:=3D ${OBJDIR_WRITABLE} >> .export MK_AUTO_OBJ >> .endif # ${MK_AUTO_OBJ} =3D=3D "no" && ... >>=20 >> -# Assign this directory as .OBJDIR if possible after determining if AUTO= _OBJ >> -# can be enabled by default. >> -.if ${MK_AUTO_OBJ} =3D=3D "no" >> +# Assign this directory as .OBJDIR if possible. >> +# >> # The expected OBJDIR already exists, set it as .OBJDIR. >> .if !empty(MAKEOBJDIRPREFIX) && exists(${MAKEOBJDIRPREFIX}${.CURDIR}) >> .OBJDIR: ${MAKEOBJDIRPREFIX}${.CURDIR} >> @@ -169,5 +168,10 @@ MK_AUTO_OBJ:=3D ${OBJDIR_WRITABLE} >> .elif ${MAKE_VERSION} <=3D 20170720 && \ >> ${.CURDIR} =3D=3D ${SRCTOP} && ${.OBJDIR} =3D=3D ${SRCTOP}/ >> .OBJDIR: ${.CURDIR} >> +.else >> +# The OBJDIR we wanted does not yet exist, ensure we default to safe .CU= RDIR >> +# in case make started with a bogus MAKEOBJDIR, that expanded before OBJ= TOP >> +# was set, that happened to match some unexpected directory. Either >> +# auto.obj.mk or bsd.obj.mk will create the directory and fix .OBJDIR la= ter. >> +.OBJDIR: ${.CURDIR} >> .endif >> -.endif # ${MK_AUTO_OBJ} =3D=3D "no" >>=20 >=20 >=20 From owner-svn-src-all@freebsd.org Sun Nov 5 01:44:00 2017 Return-Path: Delivered-To: svn-src-all@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 4241DE5D6C0; Sun, 5 Nov 2017 01:44:00 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DC86C677C0; Sun, 5 Nov 2017 01:43:59 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id B9yYeMmtGDJTWB9yZessSw; Sat, 04 Nov 2017 19:43:52 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=sC3jslCIGhcA:10 a=6I5d2MoRAAAA:8 a=BWvPGDcYAAAA:8 a=iaTFZB6CAAAA:8 a=VxmjJ2MpAAAA:8 a=YxBL1-UpAAAA:8 a=4kCip34jSpZ0RTkP-xsA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=pxhY87DP9d2VeQe4joPk:22 a=QWXrQ9iV8q7LKaLQ9lfw:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id DEFDF32D; Sat, 4 Nov 2017 18:43:49 -0700 (PDT) Received: from slippy (localhost [IPv6:0:0:0:0:0:0:0:1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vA51hnvP082564; Sat, 4 Nov 2017 18:43:49 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201711050143.vA51hnvP082564@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Bryan Drewery cc: Cy Schubert , "O. Hartmann" , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r325404 - head/share/mk In-Reply-To: Message from Bryan Drewery of "Sat, 04 Nov 2017 17:12:36 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 04 Nov 2017 18:43:49 -0700 X-CMAE-Envelope: MS4wfAWpZ5PdyDVfxkuxVR8VjkH9JHYwq3QvDMPZgByw9nqG0J2K7KTnYu3jNFA6Qfydq9upLhIVdQmWuisDwNLvAPUUGDG+I+H2bZMbeUU+JclGJrvzhBkR figvhIXOqpkpzf8ILGI+0fY3YWUnQh+Z+7r87lVEIqbmgorGvMr3dN05wtfbNEyT4nEka4zPoOsdQV/MTGPrAISdzpnVTHGMSMY3pzz2WsP1TKAhJhYkJtqO ARXjml7+9/317y6MKPKiXy17cc+p3e6kBeCZ4QEzBClNXMERdQ6x818/WBf/5jrzy2H7OEQdrjOWUtatGXhD9rik+XVsX7w6i6ZFuAIKpWBY+SsKnr2zbv+n 2AVmogFB X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 01:44:00 -0000 In message , Bryan Drewery wr ites: > This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > --jd5aa1W7povpBFPr1nqjb2xhVAv2QJAJI > Content-Type: multipart/mixed; boundary="a4v8qebmubPimsLtRnfCw0RINtwFC8x8D"; > protected-headers="v1" > From: Bryan Drewery > To: Cy Schubert > Cc: "O. Hartmann" , "Simon J. Gerraty" > , svn-src-head@freebsd.org, svn-src-all@freebsd.org, > src-committers@freebsd.org > Message-ID: > Subject: Re: svn commit: r325404 - head/share/mk > References: <201711042230.vA4MUhjw014138@slippy.cwsent.com> > > In-Reply-To: > > --a4v8qebmubPimsLtRnfCw0RINtwFC8x8D > Content-Type: text/plain; charset=utf-8 > Content-Language: en-US > Content-Transfer-Encoding: quoted-printable > > On 11/4/2017 4:57 PM, Bryan Drewery wrote: > > On 11/4/2017 3:30 PM, Cy Schubert wrote: > >> In message <0fc7e918-dcf8-0197-6b50-5936dee23d87@FreeBSD.org>, Bryan=20 > >> Drewery wr > >> ites: > >>> This is an OpenPGP/MIME signed message (RFC 4880 and 3156) > >>> --dokLDw6wDnv1gUfKm3uwMSMnWeibN2RaD > >>> Content-Type: multipart/mixed; boundary=3D"MKHGkKGfLlBFL1Vl1W5AEj2Bcc= > B14C28h"; > >>> protected-headers=3D"v1" > >>> From: Bryan Drewery > >>> To: "O. Hartmann" , "Simon J. Gerraty" > >>> > >>> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, > >>> src-committers@freebsd.org > >>> Message-ID: <0fc7e918-dcf8-0197-6b50-5936dee23d87@FreeBSD.org> > >>> Subject: Re: svn commit: r325404 - head/share/mk > >>> References: <201711042102.vA4L2RuR063978@repo.freebsd.org> > >>> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> > >>> <20171104223650.77c06a52@thor.intern.walstatt.dynvpn.de> > >>> In-Reply-To: <20171104223650.77c06a52@thor.intern.walstatt.dynvpn.de>= > > >>> > >>> --MKHGkKGfLlBFL1Vl1W5AEj2BccB14C28h > >>> Content-Type: text/plain; charset=3Dutf-8 > >>> Content-Language: en-US > >>> Content-Transfer-Encoding: quoted-printable > >>> > >>> On 11/4/2017 2:36 PM, O. Hartmann wrote: > >>>> Am Sat, 4 Nov 2017 22:31:33 +0100 > >>>> "O. Hartmann" schrieb: > >>>> =3D20 > >>>>> Am Sat, 4 Nov 2017 21:02:27 +0000 (UTC) > >>>>> "Simon J. Gerraty" schrieb: > >>>>> > >>>>>> Author: sjg > >>>>>> Date: Sat Nov 4 21:02:26 2017 > >>>>>> New Revision: 325404 > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/325404 > >>>>>> > >>>>>> Log: > >>>>>> Ensure .OBJDIR has known value > >>>>>> =3D20 > >>>>>> If for any reason we cannot set .OBJDIR=3D3D=3D3D_objdir as desi= > red > >>>>>> use .CURDIR so that at least the classic > >>>>>> .if ${.OBJDIR} !=3D3D ${.CURDIR} > >>>>>> works and dangerous misstakes can be avoided. > >>>>>> =3D20 > >>>>>> Reviewed by: bdrewery > >>>>>> > >>>>>> Modified: > >>>>>> head/share/mk/auto.obj.mk > >>>>>> > >>>>>> Modified: head/share/mk/auto.obj.mk > >>>>>> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D= > 3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D > >>> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3= > D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D > >>> =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3= > D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D > >>> =3D3D=3D3D=3D3D=3D3D=3D3D > >>>>>> --- head/share/mk/auto.obj.mk Sat Nov 4 16:23:34 2017 (r32540 > >>> 3) > >>>>>> +++ head/share/mk/auto.obj.mk Sat Nov 4 21:02:26 2017 (r32540 > >>> 4) > >>>>>> @@ -61,11 +61,17 @@ __objdir_made !=3D3D echo ${__objdir}/; umask = > ${OBJ=3D > >>> DIR_UMA > >>>>>> .endif > >>>>>> # This causes make to use the specified directory as .OBJDIR > >>>>>> .OBJDIR: ${__objdir} > >>>>>> -.if ${.OBJDIR:tA} !=3D3D ${__objdir:tA} && ${__objdir_made:Uno:M$= > {__ob=3D > >>> jdir}/*} !=3D3D "" > >>>>>> +.if ${.OBJDIR:tA} !=3D3D ${__objdir:tA} > >>>>>> +# we did not get what we want - do we care? > >>>>>> +.if ${__objdir_made:Uno:M${__objdir}/*} !=3D3D "" > >>>>>> # watch out for __objdir being relative path > >>>>>> .if !(${__objdir:M/*} =3D3D=3D3D "" && ${.OBJDIR:tA} =3D3D=3D3D $= > {${.CURDIR}=3D > >>> /${__objdir}:L:tA}) > >>>>>> .error could not use ${__objdir}: .OBJDIR=3D3D${.OBJDIR} > >>>>>> .endif > >>>>>> +.endif > >>>>>> +# apparently we can live with it > >>>>>> +# make sure we know what we have > >>>>>> +.OBJDIR: ${.CURDIR} > >>>>>> .endif > >>>>>> .endif > >>>>>> .endif > >>>>>> _______________________________________________ > >>>>>> svn-src-head@freebsd.org mailing list > >>>>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head > >>>>>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd= > =2Eor=3D > >>> g" =3D20 > >>>>> > >>>>> With the recent patches, nvidia driver x11/nvidia-driver fails tobu= > ild=3D > >>> with the error > >>>>> shown below: > >>>>> > >>>>> [...] > >>>>> =3D3D=3D3D=3D3D> src/nvidia (all) =3D20 > >>>>> make[7]: "/usr/src/share/mk/bsd.obj.mk" line 87: Malformed conditio= > nal=3D > >>> > >>>>> (${CANONICALOBJDIR} =3D3D=3D3D /${RELDIR} || ${.OBJDIR} =3D3D=3D3D = > /${RELDIR})=3D > >>> make[7]: Fatal errors > >>>>> encountered -- cannot continue > >>>>> [...] > >>>> =3D20 > >>>> The very same with emulators/virtualbox-ose-kmod: > >>>> =3D20 > >>>> [...] > >>>> kBuild: > >>>> Installing /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators= > /vi=3D > >>> rtualbox-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin= > /src=3D > >>> /vboxdrv/Makefile > >>>> =3D3D=3D3D=3D3D Building 'vboxdrv' module =3D3D=3D3D=3D3D make[6]: "= > /usr/src/share/=3D > >>> mk/bsd.obj.mk" line 87: > >>>> Malformed conditional (${CANONICALOBJDIR} =3D3D=3D3D /${RELDIR} || $= > {.OBJDI=3D > >>> R} =3D3D=3D3D /${RELDIR}) > >>>> make[6]: Fatal errors encountered -- cannot continue make[6]: stoppe= > d > >>>> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtual= > box=3D > >>> -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vbo= > xdrv=3D > >>> > >>>> *** Error code 1 > >>>> =3D20 > >>>> Stop. > >>>> make[5]: stopped > >>>> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtual= > box=3D > >>> -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src > >>>> =3D3D=3D3D=3D3D> Compilation failed unexpectedly. Try to set MAKE_JO= > BS_UNSAFE=3D > >>> =3D3Dyes and rebuild before > >>>> reporting the failure to the maintainer. > >>>> *** Error code 1 > >>>> =3D20 > >>>> =3D20 > >>> > >>> It was r325405 ... fixed in r325408. > >> > >> > >> Not really, mergemaster output. > >> > >> *** Creating the temporary root environment in /tmp/temproot > >> *** /tmp/temproot ready for use > >> *** Creating and populating directory structure in /tmp/temproot > >> > >> make[3]: "/opt/src/svn-current/share/mk/bsd.obj.mk" line 89: .OBJDIR=20 > >> incorrectly set to /etc/autofs > >> > >> *** FATAL ERROR: Cannot 'cd' to /opt/src/svn-current and install fil= > es to > >> the temproot environment > >> > >> > >=20 > > That's actually a good thing. What command did you run? > >=20 > > I got ahead of myself with the assertion in r325405 since the bug wasn't > fully fixed yet, but I'm glad the assertion works properly. > > The mergemaster issue is now fixed in r325416. It works now, thanks. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sun Nov 5 02:47:47 2017 Return-Path: Delivered-To: svn-src-all@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 A8927E5F516; Sun, 5 Nov 2017 02:47:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 637DD69A5E; Sun, 5 Nov 2017 02:47:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA52lkfw008624; Sun, 5 Nov 2017 02:47:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA52lkZu008621; Sun, 5 Nov 2017 02:47:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711050247.vA52lkZu008621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 5 Nov 2017 02:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325421 - in head/sys: conf powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/mpc85xx X-SVN-Commit-Revision: 325421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 02:47:47 -0000 Author: jhibbits Date: Sun Nov 5 02:47:46 2017 New Revision: 325421 URL: https://svnweb.freebsd.org/changeset/base/325421 Log: Add Freescale QorIQ SATA controller support. The Freescale SATA controller has many similarities to AHCI controllers, so this driver is a heavily modified AHCI driver. Currently it seems to only do SATA 1.0 speeds (~100-150MB/s), so there is still room for improvement. Still to be done: * Address erratum SATA-A-006187 -- Spread Spectrum Support (intermittent non-recoverable transient data integrity error seen when SSC enabled). * Linux doesn't read the log page as it hangs on the P1022. See if that's applicable to this, and address accordingly. * Try to determine what's holding back performance, and address it. MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D6071 Added: head/sys/powerpc/mpc85xx/fsl_sata.c (contents, props changed) head/sys/powerpc/mpc85xx/fsl_sata.h (contents, props changed) Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Nov 5 00:51:53 2017 (r325420) +++ head/sys/conf/files.powerpc Sun Nov 5 02:47:46 2017 (r325421) @@ -141,6 +141,7 @@ powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt powerpc/mpc85xx/ds1553_core.c optional ds1553 powerpc/mpc85xx/fsl_diu.c optional mpc85xx diu powerpc/mpc85xx/fsl_espi.c optional mpc85xx spibus +powerpc/mpc85xx/fsl_sata.c optional mpc85xx ata powerpc/mpc85xx/i2c.c optional iicbus fdt powerpc/mpc85xx/isa.c optional mpc85xx isa powerpc/mpc85xx/lbc.c optional mpc85xx Added: head/sys/powerpc/mpc85xx/fsl_sata.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/mpc85xx/fsl_sata.c Sun Nov 5 02:47:46 2017 (r325421) @@ -0,0 +1,1917 @@ +/*- + * Copyright (c) 2009-2012 Alexander Motin + * Copyright (c) 2017 Justin Hibbits + * 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, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "fsl_sata.h" + +struct fsl_sata_channel; +struct fsl_sata_slot; +enum fsl_sata_err_type; +struct fsl_sata_cmd_tab; + + +/* local prototypes */ +static int fsl_sata_init(device_t dev); +static int fsl_sata_deinit(device_t dev); +static int fsl_sata_suspend(device_t dev); +static int fsl_sata_resume(device_t dev); +static void fsl_sata_pm(void *arg); +static void fsl_sata_intr(void *arg); +static void fsl_sata_intr_main(struct fsl_sata_channel *ch, uint32_t istatus); +static void fsl_sata_begin_transaction(struct fsl_sata_channel *ch, union ccb *ccb); +static void fsl_sata_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error); +static void fsl_sata_execute_transaction(struct fsl_sata_slot *slot); +static void fsl_sata_timeout(struct fsl_sata_slot *slot); +static void fsl_sata_end_transaction(struct fsl_sata_slot *slot, enum fsl_sata_err_type et); +static int fsl_sata_setup_fis(struct fsl_sata_channel *ch, struct fsl_sata_cmd_tab *ctp, union ccb *ccb, int tag); +static void fsl_sata_dmainit(device_t dev); +static void fsl_sata_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); +static void fsl_sata_dmafini(device_t dev); +static void fsl_sata_slotsalloc(device_t dev); +static void fsl_sata_slotsfree(device_t dev); +static void fsl_sata_reset(struct fsl_sata_channel *ch); +static void fsl_sata_start(struct fsl_sata_channel *ch); +static void fsl_sata_stop(struct fsl_sata_channel *ch); + +static void fsl_sata_issue_recovery(struct fsl_sata_channel *ch); +static void fsl_sata_process_read_log(struct fsl_sata_channel *ch, union ccb *ccb); +static void fsl_sata_process_request_sense(struct fsl_sata_channel *ch, union ccb *ccb); + +static void fsl_sataaction(struct cam_sim *sim, union ccb *ccb); +static void fsl_satapoll(struct cam_sim *sim); + +static MALLOC_DEFINE(M_FSL_SATA, "FSL SATA driver", "FSL SATA driver data buffers"); + +#define recovery_type spriv_field0 +#define RECOVERY_NONE 0 +#define RECOVERY_READ_LOG 1 +#define RECOVERY_REQUEST_SENSE 2 +#define recovery_slot spriv_field1 + +#define FSL_SATA_P_CQR 0x0 +#define FSL_SATA_P_CAR 0x4 +#define FSL_SATA_P_CCR 0x10 +#define FSL_SATA_P_CER 0x18 +#define FSL_SATA_P_DER 0x20 +#define FSL_SATA_P_CHBA 0x24 +#define FSL_SATA_P_HSTS 0x28 +#define FSL_SATA_P_HSTS_HS_ON 0x80000000 +#define FSL_SATA_P_HSTS_ME 0x00040000 +#define FSL_SATA_P_HSTS_DLM 0x00001000 +#define FSL_SATA_P_HSTS_FOT 0x00000200 +#define FSL_SATA_P_HSTS_FOR 0x00000100 +#define FSL_SATA_P_HSTS_FE 0x00000020 +#define FSL_SATA_P_HSTS_PR 0x00000010 +#define FSL_SATA_P_HSTS_SNTFU 0x00000004 +#define FSL_SATA_P_HSTS_DE 0x00000002 +#define FSL_SATA_P_HCTRL 0x2c +#define FSL_SATA_P_HCTRL_HC_ON 0x80000000 +#define FSL_SATA_P_HCTRL_HC_FORCE_OFF 0x40000000 +#define FSL_SATA_P_HCTRL_ENT 0x10000000 +#define FSL_SATA_P_HCTRL_SNOOP 0x00000400 +#define FSL_SATA_P_HCTRL_PM 0x00000200 +#define FSL_SATA_P_HCTRL_FATAL 0x00000020 +#define FSL_SATA_P_HCTRL_PHYRDY 0x00000010 +#define FSL_SATA_P_HCTRL_SIG 0x00000008 +#define FSL_SATA_P_HCTRL_SNTFY 0x00000004 +#define FSL_SATA_P_HCTRL_DE 0x00000002 +#define FSL_SATA_P_HCTRL_CC 0x00000001 +#define FSL_SATA_P_HCTRL_INT_MASK 0x0000003f +#define FSL_SATA_P_CQPMP 0x30 +#define FSL_SATA_P_SIG 0x34 +#define FSL_SATA_P_ICC 0x38 +#define FSL_SATA_P_ICC_ITC_M 0x1f000000 +#define FSL_SATA_P_ICC_ITC_S 24 +#define FSL_SATA_P_ICC_ITTCV_M 0x0007ffff +#define FSL_SATA_P_PCC 0x15c +#define FSL_SATA_P_PCC_SLUMBER 0x0000000c +#define FSL_SATA_P_PCC_PARTIAL 0x0000000a +#define FSL_SATA_PCC_LPB_EN 0x0000000e + +#define FSL_SATA_MAX_SLOTS 16 +/* FSL_SATA register defines */ + +#define FSL_SATA_P_SSTS 0x100 +#define FSL_SATA_P_SERR 0x104 +#define FSL_SATA_P_SCTL 0x108 +#define FSL_SATA_P_SNTF 0x10c + +/* Pessimistic prognosis on number of required S/G entries */ +#define FSL_SATA_SG_ENTRIES 63 +/* Command list. 16 commands. First, 1Kbyte aligned. */ +#define FSL_SATA_CL_OFFSET 0 +#define FSL_SATA_CL_SIZE 16 +/* Command tables. Up to 32 commands, Each, 4-byte aligned. */ +#define FSL_SATA_CT_OFFSET (FSL_SATA_CL_OFFSET + FSL_SATA_CL_SIZE * FSL_SATA_MAX_SLOTS) +#define FSL_SATA_CT_SIZE (96 + FSL_SATA_SG_ENTRIES * 16) +/* Total main work area. */ +#define FSL_SATA_WORK_SIZE (FSL_SATA_CT_OFFSET + FSL_SATA_CT_SIZE * FSL_SATA_MAX_SLOTS) +#define FSL_SATA_MAX_XFER (64 * 1024 * 1024) + +/* Some convenience macros for getting the CTP and CLP */ +#define FSL_SATA_CTP_BUS(ch, slot) \ + ((ch->dma.work_bus + FSL_SATA_CT_OFFSET + (FSL_SATA_CT_SIZE * slot->slot))) +#define FSL_SATA_PRD_OFFSET(prd) (96 + (prd) * 16) +#define FSL_SATA_CTP(ch, slot) \ + ((struct fsl_sata_cmd_tab *)(ch->dma.work + FSL_SATA_CT_OFFSET + \ + (FSL_SATA_CT_SIZE * slot->slot))) +#define FSL_SATA_CLP(ch, slot) \ + ((struct fsl_sata_cmd_list *) (ch->dma.work + FSL_SATA_CL_OFFSET + \ + (FSL_SATA_CL_SIZE * slot->slot))) + +struct fsl_sata_dma_prd { + uint32_t dba; + uint32_t reserved; + uint32_t reserved2; + uint32_t dwc_flg; /* 0 based */ +#define FSL_SATA_PRD_MASK 0x01fffffc /* max 32MB */ +#define FSL_SATA_PRD_MAX (FSL_SATA_PRD_MASK + 4) +#define FSL_SATA_PRD_SNOOP 0x10000000 +#define FSL_SATA_PRD_EXT 0x80000000 +} __packed; + +struct fsl_sata_cmd_tab { + uint8_t cfis[32]; + uint8_t sfis[32]; + uint8_t acmd[16]; + uint8_t reserved[16]; + struct fsl_sata_dma_prd prd_tab[FSL_SATA_SG_ENTRIES]; +#define FSL_SATA_PRD_EXT_INDEX 15 +#define FSL_SATA_PRD_MAX_DIRECT 16 +} __packed; + +struct fsl_sata_cmd_list { + uint32_t cda; /* word aligned */ + uint16_t fis_length; /* length in bytes (aligned to words) */ + uint16_t prd_length; /* PRD entries */ + uint32_t ttl; + uint32_t cmd_flags; +#define FSL_SATA_CMD_TAG_MASK 0x001f +#define FSL_SATA_CMD_ATAPI 0x0020 +#define FSL_SATA_CMD_BIST 0x0040 +#define FSL_SATA_CMD_RESET 0x0080 +#define FSL_SATA_CMD_QUEUED 0x0100 +#define FSL_SATA_CMD_SNOOP 0x0200 +#define FSL_SATA_CMD_VBIST 0x0400 +#define FSL_SATA_CMD_WRITE 0x0800 + +} __packed; + +/* misc defines */ +#define ATA_IRQ_RID 0 +#define ATA_INTR_FLAGS (INTR_MPSAFE|INTR_TYPE_BIO|INTR_ENTROPY) + +struct ata_dmaslot { + bus_dmamap_t data_map; /* data DMA map */ + int nsegs; /* Number of segs loaded */ +}; + +/* structure holding DMA related information */ +struct ata_dma { + bus_dma_tag_t work_tag; /* workspace DMA tag */ + bus_dmamap_t work_map; /* workspace DMA map */ + uint8_t *work; /* workspace */ + bus_addr_t work_bus; /* bus address of work */ + bus_dma_tag_t data_tag; /* data DMA tag */ +}; + +enum fsl_sata_slot_states { + FSL_SATA_SLOT_EMPTY, + FSL_SATA_SLOT_LOADING, + FSL_SATA_SLOT_RUNNING, + FSL_SATA_SLOT_EXECUTING +}; + +struct fsl_sata_slot { + struct fsl_sata_channel *ch; /* Channel */ + uint8_t slot; /* Number of this slot */ + enum fsl_sata_slot_states state; /* Slot state */ + union ccb *ccb; /* CCB occupying slot */ + struct ata_dmaslot dma; /* DMA data of this slot */ + struct callout timeout; /* Execution timeout */ + uint32_t ttl; +}; + +struct fsl_sata_device { + int revision; + int mode; + u_int bytecount; + u_int atapi; + u_int tags; + u_int caps; +}; + +/* structure describing an ATA channel */ +struct fsl_sata_channel { + device_t dev; /* Device handle */ + int unit; /* Physical channel */ + struct resource *r_mem; /* Memory of this channel */ + struct resource *r_irq; /* Interrupt of this channel */ + void *ih; /* Interrupt handle */ + struct ata_dma dma; /* DMA data */ + struct cam_sim *sim; + struct cam_path *path; + uint32_t caps; /* Controller capabilities */ + int pm_level; /* power management level */ + int devices; /* What is present */ + int pm_present; /* PM presence reported */ + + union ccb *hold[FSL_SATA_MAX_SLOTS]; + struct fsl_sata_slot slot[FSL_SATA_MAX_SLOTS]; + uint32_t oslots; /* Occupied slots */ + uint32_t rslots; /* Running slots */ + uint32_t aslots; /* Slots with atomic commands */ + uint32_t eslots; /* Slots in error */ + uint32_t toslots; /* Slots in timeout */ + int lastslot; /* Last used slot */ + int taggedtarget; /* Last tagged target */ + int numrslots; /* Number of running slots */ + int numrslotspd[16];/* Number of running slots per dev */ + int numtslots; /* Number of tagged slots */ + int numtslotspd[16];/* Number of tagged slots per dev */ + int numhslots; /* Number of held slots */ + int recoverycmd; /* Our READ LOG active */ + int fatalerr; /* Fatal error happend */ + int resetting; /* Hard-reset in progress. */ + int resetpolldiv; /* Hard-reset poll divider. */ + union ccb *frozen; /* Frozen command */ + struct callout pm_timer; /* Power management events */ + struct callout reset_timer; /* Hard-reset timeout */ + + struct fsl_sata_device user[16]; /* User-specified settings */ + struct fsl_sata_device curr[16]; /* Current settings */ + + struct mtx_padalign mtx; /* state lock */ + STAILQ_HEAD(, ccb_hdr) doneq; /* queue of completed CCBs */ + int batch; /* doneq is in use */ +}; + +enum fsl_sata_err_type { + FSL_SATA_ERR_NONE, /* No error */ + FSL_SATA_ERR_INVALID, /* Error detected by us before submitting. */ + FSL_SATA_ERR_INNOCENT, /* Innocent victim. */ + FSL_SATA_ERR_TFE, /* Task File Error. */ + FSL_SATA_ERR_SATA, /* SATA error. */ + FSL_SATA_ERR_TIMEOUT, /* Command execution timeout. */ + FSL_SATA_ERR_NCQ, /* NCQ command error. CCB should be put on hold + * until READ LOG executed to reveal error. */ +}; + +/* macros to hide busspace uglyness */ +#define ATA_INB(res, offset) \ + bus_read_1((res), (offset)) +#define ATA_INW(res, offset) \ + bus_read_2((res), (offset)) +#define ATA_INL(res, offset) \ + bus_read_4((res), (offset)) +#define ATA_INSW(res, offset, addr, count) \ + bus_read_multi_2((res), (offset), (addr), (count)) +#define ATA_INSW_STRM(res, offset, addr, count) \ + bus_read_multi_stream_2((res), (offset), (addr), (count)) +#define ATA_INSL(res, offset, addr, count) \ + bus_read_multi_4((res), (offset), (addr), (count)) +#define ATA_INSL_STRM(res, offset, addr, count) \ + bus_read_multi_stream_4((res), (offset), (addr), (count)) +#define ATA_OUTB(res, offset, value) \ + bus_write_1((res), (offset), (value)) +#define ATA_OUTW(res, offset, value) \ + bus_write_2((res), (offset), (value)) +#define ATA_OUTL(res, offset, value) \ + bus_write_4((res), (offset), (value)) +#define ATA_OUTSW(res, offset, addr, count) \ + bus_write_multi_2((res), (offset), (addr), (count)) +#define ATA_OUTSW_STRM(res, offset, addr, count) \ + bus_write_multi_stream_2((res), (offset), (addr), (count)) +#define ATA_OUTSL(res, offset, addr, count) \ + bus_write_multi_4((res), (offset), (addr), (count)) +#define ATA_OUTSL_STRM(res, offset, addr, count) \ + bus_write_multi_stream_4((res), (offset), (addr), (count)) + +static int +fsl_sata_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "fsl,pq-sata-v2") && + !ofw_bus_is_compatible(dev, "fsl,pq-sata")) + return (ENXIO); + + device_set_desc_copy(dev, "Freescale Integrated SATA Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +fsl_sata_attach(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + struct cam_devq *devq; + int rid, error, i, sata_rev = 0; + + ch->dev = dev; + ch->unit = (intptr_t)device_get_ivars(dev); + mtx_init(&ch->mtx, "FSL SATA channel lock", NULL, MTX_DEF); + ch->pm_level = 0; + resource_int_value(device_get_name(dev), + device_get_unit(dev), "pm_level", &ch->pm_level); + STAILQ_INIT(&ch->doneq); + if (ch->pm_level > 3) + callout_init_mtx(&ch->pm_timer, &ch->mtx, 0); + resource_int_value(device_get_name(dev), + device_get_unit(dev), "sata_rev", &sata_rev); + for (i = 0; i < 16; i++) { + ch->user[i].revision = sata_rev; + ch->user[i].mode = 0; + ch->user[i].bytecount = 8192; + ch->user[i].tags = FSL_SATA_MAX_SLOTS; + ch->user[i].caps = 0; + ch->curr[i] = ch->user[i]; + if (ch->pm_level) { + ch->user[i].caps = CTS_SATA_CAPS_H_PMREQ | + CTS_SATA_CAPS_D_PMREQ; + } + ch->user[i].caps |= CTS_SATA_CAPS_H_AN; + } + rid = 0; + if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE))) + return (ENXIO); + rman_set_bustag(ch->r_mem, &bs_le_tag); + fsl_sata_dmainit(dev); + fsl_sata_slotsalloc(dev); + fsl_sata_init(dev); + rid = ATA_IRQ_RID; + if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_SHAREABLE | RF_ACTIVE))) { + device_printf(dev, "Unable to map interrupt\n"); + error = ENXIO; + goto err0; + } + if ((bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL, + fsl_sata_intr, ch, &ch->ih))) { + device_printf(dev, "Unable to setup interrupt\n"); + error = ENXIO; + goto err1; + } + mtx_lock(&ch->mtx); + /* Create the device queue for our SIM. */ + devq = cam_simq_alloc(FSL_SATA_MAX_SLOTS); + if (devq == NULL) { + device_printf(dev, "Unable to allocate simq\n"); + error = ENOMEM; + goto err1; + } + /* Construct SIM entry */ + ch->sim = cam_sim_alloc(fsl_sataaction, fsl_satapoll, "fslsata", ch, + device_get_unit(dev), (struct mtx *)&ch->mtx, 2, FSL_SATA_MAX_SLOTS, + devq); + if (ch->sim == NULL) { + cam_simq_free(devq); + device_printf(dev, "unable to allocate sim\n"); + error = ENOMEM; + goto err1; + } + if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) { + device_printf(dev, "unable to register xpt bus\n"); + error = ENXIO; + goto err2; + } + if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + device_printf(dev, "unable to create path\n"); + error = ENXIO; + goto err3; + } + if (ch->pm_level > 3) { + callout_reset(&ch->pm_timer, + (ch->pm_level == 4) ? hz / 1000 : hz / 8, + fsl_sata_pm, ch); + } + mtx_unlock(&ch->mtx); + return (0); + +err3: + xpt_bus_deregister(cam_sim_path(ch->sim)); +err2: + cam_sim_free(ch->sim, /*free_devq*/TRUE); +err1: + mtx_unlock(&ch->mtx); + bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); +err0: + bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); + mtx_destroy(&ch->mtx); + return (error); +} + +static int +fsl_sata_detach(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + + mtx_lock(&ch->mtx); + xpt_async(AC_LOST_DEVICE, ch->path, NULL); + + xpt_free_path(ch->path); + xpt_bus_deregister(cam_sim_path(ch->sim)); + cam_sim_free(ch->sim, /*free_devq*/TRUE); + mtx_unlock(&ch->mtx); + + if (ch->pm_level > 3) + callout_drain(&ch->pm_timer); + bus_teardown_intr(dev, ch->r_irq, ch->ih); + bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); + + fsl_sata_deinit(dev); + fsl_sata_slotsfree(dev); + fsl_sata_dmafini(dev); + + bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem); + mtx_destroy(&ch->mtx); + return (0); +} + +static int +fsl_sata_wait_register(struct fsl_sata_channel *ch, bus_size_t off, + unsigned int mask, unsigned int val, int t) +{ + int timeout = 0; + uint32_t rval; + + while (((rval = ATA_INL(ch->r_mem, off)) & mask) != val) { + if (timeout > t) { + return (EBUSY); + } + DELAY(1000); + timeout++; + } + return (0); +} + +static int +fsl_sata_init(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + uint64_t work; + uint32_t r; + + /* Disable port interrupts */ + r = ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL); + r &= ~FSL_SATA_P_HCTRL_HC_ON; + r |= FSL_SATA_P_HCTRL_HC_FORCE_OFF; + ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, r & ~FSL_SATA_P_HCTRL_INT_MASK); + fsl_sata_wait_register(ch, FSL_SATA_P_HSTS, + FSL_SATA_P_HSTS_HS_ON, 0, 1000); + /* Setup work areas */ + work = ch->dma.work_bus + FSL_SATA_CL_OFFSET; + ATA_OUTL(ch->r_mem, FSL_SATA_P_CHBA, work); + r &= ~FSL_SATA_P_HCTRL_ENT; + r &= ~FSL_SATA_P_HCTRL_PM; + ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, r); + r = ATA_INL(ch->r_mem, FSL_SATA_P_PCC); + ATA_OUTL(ch->r_mem, FSL_SATA_P_PCC, r & ~FSL_SATA_PCC_LPB_EN); + ATA_OUTL(ch->r_mem, FSL_SATA_P_ICC, (1 << FSL_SATA_P_ICC_ITC_S)); + fsl_sata_start(ch); + return (0); +} + +static int +fsl_sata_deinit(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + uint32_t r; + + /* Disable port interrupts. */ + r = ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL); + ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, r & ~FSL_SATA_P_HCTRL_INT_MASK); + /* Reset command register. */ + fsl_sata_stop(ch); + /* Allow everything, including partial and slumber modes. */ + ATA_OUTL(ch->r_mem, FSL_SATA_P_SCTL, 0); + DELAY(100); + /* Disable PHY. */ + ATA_OUTL(ch->r_mem, FSL_SATA_P_SCTL, ATA_SC_DET_DISABLE); + r = ATA_INL(ch->r_mem, FSL_SATA_P_HCTRL); + /* Turn off the controller. */ + ATA_OUTL(ch->r_mem, FSL_SATA_P_HCTRL, r & ~FSL_SATA_P_HCTRL_HC_ON); + return (0); +} + +static int +fsl_sata_suspend(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + + mtx_lock(&ch->mtx); + xpt_freeze_simq(ch->sim, 1); + while (ch->oslots) + msleep(ch, &ch->mtx, PRIBIO, "fsl_satasusp", hz/100); + fsl_sata_deinit(dev); + mtx_unlock(&ch->mtx); + return (0); +} + +static int +fsl_sata_resume(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + + mtx_lock(&ch->mtx); + fsl_sata_init(dev); + fsl_sata_reset(ch); + xpt_release_simq(ch->sim, TRUE); + mtx_unlock(&ch->mtx); + return (0); +} + +devclass_t fsl_satach_devclass; +static device_method_t fsl_satach_methods[] = { + DEVMETHOD(device_probe, fsl_sata_probe), + DEVMETHOD(device_attach, fsl_sata_attach), + DEVMETHOD(device_detach, fsl_sata_detach), + DEVMETHOD(device_suspend, fsl_sata_suspend), + DEVMETHOD(device_resume, fsl_sata_resume), + DEVMETHOD_END +}; +static driver_t fsl_satach_driver = { + "fslsata", + fsl_satach_methods, + sizeof(struct fsl_sata_channel) +}; +DRIVER_MODULE(fsl_satach, simplebus, fsl_satach_driver, fsl_satach_devclass, NULL, NULL); + +struct fsl_sata_dc_cb_args { + bus_addr_t maddr; + int error; +}; + +static void +fsl_sata_dmainit(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + struct fsl_sata_dc_cb_args dcba; + + /* Command area. */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), 1024, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + NULL, NULL, FSL_SATA_WORK_SIZE, 1, FSL_SATA_WORK_SIZE, + 0, NULL, NULL, &ch->dma.work_tag)) + goto error; + if (bus_dmamem_alloc(ch->dma.work_tag, (void **)&ch->dma.work, + BUS_DMA_ZERO, &ch->dma.work_map)) + goto error; + if (bus_dmamap_load(ch->dma.work_tag, ch->dma.work_map, ch->dma.work, + FSL_SATA_WORK_SIZE, fsl_sata_dmasetupc_cb, &dcba, 0) || dcba.error) { + bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map); + goto error; + } + ch->dma.work_bus = dcba.maddr; + /* Data area. */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), 4, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + NULL, NULL, FSL_SATA_MAX_XFER, + FSL_SATA_SG_ENTRIES - 1, FSL_SATA_PRD_MAX, + 0, busdma_lock_mutex, &ch->mtx, &ch->dma.data_tag)) { + goto error; + } + if (bootverbose) + device_printf(dev, "work area: %p\n", ch->dma.work); + return; + +error: + device_printf(dev, "WARNING - DMA initialization failed\n"); + fsl_sata_dmafini(dev); +} + +static void +fsl_sata_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct fsl_sata_dc_cb_args *dcba = (struct fsl_sata_dc_cb_args *)xsc; + + if (!(dcba->error = error)) + dcba->maddr = segs[0].ds_addr; +} + +static void +fsl_sata_dmafini(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + + if (ch->dma.data_tag) { + bus_dma_tag_destroy(ch->dma.data_tag); + ch->dma.data_tag = NULL; + } + if (ch->dma.work_bus) { + bus_dmamap_unload(ch->dma.work_tag, ch->dma.work_map); + bus_dmamem_free(ch->dma.work_tag, ch->dma.work, ch->dma.work_map); + ch->dma.work_bus = 0; + ch->dma.work = NULL; + } + if (ch->dma.work_tag) { + bus_dma_tag_destroy(ch->dma.work_tag); + ch->dma.work_tag = NULL; + } +} + +static void +fsl_sata_slotsalloc(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + int i; + + /* Alloc and setup command/dma slots */ + bzero(ch->slot, sizeof(ch->slot)); + for (i = 0; i < FSL_SATA_MAX_SLOTS; i++) { + struct fsl_sata_slot *slot = &ch->slot[i]; + + slot->ch = ch; + slot->slot = i; + slot->state = FSL_SATA_SLOT_EMPTY; + slot->ccb = NULL; + callout_init_mtx(&slot->timeout, &ch->mtx, 0); + + if (bus_dmamap_create(ch->dma.data_tag, 0, &slot->dma.data_map)) + device_printf(ch->dev, "FAILURE - create data_map\n"); + } +} + +static void +fsl_sata_slotsfree(device_t dev) +{ + struct fsl_sata_channel *ch = device_get_softc(dev); + int i; + + /* Free all dma slots */ + for (i = 0; i < FSL_SATA_MAX_SLOTS; i++) { + struct fsl_sata_slot *slot = &ch->slot[i]; + + callout_drain(&slot->timeout); + if (slot->dma.data_map) { + bus_dmamap_destroy(ch->dma.data_tag, slot->dma.data_map); + slot->dma.data_map = NULL; + } + } +} + +static int +fsl_sata_phy_check_events(struct fsl_sata_channel *ch, u_int32_t serr) +{ + + if (((ch->pm_level == 0) && (serr & ATA_SE_PHY_CHANGED)) || + ((ch->pm_level != 0) && (serr & ATA_SE_EXCHANGED))) { + u_int32_t status = ATA_INL(ch->r_mem, FSL_SATA_P_SSTS); + union ccb *ccb; + + if (bootverbose) { + if ((status & ATA_SS_DET_MASK) != ATA_SS_DET_NO_DEVICE) + device_printf(ch->dev, "CONNECT requested\n"); + else + device_printf(ch->dev, "DISCONNECT requested\n"); + } + /* Issue soft reset */ + xpt_async(AC_BUS_RESET, ch->path, NULL); + if ((ccb = xpt_alloc_ccb_nowait()) == NULL) + return (0); + if (xpt_create_path(&ccb->ccb_h.path, NULL, + cam_sim_path(ch->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + xpt_free_ccb(ccb); + return (0); + } + xpt_rescan(ccb); + return (1); + } + return (0); +} + +static void +fsl_sata_notify_events(struct fsl_sata_channel *ch, u_int32_t status) +{ + struct cam_path *dpath; + int i; + + ATA_OUTL(ch->r_mem, FSL_SATA_P_SNTF, status); + if (bootverbose) + device_printf(ch->dev, "SNTF 0x%04x\n", status); + for (i = 0; i < 16; i++) { + if ((status & (1 << i)) == 0) + continue; + if (xpt_create_path(&dpath, NULL, + xpt_path_path_id(ch->path), i, 0) == CAM_REQ_CMP) { + xpt_async(AC_SCSI_AEN, dpath, NULL); + xpt_free_path(dpath); + } + } +} + +static void +fsl_sata_done(struct fsl_sata_channel *ch, union ccb *ccb) +{ + + mtx_assert(&ch->mtx, MA_OWNED); + if ((ccb->ccb_h.func_code & XPT_FC_QUEUED) == 0 || + ch->batch == 0) { + xpt_done(ccb); + return; + } + + STAILQ_INSERT_TAIL(&ch->doneq, &ccb->ccb_h, sim_links.stqe); +} + +static void +fsl_sata_intr(void *arg) +{ + struct fsl_sata_channel *ch = (struct fsl_sata_channel *)arg; + struct ccb_hdr *ccb_h; + uint32_t istatus; + STAILQ_HEAD(, ccb_hdr) tmp_doneq = STAILQ_HEAD_INITIALIZER(tmp_doneq); + + /* Read interrupt statuses. */ + istatus = ATA_INL(ch->r_mem, FSL_SATA_P_HSTS) & 0x7ffff; + if ((istatus & 0x3f) == 0) + return; + + mtx_lock(&ch->mtx); + ch->batch = 1; + fsl_sata_intr_main(ch, istatus); + ch->batch = 0; + /* + * Prevent the possibility of issues caused by processing the queue + * while unlocked below by moving the contents to a local queue. + */ + STAILQ_CONCAT(&tmp_doneq, &ch->doneq); + mtx_unlock(&ch->mtx); + while ((ccb_h = STAILQ_FIRST(&tmp_doneq)) != NULL) { + STAILQ_REMOVE_HEAD(&tmp_doneq, sim_links.stqe); + xpt_done_direct((union ccb *)ccb_h); + } + /* Clear interrupt statuses. */ + ATA_OUTL(ch->r_mem, FSL_SATA_P_HSTS, istatus & 0x3f); + +} + +static void +fsl_sata_pm(void *arg) +{ + struct fsl_sata_channel *ch = (struct fsl_sata_channel *)arg; + uint32_t work; + + if (ch->numrslots != 0) + return; + work = ATA_INL(ch->r_mem, FSL_SATA_P_PCC) & ~FSL_SATA_PCC_LPB_EN; + if (ch->pm_level == 4) + work |= FSL_SATA_P_PCC_PARTIAL; + else + work |= FSL_SATA_P_PCC_SLUMBER; + ATA_OUTL(ch->r_mem, FSL_SATA_P_PCC, work); +} + +/* XXX: interrupt todo */ +static void +fsl_sata_intr_main(struct fsl_sata_channel *ch, uint32_t istatus) +{ + uint32_t cer, der, serr = 0, sntf = 0, ok, err; + enum fsl_sata_err_type et; + int i; + + /* Complete all successful commands. */ + ok = ATA_INL(ch->r_mem, FSL_SATA_P_CCR); + if (ch->aslots == 0) + for (i = 0; i < FSL_SATA_MAX_SLOTS; i++) { + if (((ok >> i) & 1) && ch->slot[i].ccb != NULL) + fsl_sata_end_transaction(&ch->slot[i], FSL_SATA_ERR_NONE); + } + /* Read command statuses. */ + if (istatus & FSL_SATA_P_HSTS_SNTFU) + sntf = ATA_INL(ch->r_mem, FSL_SATA_P_SNTF); + /* XXX: Process PHY events */ + serr = ATA_INL(ch->r_mem, FSL_SATA_P_SERR); + ATA_OUTL(ch->r_mem, FSL_SATA_P_SERR, serr); + if (istatus & (FSL_SATA_P_HSTS_PR)) { + if (serr) { + fsl_sata_phy_check_events(ch, serr); + } + } + /* Process command errors */ + err = (istatus & (FSL_SATA_P_HSTS_FE | FSL_SATA_P_HSTS_DE)); + cer = ATA_INL(ch->r_mem, FSL_SATA_P_CER); + ATA_OUTL(ch->r_mem, FSL_SATA_P_CER, cer); + der = ATA_INL(ch->r_mem, FSL_SATA_P_DER); + ATA_OUTL(ch->r_mem, FSL_SATA_P_DER, der); + /* On error, complete the rest of commands with error statuses. */ + if (err) { + if (ch->frozen) { + union ccb *fccb = ch->frozen; + ch->frozen = NULL; + fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ; + if (!(fccb->ccb_h.status & CAM_DEV_QFRZN)) { + xpt_freeze_devq(fccb->ccb_h.path, 1); + fccb->ccb_h.status |= CAM_DEV_QFRZN; + } + fsl_sata_done(ch, fccb); + } + for (i = 0; i < FSL_SATA_MAX_SLOTS; i++) { + if (ch->slot[i].ccb == NULL) + continue; + if ((cer & (1 << i)) != 0) + et = FSL_SATA_ERR_TFE; + else if ((der & (1 << ch->slot[i].ccb->ccb_h.target_id)) != 0) + et = FSL_SATA_ERR_SATA; + else + et = FSL_SATA_ERR_INVALID; + fsl_sata_end_transaction(&ch->slot[i], et); + } + } + /* Process NOTIFY events */ + if (sntf) + fsl_sata_notify_events(ch, sntf); +} + +/* Must be called with channel locked. */ +static int +fsl_sata_check_collision(struct fsl_sata_channel *ch, union ccb *ccb) +{ + int t = ccb->ccb_h.target_id; + + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { + /* Tagged command while we have no supported tag free. */ + if (((~ch->oslots) & (0xffffffff >> (32 - + ch->curr[t].tags))) == 0) + return (1); + /* Tagged command while untagged are active. */ + if (ch->numrslotspd[t] != 0 && ch->numtslotspd[t] == 0) + return (1); + } else { + /* Untagged command while tagged are active. */ + if (ch->numrslotspd[t] != 0 && ch->numtslotspd[t] != 0) + return (1); + } + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & (CAM_ATAIO_CONTROL | CAM_ATAIO_NEEDRESULT))) { + /* Atomic command while anything active. */ + if (ch->numrslots != 0) + return (1); + } + /* We have some atomic command running. */ + if (ch->aslots != 0) + return (1); + return (0); +} + +/* Must be called with channel locked. */ +static void +fsl_sata_begin_transaction(struct fsl_sata_channel *ch, union ccb *ccb) +{ + struct fsl_sata_slot *slot; + int tag, tags; + + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("fsl_sata_begin_transaction func_code=0x%x\n", ccb->ccb_h.func_code)); + /* Choose empty slot. */ + tags = FSL_SATA_MAX_SLOTS; + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) + tags = ch->curr[ccb->ccb_h.target_id].tags; + if (ch->lastslot + 1 < tags) + tag = ffs(~(ch->oslots >> (ch->lastslot + 1))); + else + tag = 0; + if (tag == 0 || tag + ch->lastslot >= tags) + tag = ffs(~ch->oslots) - 1; + else + tag += ch->lastslot; + ch->lastslot = tag; + /* Occupy chosen slot. */ + slot = &ch->slot[tag]; + slot->ccb = ccb; + slot->ttl = 0; + /* Stop PM timer. */ + if (ch->numrslots == 0 && ch->pm_level > 3) + callout_stop(&ch->pm_timer); + /* Update channel stats. */ + ch->oslots |= (1 << tag); + ch->numrslots++; + ch->numrslotspd[ccb->ccb_h.target_id]++; + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { + ch->numtslots++; + ch->numtslotspd[ccb->ccb_h.target_id]++; + ch->taggedtarget = ccb->ccb_h.target_id; + } + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & (CAM_ATAIO_CONTROL | CAM_ATAIO_NEEDRESULT))) + ch->aslots |= (1 << tag); + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + slot->state = FSL_SATA_SLOT_LOADING; + bus_dmamap_load_ccb(ch->dma.data_tag, slot->dma.data_map, ccb, + fsl_sata_dmasetprd, slot, 0); + } else { + slot->dma.nsegs = 0; + fsl_sata_execute_transaction(slot); + } + + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("fsl_sata_begin_transaction exit\n")); +} + +/* Locked by busdma engine. */ +static void +fsl_sata_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct fsl_sata_slot *slot = arg; + struct fsl_sata_channel *ch = slot->ch; + struct fsl_sata_cmd_tab *ctp; + struct fsl_sata_dma_prd *prd; + int i, j, len, extlen; + + if (error) { + device_printf(ch->dev, "DMA load error %d\n", error); + fsl_sata_end_transaction(slot, FSL_SATA_ERR_INVALID); + return; + } + KASSERT(nsegs <= FSL_SATA_SG_ENTRIES - 1, + ("too many DMA segment entries\n")); + /* Get a piece of the workspace for this request */ + ctp = FSL_SATA_CTP(ch, slot); + /* Fill S/G table */ + prd = &ctp->prd_tab[0]; + for (i = 0, j = 0; i < nsegs; i++, j++) { + if (j == FSL_SATA_PRD_EXT_INDEX && + FSL_SATA_PRD_MAX_DIRECT < nsegs) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Nov 5 03:02:20 2017 Return-Path: Delivered-To: svn-src-all@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 6D563E5FD1E; Sun, 5 Nov 2017 03:02:20 +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 3CF7A6A7D4; Sun, 5 Nov 2017 03:02:20 +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 vA532JlF015187; Sun, 5 Nov 2017 03:02:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA532JBM015186; Sun, 5 Nov 2017 03:02:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711050302.vA532JBM015186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Nov 2017 03:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325422 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 325422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 03:02:20 -0000 Author: emaste Date: Sun Nov 5 03:02:19 2017 New Revision: 325422 URL: https://svnweb.freebsd.org/changeset/base/325422 Log: posix_fallocate.2: add an EINVAL errno case As of r325320 posix_fallocate returns EINVAL on ZFS to indicate that the underlying filesystem does not support this operation, per POSIX.1-2008. Document this case in the man page. MFC after: 20 days MFC with: r325320 Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/sys/posix_fallocate.2 Modified: head/lib/libc/sys/posix_fallocate.2 ============================================================================== --- head/lib/libc/sys/posix_fallocate.2 Sun Nov 5 02:47:46 2017 (r325421) +++ head/lib/libc/sys/posix_fallocate.2 Sun Nov 5 03:02:19 2017 (r325422) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd October 12, 2017 +.Dd November 4, 2017 .Dt POSIX_FALLOCATE 2 .Os .Sh NAME @@ -106,9 +106,10 @@ A signal was caught during execution. .It Bq Er EINVAL The .Fa len -argument was less than or equal to zero or the +argument was less than or equal to zero, the .Fa offset -argument was less than zero. +argument was less than zero, +or the operation is not supported by the file system. .It Bq Er EIO An I/O error occurred while reading from or writing to a file system. .It Bq Er ENODEV From owner-svn-src-all@freebsd.org Sun Nov 5 04:51:02 2017 Return-Path: Delivered-To: svn-src-all@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 4DE93E61E77; Sun, 5 Nov 2017 04:51:02 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38D676D1EC; Sun, 5 Nov 2017 04:51:01 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 5E5E959D; Sat, 4 Nov 2017 21:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1509857455; bh=yCK80MY4CQcDUdCCZaWvJUmMxSiBTuvRbm3y1+Yk6oY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sT5uUcph+kxRjHd/SNocczpGwCN7ogl2CxTq+iQlvlArwOaW+myTC4D932nglDHu5 xV7WeAG2mH56H+cOECdQbWQABwb1sl6vdaz+2IPj63rVE6fEG+NVm0tAyUGzd7H2F8 4q9t/veLJYPqxTYSgR/1Qw9uIGu/R4YE7xaBbL1U= From: Peter Wemm To: svn-src-all@freebsd.org Cc: Warner Losh , src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325378 - head/sys/dev/ipmi Date: Sat, 04 Nov 2017 21:50:50 -0700 Message-ID: <2932858.xKWtPkGhRe@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.30; amd64; ; ) In-Reply-To: <201711040301.vA431wdY002757@repo.freebsd.org> References: <201711040301.vA431wdY002757@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2203108.fd0kqvgrHI"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 04:51:02 -0000 --nextPart2203108.fd0kqvgrHI Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Saturday, November 04, 2017 03:01:58 AM Warner Losh wrote: > Author: imp > Date: Sat Nov 4 03:01:58 2017 > New Revision: 325378 > URL: https://svnweb.freebsd.org/changeset/base/325378 >=20 > Log: > Make the startup timeout 0 seconds by default rathern than 420s. T= his > makes the default fail safe when watchdogd is disabled (which is al= so > the default). We're still getting unanticipated reboots. I think what is happening is: 1) orderly reboot initiated. 2) By default, the watchdog code sets a 420 second timer, even with no=20= watchdogd. 3) reboot complets, system comes up.=20 4) A few minutes later, the pre-reboot 420 second timer expires and *an= other*=20 reboot happens. Setting hw.ipmi.on=3D"0" in loader.conf stops this... eg: reboot at 4:41:47.. system comes back up, and later: ... Uptime: 322 Sun Nov 5 04:48:45 UTC 2017 Uptime: 323 Sun Nov 5 04:48:46 UTC 2017 Uptime: 324 Sun Nov 5 04:48:47 UTC 2017 Stopping cron. Waiting for PIDS: 1004. Stopping sshd. Waiting for PIDS: 994. Stopping nginx. ... That's exactly 420 seconds after the original reboot which matches the=20= wd_shutdown_countdown timer that is still enabled. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart2203108.fd0kqvgrHI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAln+mKoACgkQNdaXCeyA ngQkAgf/TOCHmKHGF13lLFdf0NbYbkpRgi3cTxfN/eJlp8CTL7xDTn7PWBApskoT x39rdhFCIhkgkkyu7sm9YMD9EC6771cxvAbT3moBiruHzhZ140Q+dZpH2nsBGGcK UisDBBAeelstU3VGpXA/dhEpslITmWbretmrokH6GVT/SI+UyH4VYvKp7KMw4I1d TowIHxmS0Uix9Pm/92j2vZ7gqP+VhF2SemwBxylF8KQOjy8lf5DgZekSLQJ+BF2J Yf+jLPcSa+DiJjO/yDEe7YnXwZf1+Y9BeiMWUZEVrZnH70HmZrs1EJ10ClKqOwOv cOjFQtmUE6gKwHSo404wvwdXl51dhw== =SGir -----END PGP SIGNATURE----- --nextPart2203108.fd0kqvgrHI-- From owner-svn-src-all@freebsd.org Sun Nov 5 05:03:57 2017 Return-Path: Delivered-To: svn-src-all@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 0BD30E621E7 for ; Sun, 5 Nov 2017 05:03:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::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 BDD8B6D87E for ; Sun, 5 Nov 2017 05:03:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id p186so12468209ioe.12 for ; Sat, 04 Nov 2017 22:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=KWQEa8bxI52Medqlr1nC7ODFZoPgWBxP/TMIYpQrk24=; b=ki23K/G1HxL+IdzVFlXQcA93BmXyqpxcxNLT/Ju/FdHomVuxij1ZA5Tbwxy4uYWPI1 XZIZuAjo/uuozrDIx/Nnp8aHpQiq6HwDBajz+Z9LyvFE18f9yut6KI7QMkZYIsqsaAjF zfwSgy/lLZnM9hNM64BeiKjFNsjS5P1v5HcfKLYWclw260ffh8FBiR96Z0VgFka12wEc b2VEJBjVLQMaMyud0hjVdrYvCm9kSA1q68SSXARZxltSCzpmk5rnRiIQGnBUkcKU5Fs9 j9BDNAEsow+RhXXURHEZJs9BhMgHPP2KElj3OIf/q8ZDJmoww8N2HwKhCJZ0bdmBfcJK OFFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=KWQEa8bxI52Medqlr1nC7ODFZoPgWBxP/TMIYpQrk24=; b=YjYFropQlHeLoBW0zAKSxs3Y5Ms9wKwy+s8bX0jlWE8BiWxxOKqBem2/AjGkIA587p Co65wy8lrQFJUcs+rSvR/+6h1hGtus4xXosc45YPCKqh7uOu+3qC1H6uy+paX16mqucc 7ntxX1v4lT7EPUXhzQifCYsb1J2TTtaapqGWF4cMlG5vxg/gf9TpPfx9ooD9OgjsS+2A A7yaqP5x+Eh6C9fBYKFfCv2Gua0sVAkJq1PeMce0VDM9T7xAZicV4vsXWfl1L9Rvw/YS JiS7aOpCBMjZCWlSU+3oIym0VO7wz6rqvlR13YNMgA7DKdZhf77qPMX9TCd/jT7Nkknz kbIA== X-Gm-Message-State: AMCzsaWzfo/TsQfRJ/jHWtwS4KAgXHX1IChBHFnWyliYnBaotnbThOqS 6rfcFB1VW4tyjFOD64C2XQfGq+tODJ2uZoeiSe3TPw== X-Google-Smtp-Source: ABhQp+Rqx6bbDU/QqRZDutnqmlYwYJRXXTqfCQIhXaTbTuCmJP7MO/hdyFK/oTFH8KCVRCbN32anWd6u5t2FTGGdUv4= X-Received: by 10.107.46.216 with SMTP id u85mr13999284iou.136.1509858236053; Sat, 04 Nov 2017 22:03:56 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Sat, 4 Nov 2017 22:03:55 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:a004:68c9:b567:b3a8] In-Reply-To: <2932858.xKWtPkGhRe@overcee.wemm.org> References: <201711040301.vA431wdY002757@repo.freebsd.org> <2932858.xKWtPkGhRe@overcee.wemm.org> From: Warner Losh Date: Sat, 4 Nov 2017 23:03:55 -0600 X-Google-Sender-Auth: cAOeRqM2MiMagG4NQpXZNKgb258 Message-ID: Subject: Re: svn commit: r325378 - head/sys/dev/ipmi To: Peter Wemm Cc: "svn-src-all@freebsd.org" , Warner Losh , src-committers , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 05:03:57 -0000 On Sat, Nov 4, 2017 at 10:50 PM, Peter Wemm wrote: > On Saturday, November 04, 2017 03:01:58 AM Warner Losh wrote: > > Author: imp > > Date: Sat Nov 4 03:01:58 2017 > > New Revision: 325378 > > URL: https://svnweb.freebsd.org/changeset/base/325378 > > > > Log: > > Make the startup timeout 0 seconds by default rathern than 420s. This > > makes the default fail safe when watchdogd is disabled (which is also > > the default). > > We're still getting unanticipated reboots. > > I think what is happening is: > 1) orderly reboot initiated. > 2) By default, the watchdog code sets a 420 second timer, even with no > watchdogd. > 3) reboot complets, system comes up. > 4) A few minutes later, the pre-reboot 420 second timer expires and > *another* > reboot happens. > > Setting hw.ipmi.on="0" in loader.conf stops this... > > eg: reboot at 4:41:47.. system comes back up, and later: > ... > Uptime: 322 Sun Nov 5 04:48:45 UTC 2017 > Uptime: 323 Sun Nov 5 04:48:46 UTC 2017 > Uptime: 324 Sun Nov 5 04:48:47 UTC 2017 > Stopping cron. > Waiting for PIDS: 1004. > Stopping sshd. > Waiting for PIDS: 994. > Stopping nginx. > ... > That's exactly 420 seconds after the original reboot which matches the > wd_shutdown_countdown timer that is still enabled.] > Good detective work.I suspect this will need to be opt-in as well... Though the other option is to disable the watchdog on attach if we're not enabling the early watchdog which would give us a watchdog when we hang on shutdown... I need to think this through.... Fix it early with less protection by setting this to 0, or fix it later with more protection, but perhaps odd behavior for some edge cases like downgrade. In the mean time hw.ipmi.wd_shutdown_countdown=0 should also fix it. Can you confirm that? Warner From owner-svn-src-all@freebsd.org Sun Nov 5 05:05:20 2017 Return-Path: Delivered-To: svn-src-all@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 4D783E62275; Sun, 5 Nov 2017 05:05:20 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1BCF76D9D6; Sun, 5 Nov 2017 05:05:20 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA555JEi067298; Sun, 5 Nov 2017 05:05:19 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA555JSf067297; Sun, 5 Nov 2017 05:05:19 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201711050505.vA555JSf067297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Sun, 5 Nov 2017 05:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325425 - head/sys/dev/ipmi X-SVN-Group: head X-SVN-Commit-Author: peter X-SVN-Commit-Paths: head/sys/dev/ipmi X-SVN-Commit-Revision: 325425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 05:05:20 -0000 Author: peter Date: Sun Nov 5 05:05:18 2017 New Revision: 325425 URL: https://svnweb.freebsd.org/changeset/base/325425 Log: As a follow-on to r325378, make the shutdown timer default to 0 as well. Otherwise an orderly shutdown will initiate a watchdog that will cause a 7 minute delayed reboot *by default*, In the freebsd.org cluster's case this often worked out be a surprise reboot a minute or two after the machine came back up. Modified: head/sys/dev/ipmi/ipmi.c Modified: head/sys/dev/ipmi/ipmi.c ============================================================================== --- head/sys/dev/ipmi/ipmi.c Sun Nov 5 04:28:05 2017 (r325424) +++ head/sys/dev/ipmi/ipmi.c Sun Nov 5 05:05:18 2017 (r325425) @@ -83,7 +83,7 @@ int ipmi_attached = 0; static int on = 1; static bool wd_in_shutdown = false; static int wd_timer_actions = IPMI_SET_WD_ACTION_POWER_CYCLE; -static int wd_shutdown_countdown = 420; /* sec */ +static int wd_shutdown_countdown = 0; /* sec */ static int wd_startup_countdown = 0; /* sec */ static int wd_pretimeout_countdown = 120; /* sec */ static int cycle_wait = 10; /* sec */ From owner-svn-src-all@freebsd.org Sun Nov 5 05:19:50 2017 Return-Path: Delivered-To: svn-src-all@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 2D519E62507; Sun, 5 Nov 2017 05:19:50 +0000 (UTC) (envelope-from peter@wemm.org) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA726E007; Sun, 5 Nov 2017 05:19:49 +0000 (UTC) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 320375B9; Sat, 4 Nov 2017 22:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1509859189; bh=NXQbXuMbNQCeUzP1hZxkLZbMJjdCG1Rlg8oMV2p9Ymw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GLAZuRigrK82w3rG/tShhkf4iXdMHSNXjxRinOeqPK58qelHGgeUwsmi8Ls4oY7uy kxFlpfXa08GPQFNq3AQsjAL6NZGyV83INGKJy4CSBnC6gPSY9IJGjRkewNpFL8vHmZ ApHoGwfWrLzFMJ1/w88viRz7tqgc0rg69ZUH7TkE= From: Peter Wemm To: Warner Losh Cc: "svn-src-all@freebsd.org" , Warner Losh , src-committers , "svn-src-head@freebsd.org" Subject: Re: svn commit: r325378 - head/sys/dev/ipmi Date: Sat, 04 Nov 2017 22:19:45 -0700 Message-ID: <1595776.mmy5sTxHyV@overcee.wemm.org> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201711040301.vA431wdY002757@repo.freebsd.org> <2932858.xKWtPkGhRe@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7964703.98dSmvIvTU"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 05:19:50 -0000 --nextPart7964703.98dSmvIvTU Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Saturday, November 04, 2017 11:03:55 PM Warner Losh wrote: > On Sat, Nov 4, 2017 at 10:50 PM, Peter Wemm wrote: > > On Saturday, November 04, 2017 03:01:58 AM Warner Losh wrote: > > > Author: imp > > > Date: Sat Nov 4 03:01:58 2017 > > > New Revision: 325378 > > > URL: https://svnweb.freebsd.org/changeset/base/325378 > > >=20 > > > Log: > > > Make the startup timeout 0 seconds by default rathern than 420s= . This > > > makes the default fail safe when watchdogd is disabled (which i= s also > > > the default). > >=20 > > We're still getting unanticipated reboots. > >=20 > > I think what is happening is: > > 1) orderly reboot initiated. > > 2) By default, the watchdog code sets a 420 second timer, even with= no > > watchdogd. > > 3) reboot complets, system comes up. > > 4) A few minutes later, the pre-reboot 420 second timer expires and= > > *another* > > reboot happens. > >=20 > > Setting hw.ipmi.on=3D"0" in loader.conf stops this... > >=20 > > eg: reboot at 4:41:47.. system comes back up, and later: > > ... > > Uptime: 322 Sun Nov 5 04:48:45 UTC 2017 > > Uptime: 323 Sun Nov 5 04:48:46 UTC 2017 > > Uptime: 324 Sun Nov 5 04:48:47 UTC 2017 > > Stopping cron. > > Waiting for PIDS: 1004. > > Stopping sshd. > > Waiting for PIDS: 994. > > Stopping nginx. > > ... > > That's exactly 420 seconds after the original reboot which matches = the > > wd_shutdown_countdown timer that is still enabled.] >=20 > Good detective work.I suspect this will need to be opt-in as well... = Though > the other option is to disable the watchdog on attach if we're not en= abling > the early watchdog which would give us a watchdog when we hang on > shutdown... I need to think this through.... Fix it early with less > protection by setting this to 0, or fix it later with more protection= , but > perhaps odd behavior for some edge cases like downgrade. >=20 > In the mean time hw.ipmi.wd_shutdown_countdown=3D0 should also fix it= . Can > you confirm that? >=20 > Warner We have a number of obnoxious machines that take 5+ minutes in POST. T= he 7=20 minute timer is cutting it awfully close. However, what I'm more worried about: what if you're going to boot some= thing=20 other than FreeBSD? Or going into the BIOS to tweak something? If I = break=20 into the loader to pause booting, it'll just silently reboot out from u= nder me=20 a few minutes later. I don't see how this can be anything but opt-in = by=20 default. As it's a timer initiated by an orderly shutdown/reboot there= should=20 be plenty of time for an approprate value to be safely set. Yes, setting the sysctl after boot did prevent the spurious reboot afte= r the=20 next boot-up. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart7964703.98dSmvIvTU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEBgrA0Vr/vfNVuPoUNdaXCeyAngQFAln+n3EACgkQNdaXCeyA ngTSrgf+LQTK8ZlkoaM8e9thKzvDnGTaC2yASnunCiVYu67gojRYoU5aUALXjR5o B4mohlD2BA+5cZWOdjfa7gq1PZ6zhZnQ/Zs9UfZ2qiDV4arhPj9XXO1Mj2zU8mZu wq4VMC1RRDRXqtw+vJVc0WtpRE7JdUqaXm33kQxFoKMuDW3ITN4A1jCam4Lkca/D HqS25pC/s9TFjwhYAi6n354zkw92Q3dEZWv0eYbnWYyTn2/V3Vw/kNSxEWgyeq8L Q7IAwB140ZuofW8Cu9clJXDY4boxtHDkfDjYVsRCnBfSvyZ7rElgy8a/o611LCxk PmRAkoK026ohVxxHHR2E5DnjAFR/WA== =d1zx -----END PGP SIGNATURE----- --nextPart7964703.98dSmvIvTU-- From owner-svn-src-all@freebsd.org Sun Nov 5 05:30:13 2017 Return-Path: Delivered-To: svn-src-all@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 C0828E62919; Sun, 5 Nov 2017 05:30:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x229.google.com (mail-pg0-x229.google.com [IPv6:2607:f8b0:400e:c05::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 85FF26E4E9; Sun, 5 Nov 2017 05:30:13 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x229.google.com with SMTP id r25so5725077pgn.4; Sat, 04 Nov 2017 22:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=5mBkLE43BoFHUU0Ed54U9dM6qeaGobiH0/exF7YctZ4=; b=fLwy1KP9LUNdM55LOvljyKS9ABTIaVIhiUa9S7traeKDFVoI514YVOt/hFPvQPX4BY pctppmPiKo4mdGsU70SkunXh62nJUYXAVJuqxwGSS21zds7veWEeCFiovo4P80Q0AE8X RgnU7SyX+3YlFlf/gSKlcubbG4jMTENmRMj6fqZHXPf8H1qo5lZVrb64F91DqB0dfPAQ OqELu6S6SR5RjSPCtN1pmki38w7/ymM6zJjGe2PMNx1M1SAHONvt9wJwllU0ZHBmwV5o yRe8nEoxndcSm0JeHMRUrIWT93iY+RsCuJJnblqVtOypbhxhXuU8LKCg0AyKOwX3lLV8 0ljw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=5mBkLE43BoFHUU0Ed54U9dM6qeaGobiH0/exF7YctZ4=; b=U//uVZdL3Pcp0RW/bM5s6CkHrU+J5xshIwkXojKJeU000jcbXYOIMQ9SeZPafadTNP boMCwTlaRW4kYjkl9kjs79lRfh4kvx7myp9XGk4UVWOWXFaQa3Ev35mE8f+HghH5gj+y u0EY1/keZz8nhCjc/4INPIxhLs3pVuc+D71tYqdGEOqaZReSXWWCSfueqlIJVKQeWefK MafNEke4IdmyDEAW7ZRLPxLctg5tF0Ds/9j6PrG+y3sMfssF/+T0zEKA7yLAuc3JA3/U 2qMQxccc76It0PKCgY2cIH9D81xyLnQ6CeEQSyNwtbskgH6L87iiQKPQdnB0a1Prbosa BS7g== X-Gm-Message-State: AMCzsaVlPgQts2otVbEqRQ44TeS50e9ql0V0JHZ8fcojpSOO2KglmLpG 1zzJh4QpBkwxRpO5C/4SQzFXjViw X-Google-Smtp-Source: ABhQp+SnvEShM3SRccBnZVid8GZaj13P2XWeeGNHpTlsYvUcJ3tX2PkGauX6FZAyLIRd/jXI5WhZNA== X-Received: by 10.99.56.82 with SMTP id h18mr11921173pgn.281.1509859812700; Sat, 04 Nov 2017 22:30:12 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q77sm18712762pfd.84.2017.11.04.22.30.11 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Nov 2017 22:30:12 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_5A98044D-6B0E-4E68-A656-9558D5312278"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r325116 - head From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Sat, 4 Nov 2017 22:30:10 -0700 Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <57DE6BAA-EAE4-49EB-BEEE-27286480B283@gmail.com> References: <201710300312.v9U3CcCT021416@repo.freebsd.org> <8d9e9f50-035c-403c-3bc5-6788b7a94dea@FreeBSD.org> <72ee6c6d-0d9a-ebe9-8e15-c278fc91ded2@FreeBSD.org> <3a0a92dd-19fc-2ee3-dcbf-224e4c2e8eec@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 05:30:13 -0000 --Apple-Mail=_5A98044D-6B0E-4E68-A656-9558D5312278 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 > On Nov 4, 2017, at 08:31, Bryan Drewery wrote: >=20 > On 11/4/2017 12:08 AM, Ngie Cooper (yaneurabeya) wrote: >> I just ran into this with bash on universe12a.freebsd.org by = doing ^d. I think the change should be reverted. >> Thanks, >> -Ngie >>=20 >> $ exit >> *** Error code 130 >>=20 >> Stop. >> make[1]: stopped in /scratch/tmp/ngie/svn >> *** Error code 1 >>=20 >> Stop. >> make: stopped in /scratch/tmp/ngie/svn >>=20 >=20 > When you first go into buildenv check 'echo $?'. > My problem was a construct like '[ -f xxx ] && . xxx' at the end of = one > of my profile scripts. It needs to be 'if [ -f xxx ]; then . xxx; fi' > to avoid the bad status. It's really unrelated to buildenv. The last line in my ~/.bashrc on my VM is export PATH that doesn=92t = fail with a syntax error, and the last line on my ~/.bashrc on = universe12a is an alias set, which also doesn=92t fail with a syntax = error. Both cases set $? =3D 0. The issue I reported is caused by doing ^c + ^d (hence the error code = 130 in my original reply). I guess this is expected, but it=92s going to = confuse people and force them to have to investigate the issue, = unnecessarily, when it wasn=92t an =93issue=94 before. -Ngie --Apple-Mail=_5A98044D-6B0E-4E68-A656-9558D5312278 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE5bk3FaGcY5rvqmb79YOpJmkwhhUFAln+oeIACgkQ9YOpJmkw hhVAeA/+JaNaMKPDYv5t0zuRlEOxjad96wLU7YGQ45NVgLSqIPpO6Qr25/byjEJc VzajwcCb4MNp0CjJgYhKJ5gZwu2s/xHNciIRJtnb3iYMCh9lro7WtbgR/2o9xtNU VfQXcI+b2EPz+G+m1gGK/cvzRmCfKlusqbGA7Kxwoz+YvvmBO2iCiZxnHMuUrLdi uUGe+FlbvdumAE9nsShqW05ZispERdvCV1/P9xkGvKEB46k1g4y5C6pJUlq4VT1o /FQgtfiqwpnFmfuUQ/2VRH24RNvvdSFDyiJRox6D97NIuYdoVZvs8ttNy2EiKsEl 7YRyIhTJ//pSuDFGjKW4MHyYLdOutrsleFxpHPuQIw4BBHq5THw3ODfuUsN0VBsM HzqGrdyb3zg1eKgSGiGaHBRxT7jOuZJCB6mc9wgrv0tIOtBhEFlubq4h3AjfqK3i gsfNmmZHNlIW88+F6kuyyS1nzl/zHqBe8nl2ZROvYUd20+YoHmO1Sed4w+iUlPLg 1/fSF8ty+Gm5oS+d8shdZLr3Tuvn6FelU+xPRWDjTaOvrhwZ8W24RDWH5bfff75G RjaHVTOlanAdH18aDskjsNzNgocL9HkJx8Droiyp1TBe6gqTvc7TGDRBPIxedHb2 mL5Vzr3cK3WTGdalvqs/aZ1n1uZtqxDtpMZnrhHb4SxObGbI+p0= =wxhj -----END PGP SIGNATURE----- --Apple-Mail=_5A98044D-6B0E-4E68-A656-9558D5312278-- From owner-svn-src-all@freebsd.org Sun Nov 5 05:35:48 2017 Return-Path: Delivered-To: svn-src-all@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 E0E62E62B6D for ; Sun, 5 Nov 2017 05:35:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (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 A42426E8E6 for ; Sun, 5 Nov 2017 05:35:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id 72so1736781itk.3 for ; Sat, 04 Nov 2017 22:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=U22cVcdAREMTydsxZNCB0svM5cjPuW8GM44B3K4XS/k=; b=rZo4AI7/DpVKBrATtT6soDDu/yKa30E1MxsL/3mXKPMtJgCtQFBX3JBCF7soEtAQxz gvAR/eKq0j8anS/J0l0YND9SpugffHegghVW0dzRJsTEW8ggx6CGWLwKKdT5FHW/hBxw Nu7E0j4Fi6LA5aMtLEz1b4KQPjwx7SOlRwDg69PU1N+mSyH0ArV9Hd+mdX2vx1qjr4/9 Vqbi8VgUvvDJ2D8ps/jwRtdJ6Ss4VHUnJzR+ZM/+cW7Q972f6wSPFqz3vnJ0O+b98Xjj 3nClcGLZhPh12wREALXIwGJOrULFZEXLkd1uRzZ/OxNvyQNwk3vzjQtaL4lruPQXcGiM eXXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=U22cVcdAREMTydsxZNCB0svM5cjPuW8GM44B3K4XS/k=; b=b/MkAuToFy9m62fE+OqmcXqI6+/Rl8i1tGJpZ+zwuWwpHn4OLqJd5vpDcd95mQVdKj eCQz8cP3blYxgvZ4Q6rGiHuVUXQT801iO2mQ+ilMrmBrXq1yjjErVRnZfd2ZvGVXEI36 3G2WwojY8u7TB0PdH34zGo5IyzjkeRFtn9dDk0pekvSfL812UqrvrJvEN8z24kvoKrix fQT+e3gIAyYDQAGV63lfZ8UFZup7GnflSsqWeF+a4n+DrthOEQg3yrZvodF5UEZJsC2Q AsFxL7B7bUrSgDbziOEBj/Ct47PdCy73odlO8EUVwFls9PTWkekz4pFYM5B+2c0dTIRO T+5w== X-Gm-Message-State: AJaThX4hOBhWrq5fXxdC4/s1mcPoPdSisab4f6Mx6/ARiWjs0bLyN0s6 8nPrYkD/25lFMQdyvAIORy+U9X+T1qIwGaHEn67XTA== X-Google-Smtp-Source: ABhQp+SpCcD5iFb981JF+Q2xOY3wUw0UJjIte7dDpO5LhC6Ja0qiLs/Sfamy8nsto9xxv+hV5usvsIe4ajCj1sYT5mQ= X-Received: by 10.36.184.5 with SMTP id m5mr5145834ite.69.1509860147969; Sat, 04 Nov 2017 22:35:47 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Sat, 4 Nov 2017 22:35:47 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:a004:68c9:b567:b3a8] In-Reply-To: <1595776.mmy5sTxHyV@overcee.wemm.org> References: <201711040301.vA431wdY002757@repo.freebsd.org> <2932858.xKWtPkGhRe@overcee.wemm.org> <1595776.mmy5sTxHyV@overcee.wemm.org> From: Warner Losh Date: Sat, 4 Nov 2017 23:35:47 -0600 X-Google-Sender-Auth: x2drmQJLEZ1niZEObvN9eHsO_7g Message-ID: Subject: Re: svn commit: r325378 - head/sys/dev/ipmi To: Peter Wemm Cc: "svn-src-all@freebsd.org" , Warner Losh , src-committers , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 05:35:49 -0000 On Sat, Nov 4, 2017 at 11:19 PM, Peter Wemm wrote: > On Saturday, November 04, 2017 11:03:55 PM Warner Losh wrote: > > On Sat, Nov 4, 2017 at 10:50 PM, Peter Wemm wrote: > > > On Saturday, November 04, 2017 03:01:58 AM Warner Losh wrote: > > > > Author: imp > > > > Date: Sat Nov 4 03:01:58 2017 > > > > New Revision: 325378 > > > > URL: https://svnweb.freebsd.org/changeset/base/325378 > > > > > > > > Log: > > > > Make the startup timeout 0 seconds by default rathern than 420s. > This > > > > makes the default fail safe when watchdogd is disabled (which is > also > > > > the default). > > > > > > We're still getting unanticipated reboots. > > > > > > I think what is happening is: > > > 1) orderly reboot initiated. > > > 2) By default, the watchdog code sets a 420 second timer, even with no > > > watchdogd. > > > 3) reboot complets, system comes up. > > > 4) A few minutes later, the pre-reboot 420 second timer expires and > > > *another* > > > reboot happens. > > > > > > Setting hw.ipmi.on="0" in loader.conf stops this... > > > > > > eg: reboot at 4:41:47.. system comes back up, and later: > > > ... > > > Uptime: 322 Sun Nov 5 04:48:45 UTC 2017 > > > Uptime: 323 Sun Nov 5 04:48:46 UTC 2017 > > > Uptime: 324 Sun Nov 5 04:48:47 UTC 2017 > > > Stopping cron. > > > Waiting for PIDS: 1004. > > > Stopping sshd. > > > Waiting for PIDS: 994. > > > Stopping nginx. > > > ... > > > That's exactly 420 seconds after the original reboot which matches the > > > wd_shutdown_countdown timer that is still enabled.] > > > > Good detective work.I suspect this will need to be opt-in as well... > Though > > the other option is to disable the watchdog on attach if we're not > enabling > > the early watchdog which would give us a watchdog when we hang on > > shutdown... I need to think this through.... Fix it early with less > > protection by setting this to 0, or fix it later with more protection, > but > > perhaps odd behavior for some edge cases like downgrade. > > > > In the mean time hw.ipmi.wd_shutdown_countdown=0 should also fix it. Can > > you confirm that? > > > > Warner > > We have a number of obnoxious machines that take 5+ minutes in POST. The 7 > minute timer is cutting it awfully close. > > However, what I'm more worried about: what if you're going to boot > something > other than FreeBSD? Or going into the BIOS to tweak something? If I > break > into the loader to pause booting, it'll just silently reboot out from > under me > a few minutes later. I don't see how this can be anything but opt-in by > default. As it's a timer initiated by an orderly shutdown/reboot there > should > be plenty of time for an approprate value to be safely set. > > Yes, setting the sysctl after boot did prevent the spurious reboot after > the > next boot-up. OK. Given the edge cases aren't so edgy as I was originally thinking, I'm inclined to agree here: both features have to be opt-in. Attempts at being clever only work in a monoculture of FreeBSD where one is always moving forward in versions and never back. There's problems with both of these assumptions... Sorry for what sounds like a lot of hassle to diagnose this. Warner From owner-svn-src-all@freebsd.org Sun Nov 5 05:50:01 2017 Return-Path: Delivered-To: svn-src-all@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 03980E62EC0 for ; Sun, 5 Nov 2017 05:50:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (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 B04616ED9B for ; Sun, 5 Nov 2017 05:50:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id m81so12493603ioi.13 for ; Sat, 04 Nov 2017 22:50:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CBl5yK/pGBbJL6fLFLuk0KmPDW1Q9wLNBZq5bwB695Y=; b=2EnD3qFaRvbR/44gqQc+S1Lddth6YuCpjAQfrKeykpu4wcIhu+7Disx+NegJQdq6Dz xXuEjP13UUq55JUGkP/4TiYDlIu7RSUaSypwPeukDo8r2wTCi6sC7Ss6MKBrIOSaDlU/ +3foOn33GFd3hOQq4MW7GYD2pAOY+zvGzT+rKn+Sr8VPxpOAEtj/ihDvHLr9ccjqILmU eF0sf0gFBh75OhSB03vPxSvudBfHwgptOZXeM5YMob6rbr9ngtgqzVsgnpYrYBL5DRz8 r7iqFMix6G3gXMpMU4ZjeYGk8Y33h4EQlYckpLIxsStOPH+2VtWPBHnFhjbykhhS0F7+ eS2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=CBl5yK/pGBbJL6fLFLuk0KmPDW1Q9wLNBZq5bwB695Y=; b=EwLWkJTsA+wYyrGqt56VpDxnI/KTScrwQ5MBTKlrdvlAlGOBR9LEdv02KRYb3m16WS G+NvgbgSKr3m3JjLijdY18fbgIcJFxJ5/I7HEcOsNfi5lPs1RD4NfDj5aWpgKgIuxFWS QhENnWdsHCFpf4GdH7CpPhgxOtDa6kqGI85CjC1WiNpRbmUaaPABnwzYXJL56frAVRro CrzX5ZrR6E5V1okbC6iGQm2RSSPW9n9ApxDn1R7E4e1Z+J27H7jNTerNlltVXdTKxkRg HWsb2VZ5UEMEAWjslzN6W2y18jfuts1nWZEJJXRf2qcrQLMzm6hfKS6LC0XgREzYj0hT Po7A== X-Gm-Message-State: AJaThX7DG97ac7jzUqbFTBvxvyNDProXAgPAtLrd/e7lvrhVE6CN3LVi V1/jy5JqHp15aLZvmHKOl90YpZqPPdie/G18Nwq3Jg== X-Google-Smtp-Source: ABhQp+TU0baa2qid8Bda75O3pDi6dV4cl3HcJHYjY/Y+ujlw8OJbWQ6FY8F29RkTLcEUNtTWykt33Fefa9RciSot/xU= X-Received: by 10.107.81.21 with SMTP id f21mr14765126iob.63.1509861000043; Sat, 04 Nov 2017 22:50:00 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Sat, 4 Nov 2017 22:49:59 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:a004:68c9:b567:b3a8] In-Reply-To: <57DE6BAA-EAE4-49EB-BEEE-27286480B283@gmail.com> References: <201710300312.v9U3CcCT021416@repo.freebsd.org> <8d9e9f50-035c-403c-3bc5-6788b7a94dea@FreeBSD.org> <72ee6c6d-0d9a-ebe9-8e15-c278fc91ded2@FreeBSD.org> <3a0a92dd-19fc-2ee3-dcbf-224e4c2e8eec@FreeBSD.org> <57DE6BAA-EAE4-49EB-BEEE-27286480B283@gmail.com> From: Warner Losh Date: Sat, 4 Nov 2017 23:49:59 -0600 X-Google-Sender-Auth: 4B2OU6YL3owoybQ7o4l6dCwpy90 Message-ID: Subject: Re: svn commit: r325116 - head To: "Ngie Cooper (yaneurabeya)" Cc: Bryan Drewery , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 05:50:01 -0000 On Sat, Nov 4, 2017 at 11:30 PM, Ngie Cooper (yaneurabeya) < yaneurabeya@gmail.com> wrote: > > > On Nov 4, 2017, at 08:31, Bryan Drewery wrote: > > > > On 11/4/2017 12:08 AM, Ngie Cooper (yaneurabeya) wrote: > >> I just ran into this with bash on universe12a.freebsd.org by > doing ^d. I think the change should be reverted. > >> Thanks, > >> -Ngie > >> > >> $ exit > >> *** Error code 130 > >> > >> Stop. > >> make[1]: stopped in /scratch/tmp/ngie/svn > >> *** Error code 1 > >> > >> Stop. > >> make: stopped in /scratch/tmp/ngie/svn > >> > > > > When you first go into buildenv check 'echo $?'. > > My problem was a construct like '[ -f xxx ] && . xxx' at the end of one > > of my profile scripts. It needs to be 'if [ -f xxx ]; then . xxx; fi' > > to avoid the bad status. It's really unrelated to buildenv. > > The last line in my ~/.bashrc on my VM is export PATH that doesn=E2=80=99= t fail > with a syntax error, and the last line on my ~/.bashrc on universe12a is = an > alias set, which also doesn=E2=80=99t fail with a syntax error. Both case= s set $? =3D > 0. > > The issue I reported is caused by doing ^c + ^d (hence the error code 130 > in my original reply). I guess this is expected, but it=E2=80=99s going t= o confuse > people and force them to have to investigate the issue, unnecessarily, wh= en > it wasn=E2=80=99t an =E2=80=9Cissue=E2=80=9D before. > I can confirm this in my rather bare-bones bash environment. I'm inclined to think that the edge case like this throwing slightly odd results is a less bad outcome than not being able to get the results of a make buildenv command... It's good to know that this oddity can happen. We could: (a) just put "|| true" back and stop. This breaks detecting if the make buildenv command failed. (b) We could just document this can happen, which is easy but still has the issue (c) We could create a new target to run commands, but that would be exactly what buildenv is w/o the || true. I'm inclined do (b). (a) is a non-starter. (c) is possible, but seems wasteful to solve this case that can be explained in documentation. Warner From owner-svn-src-all@freebsd.org Sun Nov 5 08:31:27 2017 Return-Path: Delivered-To: svn-src-all@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 13528E65674; Sun, 5 Nov 2017 08:31:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5B2372F79; Sun, 5 Nov 2017 08:31:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA58VPau052276; Sun, 5 Nov 2017 08:31:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA58VPY9052275; Sun, 5 Nov 2017 08:31:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711050831.vA58VPY9052275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Nov 2017 08:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325433 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 08:31:27 -0000 Author: mjg Date: Sun Nov 5 08:31:25 2017 New Revision: 325433 URL: https://svnweb.freebsd.org/changeset/base/325433 Log: namecache: skip locking in cache_purge_negative if there are no entries Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Nov 5 08:20:27 2017 (r325432) +++ head/sys/kern/vfs_cache.c Sun Nov 5 08:31:25 2017 (r325433) @@ -1967,6 +1967,8 @@ cache_purge_negative(struct vnode *vp) CTR1(KTR_VFS, "cache_purge_negative(%p)", vp); SDT_PROBE1(vfs, namecache, purge_negative, done, vp); + if (LIST_EMPTY(&vp->v_cache_src)) + return; TAILQ_INIT(&ncps); vlp = VP2VNODELOCK(vp); mtx_lock(vlp); From owner-svn-src-all@freebsd.org Sun Nov 5 10:17:16 2017 Return-Path: Delivered-To: svn-src-all@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 1CC7CE67401; Sun, 5 Nov 2017 10:17:16 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F22775B8C; Sun, 5 Nov 2017 10:17:14 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.180.160.143]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LpsIh-1dWC4I26ZL-00fmyW; Sun, 05 Nov 2017 11:17:01 +0100 Date: Sun, 5 Nov 2017 11:16:52 +0100 From: "O. Hartmann" To: "O. Hartmann" Cc: "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bryan Drewery , Cy Schubert Subject: Re: svn commit: r325404 - head/share/mk Message-ID: <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> References: <201711042102.vA4L2RuR063978@repo.freebsd.org> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/30C4oE74jq/O0_uhngRxUMl"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:WGzhI1IuBmaRhYS+FdGnv6tHWzYKpVNqYh/+mufuDzmlvBK/QjD i/v09Ee8O/sBwsXqnP46M1YTVqVrMImkTk3vMGYhidyUt4PuTVni7aZ0lbQSUjXV5RRpBYL Mz25MCjVI5bkeghsRg3HJB4bJUHq5z3xqbppAAE8ZX3nIFFX10RYAMU5/WSy+IcY4muvx07 QMN8H5jiOUitiYgtC7Cxw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Ds837YcG4OQ=:RwvZLpG6fo72DyvYKVtNtN rdCW3x1XQpbqBhfqJDKUKt7YYHHgAbs+b1wHyzv7mxIH2fVVNiyJ06Ch75gfXUeYP5i4ZZ86K gKXU33JrVYkviy8IwOW5PbcMqFcVsX7VR79r4TXhhSnlPUsqKyAqSvIQ0rTIWezWG1PM/Kw8+ UfwswYojRgeuTO8v6wiK+BZbb9p8RBx4uknUMdivzLJJ2/guFBoskWZEX8IovbW4/gDDf21dB VOvt45mpp8eqFADdwEXNdlFoPfEklYxFffJvXpyMKbkt9DBDQc2tSY8m1r6jS39r2ZbWOGCxu whVrc97JWwsasIWZBPxXDsV9skTTH6WeeI7S+FAc5ZuP498DDjSebqQjrplkJLvOfNOWdXVH0 lJI1bt3dG11uLXnx+JONK9TekCpOkESMD6Vo6Egp5zKbKeGZsroY9l9Q9v1V+GyEjgRDlaAGZ AW1QXXXvVK1PFZqeKkmOjkDfplZtMptqSsS7YGXd3gC2lwyESEFkm5jcaiRdCZfMZEZiozHjt ymPEKmTYv71Bo/t1aVsgFQ0vG8eRF9yvxO2kYxM9ONP4Lpje+10GD/eVEl3c5GL8Aqra/Dpg9 iiIqgb478A2giwE5EZiBcFMxOKekS4QOBaf3q0tG73Xcz37Q5Qx2JsxvPL1ZpkTEBlQKJRAol 3fhyApkQIdvcqFZXKs/Xg0uV/bglq4vNVpGIYoRZGFSzuN8QYyxFDKmUXZyaanG/atb1DVFNx dnsslpEexOzaBrEV6KF1uBXJYuhmSb+n/0ocxi4foZG4VFBoqBjKjc6l36ZP0nmzMBWxeyDUW 6MoCGkZa+j5IAkfICWHpZTuJM7bHg== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 10:17:16 -0000 --Sig_/30C4oE74jq/O0_uhngRxUMl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 4 Nov 2017 22:31:33 +0100 "O. Hartmann" schrieb: > Am Sat, 4 Nov 2017 21:02:27 +0000 (UTC) > "Simon J. Gerraty" schrieb: >=20 > > Author: sjg > > Date: Sat Nov 4 21:02:26 2017 > > New Revision: 325404 > > URL: https://svnweb.freebsd.org/changeset/base/325404 > >=20 > > Log: > > Ensure .OBJDIR has known value > > =20 > > If for any reason we cannot set .OBJDIR=3D=3D_objdir as desired > > use .CURDIR so that at least the classic > > .if ${.OBJDIR} !=3D ${.CURDIR} > > works and dangerous misstakes can be avoided. > > =20 > > Reviewed by: bdrewery > >=20 > > Modified: > > head/share/mk/auto.obj.mk > >=20 > > Modified: head/share/mk/auto.obj.mk > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/share/mk/auto.obj.mk Sat Nov 4 16:23:34 2017 (r325403) > > +++ head/share/mk/auto.obj.mk Sat Nov 4 21:02:26 2017 (r325404) > > @@ -61,11 +61,17 @@ __objdir_made !=3D echo ${__objdir}/; umask ${OBJDI= R_UMA > > .endif > > # This causes make to use the specified directory as .OBJDIR > > .OBJDIR: ${__objdir} > > -.if ${.OBJDIR:tA} !=3D ${__objdir:tA} && ${__objdir_made:Uno:M${__objd= ir}/*} !=3D "" > > +.if ${.OBJDIR:tA} !=3D ${__objdir:tA} > > +# we did not get what we want - do we care? > > +.if ${__objdir_made:Uno:M${__objdir}/*} !=3D "" > > # watch out for __objdir being relative path > > .if !(${__objdir:M/*} =3D=3D "" && ${.OBJDIR:tA} =3D=3D ${${.CURDIR}/$= {__objdir}:L:tA}) > > .error could not use ${__objdir}: .OBJDIR=3D${.OBJDIR} > > .endif > > +.endif > > +# apparently we can live with it > > +# make sure we know what we have > > +.OBJDIR: ${.CURDIR} > > .endif > > .endif > > .endif > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"= =20 >=20 > With the recent patches, nvidia driver x11/nvidia-driver fails tobuild wi= th the error > shown below: >=20 > [...] > =3D=3D=3D> src/nvidia (all) =20 > make[7]: "/usr/src/share/mk/bsd.obj.mk" line 87: Malformed conditional > (${CANONICALOBJDIR} =3D=3D /${RELDIR} || ${.OBJDIR} =3D=3D /${RELDIR}) ma= ke[7]: Fatal errors > encountered -- cannot continue > [...] Not really solved for me: [...] =3D=3D=3D> src (all) =3D=3D=3D> src/nvidia (all) make[7]: "/usr/src/share/mk/bsd.obj.mk" line 89: Malformed conditional (def= ined(SRCTOP) && (${CANONICALOBJDIR} =3D=3D /${RELDIR} || ${.OBJDIR} =3D=3D /${RELDIR}))= make[7]: Fatal errors encountered -- cannot continue [...] Is there something I miss here? Same for emulators/emulators/virtualbox-ose-kmod [...] kBuild: Installing /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtua= lbox-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vboxd= rv/Makefile =3D=3D=3D Building 'vboxdrv' module =3D=3D=3D make[6]: "/usr/src/share/mk/b= sd.obj.mk" line 89: Malformed conditional (defined(SRCTOP) && (${CANONICALOBJDIR} =3D=3D /${RE= LDIR} || ${.OBJDIR} =3D=3D /${RELDIR})) make[6]: Fatal errors encountered -- cannot = continue make[6]: stopped in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualbox-ose= -kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vboxdrv *** Error code 1 Stop. make[5]: stopped in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualbox-ose= -kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src =3D=3D=3D> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=3Dy= es and rebuild before reporting the failure to the maintainer. *** Error code 1 [...] By the way: both kernel modules are build with=20 [...] PORTS_MODULES+=3D x11/nvidia-driver PORTS_MODULES+=3D emulators/virtualbox-ose-kmod [...] in /etc/src.conf Do I miss something or is this a bug? Kind regards, Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/30C4oE74jq/O0_uhngRxUMl Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWf7lFAAKCRDS528fyFhY lB1TAfoDcCr3vhUmoOdZBpn4aHIwojKH86soUKCXAAuRj5jvbEckloBxBVZh4nJ0 Vs7q68NoSCtjETufiK2LlsYGkkX5Af98TzNEb6TDcPN+m0NZONhTaR1vp6H3EGXP Szr/P843Yd6tqnLs0bYykdn0wouJuNK0ALXwuDzp+xJcS4vHiu5a =GgDD -----END PGP SIGNATURE----- --Sig_/30C4oE74jq/O0_uhngRxUMl-- From owner-svn-src-all@freebsd.org Sun Nov 5 11:59:34 2017 Return-Path: Delivered-To: svn-src-all@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 524ADE691FD; Sun, 5 Nov 2017 11:59:34 +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 2CA777C954; Sun, 5 Nov 2017 11:59:34 +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 vA5BxXxf039947; Sun, 5 Nov 2017 11:59:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5BxXS4039946; Sun, 5 Nov 2017 11:59:33 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201711051159.vA5BxXS4039946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 5 Nov 2017 11:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325434 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 325434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 11:59:34 -0000 Author: tuexen Date: Sun Nov 5 11:59:33 2017 New Revision: 325434 URL: https://svnweb.freebsd.org/changeset/base/325434 Log: Fix an accounting bug where data was counted twice if on the read queue and on the ordered or unordered queue. While there, improve the checking in INVARIANTs when computing the a_rwnd. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Nov 5 08:31:25 2017 (r325433) +++ head/sys/netinet/sctp_indata.c Sun Nov 5 11:59:33 2017 (r325434) @@ -88,12 +88,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso if (stcb->sctp_socket == NULL) { return (calc); } + KASSERT(asoc->cnt_on_reasm_queue > 0 || asoc->size_on_reasm_queue == 0, + ("size_on_reasm_queue is %u", asoc->size_on_reasm_queue)); + KASSERT(asoc->cnt_on_all_streams > 0 || asoc->size_on_all_streams == 0, + ("size_on_all_streams is %u", asoc->size_on_all_streams)); if (stcb->asoc.sb_cc == 0 && - asoc->size_on_reasm_queue == 0 && - asoc->size_on_all_streams == 0) { + asoc->cnt_on_reasm_queue == 0 && + asoc->cnt_on_all_streams == 0) { /* Full rwnd granted */ - KASSERT(asoc->cnt_on_reasm_queue == 0, ("cnt_on_reasm_queue is %u", asoc->cnt_on_reasm_queue)); - KASSERT(asoc->cnt_on_all_streams == 0, ("cnt_on_all_streams is %u", asoc->cnt_on_all_streams)); calc = max(SCTP_SB_LIMIT_RCV(stcb->sctp_socket), SCTP_MINIMAL_RWND); return (calc); } @@ -1245,6 +1247,19 @@ deliver_more: } done = (control->end_added) && (control->last_frag_seen); if (control->on_read_q == 0) { + if (!done) { + if (asoc->size_on_all_streams >= control->length) { + asoc->size_on_all_streams -= control->length; + } else { +#ifdef INVARIANTS + panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); +#else + asoc->size_on_all_streams = 0; +#endif + } + strm->pd_api_started = 1; + control->pdapi_started = 1; + } sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, control->end_added, @@ -1254,10 +1269,6 @@ deliver_more: if (done) { control = nctl; goto deliver_more; - } else { - /* We are now doing PD API */ - strm->pd_api_started = 1; - control->pdapi_started = 1; } } } @@ -1316,15 +1327,11 @@ sctp_add_chk_to_control(struct sctp_queued_to_read *co } else if (control->on_strm_q == SCTP_ON_ORDERED) { /* Ordered */ TAILQ_REMOVE(&strm->inqueue, control, next_instrm); - if (asoc->size_on_all_streams >= control->length) { - asoc->size_on_all_streams -= control->length; - } else { -#ifdef INVARIANTS - panic("size_on_all_streams = %u smaller than control length %u", asoc->size_on_all_streams, control->length); -#else - asoc->size_on_all_streams = 0; -#endif - } + /* + * Don't need to decrement + * size_on_all_streams, since control is on + * the read queue. + */ sctp_ucount_decr(asoc->cnt_on_all_streams); control->on_strm_q = 0; #ifdef INVARIANTS From owner-svn-src-all@freebsd.org Sun Nov 5 13:03:57 2017 Return-Path: Delivered-To: svn-src-all@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 64559E6B793; Sun, 5 Nov 2017 13:03:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 EE7907F176; Sun, 5 Nov 2017 13:03:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA5D3oo7093357 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 5 Nov 2017 15:03:50 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA5D3oo7093357 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA5D3n8l093356; Sun, 5 Nov 2017 15:03:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 5 Nov 2017 15:03:49 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324853 - in head/sys: kern sys Message-ID: <20171105130349.GZ2566@kib.kiev.ua> References: <201710220811.v9M8Bjw5033551@repo.freebsd.org> <20171105014453.L1354@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171105014453.L1354@besplex.bde.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 13:03:57 -0000 On Sun, Nov 05, 2017 at 03:06:22AM +1100, Bruce Evans wrote: > On Sun, 22 Oct 2017, Konstantin Belousov wrote: > > > Author: kib > > Date: Sun Oct 22 08:11:45 2017 > > New Revision: 324853 > > URL: https://svnweb.freebsd.org/changeset/base/324853 > > > > Log: > > Remove the support for mknod(S_IFMT), which created dummy vnodes with > > VBAD type. > > > > FFS ffs_write() VOP catches such vnodes and panics, other VOPs do not > > check for the type and their behaviour is really undefined. The > > comment claims that this support was done for 'badsect' to flag bad > > sectors, we do not have such facility in kernel anyway. > > badsect(8) is a utility and this commit breaks it by removing its kernel > support. I see, thank you for the pointer. I will prepare the patch to remove badsect(8). From owner-svn-src-all@freebsd.org Sun Nov 5 13:06:13 2017 Return-Path: Delivered-To: svn-src-all@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 12EB5E6B85C; Sun, 5 Nov 2017 13:06:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 80AE37F304; Sun, 5 Nov 2017 13:06:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA5D67OM094427 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 5 Nov 2017 15:06:07 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA5D67OM094427 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA5D67qP094426; Sun, 5 Nov 2017 15:06:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 5 Nov 2017 15:06:07 +0200 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325386 - head/sys/kern Message-ID: <20171105130607.GA2566@kib.kiev.ua> References: <201711041049.vA4AnZUE096709@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 13:06:13 -0000 On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote: > This is a functional change, because MPASS (via KASSERT) is only > enabled on DEBUG kernels. Ideally we would have a kind of ASSERT that > worked on NODEBUG kernels. Why would we need such thing ? Our conventions are clear: consistency checks are normally done with KASSERT() and enabled for DEBUG (INVARIANTS or harder) configurations. We only leave explicit panics in the production kernels when there continuation of operations is worse then abort, e.g. when UFS detects the metadata corruption. The submission perfectly fits into this model. > > Best, > Conrad > > On Sat, Nov 4, 2017 at 3:49 AM, Konstantin Belousov wrote: > > Author: kib > > Date: Sat Nov 4 10:49:34 2017 > > New Revision: 325386 > > URL: https://svnweb.freebsd.org/changeset/base/325386 > > > > Log: > > Convert explicit panic() call to assert. > > > > Based on github pull request: #113 > > Submitted by: pmarillo@github > > MFC after: 1 week > > > > Modified: > > head/sys/kern/kern_umtx.c > > > > Modified: head/sys/kern/kern_umtx.c > > ============================================================================== > > --- head/sys/kern/kern_umtx.c Sat Nov 4 10:10:34 2017 (r325385) > > +++ head/sys/kern/kern_umtx.c Sat Nov 4 10:49:34 2017 (r325386) > > @@ -1579,8 +1579,7 @@ umtx_pi_setowner(struct umtx_pi *pi, struct thread *ow > > > > uq_owner = owner->td_umtxq; > > mtx_assert(&umtx_lock, MA_OWNED); > > - if (pi->pi_owner != NULL) > > - panic("pi_owner != NULL"); > > + MPASS(pi->pi_owner == NULL); > > pi->pi_owner = owner; > > TAILQ_INSERT_TAIL(&uq_owner->uq_pi_contested, pi, pi_link); > > } > > From owner-svn-src-all@freebsd.org Sun Nov 5 13:28:49 2017 Return-Path: Delivered-To: svn-src-all@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 87DF8E6BE95; Sun, 5 Nov 2017 13:28:49 +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 56BA37FC4E; Sun, 5 Nov 2017 13:28:49 +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 vA5DSmvZ077981; Sun, 5 Nov 2017 13:28:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5DSmQj077980; Sun, 5 Nov 2017 13:28:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711051328.vA5DSmQj077980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 Nov 2017 13:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325435 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 325435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 13:28:49 -0000 Author: kib Date: Sun Nov 5 13:28:48 2017 New Revision: 325435 URL: https://svnweb.freebsd.org/changeset/base/325435 Log: Improve the message printed when the cylinder group checksum is wrong. Mention the device path and mount point path, handle snapshots. Tested by: imp Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Nov 5 11:59:33 2017 (r325434) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Nov 5 13:28:48 2017 (r325435) @@ -2584,6 +2584,15 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz) return (-1); } +static const struct statfs * +ffs_getmntstat(struct vnode *devvp) +{ + + if (devvp->v_type == VCHR) + return (&devvp->v_rdev->si_mountpt->mnt_stat); + return (ffs_getmntstat(VFSTOUFS(devvp->v_mount)->um_devvp)); +} + /* * Fetch and verify a cylinder group. */ @@ -2597,6 +2606,7 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) { struct buf *bp; struct cg *cgp; + const struct statfs *sfs; int flags, error; *bpp = NULL; @@ -2615,7 +2625,11 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) (bp->b_flags & B_CKHASH) != 0 && cgp->cg_ckhash != bp->b_ckhash) || !cg_chkmagic(cgp) || cgp->cg_cgx != cg) { - printf("checksum failed: cg %u, cgp: 0x%x != bp: 0x%jx\n", + sfs = ffs_getmntstat(devvp); + printf("UFS %s%s (%s) cylinder checksum failed: cg %u, cgp: " + "0x%x != bp: 0x%jx\n", + devvp->v_type == VCHR ? "" : "snapshot of ", + sfs->f_mntfromname, sfs->f_mntonname, cg, cgp->cg_ckhash, (uintmax_t)bp->b_ckhash); bp->b_flags &= ~B_CKHASH; bp->b_flags |= B_INVAL | B_NOCACHE; From owner-svn-src-all@freebsd.org Sun Nov 5 13:56:14 2017 Return-Path: Delivered-To: svn-src-all@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 CD0E0E6CAAF; Sun, 5 Nov 2017 13:56:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 6681F80AB5; Sun, 5 Nov 2017 13:56:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.104] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id C22541A3E68; Mon, 6 Nov 2017 00:56:10 +1100 (AEDT) Date: Mon, 6 Nov 2017 00:56:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Edward Tomasz Napierala cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324857 - in head: lib/libc/gen sys/vm In-Reply-To: <201710221035.v9MAZUki094587@repo.freebsd.org> Message-ID: <20171105233555.H976@besplex.bde.org> References: <201710221035.v9MAZUki094587@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=o3nkn_tHlLxaG1aYcFAA:9 a=FizZLGP9__hjo0mp:21 a=tekaci9hYXvlrzS2:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 13:56:14 -0000 On Sun, 22 Oct 2017, Edward Tomasz Napierala wrote: > Log: > Add OID for the vm.overcommit sysctl. This makes it possible to remove > one call to sysctl(2) from jemalloc startup code. (That also requires > changes to jemalloc, but I plan to push those to upstream first.) This change has many style bugs, and the ABI regression is unfortunate. Is it really useful to avoid 1 syscall, even in critical code? I prefer to avoid jemalloc (and also malloc) in small utilities. In non-small utilities, 1 more syscall doesn't matter. > Modified: head/lib/libc/gen/sysctl.3 > ============================================================================== > --- head/lib/libc/gen/sysctl.3 Sun Oct 22 10:32:40 2017 (r324856) > +++ head/lib/libc/gen/sysctl.3 Sun Oct 22 10:35:29 2017 (r324857) > @@ -28,7 +28,7 @@ > .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 > .\" $FreeBSD$ > .\" > -.Dd September 10, 2015 > +.Dd October 22, 2017 > .Dt SYSCTL 3 > .Os > .Sh NAME > @@ -741,6 +741,7 @@ privilege may change the value. > .It Dv VM_V_FREE_TARGET Ta integer Ta yes > .It Dv VM_V_INACTIVE_TARGET Ta integer Ta yes > .It Dv VM_V_PAGEOUT_FREE_MIN Ta integer Ta yes > +.It Dv VM_OVERCOMMIT Ta integer Ta yes > .El > .Bl -tag -width 6n > .It Li VM_LOADAVG This unsorts the list. Most lists in sysctl(3) were almost sorted, and this one was unsorted. The main unsortings and nearby errors now are: - CTL_VFS is unsorted in the top-level list (and description) - CTL_P1003_1B is missing in the top-level list (and description) - the second level for CTL_P1003_1B has more compile-time-constant numeric ids than most; these are also missing - CTL_*MAXID values were bogus/unused. All of them except the one for CTL_P1003_1B have been removed in sys/sysctl.h. - the second level for CTL_HW is in numeric order which is random/historical alphabetically - the second level KERN_HOSTNAME is unsorted - the second level KERN_ARND, KERN_DUMPDEV, KERN_IOV_MAX, KERN_IPC, KERN_LOGSIGEXIT, KERN_MAXPHYS, KERN_NTP_PLL, KERN_PS_STRINGS and KERN_USRSTACK are missing. All of these are relatively new and probably shouldn't exist as compile-time constants. - the second level KERN_QUANTUM is not missing, but doesn't exist. Its numeric value was renamed to KERN_DUMMY, and its name was changed to kern.sched.quantum. It should never have existed as a compile-time constant, but it should be documented. Its new name is of course not documented in any many page. Nothing in kern.sched is not documented in any many page. sysctl -d kern.sched gives some documentation. - the second level of KERN_PROF is in numeric/historical order - the second level PF_ROUTE is unsorted - the fifth level NET_RT_FLAGS is unsorted and not described - the fifth level NET_RT_IFLISTL is unsorted - sysctls without a compile-time-constant numeric id are mostly missing in sysctl(3). The second and lower levels of FP_INET are exceptions which show how things should be done. > @@ -773,6 +774,9 @@ process address space when needed. > .It Li VM_V_PAGEOUT_FREE_MIN > If the amount of free and cache memory falls below this value, the > pageout daemon will enter "memory conserving mode" to avoid deadlock. > +.It Li VM_OVERCOMMIT > +Overcommit behaviour, as described in > +.Xr tuning 7 . This is consistently unsorted. U.S. spelling for behavior, etc., should be used in most places in FreeBSD (except where the nearby spelling is already British). Many references to tuning(7) are bogus, but this one is correct, except I think the reference should be from tuning(7) to here instead of vice versa. > .El > .Sh RETURN VALUES > .Rv -std > > Modified: head/sys/vm/swap_pager.c > ============================================================================== > --- head/sys/vm/swap_pager.c Sun Oct 22 10:32:40 2017 (r324856) > +++ head/sys/vm/swap_pager.c Sun Oct 22 10:35:29 2017 (r324857) > @@ -157,7 +157,7 @@ static vm_ooffset_t swap_reserved; > SYSCTL_QUAD(_vm, OID_AUTO, swap_reserved, CTLFLAG_RD, &swap_reserved, 0, > "Amount of swap storage needed to back all allocated anonymous memory."); > static int overcommit = 0; > -SYSCTL_INT(_vm, OID_AUTO, overcommit, CTLFLAG_RW, &overcommit, 0, > +SYSCTL_INT(_vm, VM_OVERCOMMIT, overcommit, CTLFLAG_RW, &overcommit, 0, > "Configure virtual memory overcommit behavior. See tuning(7) " > "for details."); This reference to tuning(7) is bogus. The string has several style bugs. It is verbose, and the reference to the man page is mostly padding. Every sysctl should be described in more detail in a man page. Preferably only one big one, or one whose name is consistently related to the sysctl name, so that it is easy to find. > static unsigned long swzone; > > Modified: head/sys/vm/vm_param.h > ============================================================================== > --- head/sys/vm/vm_param.h Sun Oct 22 10:32:40 2017 (r324856) > +++ head/sys/vm/vm_param.h Sun Oct 22 10:35:29 2017 (r324857) > @@ -84,7 +84,8 @@ > #define VM_V_PAGEOUT_FREE_MIN 9 /* vm_cnt.v_pageout_free_min */ > #define VM_OBSOLETE_10 10 /* pageout algorithm */ > #define VM_SWAPPING_ENABLED 11 /* swapping enabled */ > -#define VM_MAXID 12 /* number of valid vm ids */ > +#define VM_OVERCOMMIT 12 /* vm.overcommit */ > +#define VM_MAXID 13 /* number of valid vm ids */ VM_OVERCOMMIT is misindented like 2 of the 4 nearby visible definitions. VM_OVERCOMMIT has a banal comment, like 1 nearby visible definitions. MAXID definitions haven't been removed for lower levels yet, but if VM_MAXID were actually used then incrementing it would give ABI problems. > > /* > * Structure for swap device statistics Bruce From owner-svn-src-all@freebsd.org Sun Nov 5 14:41:50 2017 Return-Path: Delivered-To: svn-src-all@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 26ED2E6D674; Sun, 5 Nov 2017 14:41:50 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E8DB181C92; Sun, 5 Nov 2017 14:41:49 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5EfnVo007507; Sun, 5 Nov 2017 14:41:49 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5Efn6N007506; Sun, 5 Nov 2017 14:41:49 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711051441.vA5Efn6N007506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sun, 5 Nov 2017 14:41:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325436 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 325436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 14:41:50 -0000 Author: eugen (ports committer) Date: Sun Nov 5 14:41:48 2017 New Revision: 325436 URL: https://svnweb.freebsd.org/changeset/base/325436 Log: Allow a process to assign an IP address to local ppp interface even if kernel routing table already has a route to the address in question installed by some routing daemon (PR 223129). Also, allow loopback route deletion when stopping a VIMAGE jail (PR 222647). PR: 222647, 223129 Reviewed by: gnn Approved by: avg (mentor), mav (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12747 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Nov 5 13:28:48 2017 (r325435) +++ head/sys/net/if.c Sun Nov 5 14:41:48 2017 (r325436) @@ -1708,7 +1708,7 @@ ifa_maintain_loopback_route(int cmd, const char *otype bzero(&info, sizeof(info)); if (cmd != RTM_DELETE) info.rti_ifp = V_loif; - info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC; + info.rti_flags = ifa->ifa_flags | RTF_HOST | RTF_STATIC | RTF_PINNED; info.rti_info[RTAX_DST] = ia; info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&null_sdl; link_init_sdl(ifp, (struct sockaddr *)&null_sdl, ifp->if_type); From owner-svn-src-all@freebsd.org Sun Nov 5 15:17:03 2017 Return-Path: Delivered-To: svn-src-all@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 62224E6DEA3; Sun, 5 Nov 2017 15:17:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 26CF882AF6; Sun, 5 Nov 2017 15:17:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.104] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 1C34B10478F8; Mon, 6 Nov 2017 01:46:50 +1100 (AEDT) Date: Mon, 6 Nov 2017 01:46:49 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324853 - in head/sys: kern sys In-Reply-To: <20171105130349.GZ2566@kib.kiev.ua> Message-ID: <20171106010605.L1257@besplex.bde.org> References: <201710220811.v9M8Bjw5033551@repo.freebsd.org> <20171105014453.L1354@besplex.bde.org> <20171105130349.GZ2566@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=dJygQ0nzWWpy1se7vO8A:9 a=1V_zddbC5oYsKgxO:21 a=FXTM8E97C0I6whea:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 15:17:03 -0000 On Sun, 5 Nov 2017, Konstantin Belousov wrote: > On Sun, Nov 05, 2017 at 03:06:22AM +1100, Bruce Evans wrote: >> On Sun, 22 Oct 2017, Konstantin Belousov wrote: >> >>> Author: kib >>> Date: Sun Oct 22 08:11:45 2017 >>> New Revision: 324853 >>> URL: https://svnweb.freebsd.org/changeset/base/324853 >>> >>> Log: >>> Remove the support for mknod(S_IFMT), which created dummy vnodes with >>> VBAD type. >>> >>> FFS ffs_write() VOP catches such vnodes and panics, other VOPs do not >>> check for the type and their behaviour is really undefined. The >>> comment claims that this support was done for 'badsect' to flag bad >>> sectors, we do not have such facility in kernel anyway. >> >> badsect(8) is a utility and this commit breaks it by removing its kernel >> support. > > I see, thank you for the pointer. I will prepare the patch to remove > badsect(8). That would increase the number of things to fix. Even if badsect(8) is implemented less hackishly, binary compatibility for mknod(2) requires ifdefing it with COMPAT_*. I only checked that badsect(*) worked before this commit without INVARIANTS or soft updates. Perhaps the panic always occurs with INVARIANTS due to some INAVRIANTS check being wrong, or soft updates doesn't understand this case. badsect(8) says to run badsect on a "quiet" file system, but this should only be necessary to prevent the bad block being reallocated while you are creating a VBAD file to hold it. Note that mknod(S_IFMT) doesn't force an fsck before the next mount. This seems to be be just another bug involving the clean flag -- I doubt that it is really safe to never clean up the VBAD files, so creating one should have set a sticky dirty flag. Bruce From owner-svn-src-all@freebsd.org Sun Nov 5 15:30:35 2017 Return-Path: Delivered-To: svn-src-all@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 C0B51E6E0FF; Sun, 5 Nov 2017 15:30:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 2565F82FEB; Sun, 5 Nov 2017 15:30:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA5FUQ9U026049 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 5 Nov 2017 17:30:27 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA5FUQ9U026049 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA5FUQ0w026048; Sun, 5 Nov 2017 17:30:26 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 5 Nov 2017 17:30:26 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324853 - in head/sys: kern sys Message-ID: <20171105153026.GC2566@kib.kiev.ua> References: <201710220811.v9M8Bjw5033551@repo.freebsd.org> <20171105014453.L1354@besplex.bde.org> <20171105130349.GZ2566@kib.kiev.ua> <20171106010605.L1257@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171106010605.L1257@besplex.bde.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 15:30:35 -0000 On Mon, Nov 06, 2017 at 01:46:49AM +1100, Bruce Evans wrote: > On Sun, 5 Nov 2017, Konstantin Belousov wrote: > > > On Sun, Nov 05, 2017 at 03:06:22AM +1100, Bruce Evans wrote: > >> On Sun, 22 Oct 2017, Konstantin Belousov wrote: > >> > >>> Author: kib > >>> Date: Sun Oct 22 08:11:45 2017 > >>> New Revision: 324853 > >>> URL: https://svnweb.freebsd.org/changeset/base/324853 > >>> > >>> Log: > >>> Remove the support for mknod(S_IFMT), which created dummy vnodes with > >>> VBAD type. > >>> > >>> FFS ffs_write() VOP catches such vnodes and panics, other VOPs do not > >>> check for the type and their behaviour is really undefined. The > >>> comment claims that this support was done for 'badsect' to flag bad > >>> sectors, we do not have such facility in kernel anyway. > >> > >> badsect(8) is a utility and this commit breaks it by removing its kernel > >> support. > > > > I see, thank you for the pointer. I will prepare the patch to remove > > badsect(8). > > That would increase the number of things to fix. In which way ? > > Even if badsect(8) is implemented less hackishly, binary compatibility > for mknod(2) requires ifdefing it with COMPAT_*. No, mknod(S_IFMT) is clearly non-functional management interface, and we allow management interface changes between releases, and if desired, inside the releases as well. > > I only checked that badsect(*) worked before this commit without INVARIANTS > or soft updates. Perhaps the panic always occurs with INVARIANTS due to > some INAVRIANTS check being wrong, or soft updates doesn't understand this > case. badsect(8) says to run badsect on a "quiet" file system, but this > should only be necessary to prevent the bad block being reallocated while > you are creating a VBAD file to hold it. Note that mknod(S_IFMT) doesn't > force an fsck before the next mount. This seems to be be just another bug > involving the clean flag -- I doubt that it is really safe to never clean > up the VBAD files, so creating one should have set a sticky dirty flag. UFS code is not prepared to VBAD vnodes. I do not mean specifically the vnode type, but the VOPs operations on such inodes. It is pointless to spend the time on making it functional. Modern disk failure modes made badsect(8) useless in the beginning if the beginning of 199x. I will commit the following patch after make universe finishes. diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 979483ba44e..044d7c89941 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20171108: badsect(8) removal +OLD_FILES+=sbin/badsect +OLD_FILES+=usr/share/man/man8/badsect.8.gz # 20171104: libcap_random should be in /lib not in /usr/lib OLD_LIBS+=usr/lib/libcap_random.so.0 # 20171104: Casper can work only as shared library diff --git a/sbin/Makefile b/sbin/Makefile index 43f3cec7e03..ca9f42ec0d6 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -6,7 +6,6 @@ # XXX MISSING: icheck ncheck SUBDIR=adjkerntz \ - badsect \ camcontrol \ clri \ comcontrol \ diff --git a/sbin/badsect/Makefile b/sbin/badsect/Makefile deleted file mode 100644 index c344e6c6355..00000000000 --- a/sbin/badsect/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 6/5/93 -# $FreeBSD$ - -PACKAGE=runtime -PROG= badsect -LIBADD= ufs -MAN= badsect.8 - -.include diff --git a/sbin/badsect/Makefile.depend b/sbin/badsect/Makefile.depend deleted file mode 100644 index 735bf03b75b..00000000000 --- a/sbin/badsect/Makefile.depend +++ /dev/null @@ -1,18 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/libufs \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/sbin/badsect/badsect.8 b/sbin/badsect/badsect.8 deleted file mode 100644 index 498febab1d9..00000000000 --- a/sbin/badsect/badsect.8 +++ /dev/null @@ -1,133 +0,0 @@ -.\" Copyright (c) 1985, 1991, 1993 -.\" The Regents of the University of California. 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. -.\" 3. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" @(#)badsect.8 8.1 (Berkeley) 6/5/93 -.\" $FreeBSD$ -.\" -.Dd June 5, 1993 -.Dt BADSECT 8 -.Os -.Sh NAME -.Nm badsect -.Nd create files to contain bad sectors -.Sh SYNOPSIS -.Nm -.Ar bbdir sector ... -.Sh DESCRIPTION -The -.Nm -utility makes a file to contain a bad sector. -Normally, bad sectors -are made inaccessible by the standard formatter, which provides -a forwarding table for bad sectors to the driver. -If a driver supports the bad blocking standard it is much preferable to -use that method to isolate bad blocks, since the bad block forwarding -makes the pack appear perfect, and such packs can then be copied with -.Xr dd 1 . -The technique used by this program is also less general than -bad block forwarding, as -.Nm -cannot make amends for -bad blocks in the i-list of file systems or in swap areas. -.Pp -On some disks, -adding a sector which is suddenly bad to the bad sector table -currently requires the running of the standard -.Tn DEC -formatter. -Thus to deal with a newly bad block -or on disks where the drivers -do not support the bad-blocking standard -.Nm -may be used to good effect. -.Pp -The -.Nm -utility is used on a quiet file system in the following way: -First mount the file system, and change to its root directory. -Make a directory -.Li BAD -there. -Run -.Nm -giving as argument the -.Ar BAD -directory followed by -all the bad sectors you wish to add. -(The sector numbers must be relative to the beginning of -the file system, but this is not hard as the system reports -relative sector numbers in its console error messages.) -Then change back to the root directory, unmount the file system -and run -.Xr fsck 8 -on the file system. -The bad sectors should show up in two files -or in the bad sector files and the free list. -Have -.Xr fsck 8 -remove files containing the offending bad sectors, but -.Em do not -have it remove the -.Pa BAD/ Ns Em nnnnn -files. -This will leave the bad sectors in only the -.Li BAD -files. -.Pp -The -.Nm -utility works by giving the specified sector numbers in a -.Xr mknod 2 -system call, -creating an illegal file whose first block address is the block containing -bad sector and whose name is the bad sector number. -When it is discovered by -.Xr fsck 8 -it will ask -.Dq Li "HOLD BAD BLOCK \&?" . -A positive response will cause -.Xr fsck 8 -to convert the inode to a regular file containing the bad block. -.Sh DIAGNOSTICS -The -.Nm -utility refuses to attach a block that -resides in a critical area or is out of range of the file system. -A warning is issued if the block is already in use. -.Sh SEE ALSO -.Xr fsck 8 -.Sh HISTORY -The -.Nm -utility appeared in -.Bx 4.1 . -.Sh BUGS -If more than one sector which comprise a file system fragment are bad, -you should specify only one of them to -.Nm , -as the blocks in the bad sector files actually cover all the sectors in a -file system fragment. diff --git a/sbin/badsect/badsect.c b/sbin/badsect/badsect.c deleted file mode 100644 index 097e3b112f6..00000000000 --- a/sbin/badsect/badsect.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 1981, 1983, 1993 - * The Regents of the University of California. 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. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1981, 1983, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static const char sccsid[] = "@(#)badsect.c 8.1 (Berkeley) 6/5/93"; -#endif -#endif -#include -__FBSDID("$FreeBSD$"); - -/* - * badsect - * - * Badsect takes a list of file-system relative sector numbers - * and makes files containing the blocks of which these sectors are a part. - * It can be used to contain sectors which have problems if these sectors - * are not part of the bad file for the pack (see bad144). For instance, - * this program can be used if the driver for the file system in question - * does not support bad block forwarding. - */ -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define sblock disk.d_fs -#define acg disk.d_cg -static struct uufsd disk; -static struct fs *fs = &sblock; -static int errs; - -int chkuse(daddr_t, int); - -static void -usage(void) -{ - fprintf(stderr, "usage: badsect bbdir blkno ...\n"); - exit(1); -} - -int -main(int argc, char *argv[]) -{ - daddr_t diskbn; - daddr_t number; - struct stat stbuf, devstat; - struct dirent *dp; - DIR *dirp; - char name[2 * MAXPATHLEN]; - char *name_dir_end; - - if (argc < 3) - usage(); - if (chdir(argv[1]) < 0 || stat(".", &stbuf) < 0) - err(2, "%s", argv[1]); - strcpy(name, _PATH_DEV); - if ((dirp = opendir(name)) == NULL) - err(3, "%s", name); - name_dir_end = name + strlen(name); - while ((dp = readdir(dirp)) != NULL) { - strcpy(name_dir_end, dp->d_name); - if (lstat(name, &devstat) < 0) - err(4, "%s", name); - if (stbuf.st_dev == devstat.st_rdev && - (devstat.st_mode & IFMT) == IFCHR) - break; - } - closedir(dirp); - if (dp == NULL) { - printf("Cannot find dev 0%lo corresponding to %s\n", - (u_long)stbuf.st_rdev, argv[1]); - exit(5); - } - if (ufs_disk_fillout(&disk, name) == -1) { - if (disk.d_error != NULL) - errx(6, "%s: %s", name, disk.d_error); - else - err(7, "%s", name); - } - for (argc -= 2, argv += 2; argc > 0; argc--, argv++) { - number = strtol(*argv, NULL, 0); - if (errno == EINVAL || errno == ERANGE) - err(8, "%s", *argv); - if (chkuse(number, 1)) - continue; - diskbn = dbtofsb(fs, number); - if (mknod(*argv, IFMT|0600, (dev_t)diskbn) < 0) { - warn("%s", *argv); - errs++; - } - } - ufs_disk_close(&disk); - printf("Don't forget to run ``fsck %s''\n", name); - exit(errs); -} - -int -chkuse(daddr_t blkno, int cnt) -{ - int cg; - daddr_t fsbn, bn; - - fsbn = dbtofsb(fs, blkno); - if ((unsigned)(fsbn+cnt) > fs->fs_size) { - printf("block %ld out of range of file system\n", (long)blkno); - return (1); - } - cg = dtog(fs, fsbn); - if (fsbn < cgdmin(fs, cg)) { - if (cg == 0 || (fsbn+cnt) > cgsblock(fs, cg)) { - printf("block %ld in non-data area: cannot attach\n", - (long)blkno); - return (1); - } - } else { - if ((fsbn+cnt) > cgbase(fs, cg+1)) { - printf("block %ld in non-data area: cannot attach\n", - (long)blkno); - return (1); - } - } - if (cgread1(&disk, cg) != 1) { - fprintf(stderr, "cg %d: could not be read\n", cg); - errs++; - return (1); - } - if (!cg_chkmagic(&acg)) { - fprintf(stderr, "cg %d: bad magic number\n", cg); - errs++; - return (1); - } - bn = dtogd(fs, fsbn); - if (isclr(cg_blksfree(&acg), bn)) - printf("Warning: sector %ld is in use\n", (long)blkno); - return (0); -} From owner-svn-src-all@freebsd.org Sun Nov 5 16:01:11 2017 Return-Path: Delivered-To: svn-src-all@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 8E70BE6EACF; Sun, 5 Nov 2017 16:01:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A16383E43; Sun, 5 Nov 2017 16:01:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 7BBDD1FF82; Sun, 5 Nov 2017 16:01:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 4868E50B3; Sun, 5 Nov 2017 16:01:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Fm2Fld7QpwBO; Sun, 5 Nov 2017 16:01:04 +0000 (UTC) Subject: Re: svn commit: r325404 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 6C6DC50AE To: "O. Hartmann" Cc: "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Cy Schubert References: <201711042102.vA4L2RuR063978@repo.freebsd.org> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> Date: Sun, 5 Nov 2017 08:00:48 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W8eaWABA1WToX1gRufsQk7XpqwtgigEVN" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 16:01:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --W8eaWABA1WToX1gRufsQk7XpqwtgigEVN Content-Type: multipart/mixed; boundary="aCbdaR2UR1q8LiasSPAJ9h9GogOhI1oKG"; protected-headers="v1" From: Bryan Drewery To: "O. Hartmann" Cc: "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Cy Schubert Message-ID: <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> Subject: Re: svn commit: r325404 - head/share/mk References: <201711042102.vA4L2RuR063978@repo.freebsd.org> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> --aCbdaR2UR1q8LiasSPAJ9h9GogOhI1oKG Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/5/2017 2:16 AM, O. Hartmann wrote: > Am Sat, 4 Nov 2017 22:31:33 +0100 > "O. Hartmann" schrieb: >=20 >> Am Sat, 4 Nov 2017 21:02:27 +0000 (UTC) >> "Simon J. Gerraty" schrieb: >> >>> Author: sjg >>> Date: Sat Nov 4 21:02:26 2017 >>> New Revision: 325404 >>> URL: https://svnweb.freebsd.org/changeset/base/325404 >>> >>> Log: >>> Ensure .OBJDIR has known value >>> =20 >>> If for any reason we cannot set .OBJDIR=3D=3D_objdir as desired >>> use .CURDIR so that at least the classic >>> .if ${.OBJDIR} !=3D ${.CURDIR} >>> works and dangerous misstakes can be avoided. >>> =20 >>> Reviewed by: bdrewery >>> >>> Modified: >>> head/share/mk/auto.obj.mk >>> >>> Modified: head/share/mk/auto.obj.mk >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/share/mk/auto.obj.mk Sat Nov 4 16:23:34 2017 (r325403) >>> +++ head/share/mk/auto.obj.mk Sat Nov 4 21:02:26 2017 (r325404) >>> @@ -61,11 +61,17 @@ __objdir_made !=3D echo ${__objdir}/; umask ${OBJ= DIR_UMA >>> .endif >>> # This causes make to use the specified directory as .OBJDIR >>> .OBJDIR: ${__objdir} >>> -.if ${.OBJDIR:tA} !=3D ${__objdir:tA} && ${__objdir_made:Uno:M${__ob= jdir}/*} !=3D "" >>> +.if ${.OBJDIR:tA} !=3D ${__objdir:tA} >>> +# we did not get what we want - do we care? >>> +.if ${__objdir_made:Uno:M${__objdir}/*} !=3D "" >>> # watch out for __objdir being relative path >>> .if !(${__objdir:M/*} =3D=3D "" && ${.OBJDIR:tA} =3D=3D ${${.CURDIR}= /${__objdir}:L:tA}) >>> .error could not use ${__objdir}: .OBJDIR=3D${.OBJDIR} >>> .endif >>> +.endif >>> +# apparently we can live with it >>> +# make sure we know what we have >>> +.OBJDIR: ${.CURDIR} >>> .endif >>> .endif >>> .endif >>> _______________________________________________ >>> svn-src-head@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.or= g" =20 >> >> With the recent patches, nvidia driver x11/nvidia-driver fails tobuild= with the error >> shown below: >> >> [...] >> =3D=3D=3D> src/nvidia (all) =20 >> make[7]: "/usr/src/share/mk/bsd.obj.mk" line 87: Malformed conditional= >> (${CANONICALOBJDIR} =3D=3D /${RELDIR} || ${.OBJDIR} =3D=3D /${RELDIR})= make[7]: Fatal errors >> encountered -- cannot continue >> [...] >=20 > Not really solved for me: >=20 > [...] > =3D=3D=3D> src (all) > =3D=3D=3D> src/nvidia (all) > make[7]: "/usr/src/share/mk/bsd.obj.mk" line 89: Malformed conditional = (defined(SRCTOP) > && (${CANONICALOBJDIR} =3D=3D /${RELDIR} || ${.OBJDIR} =3D=3D /${RELDI= R})) make[7]: Fatal errors > encountered -- cannot continue > [...] >=20 >=20 > Is there something I miss here? >=20 > Same for emulators/emulators/virtualbox-ose-kmod >=20 > [...] > kBuild: > Installing /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/vi= rtualbox-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src= /vboxdrv/Makefile > =3D=3D=3D Building 'vboxdrv' module =3D=3D=3D make[6]: "/usr/src/share/= mk/bsd.obj.mk" line 89: > Malformed conditional (defined(SRCTOP) && (${CANONICALOBJDIR} =3D=3D /= ${RELDIR} || > ${.OBJDIR} =3D=3D /${RELDIR})) make[6]: Fatal errors encountered -- can= not continue make[6]: > stopped > in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualbox= -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vboxdrv= > *** Error code 1 >=20 > Stop. > make[5]: stopped > in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualbox= -ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src > =3D=3D=3D> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE= =3Dyes and rebuild before > reporting the failure to the maintainer. > *** Error code 1 > [...] >=20 >=20 > By the way: both kernel modules are build with=20 >=20 > [...] > PORTS_MODULES+=3D x11/nvidia-driver > PORTS_MODULES+=3D emulators/virtualbox-ose-kmod > [...] >=20 > in /etc/src.conf >=20 >=20 > Do I miss something or is this a bug? >=20 Weird, can you try this please? http://dpaste.com/3HR1EQH.txt >=20 > Kind regards, >=20 > Oliver >=20 --=20 Regards, Bryan Drewery --aCbdaR2UR1q8LiasSPAJ9h9GogOhI1oKG-- --W8eaWABA1WToX1gRufsQk7XpqwtgigEVN 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 iQEcBAEBAgAGBQJZ/zWxAAoJEDXXcbtuRpfPjmoIAJIbT79gF6Fw3DYbA4LSRMMR huYzzNqyGgj3ouiQDYedxpF4KySYFGRGsfI4jojYNy3BzX44qJMB7ldDT6UbYmQX ncwuhJfvVzYGxuaoXw+8bVWd7A92mtogADb5Td8wm39793MMmLnwd+eUWugIDU9Z YRN993sUY4aDqyM7ghNRyAYFKmPoFlyLBUJCc62cPiEkHDqUXJ9Jd94D+nW3BL+i 6saxTI6y9X3ELeIrR6az/Ro9/TIWggHckZtzlnPpuwQUjANfty5USzAeOfveOXg7 dIUtbc5d7v85RZe5wEUppu/ouOP5aXj2tSeGsAwfs9PnOa/9I1CqS9XoczpnTAk= =V5ZQ -----END PGP SIGNATURE----- --W8eaWABA1WToX1gRufsQk7XpqwtgigEVN-- From owner-svn-src-all@freebsd.org Sun Nov 5 16:26:48 2017 Return-Path: Delivered-To: svn-src-all@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 340F9E37558; Sun, 5 Nov 2017 16:26:48 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0114.outbound.protection.outlook.com [104.47.32.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7D34F1A; Sun, 5 Nov 2017 16:26:41 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QDnpKrhuEXM0FaO5SRjNI0DvSfh3M+EEE+DvArXYme0=; b=XhB4+rTh3zsVj7CuiyWKHkfIBlPiXml4l0FMgK8B5d9UFsOBrgDRf2fCDqo6AmQHcONfxJFlx/R2zdYgtoTBvplNQxZ+EZhLmE+fIGDlYjL05Mi5ANtgyXCQTYeZTvxBU27hh+hIUDeoVPvKdT3hZt1r05JKABcx7LMKNiOMTto= Received: from DM5PR05CA0047.namprd05.prod.outlook.com (10.174.188.164) by BY2PR0501MB2069.namprd05.prod.outlook.com (10.163.197.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.6; Sun, 5 Nov 2017 16:26:39 +0000 Received: from BY2NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::206) by DM5PR05CA0047.outlook.office365.com (2603:10b6:4:39::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.218.6 via Frontend Transport; Sun, 5 Nov 2017 16:26:39 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.12 as permitted sender) Received: from p-emfe01a-sac.jnpr.net (66.129.239.12) by BY2NAM05FT022.mail.protection.outlook.com (10.152.100.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.197.9 via Frontend Transport; Sun, 5 Nov 2017 16:26:39 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sun, 5 Nov 2017 08:26:35 -0800 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id vA5GQZKC015724; Sun, 5 Nov 2017 08:26:35 -0800 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 7F177385568; Sun, 5 Nov 2017 08:26:35 -0800 (PST) To: Bryan Drewery CC: "O. Hartmann" , , , , Cy Schubert , Subject: Re: svn commit: r325404 - head/share/mk In-Reply-To: <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> References: <201711042102.vA4L2RuR063978@repo.freebsd.org> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Sun, 05 Nov 2017 08:00:48 -0800." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13706.1509899195.1@kaos.jnpr.net> Content-Transfer-Encoding: quoted-printable Date: Sun, 5 Nov 2017 08:26:35 -0800 Message-ID: <13707.1509899195@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.12; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(376002)(346002)(2980300002)(189002)(24454002)(199003)(6266002)(69596002)(2810700001)(54906003)(97876018)(46406003)(86362001)(47776003)(316002)(105596002)(53416004)(76506005)(93886005)(97736004)(106466001)(9686003)(55016002)(97756001)(6306002)(68736007)(53936002)(117636001)(50226002)(2906002)(77096006)(6246003)(7696004)(478600001)(2950100002)(6916009)(229853002)(189998001)(107886003)(966005)(50466002)(53376002)(5660300001)(4326008)(8746002)(7126002)(23726003)(76176999)(50986999)(356003)(8936002)(81166006)(305945005)(81156014)(8676002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0501MB2069; H:p-emfe01a-sac.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM05FT022; 1:Jeic1wop5px7wjPEki7RzjXqdYYxEquw9qwLNBs1FuMqWDq6L+at2+s8SqEzQfFgvh6h7yCMuGs2zUb84QSFLdRad7dsAFTFGDD53HdX5S2b22oVy2rcD/eBbIsvnO5E X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 04224f04-664d-4133-26c5-08d52469fde0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249); SRVR:BY2PR0501MB2069; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0501MB2069; 3:xD1sSEKs1BDSRcVSz3x5NT0rN6Sn73tiVwBzO0QfBEzxvuCaWoHtxPinMERni7wOJEZEl/raHcNWlKH/uksWlkxVHve1NzXvWua5fwqc8t9Gy7CoV699m3CkPD24p6h0iohEmGoDF73dtmX7rMIbznDJLoHFvyR/VurauvBa22zu8007dzym36TTY4wc1WvdvbaxwTCPxr9s/l11kLz2197MqXSQkIkvt9fjQwrnhhd2mspdFyv3V1AbPg8iX0ar7A1DCgm6whMTPaZib7dwf0e5N7zdsn1lwHph7sux5aDdc5XsCbkNLqQDpSkrEjg6ubYHM9BHrcy+cj0++EDatImBd+W1sYaiwOtHrihccoQ=; 25:zpHyewJKnxD91rUxgBDrxJVtigKS2u3c6LBV7zFC3vvp0ZUh10tCSZgVoPBRzmPLN9hkhK5Ms+k4Y6tsf2PWDDjPcN72l001GchbAD34BS2/P9fzqbqWTo8kAQQ4fxSQRs051iDLmgKY9vTo2qx6CMF44geE/urdeICWGJI5iQTagYG0aMqT9QkTyqiBULJU4w+GE4uXR4Get8Q8yn05g8V3zgbZZsCsotXAj9b8DHZnxG7vfZFSc2NlIxwR6cFBAymblJP62fkG+oMNHgAWqM1KoOxwKcP/6vS2oS0nGZXoD0QEESpxU6eOjdwCUUd8+QhEbSzpdQnYRikIsjYTHQ== X-MS-TrafficTypeDiagnostic: BY2PR0501MB2069: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0501MB2069; 31:G1MgQ+yUt3cA16fTp4xVE/wy6feLKfKkVzxBsrD9PLZ5OLpS6Idm3dizizW3zja5/2/PEkFPcloba/ekMZaeGH1q0PBTHAJgbZJfE80wpQ9s/wtNKjKIyb4BI/2VWfLsI0MlLevzyWwR446vGtO0L+xzlId9MBxA42L5H7Ex8LtD2X1K+YDU2vb4BnVh3OFAzmFgLbJZF/SZchouArh+B5zUSJv0UwGGAb2DpYZTCI4=; 20:YrQ4l8WikZORuCaX8eqZ7o7VTCW3uO1PgKjdnJt5RlndG7Q4C+J3c+Blbl2/z84hM1Rn7YSsP2FtzU9Xx79slcHYpIvRrlLDqm4hHYBIWZCfypRcc1EuFg6RO9rXXe/SQDC22Dw2S8UCH24yUNVOuAp2SKdH84ngV3QqtNWqgb6Vnne3Dplwm3Edx5/3D9jmsvg7Fbu05Q1Le8iIN6+r6Cgwvq6eAvnZcAhy+GKhleuB3wuz67vzHvmW5GIMwen7TtYyWFiBGD7z7DeCO6tCVHJrcJb/ex7figlxcMonas4QW3VjrOubAjbqhxYSeAgiwEkAjNIjSJ3croWN2mNjOo1i4ifrFutAfg02CDqhPcXFCtSAKQo3ZzRR82jgYp2N90Nqk1dRuS8kezT4Gw29rCSUeeUpdYoPGtQc6hUp6F6qMBLB1IRmMNHBGfEUqyzuN+iPmH/6S8pdiYBzJ1ax8AZOZ38zOaT2I/NZeAEgYx8oK4O6HzA/TFHNKtajxrEg X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231021)(100000703101)(100105400095)(93006095)(93003095)(6055026)(2017110403001)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR0501MB2069; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR0501MB2069; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0501MB2069; 4:aYVjIRIUvQd31/FFkrGDVcn2uycQtUPUrXQ4rxOGH/ZNbsT9ywuv8urjCRik5AhDkVfna9DrIcOz75B99A0kFnif92nLtvRkuFcxQ2Hvm6S/87JTSYaGvAM+qr8JWnbmNvduAE+aLduF1CT2srxlcfhzB/SPO1eh4DkcCSMruOd/JxYWlYQ2g2I+j+N7RCaBJSENmnyGKw3B35OYFum8oMnd402vZx2S6uA0ShT++T2Wyv7A7zSoeQcbgRg5T6irZ+lX1EUL8SUh3Zp24iaDlw== X-Forefront-PRVS: 04825EA361 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0501MB2069; 23:79MYDwfRcI+6VJmT30uKEPChNFSAb64NjLXS/s3?= =?us-ascii?Q?oz4MKumoJ7vltfXKYUk3OO9bShTDx2Xq5cCIvdsZiId1pMwxqzEecKGq0bU8?= =?us-ascii?Q?JjUk9zhgnkWpvJofEefYVpQBpnPTJgCriMVvbV0pMdS8gT4GpbX5OKTpvv86?= =?us-ascii?Q?B1CUenRn9NeKwMylTR6UhulAKHtfDHCEmouJdOvwwRVHEH+LMiNPSvt4+nH0?= =?us-ascii?Q?1i+2MBf6ZtMF5Nj4HOGk6hFZTDldST+hJkHAywG5B2P/F3QUyym2q4aTFl3m?= =?us-ascii?Q?MxfxWWfWtHo+ueYdo6DFUhHx2NYxoFcPMIZdfuHXYNkyybUi/RgqX9WoUMYq?= =?us-ascii?Q?3I3XjKtEQhQ6kx1J66YArRnPjEtMyHy8+mkUG/A04fNHxbileqDVrSaTJOqR?= =?us-ascii?Q?NMdmka/lfzWqyv7uj88X16O83JWPZC/QRodlLHtdNYvzuqd4bNrxbA8XMGvO?= =?us-ascii?Q?CFHs+Phqs4ttNzAUa9+DrZ2SA0Krt+/FsA2/7lF1mfsuFrBh3FSmXN4jToWm?= =?us-ascii?Q?dtRP0SA9fhGGubwCnFCCTBIlv7sNHhm+/8BfxFHTQidLYVdwXTlP9CJnINle?= =?us-ascii?Q?dptsJCh2AHbSKfYh00y3EdGAN/YzpC39d28ZADN6paOWZA9jVfaVRVipvyGW?= =?us-ascii?Q?ZPp621RK2SqnWPdgQwAwHd37JjFVY+GypK7yfE0Iav3r2513GTpQnVf+Ul9t?= =?us-ascii?Q?TGtH9mekCsQLLqCGOwwv2QrZvfDlCVuhtR6MQDviEhFLk6vJXLWexQgIkPTy?= =?us-ascii?Q?L58H1+lVnLCrL4iY/N56IeeVaoP+Ir3pnp2bsLVWZK4VVQ26Fk2F6V/gPVJg?= =?us-ascii?Q?hu5X81Ggzepe/YkCkP1FY2wKLTuqnAhZmxFLYp8sg0kzQD9TKM3tm13meWEO?= =?us-ascii?Q?YhfF5J3fPoF/j9tTKcNvTqOwMZ4iRy+a4aDJqYTbarFL3X0rMAMNalwy3jf4?= =?us-ascii?Q?jljjC7cbo6oUaynaiXpAQ1AvDnddX8aoAgEJbZOvDlYSiexAMRFWBvJv2t6j?= =?us-ascii?Q?cRtJC/ca+TiSv8cGLLXlTmB+sZWba1q+UTkxhAcerqVpYXvAhGeQkEq7xR3H?= =?us-ascii?Q?ahrN463/+vEFcpq7ResSk6/EAmIqlIeTiK0IiNSK9FlGwhq3vVclL/Ln44P1?= =?us-ascii?Q?LiKEtGujiSwrZY668x+CMzN9XuebZ0EdYc0w5LuXLJVuJRJUfvavQJKADnAY?= =?us-ascii?Q?V28GLe6+YLujS60OymJSjg9bhHl+b1YmKkTW+4OH/PzdcFC0a5hBlxvEHTFF?= =?us-ascii?Q?zXyHduhAadbKAPN0biz9/W3F+xIqhK5bDvNQeP1YpCoaP8PCiYsc3hGVpH+N?= =?us-ascii?Q?nu/jcmMfdKF40KcsCox2jIs8=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0501MB2069; 6:OXlugyFmXyf414Ylo+5OMp8heQGBQQKa1kR7dNh8gp9w5rNSBE2/J3xjUJtJ+d11oggurh0TmOpOl+j7BVR/cRop9Qa4AKa6dYyG8BAHigp9JaGELMIS7ZUDyIJfxD8OI9SReynIOsFqG4uNm7rWVDRsOt/sThKLNlKIifU2b2hkRigE8n6jGOMmTeNq9BbSf+PA7jCskvDg07Ynuoa7dNRrUO86O5LEReGWGT+PwWzX3t4L6d20BVmrb1WvP9Z+TD35bTOK4xihKQ7YEA4mHZWRQjdac8j07Ew7jIJcP0SwazkTuhwRto8MKxhRTUnFvKyjXtKwA8vKKRT3PY9mKTngcIXUp/iE59BrY0yi0XU=; 5:GtJCCQwePeapOU6FdgUgGxm23ntq5p7sovlpD9VHfZPNbDbeEAXu+tkyxB7QQcIq/F8aGJdVI+iP9UX4V47QfmwSO9bv4k4UzY3V6rqUHtuI+Q/za3I/8fxPJu0PL1GL4F/Rml+WziDBpp75zY4EXZNY01iWX3QqhDcIYuSoqso=; 24:mqCZlv54HYHnyx1HjLHSUFy6TJ0M3ceaG/GUxpIgnGICByRvnZRhMW2/5xH7XW+8GAfecxa04nRTH0rTBXM7XMF8Vfo8I3Qm+MSGPM+7SJY=; 7:ADmAla4fNVMPXHHMGgZ4yzTiyOjAayacxzM7XCoXYDBZxuoVjLLyBvFswUc46fuz1Yfq2IDn6IhzE32tce4qeiI2NgZyLdYCkWgEVuimZm31mXIGJDrnoone1+w6SEgWiKZkSyUw9zzOdhy8Q52nhf4aXN/hrfqgF+k5pR2yQDXjgIl+Bo/6lR7sVWKiA1RsEAdOU885YRfteTz8E7SKcxNauKK2D6dU7s9ZVz7e9yQp4cktYj72RWGHO1JfnpHZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2017 16:26:39.1191 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04224f04-664d-4133-26c5-08d52469fde0 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12]; Helo=[p-emfe01a-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0501MB2069 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 16:26:48 -0000 Bryan Drewery wrote: > > ${.OBJDIR} =3D=3D /${RELDIR})) make[6]: Fatal errors encountered -- ca= nnot continue make[6]: > > stopped > > in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualbo= x-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vboxdrv > > *** Error code 1 > = > Weird, can you try this please? http://dpaste.com/3HR1EQH.txt > = That will work, but you could remove the check for SRCTOP since it isn't used in the conditional. FWIW this is happening because make is being run from within OBJTOP during kernel module build, and thus the logic in src.sys.env.mk isn't defining RELDIR. If OBJTOP were defined (it is in my case) the following which is similar to what we have in our internal trees would fix it. In the FreeBSD tree though OBJTOP may not defined until some time later. And if you want to .export it you need to use .export-env and play games to get it into a form that will work as TARGET_SPEC_VARS change values. Index: share/mk/src.sys.env.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- share/mk/src.sys.env.mk (revision 325436) +++ share/mk/src.sys.env.mk (working copy) @@ -10,6 +10,8 @@ RELTOP=3D . .elif ${.CURDIR:M${SRCTOP}/*} RELDIR:=3D ${.CURDIR:S,${SRCTOP}/,,} +.elif ${.CURDIR:M${OBJTOP}/*} +RELDIR:=3D ${.CURDIR:S,${OBJTOP}/,,} .endif RELTOP?=3D ${RELDIR:C,[^/]+,..,g} RELOBJTOP?=3D ${RELTOP} From owner-svn-src-all@freebsd.org Sun Nov 5 16:28:06 2017 Return-Path: Delivered-To: svn-src-all@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 3FBC1E37604; Sun, 5 Nov 2017 16:28:06 +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 0D4431099; Sun, 5 Nov 2017 16:28:05 +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 vA5GS5Nv053592; Sun, 5 Nov 2017 16:28:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5GS5Eo053591; Sun, 5 Nov 2017 16:28:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711051628.vA5GS5Eo053591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 16:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325437 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 16:28:06 -0000 Author: bdrewery Date: Sun Nov 5 16:28:05 2017 New Revision: 325437 URL: https://svnweb.freebsd.org/changeset/base/325437 Log: Follow-up r325405: Fix assertion still for kernel module builds. Apparently they have SRCTOP set, but won't have RELDIR set since they are not in-tree. Pointyhat to: bdrewery Reported by: O. Hartmann , dhw Tested by: dhw Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Sun Nov 5 14:41:48 2017 (r325436) +++ head/share/mk/bsd.obj.mk Sun Nov 5 16:28:05 2017 (r325437) @@ -85,7 +85,7 @@ OBJTOP?= ${MAKEOBJDIR} CANONICALOBJDIR:=/usr/obj${.CURDIR} .endif -.if defined(SRCTOP) && \ +.if defined(SRCTOP) && defined(RELDIR) && \ (${CANONICALOBJDIR} == /${RELDIR} || ${.OBJDIR} == /${RELDIR}) .error .OBJDIR incorrectly set to /${RELDIR} .endif From owner-svn-src-all@freebsd.org Sun Nov 5 16:29:20 2017 Return-Path: Delivered-To: svn-src-all@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 94860E3769E; Sun, 5 Nov 2017 16:29:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E7771206; Sun, 5 Nov 2017 16:29:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 76D5D6FB; Sun, 5 Nov 2017 16:29:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 930C25158; Sun, 5 Nov 2017 16:29:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id U93QG2Cygzft; Sun, 5 Nov 2017 16:29:13 +0000 (UTC) Subject: Re: svn commit: r325404 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 735EC5153 From: Bryan Drewery To: "O. Hartmann" Cc: "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Cy Schubert References: <201711042102.vA4L2RuR063978@repo.freebsd.org> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Sun, 5 Nov 2017 08:29:16 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EohwIQF03JfaPo245pW1U3EkWU5JgQ9dH" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 16:29:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EohwIQF03JfaPo245pW1U3EkWU5JgQ9dH Content-Type: multipart/mixed; boundary="saSNhhWvCoJ388o7KsEGpx1gHawX5Vc5k"; protected-headers="v1" From: Bryan Drewery To: "O. Hartmann" Cc: "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Cy Schubert Message-ID: Subject: Re: svn commit: r325404 - head/share/mk References: <201711042102.vA4L2RuR063978@repo.freebsd.org> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> In-Reply-To: <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> --saSNhhWvCoJ388o7KsEGpx1gHawX5Vc5k Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/5/2017 8:00 AM, Bryan Drewery wrote: > On 11/5/2017 2:16 AM, O. Hartmann wrote: >> Am Sat, 4 Nov 2017 22:31:33 +0100 >> "O. Hartmann" schrieb: >> >>> Am Sat, 4 Nov 2017 21:02:27 +0000 (UTC) >>> "Simon J. Gerraty" schrieb: >>> >>>> Author: sjg >>>> Date: Sat Nov 4 21:02:26 2017 >>>> New Revision: 325404 >>>> URL: https://svnweb.freebsd.org/changeset/base/325404 >>>> >>>> Log: >>>> Ensure .OBJDIR has known value >>>> =20 >>>> If for any reason we cannot set .OBJDIR=3D=3D_objdir as desired >>>> use .CURDIR so that at least the classic >>>> .if ${.OBJDIR} !=3D ${.CURDIR} >>>> works and dangerous misstakes can be avoided. >>>> =20 >>>> Reviewed by: bdrewery >>>> >>>> Modified: >>>> head/share/mk/auto.obj.mk >>>> >>>> Modified: head/share/mk/auto.obj.mk >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- head/share/mk/auto.obj.mk Sat Nov 4 16:23:34 2017 (r325403) >>>> +++ head/share/mk/auto.obj.mk Sat Nov 4 21:02:26 2017 (r325404) >>>> @@ -61,11 +61,17 @@ __objdir_made !=3D echo ${__objdir}/; umask ${OB= JDIR_UMA >>>> .endif >>>> # This causes make to use the specified directory as .OBJDIR >>>> .OBJDIR: ${__objdir} >>>> -.if ${.OBJDIR:tA} !=3D ${__objdir:tA} && ${__objdir_made:Uno:M${__o= bjdir}/*} !=3D "" >>>> +.if ${.OBJDIR:tA} !=3D ${__objdir:tA} >>>> +# we did not get what we want - do we care? >>>> +.if ${__objdir_made:Uno:M${__objdir}/*} !=3D "" >>>> # watch out for __objdir being relative path >>>> .if !(${__objdir:M/*} =3D=3D "" && ${.OBJDIR:tA} =3D=3D ${${.CURDIR= }/${__objdir}:L:tA}) >>>> .error could not use ${__objdir}: .OBJDIR=3D${.OBJDIR} >>>> .endif >>>> +.endif >>>> +# apparently we can live with it >>>> +# make sure we know what we have >>>> +.OBJDIR: ${.CURDIR} >>>> .endif >>>> .endif >>>> .endif >>>> _______________________________________________ >>>> svn-src-head@freebsd.org mailing list >>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.o= rg" =20 >>> >>> With the recent patches, nvidia driver x11/nvidia-driver fails tobuil= d with the error >>> shown below: >>> >>> [...] >>> =3D=3D=3D> src/nvidia (all) =20 >>> make[7]: "/usr/src/share/mk/bsd.obj.mk" line 87: Malformed conditiona= l >>> (${CANONICALOBJDIR} =3D=3D /${RELDIR} || ${.OBJDIR} =3D=3D /${RELDIR}= ) make[7]: Fatal errors >>> encountered -- cannot continue >>> [...] >> >> Not really solved for me: >> >> [...] >> =3D=3D=3D> src (all) >> =3D=3D=3D> src/nvidia (all) >> make[7]: "/usr/src/share/mk/bsd.obj.mk" line 89: Malformed conditional= (defined(SRCTOP) >> && (${CANONICALOBJDIR} =3D=3D /${RELDIR} || ${.OBJDIR} =3D=3D /${RELD= IR})) make[7]: Fatal errors >> encountered -- cannot continue >> [...] >> >> >> Is there something I miss here? >> >> Same for emulators/emulators/virtualbox-ose-kmod >> >> [...] >> kBuild: >> Installing /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/v= irtualbox-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/sr= c/vboxdrv/Makefile >> =3D=3D=3D Building 'vboxdrv' module =3D=3D=3D make[6]: "/usr/src/share= /mk/bsd.obj.mk" line 89: >> Malformed conditional (defined(SRCTOP) && (${CANONICALOBJDIR} =3D=3D = /${RELDIR} || >> ${.OBJDIR} =3D=3D /${RELDIR})) make[6]: Fatal errors encountered -- ca= nnot continue make[6]: >> stopped >> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualbo= x-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vboxdr= v >> *** Error code 1 >> >> Stop. >> make[5]: stopped >> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualbo= x-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src >> =3D=3D=3D> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAF= E=3Dyes and rebuild before >> reporting the failure to the maintainer. >> *** Error code 1 >> [...] >> >> >> By the way: both kernel modules are build with=20 >> >> [...] >> PORTS_MODULES+=3D x11/nvidia-driver >> PORTS_MODULES+=3D emulators/virtualbox-ose-kmod >> [...] >> >> in /etc/src.conf >> >> >> Do I miss something or is this a bug? >> >=20 > Weird, can you try this please? http://dpaste.com/3HR1EQH.txt >=20 >> dhw@ tested, ommitted in r325437. --=20 Regards, Bryan Drewery --saSNhhWvCoJ388o7KsEGpx1gHawX5Vc5k-- --EohwIQF03JfaPo245pW1U3EkWU5JgQ9dH 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 iQEcBAEBAgAGBQJZ/zxdAAoJEDXXcbtuRpfPL+0H/3Hfuv1V3yXcl2qY45hQXdOU ltas3+xpVqezOm40JAApszVwyxImIvSnUWH99ioQMPROpH5C4cdHGN6SMCYvNMoW uXZlj7VZovyun208dLaBWpR6SUzwJnaLjG/Dut+Oe/hA6w200NBGJ97p9VId7o5t plXeEgsDlhIhVI35R+uZLvdQ50WTVHGGBtloLZ2QPEaJE6z8+NhTp84gov+uRgs6 ZxWIDhtR1G8hXDkZHF7GWIzIoxQFZ/0ijMz+EOOl3jlYZUuOrgNZdnbWuz9kQ7kA Nm+REYXBPOFbm3/r0RHBN7QsPaX/lHSXZOP/OtQxSKM2yjAnR/FfNIEQVJeJZFU= =EDI+ -----END PGP SIGNATURE----- --EohwIQF03JfaPo245pW1U3EkWU5JgQ9dH-- From owner-svn-src-all@freebsd.org Sun Nov 5 16:30:23 2017 Return-Path: Delivered-To: svn-src-all@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 082A1E37745; Sun, 5 Nov 2017 16:30:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C56A9136E; Sun, 5 Nov 2017 16:30:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 00D4F827; Sun, 5 Nov 2017 16:30:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 16F6E5164; Sun, 5 Nov 2017 16:30:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id qS2Gg_x5ZYRv; Sun, 5 Nov 2017 16:30:17 +0000 (UTC) Subject: Re: svn commit: r325404 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 78139515F To: "Simon J. Gerraty" Cc: "O. Hartmann" , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Cy Schubert References: <201711042102.vA4L2RuR063978@repo.freebsd.org> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> <13707.1509899195@kaos.jnpr.net> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <0b1ad34d-bc2f-c0fb-5ed3-68d07f4a7aac@FreeBSD.org> Date: Sun, 5 Nov 2017 08:30:20 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <13707.1509899195@kaos.jnpr.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QNokupXj5FohTNa4AmPgigvakF7NgGPWX" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 16:30:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QNokupXj5FohTNa4AmPgigvakF7NgGPWX Content-Type: multipart/mixed; boundary="T9L9mboiQXoHsEmc0EVPFO9rBvo7FhW9h"; protected-headers="v1" From: Bryan Drewery To: "Simon J. Gerraty" Cc: "O. Hartmann" , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Cy Schubert Message-ID: <0b1ad34d-bc2f-c0fb-5ed3-68d07f4a7aac@FreeBSD.org> Subject: Re: svn commit: r325404 - head/share/mk References: <201711042102.vA4L2RuR063978@repo.freebsd.org> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> <13707.1509899195@kaos.jnpr.net> In-Reply-To: <13707.1509899195@kaos.jnpr.net> --T9L9mboiQXoHsEmc0EVPFO9rBvo7FhW9h Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/5/2017 8:26 AM, Simon J. Gerraty wrote: > Bryan Drewery wrote: >>> ${.OBJDIR} =3D=3D /${RELDIR})) make[6]: Fatal errors encountered -- c= annot continue make[6]: >>> stopped >>> in /usr/obj/usr/src/amd64.amd64/sys/THOR/usr/ports/emulators/virtualb= ox-ose-kmod/work/VirtualBox-5.2.0/out/freebsd.amd64/release/bin/src/vboxd= rv >>> *** Error code 1 >> >> Weird, can you try this please? http://dpaste.com/3HR1EQH.txt >> >=20 > That will work, but you could remove the check for SRCTOP since it isn'= t > used in the conditional. >=20 > FWIW this is happening because make is being run from within OBJTOP > during kernel module build, and thus the logic in src.sys.env.mk > isn't defining RELDIR. >=20 > If OBJTOP were defined (it is in my case) the following > which is similar to what we have in our internal trees > would fix it. >=20 > In the FreeBSD tree though OBJTOP may not defined until some time later= =2E > And if you want to .export it you need to use .export-env and play game= s > to get it into a form that will work as TARGET_SPEC_VARS change values.= >=20 > Index: share/mk/src.sys.env.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- share/mk/src.sys.env.mk (revision 325436) > +++ share/mk/src.sys.env.mk (working copy) > @@ -10,6 +10,8 @@ > RELTOP=3D . > .elif ${.CURDIR:M${SRCTOP}/*} > RELDIR:=3D ${.CURDIR:S,${SRCTOP}/,,} > +.elif ${.CURDIR:M${OBJTOP}/*} > +RELDIR:=3D ${.CURDIR:S,${OBJTOP}/,,} > .endif > RELTOP?=3D ${RELDIR:C,[^/]+,..,g} > RELOBJTOP?=3D ${RELTOP} >=20 I only find RELDIR useful in the non-kernel builds, so I don't really care to extend it here. --=20 Regards, Bryan Drewery --T9L9mboiQXoHsEmc0EVPFO9rBvo7FhW9h-- --QNokupXj5FohTNa4AmPgigvakF7NgGPWX 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 iQEcBAEBAgAGBQJZ/zydAAoJEDXXcbtuRpfPQn4IANSOUvYWoR/Ek+AGO2LTZWZ2 rZx7lDCDezHMUEeHVVIaHpCHVx0FNrfVi7TnsScyO8ps/jb8pzk+jFW0JXabAeAg 8s4bafwTJnimzNIXcBQzmOcPae+lXeFoDXRi/6SN+zsfWGrnTsMp/NCx8feursVO V8IRCdieigk7mMbZN4O7EO/lnrn0iNJuhWpI0XsdlMwF26+FYkI1FwfijFj9PUjA IPWMcsU6C6tDf0+BoVPxMUWymHCam39P+vgKtPnX0c9oZQNQ+ng/4xXVZMj8//Ce Ztp0yqOLxDFFfvx6tenMJOF9t3gwbsgu0Z9b626TWcjeuRqUIeRo6EunXEFWV40= =zLf9 -----END PGP SIGNATURE----- --QNokupXj5FohTNa4AmPgigvakF7NgGPWX-- From owner-svn-src-all@freebsd.org Sun Nov 5 16:52:55 2017 Return-Path: Delivered-To: svn-src-all@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 E0E9AE4B018; Sun, 5 Nov 2017 16:52:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A5F5121DB; Sun, 5 Nov 2017 16:52:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5GqsFR066325; Sun, 5 Nov 2017 16:52:54 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5GqswC066323; Sun, 5 Nov 2017 16:52:54 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201711051652.vA5GqswC066323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 5 Nov 2017 16:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325438 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 325438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 16:52:56 -0000 Author: mmel Date: Sun Nov 5 16:52:54 2017 New Revision: 325438 URL: https://svnweb.freebsd.org/changeset/base/325438 Log: All CP15 registers are bit fields or counters, don't use signed type when accessing them. MFC after: 3 weeks Modified: head/sys/arm/include/cpu-v4.h head/sys/arm/include/cpu-v6.h Modified: head/sys/arm/include/cpu-v4.h ============================================================================== --- head/sys/arm/include/cpu-v4.h Sun Nov 5 16:28:05 2017 (r325437) +++ head/sys/arm/include/cpu-v4.h Sun Nov 5 16:52:54 2017 (r325438) @@ -51,10 +51,10 @@ #define _FX(s...) #s #define _RF0(fname, aname...) \ -static __inline register_t \ +static __inline uint32_t \ fname(void) \ { \ - register_t reg; \ + uint32_t reg; \ __asm __volatile("mrc\t" _FX(aname): "=r" (reg)); \ return(reg); \ } @@ -77,7 +77,7 @@ fname(void) \ #define _WF1(fname, aname...) \ static __inline void \ -fname(register_t reg) \ +fname(uint32_t reg) \ { \ __asm __volatile("mcr\t" _FX(aname):: "r" (reg)); \ } Modified: head/sys/arm/include/cpu-v6.h ============================================================================== --- head/sys/arm/include/cpu-v6.h Sun Nov 5 16:28:05 2017 (r325437) +++ head/sys/arm/include/cpu-v6.h Sun Nov 5 16:52:54 2017 (r325438) @@ -103,10 +103,10 @@ extern int pmu_attched; #define _FX(s...) #s #define _RF0(fname, aname...) \ -static __inline register_t \ +static __inline uint32_t \ fname(void) \ { \ - register_t reg; \ + uint32_t reg; \ __asm __volatile("mrc\t" _FX(aname): "=r" (reg)); \ return(reg); \ } @@ -129,7 +129,7 @@ fname(void) \ #define _WF1(fname, aname...) \ static __inline void \ -fname(register_t reg) \ +fname(uint32_t reg) \ { \ __asm __volatile("mcr\t" _FX(aname):: "r" (reg)); \ } From owner-svn-src-all@freebsd.org Sun Nov 5 16:55:27 2017 Return-Path: Delivered-To: svn-src-all@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 413C4E4B140; Sun, 5 Nov 2017 16:55:27 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0132.outbound.protection.outlook.com [104.47.34.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBB6924AE; Sun, 5 Nov 2017 16:55:26 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=blYWYV2atsgqUbnc2w6C1/UI1STzt3lVTp9uu7dDnJ4=; b=j5B5PiXzu3Fij8cFY2k+ZLmEHS/R1Vk94sa7zsr7aTv4jZvRwl7y8eE9284PFz9dhCP0qpvId71xinkcSA1GsK2bwlGTfqm7I7VMUS4rOCbzUbXez5gT12SQt7/4qDSWGUa2GDSC7pcxl3tP7okmKE5pKi6UjE89tx/FOwawhLM= Received: from BN3PR05CA0003.namprd05.prod.outlook.com (10.174.64.13) by CY4PR05MB3605.namprd05.prod.outlook.com (10.171.244.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.6; Sun, 5 Nov 2017 16:55:25 +0000 Received: from CO1NAM05FT021.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::209) by BN3PR05CA0003.outlook.office365.com (2603:10b6:400::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.218.6 via Frontend Transport; Sun, 5 Nov 2017 16:55:24 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.12) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=fail action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.12 as permitted sender) Received: from p-emfe01a-sac.jnpr.net (66.129.239.12) by CO1NAM05FT021.mail.protection.outlook.com (10.152.96.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.197.9 via Frontend Transport; Sun, 5 Nov 2017 16:55:24 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by p-emfe01a-sac.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Sun, 5 Nov 2017 08:55:16 -0800 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id vA5GtFSM020476; Sun, 5 Nov 2017 08:55:15 -0800 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 12039385567; Sun, 5 Nov 2017 08:55:16 -0800 (PST) To: Bryan Drewery CC: "O. Hartmann" , , , , Cy Schubert , Subject: Re: svn commit: r325404 - head/share/mk In-Reply-To: <0b1ad34d-bc2f-c0fb-5ed3-68d07f4a7aac@FreeBSD.org> References: <201711042102.vA4L2RuR063978@repo.freebsd.org> <20171104223133.00f5bf30@thor.intern.walstatt.dynvpn.de> <20171105111644.4c294342@thor.intern.walstatt.dynvpn.de> <7d0c021d-fe3d-9bea-b088-5e530176288b@FreeBSD.org> <13707.1509899195@kaos.jnpr.net> <0b1ad34d-bc2f-c0fb-5ed3-68d07f4a7aac@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Sun, 05 Nov 2017 08:30:20 -0800." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14203.1509900916.1@kaos.jnpr.net> Date: Sun, 5 Nov 2017 08:55:16 -0800 Message-ID: <14204.1509900916@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.12; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(346002)(376002)(39860400002)(2980300002)(199003)(24454002)(189002)(8676002)(86362001)(81156014)(7696004)(4326008)(5660300001)(68736007)(53936002)(6266002)(97736004)(6246003)(7126002)(2906002)(93886005)(50226002)(77096006)(9686003)(55016002)(2950100002)(229853002)(50466002)(81166006)(76506005)(478600001)(16586007)(2810700001)(97876018)(69596002)(97756001)(46406003)(189998001)(53416004)(316002)(54906003)(6916009)(47776003)(76176999)(558084003)(50986999)(356003)(8936002)(105596002)(107886003)(117636001)(23726003)(106466001)(305945005)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR05MB3605; H:p-emfe01a-sac.jnpr.net; FPR:; SPF:SoftFail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM05FT021; 1:Dhsamp3ATXnB6v2sMp57FHFGdWoWSdARfY1AsITaTCfgqfvqBFQyUEo4+rE6/mEu7qx2CQP0k+1Gw+HKhD1RWx8D47ry8CLpZBUtrqfa0yql/3Bq7nJ01Q2UiCT51GOW X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b408b66b-3597-4650-07ab-08d5246e0258 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:CY4PR05MB3605; X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3605; 3:Hf2dcWPvJ4S7XoqzgdqvrpISlz8z1aJVrx5abHFclzrP2kBrJfheYuxq51ktrsUGYeT1F4PvOmtafJC2b4NDDL6qk1ILp9zB8W7Xc/obEIETj1iY9jWqedk55la8CG9gxvrnb5cS4T3O6HJ1kd5z0rIw6laYIvrE8CGi5IjaSioIn3hZclWqOiCsmj+t7thwUcgzPmyh5IZ4mJy7YjjQrVJEGHpdSJg7kLyzAj5Qgs/weUZ+DAL+DphdR+9lOcuB4N2uSAJwMQgsvgoGFnAaefvs8rJjy4LPs7MMi7X1waslWE45vuJp7WXKoRSqWxfJQW5IfBpvWrsUhjc1mKdIxfHywWKBsHkMa86flp/1ONA=; 25:94fkAgywHDPVgeCRdzYsZ9OQno5DEWx03CqwQTd6SA5RUGAqDBeUavCaXp482SzwdFdT0g+2bT+D/GpObtSCnaTEPD10woGjy+bJdVgu8PLgtEyLCMshVAopclEIx6uZy5yE9YAbBnea1OEyJtFPaY1GQ9PAuALrKZv7UKSYobJ3p5thZEjLIltjZ7dtbaowV1J8AIv0Yqrvsxe0koJo6b7AghE/nZMa8OtgH4Su56x6g6/CxFlAMEBtPBioowlA0vQM1V02LviCoR30RgCPhGsKCBaD2w4l1FFCQsYdJlbJi2LJYYTz7+Mj0LdUjW2QVacAShEwznY4DuhE6ul+dw== X-MS-TrafficTypeDiagnostic: CY4PR05MB3605: X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3605; 31:b2kIJIksyew4pLuO1ob3Hst9KAvSqIOEBQrvOWmKq5drhw2Km/7e8NZP2rVMKMjIJ2m0+UwQD278Yh0l6fgHDSgA4y7ClFuiXZ4hJNMaA07U2mUjV6Gz61N5NU30uK+UZ8hEVbNxyBjskyIA1bdIVPVol3yVdJTkpEysLpNgdMhLZnAKNuhi7HYkMgi/xbddAnkHR4tW2QP63Mrm6HpfbepbYHoqDG5Vc8EKkoELolQ=; 20:HG+NR+O17lKUjG/fwgdsK7EuLi06qGclAvmBe40opR2xWEG2Wo753VoRMRhKl3PzTQA6fkp7cQshol6RSAztP8FNyUERsFE8uF5WtFFsKiy4mvrkqW4tOX2547++47pFdCokJ7hs4fPElbXSLJFxpL5WTL6Ko8jUMdvuWks52V/f09ACGSBm4fb95bi10aGEU/MlsW47SNQ5+vMAtvuuzhymjg8axETToXvr5ENysxz/+UTA1AIoH0iE232lN0egT21ichJiHPL6pFK8u+fykTjC1EpkSng/rLtsHEps3FIaA9HzZrR7O3XjSGtk8hfMpR53d6Sg0fhaLuc0/fx6amv5JtrtUrGPWsjJ9deAvchyz6AF67eZgnvighcQk7Dl/T3kCUYfM08mPFAXa+DJR9vgefR74wW77ASJYOvTDK83TBRhWyNjlCZU30kW84lhnaCt0Bmiw4RCiYVrTSl2Lvb4u8wcMC6h4Ge05QuuRqZJNnT5vcu//vQrRACUZvaJ X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93003095)(10201501046)(3231021)(100000703101)(100105400095)(3002001)(6055026)(2017110403001)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR05MB3605; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR05MB3605; X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3605; 4:nruS9OafxV4Vf3r0huUkUDE02eS7+8JxaRHqZFTae59+7LFvjmNLI9J25kKIzoBNWMCX/JH93m8EZsq+b+FQAOLB+2C9k+SNgpexAZ2tev7g4YIL0yJmhpjpyzRKpK2/sY2SiSoNxjTC+uJZCuy5t7oK74OBzPl4tiYEAZCaEUs8cTuCj+J79i2M7+HAv9V+koLp8bGA1mWHDCMFsDbTS6SyG9UmVgf+cm+pUtZFzPcbYniu5BCb0vpx67ytm9DZo+X1NA1wjXUdbovqOQpxWg== X-Forefront-PRVS: 04825EA361 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR05MB3605; 23:EQmt9CyylF+GT/xkS5VPvSTsPDZr87Ik5yIuzUOkC?= =?us-ascii?Q?IbG3DU9NVzJ30pgai9AVfvEiENizfDpg8FDakwPZKY4ywd4RAfon7M0PWMCp?= =?us-ascii?Q?XW1KAHS+jZDfqEVazJilV8+5XVmWNBPrR22iNpBDnUf5lCQbYaA9Up9Usppd?= =?us-ascii?Q?CJha5VSfe/puT1AX2ajHi4vscbAnVJ5+JJydr8PqVoAJLxqDpUtvgyVRmo+X?= =?us-ascii?Q?wRKSgsBlKS+iuOMICQmdD4A/lVWrLPJ38A/8iihmjdbqbRfL22oYwKYnUcaN?= =?us-ascii?Q?jbEOdIgPz5k5PNh5qoO3NyvcorxU5c0sjyo1i2/CL9yiR/ttzn9TN3aLJYdf?= =?us-ascii?Q?pofciso/GS8q+tEjlGX7eiIRR1cQT3yMYuHRdjriMLRjxOhnMYS+8W/NL+cS?= =?us-ascii?Q?pqeCvyKHkPfyG/cH1dmC2M4bEgzYbIVZzWr/mI9eAMK3mrkPo+XXxVfbc9q/?= =?us-ascii?Q?EwnkPKymioeVN2mdNwJvfzrKcT0mdhB9jxF+ZkCgjN6jRR1FPJnZ512IpYRO?= =?us-ascii?Q?zYWTv1yHwvXzGjVuBKCHPkDbTyMTm6J0fcK7jc4sFpxt8FZ0OiWGoo6UyONJ?= =?us-ascii?Q?lHkCMFiwdAytlSOORpK/zOHj/U8lnWwwyWhQCDTrJ+rvV5bQtmC6nvnexQUm?= =?us-ascii?Q?wEzCa4ZINKsqCphwqWFPgjrAnRdq7Rd4XSvv+xStd/O8NUmn4CTZoaSVIHIw?= =?us-ascii?Q?P2UJOnYPFISoUjWWiAGTco7ejfxeNQhb01y3phqSPCN736hFv9Pkt4Y9xtve?= =?us-ascii?Q?a3wRy8ErBenXaCS96G7dpsL+pDYxRKgcZFxlQ8wIRQTRd0gCD00sHnIKcRgT?= =?us-ascii?Q?sXKZgAFaWiheqovWQEJLgc/zd40F7GgvOHbY6v6reXe/BDfvWi5hbpGMA/s6?= =?us-ascii?Q?bINjdbqlIuN1g2Nb7VNU6T6KAzpssRPPhZR8x+Efv7mdcyDYWFo/G/xzxarM?= =?us-ascii?Q?DNqtioVDGvvP4qn5MESD7Sph5R2xicFoFY5qpCLLJoejiE3yzAvoVVSUdIBl?= =?us-ascii?Q?ITXKOe8KRFZIb/wpjXyQJO/s8yRSfyt5L7eyRfYh0cAHUjWKXnbonGmBiO5N?= =?us-ascii?Q?vkzhtoZl1YekC+WMsVKqLGxXwTvvYmbJH4lnKX5Ycs8bLA7+T2F+GM5jjwKW?= =?us-ascii?Q?4gsIMkPxis0viumtIQ2jdjTwVV85CvZcS9hxcqEkG2sFROStmcCT2N4rw+PQ?= =?us-ascii?Q?MVCbIV/Eo+fFx4UdDkFwASHAnJJV3k7hGIhi/xWZSgjY8QIPPLCKGSBXmJez?= =?us-ascii?Q?boTuKa5kBCdf8ItnuhW1EDhshk2AE+2qUcSjLRw3HDU1VIk7N54n83czUzAZ?= =?us-ascii?Q?MfnzsrAWqHcrINl7pGOxVc=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3605; 6:76ffXFftUD3II5UGpJAtkBVFGNFUszbxfifciWeqDRpa4qogFu1p8eTMktcQHJO1SrnbZUqnoL1H0jjy0lxrL3O7jivCbqTjT6S7KRhWm9zJl02PSr5ZNKunKNj0hcKVkCwBgeJ1WxylIb0eQNb5GBImCBluGGgIGQY7B63jyGaGhx2dI2z6R/ARexQZ5C47X309fFfOjbZacN7fZdipr4F6FK56TvrgICsJ0mM4KbzQkx684YDyCtlO1DO6aFmbK0RBCPLp9Q7xRJjwbqzZSBsUR4gqhHde3LeMHYfhSshCOEmg8CjgLwjElSpI6LrBEB+ztBEH6zL4BLRunmAWXPxeRHoQqo7Uz4GP98S0aa4=; 5:AvQj7QaALRFht9+YEE/uk4yydaTR50eJyhkbkMcXPfXjEWxos0S7rA709bQpDRESmDRxSkaBqrReH1qryKUGga3ZkKkv3CQfO4m9+/mrbM2lf3GHuK2DIp8Qu61m7fIWrISb/Ao4nFFomGXAelAkt9P/oxkWFcdIDCKne1y4I5M=; 24:W/GI9sw/YX5S30+/mlXJW3stkvdKwClwI63VOAA13JFyrDOwJWDk+bsWjRJWvBZdD8MaUb+QNAHyBdaNaOXA7HnRb7mPhQzvBcj/e4PZKB0=; 7:ilqczhETB2h5l37eEt3BwML3Ost8J9pVP/Q4TKpbx0XZliW6VXd9j/yvjsPQzkySj95QHkth3Tj6eRroPGup1z0i5781FMQOAaPlWhBd5DGmbRH5hAywyzwoZ+99jYlAm6FgYuWvKsJilsbXoD1SPXiBq43KGT386CyZ3hdU7FIF2pETuRf57fWqhs1oQ66aRbpXFS5z2KKD7sfrNjfNw38iwufCrLIXHREGZpBUfIhdCzvhDK4U4gQMnVjBo5AL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2017 16:55:24.5244 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b408b66b-3597-4650-07ab-08d5246e0258 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.12]; Helo=[p-emfe01a-sac.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR05MB3605 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 16:55:27 -0000 Bryan Drewery wrote: > I only find RELDIR useful in the non-kernel builds, so I don't really > care to extend it here. Yes I said as much in the other thread. From owner-svn-src-all@freebsd.org Sun Nov 5 17:14:45 2017 Return-Path: Delivered-To: svn-src-all@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 8D9CAE4B948; Sun, 5 Nov 2017 17:14:45 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 67EF02DCC; Sun, 5 Nov 2017 17:14:45 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5HEiKd074708; Sun, 5 Nov 2017 17:14:44 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5HEi7I074707; Sun, 5 Nov 2017 17:14:44 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201711051714.vA5HEi7I074707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 5 Nov 2017 17:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325439 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 325439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 17:14:45 -0000 Author: mmel Date: Sun Nov 5 17:14:44 2017 New Revision: 325439 URL: https://svnweb.freebsd.org/changeset/base/325439 Log: Remove support for ARMv6/v7 platform from elf_trampoline. The elf_trampoline.c is not connected to build for ARMv6/v7 for long time and it uses outdated low level cpu functions. This blocks forthcoming cleanup of ARM code. MFC after: 3 weeks Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Sun Nov 5 16:52:54 2017 (r325438) +++ head/sys/arm/arm/elf_trampoline.c Sun Nov 5 17:14:44 2017 (r325439) @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include +#if __ARM_ARCH >= 6 +#error "elf_trampline is not supported on ARMv6/v7 platforms" +#endif extern char kernel_start[]; extern char kernel_end[]; @@ -51,8 +54,6 @@ void __start(void); void __startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3); extern unsigned int cpu_ident(void); -extern void armv6_idcache_wbinv_all(void); -extern void armv7_idcache_wbinv_all(void); extern void do_call(void *, void *, void *, int); #define GZ_HEAD 0xa @@ -66,36 +67,23 @@ extern void fa526_idcache_wbinv_all(void); #elif defined(CPU_ARM9E) #define cpu_idcache_wbinv_all armv5_ec_idcache_wbinv_all extern void armv5_ec_idcache_wbinv_all(void); -#elif defined(CPU_ARM1176) -#define cpu_idcache_wbinv_all armv6_idcache_wbinv_all #elif defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) #define cpu_idcache_wbinv_all xscale_cache_purgeID extern void xscale_cache_purgeID(void); #elif defined(CPU_XSCALE_81342) #define cpu_idcache_wbinv_all xscalec3_cache_purgeID extern void xscalec3_cache_purgeID(void); -#elif defined(CPU_MV_PJ4B) -#if !defined(SOC_MV_ARMADAXP) -#define cpu_idcache_wbinv_all armv6_idcache_wbinv_all -extern void armv6_idcache_wbinv_all(void); -#else -#define cpu_idcache_wbinv_all() armadaxp_idcache_wbinv_all #endif -#endif /* CPU_MV_PJ4B */ #ifdef CPU_XSCALE_81342 #define cpu_l2cache_wbinv_all xscalec3_l2cache_purge extern void xscalec3_l2cache_purge(void); #elif defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) #define cpu_l2cache_wbinv_all sheeva_l2cache_wbinv_all extern void sheeva_l2cache_wbinv_all(void); -#elif defined(CPU_CORTEXA8) || defined(CPU_CORTEXA_MP) || defined(CPU_KRAIT) -#define cpu_idcache_wbinv_all armv7_idcache_wbinv_all -#define cpu_l2cache_wbinv_all() #else #define cpu_l2cache_wbinv_all() #endif -static void armadaxp_idcache_wbinv_all(void); int arm_picache_size; int arm_picache_line_size; @@ -389,18 +377,6 @@ arm9_setup(void) arm9_dcache_index_max = 0U - arm9_dcache_index_inc; } -static void -armadaxp_idcache_wbinv_all(void) -{ - uint32_t feat; - - __asm __volatile("mrc p15, 0, %0, c0, c1, 0" : "=r" (feat)); - if (feat & ARM_PFR0_THUMBEE_MASK) - armv7_idcache_wbinv_all(); - else - armv6_idcache_wbinv_all(); - -} #ifdef KZIP static unsigned char *orig_input, *i_input, *i_output; From owner-svn-src-all@freebsd.org Sun Nov 5 17:22:58 2017 Return-Path: Delivered-To: svn-src-all@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 D080CE4BC0C; Sun, 5 Nov 2017 17:22:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com [209.85.223.177]) (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 A108131FD; Sun, 5 Nov 2017 17:22:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f177.google.com with SMTP id e89so13338613ioi.11; Sun, 05 Nov 2017 09:22:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Trw1aivt6EzDyO9H/n2tWDP6Fj9a0NYoHNGwkQrSxm8=; b=lN9YOrM9KkuQUthDjAjgmoXfO/bQ55BBuKVDYFgsIwHhMk1Y7Mn3X2R8AaNbO7PD3J 0Ghcj/AUeM7Oe9wacqARN0nYUiixe3Bi4ylD4gxFus/wn5klrfuargbVz8XBGFr8DnX+ erAqQfUtDmpniZXR6PLlwqt+3cUWWqy4qezjsqnAnh+8zEN9m4tCcQ8G+oRG5r0EPwh8 pwgGXM8j4lcwX96F++yI2KIRZnvCWLNzSuva5csYGgda14AdXaZflK/iEWUjreGxVOHY 8o3g4Q4XNxtjMIi+TJAuyt6QAXgVRUs+IxuWlt8WwK2123UExOrwIPHnDqK8FY0uMpkV AFrA== X-Gm-Message-State: AJaThX614wi4wDhdoH8nyF2yrgr9AyJ1VktCNYmfoFe0ta9XkJ/fWyvv NdAwM/8h8INldo6dTpOOkSsUOktA X-Google-Smtp-Source: ABhQp+TIuANLNjNBNqV7YnDELJm4e0T/hfDZY7iwwQJu9f5ThUhmY8jei1FSDzal0VdHDVy8kc0+5g== X-Received: by 10.107.20.130 with SMTP id 124mr16312154iou.36.1509902189208; Sun, 05 Nov 2017 09:16:29 -0800 (PST) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id l206sm3453436ita.29.2017.11.05.09.16.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Nov 2017 09:16:29 -0800 (PST) Received: by mail-it0-f42.google.com with SMTP id f187so2702008itb.1; Sun, 05 Nov 2017 09:16:29 -0800 (PST) X-Received: by 10.36.224.78 with SMTP id c75mr6356517ith.71.1509902188986; Sun, 05 Nov 2017 09:16:28 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.164.130 with HTTP; Sun, 5 Nov 2017 09:16:28 -0800 (PST) In-Reply-To: <20171105130607.GA2566@kib.kiev.ua> References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> From: Conrad Meyer Date: Sun, 5 Nov 2017 09:16:28 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r325386 - head/sys/kern To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 17:22:58 -0000 On Sun, Nov 5, 2017 at 5:06 AM, Konstantin Belousov wrote: > On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote: >> This is a functional change, because MPASS (via KASSERT) is only >> enabled on DEBUG kernels. Ideally we would have a kind of ASSERT that >> worked on NODEBUG kernels. > Why would we need such thing ? > > Our conventions are clear: consistency checks are normally done with > KASSERT() and enabled for DEBUG (INVARIANTS or harder) configurations. > We only leave explicit panics in the production kernels when there > continuation of operations is worse then abort, e.g. when UFS detects > the metadata corruption. An always-on assert construct would be precisely for the latter scenario. Instead, we litter the tree with "if (!invariant) { panic(); }." Best, Conrad From owner-svn-src-all@freebsd.org Sun Nov 5 17:30:38 2017 Return-Path: Delivered-To: svn-src-all@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 BFB23E4BCFD; Sun, 5 Nov 2017 17:30:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 46F4633D0; Sun, 5 Nov 2017 17:30:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA5HUX8A053128 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 5 Nov 2017 19:30:33 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA5HUX8A053128 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA5HUXZj053127; Sun, 5 Nov 2017 19:30:33 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 5 Nov 2017 19:30:32 +0200 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325386 - head/sys/kern Message-ID: <20171105173032.GE2566@kib.kiev.ua> References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 17:30:38 -0000 On Sun, Nov 05, 2017 at 09:16:28AM -0800, Conrad Meyer wrote: > On Sun, Nov 5, 2017 at 5:06 AM, Konstantin Belousov wrote: > > On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote: > >> This is a functional change, because MPASS (via KASSERT) is only > >> enabled on DEBUG kernels. Ideally we would have a kind of ASSERT that > >> worked on NODEBUG kernels. > > Why would we need such thing ? > > > > Our conventions are clear: consistency checks are normally done with > > KASSERT() and enabled for DEBUG (INVARIANTS or harder) configurations. > > We only leave explicit panics in the production kernels when there > > continuation of operations is worse then abort, e.g. when UFS detects > > the metadata corruption. > > An always-on assert construct would be precisely for the latter > scenario. Instead, we litter the tree with "if (!invariant) { > panic(); }." We do #ifdef INVARIANTS if (!condition) panic(); #endif I do not understand what do you mean by 'instead'. From owner-svn-src-all@freebsd.org Sun Nov 5 18:24:32 2017 Return-Path: Delivered-To: svn-src-all@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 79DE6E4D178; Sun, 5 Nov 2017 18:24:32 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 47CE263F7F; Sun, 5 Nov 2017 18:24:32 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5IOVrH003584; Sun, 5 Nov 2017 18:24:31 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5IOVeb003583; Sun, 5 Nov 2017 18:24:31 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201711051824.vA5IOVeb003583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 5 Nov 2017 18:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325440 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 325440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 18:24:32 -0000 Author: bcr (doc committer) Date: Sun Nov 5 18:24:31 2017 New Revision: 325440 URL: https://svnweb.freebsd.org/changeset/base/325440 Log: The last example used LOG_INFO, but the message itself said error. Change to LOG_ERR to be less confusing. PR: 216756 Submitted by: Thomas Cort (linuxgeek@gmail.com) Reviewed by: noone (after 2 months) Differential Revision: https://reviews.freebsd.org/D11824 Modified: head/lib/libc/gen/syslog.3 Modified: head/lib/libc/gen/syslog.3 ============================================================================== --- head/lib/libc/gen/syslog.3 Sun Nov 5 17:14:44 2017 (r325439) +++ head/lib/libc/gen/syslog.3 Sun Nov 5 18:24:31 2017 (r325440) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 21, 2015 +.Dd November 5, 2017 .Dt SYSLOG 3 .Os .Sh NAME @@ -270,7 +270,7 @@ setlogmask(LOG_UPTO(LOG_ERR)); syslog(LOG_INFO, "Connection from host %d", CallingHost); -syslog(LOG_INFO|LOG_LOCAL2, "foobar error: %m"); +syslog(LOG_ERR|LOG_LOCAL2, "foobar error: %m"); .Ed .Sh SEE ALSO .Xr logger 1 , From owner-svn-src-all@freebsd.org Sun Nov 5 18:26:36 2017 Return-Path: Delivered-To: svn-src-all@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 9C5C8E4D2C9; Sun, 5 Nov 2017 18:26:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 2D9B9641FA; Sun, 5 Nov 2017 18:26:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.104] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 808E2104FC6; Mon, 6 Nov 2017 05:26:28 +1100 (AEDT) Date: Mon, 6 Nov 2017 05:26:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324853 - in head/sys: kern sys In-Reply-To: <20171105153026.GC2566@kib.kiev.ua> Message-ID: <20171106030252.W1814@besplex.bde.org> References: <201710220811.v9M8Bjw5033551@repo.freebsd.org> <20171105014453.L1354@besplex.bde.org> <20171105130349.GZ2566@kib.kiev.ua> <20171106010605.L1257@besplex.bde.org> <20171105153026.GC2566@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=xGrr_p8tfTUjZDuk4GIA:9 a=8QWUxf0nJNGSGus_:21 a=BxdkfwXYm5bVj3Ai:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 18:26:36 -0000 On Sun, 5 Nov 2017, Konstantin Belousov wrote: > On Mon, Nov 06, 2017 at 01:46:49AM +1100, Bruce Evans wrote: >> On Sun, 5 Nov 2017, Konstantin Belousov wrote: >> >>> On Sun, Nov 05, 2017 at 03:06:22AM +1100, Bruce Evans wrote: >>>> On Sun, 22 Oct 2017, Konstantin Belousov wrote: >>>> >>>>> Author: kib >>>>> Date: Sun Oct 22 08:11:45 2017 >>>>> New Revision: 324853 >>>>> URL: https://svnweb.freebsd.org/changeset/base/324853 >>>>> >>>>> Log: >>>>> Remove the support for mknod(S_IFMT), which created dummy vnodes with >>>>> VBAD type. >>>>> >>>>> FFS ffs_write() VOP catches such vnodes and panics, other VOPs do not >>>>> check for the type and their behaviour is really undefined. The >>>>> comment claims that this support was done for 'badsect' to flag bad >>>>> sectors, we do not have such facility in kernel anyway. >>>> >>>> badsect(8) is a utility and this commit breaks it by removing its kernel >>>> support. >>> >>> I see, thank you for the pointer. I will prepare the patch to remove >>> badsect(8). >> >> That would increase the number of things to fix. > In which way ? It requires unremoving badsect(8) as well as its kernel support. >> Even if badsect(8) is implemented less hackishly, binary compatibility >> for mknod(2) requires ifdefing it with COMPAT_*. > No, mknod(S_IFMT) is clearly non-functional management interface, and we > allow management interface changes between releases, and if desired, inside > the releases as well. No, it was perfectly functional. Much more than in 4.1BSD. Then it was limited to 16-bit block numbers by dev_t being 16 bits. With a block size of 512, that limited it to file systems of size 32 MB. That wasn't enough for a small University system in 1981, and Berkeley isn't small. It was far too small for FreeBSD-1 in 1993. 32-bit dev_t in 4.4BSD and FreeBSD-2 was large enough until relatively recently. It is larger than signed 32-bit daddr_t and ufs1_daddr_t. Now 64-bit dev_t is larger than signed 64-bit daddr_t and ufs2_daddr_t. BTW, I'm now fixing dev_t for newnfs. I fixed oldnfs to catch up with 32-bit dev_t in 1996, but newfs for v3 still hard-codes for 16-bit dev_t (actually for 8-bit major() and minor()), and ABI breakage loses all bits in major() for v3 and v4 when the kernel uses the new ABI and applications use the old ABI. v2 actually works better using raw dev_t's if the server and client application use the same 32-bit encoding. >> I only checked that badsect(*) worked before this commit without INVARIANTS >> or soft updates. Perhaps the panic always occurs with INVARIANTS due to >> some INAVRIANTS check being wrong, or soft updates doesn't understand this >> case. badsect(8) says to run badsect on a "quiet" file system, but this >> should only be necessary to prevent the bad block being reallocated while >> you are creating a VBAD file to hold it. Note that mknod(S_IFMT) doesn't >> force an fsck before the next mount. This seems to be be just another bug >> involving the clean flag -- I doubt that it is really safe to never clean >> up the VBAD files, so creating one should have set a sticky dirty flag. > UFS code is not prepared to VBAD vnodes. I do not mean specifically the > vnode type, but the VOPs operations on such inodes. But it is prepared when used as documented in badsect(8). > It is pointless to spend the time on making it functional. Modern disk > failure modes made badsect(8) useless in the beginning if the beginning > of 199x. It is just too hard to use without a more complicated program to control it. I used a "modern" disk's remapping to fix a few thousand bad sectors which needed to be fixed or zeroed just to copy as much as possible before replacing the disk, but the spares ran out too soon. bad144 would have worked better. IIRC, it can handle 64K remaps. badsect was too hard to use to even try for a few thousand not even transparent remaps. > I will commit the following patch after make universe finishes. I don't like this. Bruce From owner-svn-src-all@freebsd.org Sun Nov 5 18:32:05 2017 Return-Path: Delivered-To: svn-src-all@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 3B43BE4D7B7; Sun, 5 Nov 2017 18:32:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.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 0ADA26476A; Sun, 5 Nov 2017 18:32:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f54.google.com with SMTP id n195so2820608itg.0; Sun, 05 Nov 2017 10:32:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=zgZDDOWoDUU6388w+WVIJqObFsfbKn5MW8fXa2Q9YTs=; b=iBIvpnR0tt8A11oikO94h07DeHmUwfLy3O0xVaZf1oVTfZl0p8HAKcvgXshf9FXlSa ZNgDRY9m4GX4NgQHx+ujJ2r5iBAxHaBChD6WPTeUeGLGIg2QqY8Nn6ZdcGnodIkvJZNA LkQNnW8YU8hMyvcIb/3RIyxzuPA5W4BW+3g7qrkyVJlgDqtEJNSPmnH4iQVGP3SPEg2V SAxdQvhVgcewhYoX6bnTCWOY3mAsnI9iTArOvw5MP5so7U5MSmA8zpqgLC8qq12cOOI2 wuYQJQkGSrzkdPUyhCRQT30HLs/6NA2lHPS0eCAdrKgliZfyyc8ya5WcUCQssnfmRuMg 9qMQ== X-Gm-Message-State: AJaThX4H31PcU+1gEB+QLBqKThuZmGeJkkaeVRQG7oNXLZXdbr4Lm7IH PfPI4rp8mMDgEOV5B8pZ4JqJhp35 X-Google-Smtp-Source: ABhQp+S+fvQuH5R85q0QAzgLdEQ0m85hrP6nwfATCuZwH7B4r71Of9yaeF8MaW4gPX87iUIaC+P/wA== X-Received: by 10.36.105.65 with SMTP id e62mr6550037itc.16.1509906723918; Sun, 05 Nov 2017 10:32:03 -0800 (PST) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id w139sm3579405itb.5.2017.11.05.10.32.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Nov 2017 10:32:03 -0800 (PST) Received: by mail-it0-f45.google.com with SMTP id f187so2822046itb.1; Sun, 05 Nov 2017 10:32:03 -0800 (PST) X-Received: by 10.36.10.82 with SMTP id 79mr6902243itw.128.1509906723463; Sun, 05 Nov 2017 10:32:03 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.164.130 with HTTP; Sun, 5 Nov 2017 10:32:03 -0800 (PST) In-Reply-To: <20171105173032.GE2566@kib.kiev.ua> References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> From: Conrad Meyer Date: Sun, 5 Nov 2017 10:32:03 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r325386 - head/sys/kern To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 18:32:05 -0000 E.g., --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -304,8 +304,7 @@ retry: } if (bp->b_blkno == bp->b_lblkno) { - if (lbprev >= UFS_NDADDR) - panic("ffs_realloccg: lbprev out of range"); + ASSERT(lbprev < UFS_NDADDR, "ffs_realloccg: lbprev out of range"); bp->b_blkno = fsbtodb(fs, bprev); } On Sun, Nov 5, 2017 at 9:30 AM, Konstantin Belousov wrote: > On Sun, Nov 05, 2017 at 09:16:28AM -0800, Conrad Meyer wrote: >> On Sun, Nov 5, 2017 at 5:06 AM, Konstantin Belousov wrote: >> > On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote: >> >> This is a functional change, because MPASS (via KASSERT) is only >> >> enabled on DEBUG kernels. Ideally we would have a kind of ASSERT that >> >> worked on NODEBUG kernels. >> > Why would we need such thing ? >> > >> > Our conventions are clear: consistency checks are normally done with >> > KASSERT() and enabled for DEBUG (INVARIANTS or harder) configurations. >> > We only leave explicit panics in the production kernels when there >> > continuation of operations is worse then abort, e.g. when UFS detects >> > the metadata corruption. >> >> An always-on assert construct would be precisely for the latter >> scenario. Instead, we litter the tree with "if (!invariant) { >> panic(); }." > We do > > #ifdef INVARIANTS > if (!condition) panic(); > #endif > > I do not understand what do you mean by 'instead'. From owner-svn-src-all@freebsd.org Sun Nov 5 18:42:53 2017 Return-Path: Delivered-To: svn-src-all@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 12DB6E4DC69 for ; Sun, 5 Nov 2017 18:42:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (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 C88EB64F18 for ; Sun, 5 Nov 2017 18:42:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x241.google.com with SMTP id p186so13448191ioe.12 for ; Sun, 05 Nov 2017 10:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ur5GzTGAL6KTtw6Exuyq18ie+LbU8p0+jEbbLbpGlVQ=; b=O+7XbSAV2YygDrxZ3UvE5/lo90pfHp0+uGUvTjMuLi5Q3CT8SN0wgO4oMKqXSFei0l TSRRbOXmce7Ki9F1w+we9Uw0NgJJHpHMEE5bdx4Ke60qhrK7JkZGSecZkiRYt1sl6RDR D8EQ/du6bdxT5qBbT5PNzDfzANi4AT0tKBfHB9/sp5YA9LDoJLxM5c/ua4/x8XISNzbh xgylS/ZDm8ICF3uLJ8P3PErPZhI1/VzhO22Lo2Av+7zTUJn5+zcRr0Ty5otGFXWyNOQO JD4XhjV/BYK74TnnrR5SJe1C4dGpUp5MVfbw+6z3tIgMbfpxzDjMZIi2lHJben8plyxq NnQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ur5GzTGAL6KTtw6Exuyq18ie+LbU8p0+jEbbLbpGlVQ=; b=aajIharDuv8IwwDEffRdk1wSNtcaTfnDYuCyeBTaZqY7f62mE+BM1e/3LFAm9D2qPu Zafpl/Zvr+OaalwiO50lOjz7hfXjo/ldnXihehtjStl9Z/v80q7CqNwDTlIHsGN18llW VJKQ+bKXVX+b01X5WDHAhxOQLYGxj82/Rki90Tu7ujjFdBq93irNMfbSTkxC1MZKskMK h2FVNrkMqwyvlyppbBZS/wR0K7Vbep8hSezffVC9SirWV/nOVT1RJU1Mf4AvmrRl2RPR WYRW3O0StdOOLaESS22Wz16dD3VpptTHiBI9FLSp1PR88lVC0bcpOjdwfv7YRo8dQF3x +BQg== X-Gm-Message-State: AJaThX5wsJjExo9FFuQ9SLd4kUPlqH/A8qtFT4cfmc8pQc4mJKgaVebU HZGmYx3Tc4U0AojrDQnCdJ+4uNwp6QhTQf1c+ZJfDA== X-Google-Smtp-Source: ABhQp+RCQvfa6Lat+a2lZJYklW6L2YzR7ymZ2EoWe+JD/mFCr59tXfurHjr15zg0GlmwXKoE8GPEuH3CYU8ko7xQRT4= X-Received: by 10.107.81.21 with SMTP id f21mr16448250iob.63.1509907372180; Sun, 05 Nov 2017 10:42:52 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Sun, 5 Nov 2017 10:42:51 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c96d:b7be:45de:c872] In-Reply-To: References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> From: Warner Losh Date: Sun, 5 Nov 2017 11:42:51 -0700 X-Google-Sender-Auth: WKMHCvVH08c6pAKLqijTu87t37w Message-ID: Subject: Re: svn commit: r325386 - head/sys/kern To: "Conrad E. Meyer" Cc: Konstantin Belousov , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 18:42:53 -0000 On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: > E.g., > > --- a/sys/ufs/ffs/ffs_alloc.c > +++ b/sys/ufs/ffs/ffs_alloc.c > @@ -304,8 +304,7 @@ retry: > } > > if (bp->b_blkno == bp->b_lblkno) { > - if (lbprev >= UFS_NDADDR) > - panic("ffs_realloccg: lbprev out of range"); > + ASSERT(lbprev < UFS_NDADDR, "ffs_realloccg: lbprev out > of range"); > bp->b_blkno = fsbtodb(fs, bprev); > } > Just a side point: All these should be programming errors. The bogus data that comes or could come from the FS itself should remain always-on panics. Well, actually, they should transition from always-on panics to some sort of degraded mount that would be more resilient in the face of such corruption. But failing that, they should remain always-on panics :) Warner > On Sun, Nov 5, 2017 at 9:30 AM, Konstantin Belousov > wrote: > > On Sun, Nov 05, 2017 at 09:16:28AM -0800, Conrad Meyer wrote: > >> On Sun, Nov 5, 2017 at 5:06 AM, Konstantin Belousov < > kostikbel@gmail.com> wrote: > >> > On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote: > >> >> This is a functional change, because MPASS (via KASSERT) is only > >> >> enabled on DEBUG kernels. Ideally we would have a kind of ASSERT > that > >> >> worked on NODEBUG kernels. > >> > Why would we need such thing ? > >> > > >> > Our conventions are clear: consistency checks are normally done with > >> > KASSERT() and enabled for DEBUG (INVARIANTS or harder) configurations. > >> > We only leave explicit panics in the production kernels when there > >> > continuation of operations is worse then abort, e.g. when UFS detects > >> > the metadata corruption. > >> > >> An always-on assert construct would be precisely for the latter > >> scenario. Instead, we litter the tree with "if (!invariant) { > >> panic(); }." > > We do > > > > #ifdef INVARIANTS > > if (!condition) panic(); > > #endif > > > > I do not understand what do you mean by 'instead'. > > From owner-svn-src-all@freebsd.org Sun Nov 5 18:45:44 2017 Return-Path: Delivered-To: svn-src-all@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 9309EE4DD52; Sun, 5 Nov 2017 18:45:44 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6172E650AC; Sun, 5 Nov 2017 18:45:44 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5Ijh9N012127; Sun, 5 Nov 2017 18:45:43 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5IjhtH012126; Sun, 5 Nov 2017 18:45:43 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201711051845.vA5IjhtH012126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sun, 5 Nov 2017 18:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325441 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 325441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 18:45:44 -0000 Author: bcr (doc committer) Date: Sun Nov 5 18:45:43 2017 New Revision: 325441 URL: https://svnweb.freebsd.org/changeset/base/325441 Log: Extend the synopsis section of md(4) to look more like other manpages of this kind. Describe how to compile the driver into the kernel and how to load it as a module. This is useful for people using the MINIMAL kernel configuration file. PR: 218610 Submitted by: Harald Schmalzbauer (bugzilla.freebsd@omnilan.de) Reviewed by: noone (1 month inactivity) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12271 Modified: head/share/man/man4/md.4 Modified: head/share/man/man4/md.4 ============================================================================== --- head/share/man/man4/md.4 Sun Nov 5 18:24:31 2017 (r325440) +++ head/share/man/man4/md.4 Sun Nov 5 18:45:43 2017 (r325441) @@ -7,14 +7,26 @@ .\" .\" $FreeBSD$ .\" -.Dd October 30, 2007 +.Dd November 5, 2017 .Dt MD 4 .Os .Sh NAME .Nm md .Nd memory disk .Sh SYNOPSIS -.Cd device md +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device md" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +geom_md_load="YES" +.Ed .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Sun Nov 5 18:54:10 2017 Return-Path: Delivered-To: svn-src-all@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 84F94E4E206 for ; Sun, 5 Nov 2017 18:54:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) 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 0DBE965649 for ; Sun, 5 Nov 2017 18:54:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22b.google.com with SMTP id b189so9834140wmd.4 for ; Sun, 05 Nov 2017 10:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8KwC8Ze6+eiO2ksoVfJOgVIjPEwS1/b0DpRaoZnWkFw=; b=iAsUfiBHQPF4isIvU+JCguZQY2ItnK8n273tB0m/uBo356lvzG1KUb+qnepSwvxVQK N6JyjaassxThIzsKU9uTu9S+hoKm6yxQCxXHmfP4xBLC9W7gp/1SW/JMsmdmHtm7K84u VkFzDuMSoQcM+PBFJjkWICx3+OTDF+TWUhjHhsM1Bstd/3XVEic4A854Q1rKxpyg3XSO mbMH8TGcxK8kYM/N16MjypFHrjipjiLSOcblKX1m+2m61Kakbg+vT2Q/zSWRUlQfliRJ Fd0T0HJsV3BoMlMz9NXQdQ1otHQXZCn8paGN4Mz+NhBWb6/qjwO3WA1deNSiR/dcAOPR q0NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8KwC8Ze6+eiO2ksoVfJOgVIjPEwS1/b0DpRaoZnWkFw=; b=boZt74TURTZaRP0GCdXRkwympE6HB/HP9A2UsR+hjyvge5xW6MW715CZ95IT6P1QW4 8yLuW9qxRXz/vJl40IzbYOIn9U3/hxMxcczUP9UvZHq6KdbE9kKcaEdNL8S55jTAD2QE FV2ktTFbJsg94/4N4/dwH5TGprzbWXkKu2Ri5LOX9isQz4tHQH2WlQm4ODA9VH2jKVjL 2QXpShOiZ8QNs6JyJObnlgYpdFzfvb4sjUu869Z6yAxQbFJvg2/4nlwjAdB891YzYGHA eSgtiFrkJ7vlFKF62P1xtHe+S6ES0PibKIsjUDnmY+BINuvarpzvSVQg+jGe3fhmFcE3 oJwg== X-Gm-Message-State: AMCzsaUVG0wTlZpKMobxvxtMSfmHgXtGtk0qNrDmiGkw+C7tr1bBT6Rn wVDu0rQ8vVVuHoWQSdYYgmKdwKkA6tHjIJIDVuNBRA== X-Google-Smtp-Source: ABhQp+Ss/6GiOapTG/Kzbp5l0rx61F+Py3daulet1JhL8MfHaZAQ3EdT3ZW7kyWPXNhp1/TA60ShVzRlqKU2X6uIbGU= X-Received: by 10.80.222.130 with SMTP id c2mr17396901edl.218.1509908048548; Sun, 05 Nov 2017 10:54:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.135.21 with HTTP; Sun, 5 Nov 2017 10:54:08 -0800 (PST) In-Reply-To: References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> From: Oliver Pinter Date: Sun, 5 Nov 2017 19:54:08 +0100 Message-ID: Subject: Re: svn commit: r325386 - head/sys/kern To: Warner Losh Cc: "Conrad E. Meyer" , Konstantin Belousov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 18:54:10 -0000 On 11/5/17, Warner Losh wrote: > On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: > >> E.g., >> >> --- a/sys/ufs/ffs/ffs_alloc.c >> +++ b/sys/ufs/ffs/ffs_alloc.c >> @@ -304,8 +304,7 @@ retry: >> } >> >> if (bp->b_blkno == bp->b_lblkno) { >> - if (lbprev >= UFS_NDADDR) >> - panic("ffs_realloccg: lbprev out of range"); >> + ASSERT(lbprev < UFS_NDADDR, "ffs_realloccg: lbprev out >> of range"); >> bp->b_blkno = fsbtodb(fs, bprev); >> } >> > > Just a side point: All these should be programming errors. Yes, they are programming errors, but the INVATIANTS and all of the debugging kernel facilities are disabled on -STABLE branches, and no one (except us) running on system with enabled debug stuffs. So it would be nice to enable the debug facilities on -STABLE branches and disable them on -RELENG branch time. There was always several errors / patch, which could be catch. Now I don't want to search for them, but I uptreamed them one or two years ago. > The bogus data > that comes or could come from the FS itself should remain always-on panics. > Well, actually, they should transition from always-on panics to some sort > of degraded mount that would be more resilient in the face of such > corruption. But failing that, they should remain always-on panics :) > > Warner > > > >> On Sun, Nov 5, 2017 at 9:30 AM, Konstantin Belousov >> wrote: >> > On Sun, Nov 05, 2017 at 09:16:28AM -0800, Conrad Meyer wrote: >> >> On Sun, Nov 5, 2017 at 5:06 AM, Konstantin Belousov < >> kostikbel@gmail.com> wrote: >> >> > On Sat, Nov 04, 2017 at 12:04:56PM -0700, Conrad Meyer wrote: >> >> >> This is a functional change, because MPASS (via KASSERT) is only >> >> >> enabled on DEBUG kernels. Ideally we would have a kind of ASSERT >> that >> >> >> worked on NODEBUG kernels. >> >> > Why would we need such thing ? >> >> > >> >> > Our conventions are clear: consistency checks are normally done with >> >> > KASSERT() and enabled for DEBUG (INVARIANTS or harder) >> >> > configurations. >> >> > We only leave explicit panics in the production kernels when there >> >> > continuation of operations is worse then abort, e.g. when UFS >> >> > detects >> >> > the metadata corruption. >> >> >> >> An always-on assert construct would be precisely for the latter >> >> scenario. Instead, we litter the tree with "if (!invariant) { >> >> panic(); }." >> > We do >> > >> > #ifdef INVARIANTS >> > if (!condition) panic(); >> > #endif >> > >> > I do not understand what do you mean by 'instead'. >> >> > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Sun Nov 5 18:56:29 2017 Return-Path: Delivered-To: svn-src-all@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 B6796E4E2CB for ; Sun, 5 Nov 2017 18:56:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 549FD657DC for ; Sun, 5 Nov 2017 18:56:28 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ff8e21eb-c25a-11e7-b805-f37e907b5733 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id ff8e21eb-c25a-11e7-b805-f37e907b5733; Sun, 05 Nov 2017 18:56:16 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vA5IuEhq010763; Sun, 5 Nov 2017 11:56:14 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1509908174.99235.60.camel@freebsd.org> Subject: Re: svn commit: r325368 - head/sys/kern From: Ian Lepore To: Ed Maste , Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Sun, 05 Nov 2017 11:56:14 -0700 In-Reply-To: References: <201711031921.vA3JLakQ010001@repo.freebsd.org> <15dc8575-c699-1101-c846-b4fbdef3d1d1@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 18:56:29 -0000 On Fri, 2017-11-03 at 17:22 -0400, Ed Maste wrote: > "On 3 November 2017 at 16:42, Bryan Drewery > wrote: > > > > > > > > > >   Differential Revision:      D12929 > > Apparently this format closes the review now? I thought we needed a > > full > > URL? > Interesting, Phabricator reports "We found a "Differential Revision" > field with value "12929" in the commit message, and the domain on the > URI matches this install, so we linked this commit to D12929."  It > looks like Phabricator was changed to accept only the D##### tag, but > not the "Explain why" text. > I like having the full URL, and would like that to remain the standard.  It's very useful when you're perusing svn logs and you can just click on the url to get to the phab material cited in the commit. If people want the convenience of typing the shorter info, could we make the svn commit hooks expand it to an url? -- Ian From owner-svn-src-all@freebsd.org Sun Nov 5 19:02:20 2017 Return-Path: Delivered-To: svn-src-all@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 64E20E4E5D1; Sun, 5 Nov 2017 19:02:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 E9BFF65C6D; Sun, 5 Nov 2017 19:02:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA5J2EJ0073428 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 5 Nov 2017 21:02:14 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA5J2EJ0073428 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA5J2EId073427; Sun, 5 Nov 2017 21:02:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 5 Nov 2017 21:02:14 +0200 From: Konstantin Belousov To: Warner Losh Cc: "Conrad E. Meyer" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r325386 - head/sys/kern Message-ID: <20171105190214.GG2566@kib.kiev.ua> References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:02:20 -0000 On Sun, Nov 05, 2017 at 11:42:51AM -0700, Warner Losh wrote: > On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: > > > E.g., > > > > --- a/sys/ufs/ffs/ffs_alloc.c > > +++ b/sys/ufs/ffs/ffs_alloc.c > > @@ -304,8 +304,7 @@ retry: > > } > > > > if (bp->b_blkno == bp->b_lblkno) { > > - if (lbprev >= UFS_NDADDR) > > - panic("ffs_realloccg: lbprev out of range"); > > + ASSERT(lbprev < UFS_NDADDR, "ffs_realloccg: lbprev out > > of range"); > > bp->b_blkno = fsbtodb(fs, bprev); > > } > > > > Just a side point: All these should be programming errors. The bogus data > that comes or could come from the FS itself should remain always-on panics. > Well, actually, they should transition from always-on panics to some sort > of degraded mount that would be more resilient in the face of such > corruption. But failing that, they should remain always-on panics :) This is what I said in my reply before the last. I still have no idea what is the point cem tries to express. Nor I know what should the ASSERT() macro do in the kernel. If the patch above really about replacing panic() with _K_ASSERT, then I most likely agree with it, since the error catched is not due to the on-disk metadata corruption. From owner-svn-src-all@freebsd.org Sun Nov 5 19:19:07 2017 Return-Path: Delivered-To: svn-src-all@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 A5288E4E995; Sun, 5 Nov 2017 19:19:07 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) (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 2F1A6662FB; Sun, 5 Nov 2017 19:19:06 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f45.google.com with SMTP id 75so8287911lfx.1; Sun, 05 Nov 2017 11:19:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KdCse6TcN8mfCnTPtQj8zVl3IUhX9U4Hk9a85qZGyu8=; b=s+IQeB085dIyrY2FVjP/GwkZc/os+ZteTQ26SgjjeH23njdv/indmO7ZI9oqMzdG4N q9Mvfe7tbIWqfHkMTz9AvUi+HAiyKNojmaQTmV+5n1LwFCx8B1xolF+YM0ArLHiuG9yR 0DoIm+QbAv6f4G/FbkdG+BaYhC1L7LJKlL7AC8pvNL01qt3YHMYUK3jmDBYMq59vnWKB iZ5OGVXfbKUSD4E5jSukq6iOzSkf6ABMTmPuSbPniI+S9jkwzy33HJ80N74nJUzd7X0F A4IAzlPaK7gznTmTgvqieXHDnJASISE9J1Ff32lUM00j8mWGFvn53iDzGB0CpUsawzbz m+lA== X-Gm-Message-State: AMCzsaWmpxI5JjIcE0rcUy7AEuffvsjK8optGj7SZ9m1ZO4fBHCsHBwS ixHEMb/4gMBr//YQdcCrJh5JR4AOgpY= X-Google-Smtp-Source: ABhQp+QdX6HyiHSnCsQniA57N+1Kju4Hi5HKcbHYQJ/RFtKVE1XNNAwiRt+CpzVK+GwreAWeB4mDtA== X-Received: by 10.46.34.133 with SMTP id i127mr5243323lji.34.1509909203697; Sun, 05 Nov 2017 11:13:23 -0800 (PST) Received: from [192.168.0.197] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id s125sm2309518lja.46.2017.11.05.11.13.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Nov 2017 11:13:22 -0800 (PST) Subject: Re: svn commit: r325386 - head/sys/kern To: Konstantin Belousov , Warner Losh Cc: "Conrad E. Meyer" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> <20171105190214.GG2566@kib.kiev.ua> From: Andriy Gapon Message-ID: <20f694b3-c60c-1b6d-76a1-2ef14cbdd698@FreeBSD.org> Date: Sun, 5 Nov 2017 21:13:21 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171105190214.GG2566@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:19:07 -0000 On 05/11/2017 21:02, Konstantin Belousov wrote: > On Sun, Nov 05, 2017 at 11:42:51AM -0700, Warner Losh wrote: >> On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: >> >>> E.g., >>> >>> --- a/sys/ufs/ffs/ffs_alloc.c >>> +++ b/sys/ufs/ffs/ffs_alloc.c >>> @@ -304,8 +304,7 @@ retry: >>> } >>> >>> if (bp->b_blkno == bp->b_lblkno) { >>> - if (lbprev >= UFS_NDADDR) >>> - panic("ffs_realloccg: lbprev out of range"); >>> + ASSERT(lbprev < UFS_NDADDR, "ffs_realloccg: lbprev out >>> of range"); >>> bp->b_blkno = fsbtodb(fs, bprev); >>> } >>> >> >> Just a side point: All these should be programming errors. The bogus data >> that comes or could come from the FS itself should remain always-on panics. >> Well, actually, they should transition from always-on panics to some sort >> of degraded mount that would be more resilient in the face of such >> corruption. But failing that, they should remain always-on panics :) > > This is what I said in my reply before the last. > > I still have no idea what is the point cem tries to express. > > Nor I know what should the ASSERT() macro do in the kernel. If the > patch above really about replacing panic() with _K_ASSERT, then I most > likely agree with it, since the error catched is not due to the on-disk > metadata corruption. > I guess (only guess) that Conrad is saying that it would be useful to have a macro like KASSERT but which would be always active regardless of INVARIANTS. E.g. in illumos they have ASSERT and VERIFY. -- Andriy Gapon From owner-svn-src-all@freebsd.org Sun Nov 5 19:24:53 2017 Return-Path: Delivered-To: svn-src-all@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 D2F52E4EEBE; Sun, 5 Nov 2017 19:24:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.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 9EE0D66856; Sun, 5 Nov 2017 19:24:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f54.google.com with SMTP id n195so2800307itg.2; Sun, 05 Nov 2017 11:24:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=FH+bDwJS19Ywpynm7Dc/grX4O+OGZQQc7Lf96fkZJrc=; b=b7e9oCmRh7y222U3MCS0xafF9kkQR0zKYOQav5Wq/IOxXasIGQVWj2t1jKasuKpmaq cc6NAXm9OyCCO8Mfkw9I+Uc5L/TGv0bwlP6c8xnCxqCh4wSuouusDfDcn/LxJxrVftwq sQa29aT+nB8k4gcr1Vl8UkTg9NS8sOWOm1r1KXgpc7KJlkXmtOdhp5ZJeN9Z8HLy/oEK vMo1UP/7LuMgKUPlX/Wvdj0sLEQ61vum6T9DZWQHQWAF5I8C8l2UZf3bQAIZPCzGwjVZ ua5VwFcPh1FacuR3a2IWrRt6aEerdSf82w6ISb3sCztMPQYGwoMLDqBPPmJEH6gSFJxw khOQ== X-Gm-Message-State: AJaThX6TmvQzGOIyNd0pe1zuy9mW2WHIOAA3AcCqww+Ri7iEsBTDMHN5 5gKGW2y2rJ5kTI1qNdZi5LrGc2y8 X-Google-Smtp-Source: ABhQp+RUht/85SaIaeRQ99FeSUg/mUI7CQdtsr9p4nmuwY6CCquYKTXB0t/ere9fdSCBcBlK01Gi+Q== X-Received: by 10.36.181.27 with SMTP id v27mr6885441ite.137.1509909892262; Sun, 05 Nov 2017 11:24:52 -0800 (PST) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com. [209.85.223.176]) by smtp.gmail.com with ESMTPSA id c10sm3533031itc.39.2017.11.05.11.24.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Nov 2017 11:24:51 -0800 (PST) Received: by mail-io0-f176.google.com with SMTP id f20so13547708ioj.9; Sun, 05 Nov 2017 11:24:51 -0800 (PST) X-Received: by 10.107.156.134 with SMTP id f128mr16031852ioe.226.1509909891826; Sun, 05 Nov 2017 11:24:51 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.164.130 with HTTP; Sun, 5 Nov 2017 11:24:51 -0800 (PST) In-Reply-To: <20f694b3-c60c-1b6d-76a1-2ef14cbdd698@FreeBSD.org> References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> <20171105190214.GG2566@kib.kiev.ua> <20f694b3-c60c-1b6d-76a1-2ef14cbdd698@FreeBSD.org> From: Conrad Meyer Date: Sun, 5 Nov 2017 11:24:51 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r325386 - head/sys/kern To: Andriy Gapon Cc: Konstantin Belousov , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:24:53 -0000 On Sun, Nov 5, 2017 at 11:13 AM, Andriy Gapon wrote: > I guess (only guess) that Conrad is saying that it would be useful to have a > macro like KASSERT but which would be always active regardless of INVARIANTS. > E.g. in illumos they have ASSERT and VERIFY. Yes, exactly. There are numerous places in the kernel where we have essentially an unrolled version of that idea, with if + panic. Best, Conrad From owner-svn-src-all@freebsd.org Sun Nov 5 19:25:08 2017 Return-Path: Delivered-To: svn-src-all@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 227A2E4EEFD; Sun, 5 Nov 2017 19:25:08 +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 CD455668CB; Sun, 5 Nov 2017 19:25:07 +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 vA5JP604028900; Sun, 5 Nov 2017 19:25:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5JP6Y3028898; Sun, 5 Nov 2017 19:25:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711051925.vA5JP6Y3028898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 19:25:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325442 - in head/lib/libclang_rt: . profile X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head/lib/libclang_rt: . profile X-SVN-Commit-Revision: 325442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:25:08 -0000 Author: ngie Date: Sun Nov 5 19:25:06 2017 New Revision: 325442 URL: https://svnweb.freebsd.org/changeset/base/325442 Log: Support compiling lib/libclang_rt/profile a bit more with recent versions of gcc Several of the flags were being treated as CFLAGS, when they were actually technically CXXFLAGS. Move them there. Only apply -fno-sanitize=safe-stack with clang. PR: 223179 Modified: head/lib/libclang_rt/Makefile.inc head/lib/libclang_rt/profile/Makefile Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Sun Nov 5 18:45:43 2017 (r325441) +++ head/lib/libclang_rt/Makefile.inc Sun Nov 5 19:25:06 2017 (r325442) @@ -20,13 +20,13 @@ CFLAGS+= -DNDEBUG CFLAGS+= ${PICFLAG} CFLAGS+= -fno-builtin CFLAGS+= -fno-exceptions -CFLAGS+= -fno-rtti -.if ${COMPILER_VERSION} >= 30700 +CXXFLAGS+= -fno-rtti +.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 30700 CFLAGS+= -fno-sanitize=safe-stack .endif CFLAGS+= -fno-stack-protector CFLAGS+= -funwind-tables -CFLAGS+= -fvisibility-inlines-hidden -CFLAGS+= -fvisibility=hidden +CXXFLAGS+= -fvisibility-inlines-hidden +CXXFLAGS+= -fvisibility=hidden CFLAGS+= -I${CRTSRC}/lib CXXFLAGS+= -std=c++11 Modified: head/lib/libclang_rt/profile/Makefile ============================================================================== --- head/lib/libclang_rt/profile/Makefile Sun Nov 5 18:45:43 2017 (r325441) +++ head/lib/libclang_rt/profile/Makefile Sun Nov 5 19:25:06 2017 (r325442) @@ -5,7 +5,7 @@ LIB= clang_rt.profile-${CRTARCH} # This is needed for --coverage -CFLAGS+= -fvisibility=default +CXXFLAGS+= -fvisibility=default SRCS+= profile/GCDAProfiling.c SRCS+= profile/InstrProfiling.c From owner-svn-src-all@freebsd.org Sun Nov 5 19:37:59 2017 Return-Path: Delivered-To: svn-src-all@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 3C535E4F25F for ; Sun, 5 Nov 2017 19:37:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 1418566E56 for ; Sun, 5 Nov 2017 19:37:58 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: cbf10548-c260-11e7-b1c3-712f93d8ba90 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id cbf10548-c260-11e7-b1c3-712f93d8ba90; Sun, 05 Nov 2017 19:37:45 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vA5Jbo9H010819; Sun, 5 Nov 2017 12:37:50 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1509910670.99235.70.camel@freebsd.org> Subject: Re: svn commit: r325386 - head/sys/kern From: Ian Lepore To: cem@freebsd.org, Andriy Gapon Cc: Konstantin Belousov , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Sun, 05 Nov 2017 12:37:50 -0700 In-Reply-To: References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> <20171105190214.GG2566@kib.kiev.ua> <20f694b3-c60c-1b6d-76a1-2ef14cbdd698@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:37:59 -0000 On Sun, 2017-11-05 at 11:24 -0800, Conrad Meyer wrote: > On Sun, Nov 5, 2017 at 11:13 AM, Andriy Gapon wrote: > > > > I guess (only guess) that Conrad is saying that it would be useful to have a > > macro like KASSERT but which would be always active regardless of INVARIANTS. > > E.g. in illumos they have ASSERT and VERIFY. > Yes, exactly.  There are numerous places in the kernel where we have > essentially an unrolled version of that idea, with if + panic. > > Best, > Conrad > IMO, the only reason ASSERT-style macros exist is to hide the conditional-on-build-type part of the operation.  That is, to avoid having #ifdef INVARIANTS scattered everywhere. Creating a macro to generate always-on error detection and reporting code just because there exists a macro to do so conditionally seems to turn the world on its head.  Sure, there is a lot of 'if (condition) panic("msg")' in the source.  There is also a lot of stuff like 'if (error != 0) return (ENXIO)", so should we have a macro for that too?  Where does it end? Since I suspect my opinion will be a minority of 1-ish, I'd like to follow up with a suggestion that the new macro at least get a name that includes the word 'panic', such as PANIC_IF().  Something that can be found in the source with: grep -i panic.*message.I.saw -- Ian From owner-svn-src-all@freebsd.org Sun Nov 5 19:38:52 2017 Return-Path: Delivered-To: svn-src-all@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 A9BA4E4F303; Sun, 5 Nov 2017 19:38:52 +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 822CD67089; Sun, 5 Nov 2017 19:38:52 +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 vA5JcpFB033402; Sun, 5 Nov 2017 19:38:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5Jcpnc033399; Sun, 5 Nov 2017 19:38:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711051938.vA5Jcpnc033399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 19:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325443 - in head: . lib/libclang_rt share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: . lib/libclang_rt share/mk X-SVN-Commit-Revision: 325443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:38:52 -0000 Author: ngie Date: Sun Nov 5 19:38:51 2017 New Revision: 325443 URL: https://svnweb.freebsd.org/changeset/base/325443 Log: Fix paths for cross-built versions of lib/libclang_rt and hardfloat arm variants - Define TARGET_CPUARCH and use in libclang_rt as the basis for CRTARCH When cross-compiling, the wrong architecture was being embedded in the libclang_rt binary filenames. It should be based on TARGET_ARCH (target), not MACHINE_ARCH (host). If TARGET_ARCH isn't defined (host-builds), fallback to MACHINE_ARCH. - Define CRTARCH to armhf when TARGET/TARGET_ARCH are set to arm/armv[67] TARGET_ABI/TARGET_CPU in Makefile.inc1 sets the ABI to gnueabihf, which affects the clang lookup path per `getArchNameForCompilerRTLib(..)` in contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp, so chase clang and Linux's assumed naming convention for hard-float arm architectures. CROSSENV (in Makefile.inc1) sets CPUTYPE/MACHINE(_ARCH)? to the TARGET*-relevant values when building the `libraries` target, so test those variables instead. - Add OLD_FILES/OLD_LIBS entries for TARGET/TARGET_ARCH == arm/armv[67]. This impacts only arm/armv6 and arm/armv7. PR: 222925 Modified: head/ObsoleteFiles.inc head/lib/libclang_rt/Makefile.inc head/share/mk/sys.mk Directory Properties: head/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 5 19:25:06 2017 (r325442) +++ head/ObsoleteFiles.inc Sun Nov 5 19:38:51 2017 (r325443) @@ -38,6 +38,21 @@ # xargs -n1 | sort | uniq -d; # done +# 20171105: fixing lib/libclang_rt CRTARCH for arm:armv[67]. +.if ${MACHINE} == "arm" +.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.a +OLD_LIBS+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +.endif +.endif # 20171104: libcap_random should be in /lib not in /usr/lib OLD_LIBS+=usr/lib/libcap_random.so.0 # 20171104: Casper can work only as shared library Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Sun Nov 5 19:25:06 2017 (r325442) +++ head/lib/libclang_rt/Makefile.inc Sun Nov 5 19:38:51 2017 (r325443) @@ -2,7 +2,14 @@ .include -CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} +# NOTE: based on TARGET_ABI/TARGET_CPUTYPE, set in Makefile.inc1 . +.if ${MACHINE} == "arm" +.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" +CRTARCH= armhf +.endif +.endif + +CRTARCH?= ${TARGET_CPUARCH:C/amd64/x86_64/} CRTSRC= ${SRCTOP}/contrib/compiler-rt .PATH: ${CRTSRC}/lib Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sun Nov 5 19:25:06 2017 (r325442) +++ head/share/mk/sys.mk Sun Nov 5 19:38:51 2017 (r325443) @@ -15,6 +15,11 @@ unix ?= We run FreeBSD, not UNIX. # __TO_CPUARCH=C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?(eb)?/arm/:C/powerpc(64|spe)/powerpc/:C/riscv64(sf)?/riscv/ MACHINE_CPUARCH=${MACHINE_ARCH:${__TO_CPUARCH}} +.ifdef TARGET_ARCH +TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}} +.else +TARGET_CPUARCH=${MACHINE_CPUARCH} +.endif .endif __DEFAULT_YES_OPTIONS+= \ From owner-svn-src-all@freebsd.org Sun Nov 5 19:45:42 2017 Return-Path: Delivered-To: svn-src-all@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 1F1F5E4F5CE; Sun, 5 Nov 2017 19:45:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x22c.google.com (mail-pg0-x22c.google.com [IPv6:2607:f8b0:400e:c05::22c]) (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 DDDD76752C; Sun, 5 Nov 2017 19:45:41 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x22c.google.com with SMTP id s75so6577028pgs.0; Sun, 05 Nov 2017 11:45:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=Rozrd1w8YTQ6Khj6AjFjCsnmDn9OpXS47jZ3P1OWsgY=; b=Ihs5Q81i8C+tDUpzYsYu9lNT+bqQoKfSTgPQW9gQGD+XFzU5dNN+Y2u+NduqCpLRLi c3MMwWcisfmgz0bdrk9hMNtDsKFM5ve70srrYv/lsgVkYUGEjIYdweM4TPtuUNx6kjoB s3md8NzCNUn9+qNMOJHT7m45RmliKAT2rtT3J+L/RN2bcOwAYbucVr1sYU2suXyeQzcc EZW1bTDnp+OvjxVEhx8LhjiL0FoIfaUfu4k7EvC06CPpGVPGyKhCGuyQpUKJCNVF1VGn tKSv/e6NEErBIBsyZYW/ewgYBmLTi4DWV9/+zrZbJ7BPZrIFynpYT1l6yvZBFlKSavsq nK6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=Rozrd1w8YTQ6Khj6AjFjCsnmDn9OpXS47jZ3P1OWsgY=; b=dwpHhSBAc9FJe0vd8TGTJdWCEnI9oKfezjW6x0UnE4YZmVu9biCbKEJh55281K+zce Xxt6Rr/JpmsN2GmpLih/Kl8wRb0iQJZdn2lIl3NO2WpRsYediPsM9GG7oqwRorJp+oKx aDRc1dr5B/lcNgBdw3DFAX2o8w2lk46vn755LMJLWleaWH2v9gXnb4hqrvQtLJI0YOo5 H10gvxUQHN5bTLZjslBMi+sL9DjNj458YFbSUfsKFfo8R7Vj8hiLJ3VihdZqAI2YWi9I y0fQMXKbL8yZo/gW7BWUkQepNEQbfnII8pqQx6OUn8bLtxbSHevUM2K21/ew1mA3pq6t vj9w== X-Gm-Message-State: AMCzsaUhBRnef9yyYdLJm/0XDXY4mYCe1sjpAf8kLqvelRExWmBLub45 3AV0zW/PWh/Th6kT5wO4sPMCOdwh X-Google-Smtp-Source: ABhQp+Tko0M4zUkKhaMVbGW5dQPCvalVJxrcL4iEgHSedUcVgcaICs9QHx9FaqZrvOb9UKvGHB6exA== X-Received: by 10.159.242.194 with SMTP id x2mr12867642plw.244.1509911140871; Sun, 05 Nov 2017 11:45:40 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id g24sm22196173pfk.0.2017.11.05.11.45.39 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 05 Nov 2017 11:45:40 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_C1917D34-D6F7-4C76-8D11-63BC3E2D85ED"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r325443 - in head: . lib/libclang_rt share/mk From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201711051938.vA5Jcpnc033399@repo.freebsd.org> Date: Sun, 5 Nov 2017 11:45:38 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <44947619-4DC5-4F5E-B26C-4F29917F9DE3@gmail.com> References: <201711051938.vA5Jcpnc033399@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:45:42 -0000 --Apple-Mail=_C1917D34-D6F7-4C76-8D11-63BC3E2D85ED Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Nov 5, 2017, at 11:38, Ngie Cooper wrote: >=20 > Author: ngie > Date: Sun Nov 5 19:38:51 2017 > New Revision: 325443 > URL: https://svnweb.freebsd.org/changeset/base/325443 >=20 > Log: > Fix paths for cross-built versions of lib/libclang_rt and hardfloat = arm variants >=20 > - Define TARGET_CPUARCH and use in libclang_rt as the basis for = CRTARCH >=20 > When cross-compiling, the wrong architecture was being embedded in = the > libclang_rt binary filenames. It should be based on TARGET_ARCH = (target), not > MACHINE_ARCH (host). >=20 > If TARGET_ARCH isn't defined (host-builds), fallback to = MACHINE_ARCH. >=20 > - Define CRTARCH to armhf when TARGET/TARGET_ARCH are set to = arm/armv[67] >=20 > TARGET_ABI/TARGET_CPU in Makefile.inc1 sets the ABI to gnueabihf, = which > affects the clang lookup path per `getArchNameForCompilerRTLib(..)` = in > contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp, so chase clang = and > Linux's assumed naming convention for hard-float arm architectures. >=20 > CROSSENV (in Makefile.inc1) sets CPUTYPE/MACHINE(_ARCH)? to the > TARGET*-relevant values when building the `libraries` target, so = test > those variables instead. >=20 > - Add OLD_FILES/OLD_LIBS entries for TARGET/TARGET_ARCH =3D=3D = arm/armv[67]. This > impacts only arm/armv6 and arm/armv7. >=20 > PR: 222925 MFC after: 2 weeks --Apple-Mail=_C1917D34-D6F7-4C76-8D11-63BC3E2D85ED Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE5bk3FaGcY5rvqmb79YOpJmkwhhUFAln/amMACgkQ9YOpJmkw hhXysQ//YoRV+3WKtmKz0wWVGSk2D+v/gLB7EIQCuZKdVDpjdJ/QAU1r+cmJvF58 WFkScrjeVlwFqOz2DB2K+2g3NBYtgkcRQOmQzgw/cclANNxiTOb2NTHOnYlvnzzP hzotwUDNTtRq/1t76Pk29WWU1Dd+mH8FnSOBgmTIeEy3b8RnE6T6OJcMNx/NEzc0 2rK7OH6r450HBsNz5bktv7FT4aXJj2sDTCQUWjLw69zXFHX0LZHAczrkJjoIHB1Z HLQ8Gzzbd3OJaRK+7GyBAZQXjzxY2F96SupakLo56284tf9S8Ccr97XUDlhu+GTa GffH8djt7VfgMm+kZnuZG2+eGJqQ3LuDgIpYYIM39zgZd6+grNlyOgfCAQ4Ww0kP Ydz2qaUzX8DFD21U2bp6uEEK8vWVEYlYPt01vLaM6iGn0ICSra2XmaJT6m24/UZj tbf+5E99PF1dy7xWajWlJiEYgpvXxkUsQB7thKyEdvaJoVZc98rDb6vF0g/Kvg+K a48nvCk9mAaPPZ/ZJ8revBkQeBV1cbl6tTpMAQnp6VyPyrbqR3I22cssjMKSpdkX belhZh4KJZmxfNe8dcgxJEX4V4XqdS8Wp/BZg4sK0j282wuJKb8xFtplM/9bvGE0 4vWIfkvZGoqxMo/5FxcdQLnEgD2tKVKj+/i+EUTIcIFtKWjtD9U= =gWW1 -----END PGP SIGNATURE----- --Apple-Mail=_C1917D34-D6F7-4C76-8D11-63BC3E2D85ED-- From owner-svn-src-all@freebsd.org Sun Nov 5 19:45:57 2017 Return-Path: Delivered-To: svn-src-all@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 1ABBBE4F641; Sun, 5 Nov 2017 19:45:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com [IPv6:2607:f8b0:400e:c05::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 CB1926761B; Sun, 5 Nov 2017 19:45:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x22b.google.com with SMTP id r25so6562908pgn.4; Sun, 05 Nov 2017 11:45:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=KL706fu7zM8Svz2nX+AOWWG7WGOSUW67Xv9KfwtiQAU=; b=gMxNdzdFOQVGauchvdAtDo1Hlx48REPKkduoZkANPuc+JtG+RObvy8SU7OuJT15kft Fkd11G2xL/r14w/YVfbaWz0mSyWwc+x/hRz1zqfYuoNX16EC1/xQjtM+tUbfXjlkBT7x SUuhzJpOvlKTNH5Zced6IfwECt12LOvIMXhyxCQpCxib7+9RjV5Y2Vb1rlFLyfWk4zYI rh46Avtey/0fs2LcOblp6rSOhl4CCGNqtakrL9wrKc8ifuwb9uTqOMzG5g8oZ+HdUDyh niFVjDP6onfaFgLVhCwAK586VK2qtIt9TVds6FW048gLX/KPE/bAiyFsNM0ueEeK5c64 wuuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=KL706fu7zM8Svz2nX+AOWWG7WGOSUW67Xv9KfwtiQAU=; b=PvmBTJAP3Ik2hv0oO+0+wzjZJcHHK290z9+a4GLHbK0WQPCjfc8SJ2wLAaQc94TzsR t735lc2+BPynXOmFhn3tqgCpY8wuQgPE4j1hkJryv3BJLUAPgv2skfHBqYQrbAq9yM4s kL2rQsXbCyrKHF/gIM5zswvn5ldzdq+jHvRnovCzCwvPLS1o5lTgWOaE4cAYebUpKKBQ 2Dlg1YqSUKR+rdyfpu/9FVGXzFvfCBVUqyGVt35TMaoba/hCABsXYUg2r/PgWPZLUqo5 99SysZ82A0Qsx9nTuSH8aaq5BsOPgmOevHOk3Tv44wTQp7ddm6NutT+sa03Xp7F9a32u spdg== X-Gm-Message-State: AMCzsaVlcm4fJKu7T9YP9l2K8Ohqpyhi9OgpnsjV2mw+irb3UiMCW0QJ lZw4BuGj/kUqd+Nlu+vo4CkqyegL X-Google-Smtp-Source: ABhQp+RawW7aKmf0aI55HQDoaVy9kLZBxtbW2yN3rgzqyW2WcwgJLxaZsl7ArJTeMCr+bOocaNmelA== X-Received: by 10.101.65.200 with SMTP id b8mr13293482pgq.274.1509911156006; Sun, 05 Nov 2017 11:45:56 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id g24sm22196173pfk.0.2017.11.05.11.45.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 05 Nov 2017 11:45:55 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_6E64F8E8-03B5-42E1-BA39-1B08A503316C"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r325442 - in head/lib/libclang_rt: . profile From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201711051925.vA5JP6Y3028898@repo.freebsd.org> Date: Sun, 5 Nov 2017 11:45:54 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <2D27BFE0-ECBC-4C15-BE64-924C44A329CA@gmail.com> References: <201711051925.vA5JP6Y3028898@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:45:57 -0000 --Apple-Mail=_6E64F8E8-03B5-42E1-BA39-1B08A503316C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Nov 5, 2017, at 11:25, Ngie Cooper wrote: >=20 > Author: ngie > Date: Sun Nov 5 19:25:06 2017 > New Revision: 325442 > URL: https://svnweb.freebsd.org/changeset/base/325442 >=20 > Log: > Support compiling lib/libclang_rt/profile a bit more with recent = versions of gcc >=20 > Several of the flags were being treated as CFLAGS, when they were = actually > technically CXXFLAGS. Move them there. >=20 > Only apply -fno-sanitize=3Dsafe-stack with clang. >=20 > PR: 223179 MFC after: 2 weeks --Apple-Mail=_6E64F8E8-03B5-42E1-BA39-1B08A503316C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE5bk3FaGcY5rvqmb79YOpJmkwhhUFAln/anIACgkQ9YOpJmkw hhWRbA//WdiL36wzoj5H5KJN5NIW4z0krpsWuvlqIKYY72PO8ZcTpKB7YkqWfnmb gEEVwUfgdEg1f4LaMGweWPefHAL48qTHp+oGc8GdZHlvsuXiizl9+jRhWy2gTwKV fIrFX+awim5cDaEMZ8ZLRsdTrN9YRzYaMgw3Eom9Z8zP46ELMdl53KX2SS+LJjQq 6xCK5ELQ+2ku2+9av1fo4iBiW5aYTkqQo5Hj7BaDgh5ZpkJchAUqkCMiOkyil1+v IueU2V7COUSc43eSbPH6zjm8pBIkI8Zpa8V6/0tpHV+3L5vJWpVt5cQ+FULzYBs+ F6YiMdQfQoFnowO6KeXD/cK7b2nmsM7lqw9nSBs71bGgfFg0/mvjq3+2AyjAn8Nz aLcs4A0eiu9+Lzziw4Ypqw949qKVZqICV3qXiC2Lmf0ilOip5jqbTeW+EUV7upv0 akFhxALrUk1VPGBqqsxPsQ589iQogulIoSW3ADJjPo07lNU9d1OOIyHmnH5cKRD/ oNorh8HJP4BTihV3/MT5qG+VvaMmYsEm1p7B+D7eNwL91WOIq4I277nTT2HZu51q rc9WdVUtdvfXrrtOSDqNrpPOIX4Y1cozJulEtg4Edf4pc03yib1bwEXKik+TrVdV Qm/+RB6Jn306f3DWdrjEFBP/76cq/CHizZXsEpwWK3tWgOnwKd8= =EpmJ -----END PGP SIGNATURE----- --Apple-Mail=_6E64F8E8-03B5-42E1-BA39-1B08A503316C-- From owner-svn-src-all@freebsd.org Sun Nov 5 19:49:46 2017 Return-Path: Delivered-To: svn-src-all@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 02643E4F8C5; Sun, 5 Nov 2017 19:49:46 +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 D0E9767A07; Sun, 5 Nov 2017 19:49:45 +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 vA5JniCQ037527; Sun, 5 Nov 2017 19:49:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5JniU4037526; Sun, 5 Nov 2017 19:49:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711051949.vA5JniU4037526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 5 Nov 2017 19:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325444 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:49:46 -0000 Author: emaste Date: Sun Nov 5 19:49:44 2017 New Revision: 325444 URL: https://svnweb.freebsd.org/changeset/base/325444 Log: ANSIfy sys/kern/md4c.c PR: 223453 Submitted by: ota@j.email.ne.jp MFC After: 2 weeks Modified: head/sys/kern/md4c.c Modified: head/sys/kern/md4c.c ============================================================================== --- head/sys/kern/md4c.c Sun Nov 5 19:38:51 2017 (r325443) +++ head/sys/kern/md4c.c Sun Nov 5 19:49:44 2017 (r325444) @@ -90,8 +90,8 @@ static unsigned char PADDING[64] = { /* MD4 initialization. Begins an MD4 operation, writing a new context. */ -void MD4Init (context) -MD4_CTX *context; /* context */ +void +MD4Init(MD4_CTX *context) { context->count[0] = context->count[1] = 0; @@ -107,10 +107,9 @@ MD4_CTX *context; operation, processing another message block, and updating the context. */ -void MD4Update (context, input, inputLen) -MD4_CTX *context; /* context */ -const unsigned char *input; /* input block */ -unsigned int inputLen; /* length of input block */ +void +MD4Update(MD4_CTX *context, const unsigned char *input, + unsigned int inputLen) { unsigned int i, index, partLen; @@ -142,8 +141,8 @@ unsigned int inputLen; /* length o } /* MD4 padding. */ -void MD4Pad (context) -MD4_CTX *context; /* context */ +void +MD4Pad(MD4_CTX *context) { unsigned char bits[8]; unsigned int index, padLen; @@ -164,7 +163,8 @@ MD4_CTX *context; /* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */ -void MD4Final (unsigned char digest[static 16], MD4_CTX *context) +void +MD4Final(unsigned char digest[static 16], MD4_CTX *context) { /* Do padding */ MD4Pad (context); @@ -179,9 +179,8 @@ void MD4Final (unsigned char digest[static 16], MD4_CT /* MD4 basic transformation. Transforms state based on block. */ -static void MD4Transform (state, block) -UINT4 state[4]; -const unsigned char block[64]; +static void +MD4Transform(UINT4 state[4], const unsigned char block[64]) { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; @@ -254,10 +253,8 @@ const unsigned char block[64]; /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode (output, input, len) -unsigned char *output; -UINT4 *input; -unsigned int len; +static void +Encode(unsigned char *output, UINT4 *input, unsigned int len) { unsigned int i, j; @@ -272,11 +269,8 @@ unsigned int len; /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ -static void Decode (output, input, len) - -UINT4 *output; -const unsigned char *input; -unsigned int len; +static void +Decode(UINT4 *output, const unsigned char *input, unsigned int len) { unsigned int i, j; From owner-svn-src-all@freebsd.org Sun Nov 5 19:52:12 2017 Return-Path: Delivered-To: svn-src-all@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 99BA8E4F9E3 for ; Sun, 5 Nov 2017 19:52:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001: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 5CD2567E4D for ; Sun, 5 Nov 2017 19:52:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id n137so13590048iod.6 for ; Sun, 05 Nov 2017 11:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ainlo6eVBBDOO3XTaU60tOsE+w/jFwC10TRBMEegPq8=; b=qn7cqQcCd6T7wJ9Zwl3DP5NP9tYUpy643szTVyHab0lNb50nUuuR0Uwm0WEVyo+RLY Aim64rbuJhcRWmwOPBOIPZkANmUwArG4+WtmTjaZcqFIwnQ2Q4ex8HGM8AtvMuAfv79j g7Qoi1WedM3xixsZEyW1qwn3oZtk59mFSd48CsMOHYggfSE3uaduQDIthUCcDRD3QGa5 rZOMZCCBXhUz4L1oEL+WTlNDUZ0PEr2VOtzwe2HWmdTNDM8MQwpW/xctqUD5xa6QIz/y wcLCVXuDu+WCf/WNpg7F9IzpG4uOBg66+jYXUDRbutsNVHJe0xoVMuC6ptZ6R86SguOf bRGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ainlo6eVBBDOO3XTaU60tOsE+w/jFwC10TRBMEegPq8=; b=M1nNMy7MrbJjgzJPS8mtqhcKJD2IGjTROuGUP2zdDngLE4l4lCt7t8zQ6T2I96vJ+5 BW1dacQVaOxQbHQbzpvwkVkgr74exC/Us4WH3JId5m2omvNdbp8yPLxVFcU2OVMilZ4b 0NF6FvDT+SKO4DNPLsQGEJh/XY9XW3N/GSXpnaCEpG/VOVtmHQGvKUq9pUxEljmmMnNo FRDlNZrnr0WFnpUQcnSiDwEou/0qvX+qQcl7d/UstSe3gwleN/O3aM8krNxURuHoOfDN vF/21MEpaGYaUBtJjPe1LTOc4rlU283eV1oYbuPHmUYAtpd2rte7ErA+Aw/DILGqwrOs q5Gw== X-Gm-Message-State: AMCzsaUHIi7WfmAFs39niMrnDSwixVcMGhtVSG6GXSH4ozvCXGjEnRwl 8ssDSGGA4B2L52iwC6rUXNxzoRWrTsRtZjv/fIsPZg== X-Google-Smtp-Source: ABhQp+TStXoqhnWcEHOoH9zJZg80rWVibx9K+iQAOWaGgxfBnodt7J3XlxCCxGEwbSEL3knO4GG0GpCz1D58ffswHPg= X-Received: by 10.107.46.216 with SMTP id u85mr15790128iou.136.1509911531590; Sun, 05 Nov 2017 11:52:11 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Sun, 5 Nov 2017 11:52:10 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c96d:b7be:45de:c872] In-Reply-To: <201711051938.vA5Jcpnc033399@repo.freebsd.org> References: <201711051938.vA5Jcpnc033399@repo.freebsd.org> From: Warner Losh Date: Sun, 5 Nov 2017 12:52:10 -0700 X-Google-Sender-Auth: DlSY2nVF-1zw_tSy3ONQdhuholg Message-ID: Subject: Re: svn commit: r325443 - in head: . lib/libclang_rt share/mk To: Ngie Cooper Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:52:12 -0000 On Sun, Nov 5, 2017 at 12:38 PM, Ngie Cooper wrote: > Author: ngie > Date: Sun Nov 5 19:38:51 2017 > New Revision: 325443 > URL: https://svnweb.freebsd.org/changeset/base/325443 > > Log: > Fix paths for cross-built versions of lib/libclang_rt and hardfloat arm > variants > > - Define TARGET_CPUARCH and use in libclang_rt as the basis for CRTARCH > > When cross-compiling, the wrong architecture was being embedded in the > libclang_rt binary filenames. It should be based on TARGET_ARCH > (target), not > MACHINE_ARCH (host). > > If TARGET_ARCH isn't defined (host-builds), fallback to MACHINE_ARCH. > > - Define CRTARCH to armhf when TARGET/TARGET_ARCH are set to arm/armv[67] > > TARGET_ABI/TARGET_CPU in Makefile.inc1 sets the ABI to gnueabihf, which > affects the clang lookup path per `getArchNameForCompilerRTLib(..)` in > contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp, so chase clang and > Linux's assumed naming convention for hard-float arm architectures. > > CROSSENV (in Makefile.inc1) sets CPUTYPE/MACHINE(_ARCH)? to the > TARGET*-relevant values when building the `libraries` target, so test > those variables instead. > > - Add OLD_FILES/OLD_LIBS entries for TARGET/TARGET_ARCH == arm/armv[67]. > This > impacts only arm/armv6 and arm/armv7. > > PR: 222925 > > Modified: > head/ObsoleteFiles.inc > head/lib/libclang_rt/Makefile.inc > head/share/mk/sys.mk > Directory Properties: > head/ (props changed) > > Modified: head/ObsoleteFiles.inc > ============================================================ > ================== > --- head/ObsoleteFiles.inc Sun Nov 5 19:25:06 2017 (r325442) > +++ head/ObsoleteFiles.inc Sun Nov 5 19:38:51 2017 (r325443) > @@ -38,6 +38,21 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20171105: fixing lib/libclang_rt CRTARCH for arm:armv[67]. > +.if ${MACHINE} == "arm" > +.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" > +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a > +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.a > +OLD_LIBS+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.so > +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a > +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-arm.a > +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-arm.a > +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-arm.a > +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-arm.a > +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt. > ubsan_standalone-arm.a > +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt. > ubsan_standalone_cxx-arm.a > +.endif > +.endif > # 20171104: libcap_random should be in /lib not in /usr/lib > OLD_LIBS+=usr/lib/libcap_random.so.0 > # 20171104: Casper can work only as shared library > > Modified: head/lib/libclang_rt/Makefile.inc > ============================================================ > ================== > --- head/lib/libclang_rt/Makefile.inc Sun Nov 5 19:25:06 2017 > (r325442) > +++ head/lib/libclang_rt/Makefile.inc Sun Nov 5 19:38:51 2017 > (r325443) > @@ -2,7 +2,14 @@ > > .include > > -CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} > +# NOTE: based on TARGET_ABI/TARGET_CPUTYPE, set in Makefile.inc1 . > +.if ${MACHINE} == "arm" > +.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" > +CRTARCH= armhf > +.endif > +.endif > + > +CRTARCH?= ${TARGET_CPUARCH:C/amd64/x86_64/} > CRTSRC= ${SRCTOP}/contrib/compiler-rt > > .PATH: ${CRTSRC}/lib > > Modified: head/share/mk/sys.mk > ============================================================ > ================== > --- head/share/mk/sys.mk Sun Nov 5 19:25:06 2017 (r325442) > +++ head/share/mk/sys.mk Sun Nov 5 19:38:51 2017 (r325443) > @@ -15,6 +15,11 @@ unix ?= We run FreeBSD, not UNIX. > # > __TO_CPUARCH=C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?( > eb)?/arm/:C/powerpc(64|spe)/powerpc/:C/riscv64(sf)?/riscv/ > MACHINE_CPUARCH=${MACHINE_ARCH:${__TO_CPUARCH}} > +.ifdef TARGET_ARCH > +TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}} > +.else > +TARGET_CPUARCH=${MACHINE_CPUARCH} > +.endif > .endif > Please back this out. This os wrong. TARGET_* is never to be defined outside of Makefile.inc1. There are a couple of places in the tree that have TARGET_ stuff defined that have a private meaning to the places in the tree where it is defined. It is never a global setting. Warner From owner-svn-src-all@freebsd.org Sun Nov 5 19:56:39 2017 Return-Path: Delivered-To: svn-src-all@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 B48EEE4FC01 for ; Sun, 5 Nov 2017 19:56:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (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 68E3468220 for ; Sun, 5 Nov 2017 19:56:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id p138so2953272itp.2 for ; Sun, 05 Nov 2017 11:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nnni17/uyd2H1RfauzF3vb/8ehvB7yfZya+gVbbY+2Q=; b=KOQi14701u7/y4sh7T8sQ1xPV3J0a3PFLmVfAHIwMlP1YpLtWoZDpkIq/M3/B83ScF pQKJKacUDkY0PaSL85BzADGbWoEOSmZSljhzTZgN4j7+qdKRRuW4K/uFA9ctp8nYbTOR dhPMXC/yO4ahpk0GBC/fWaykMq3v2OerSAvmvpvGuDQtNewIQUZRUrzWvdX3kHRlPfat FHIkBg4EivwcK/Nkx3esqZIJWbipaLSWJAY50p9EkBURlPib+GJA568H3Qn1wS9Y4M8g lIKQb9znncMYqwecocFDQibE1ecaqth5SmC5lSdGUziAshShZH6JsX5hfRoBcswZmr3F GoCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nnni17/uyd2H1RfauzF3vb/8ehvB7yfZya+gVbbY+2Q=; b=tjXInHpEHAtEJ9JkPHnmhw8096UUAjORBj5NhppbucWc9cTUHPdLHlUq2xOE+XXKAG H9uJG7UcmoQpKqZamu4u7QzPp8OR0vFcAcFgrDcRusiMa4l6mBTMWYgyhhwZVPaVYKOv CuDoUXp8Z53A2KY31XqV/DaS22q77YtKjHtWFe47/VSVSXpZDzO8ZxWCD3zwvXYsgYXg 9QUl3iU81poam7mqMg/mT4MjNjNpCK0cAoe6bLacBcGFj82tdpqSVMZYMYoOkoRUNCT7 3ADWbJxkk9duTD27PNccI1gRpq4fbobPEwFHAqmi/2nsFm/Z9+15Fy7XkNvUiTF15Pcx 8DdQ== X-Gm-Message-State: AJaThX7g99nicIBdsogVO4um/DdePKKR2yZAV6gX1tBQxgGUy9mYqCxH viXgY6Uufu1OzECUqdT8Ju16hb5clEI+E52hliInKw== X-Google-Smtp-Source: ABhQp+SrvekvB3eV4rC2QO5O3CLo+YIPWuAea/5/hjYLDLWAXuxrWSKwI8+k0dmJs4MSS/uQixYYTRauraPn41S7YWI= X-Received: by 10.36.94.129 with SMTP id h123mr5621270itb.64.1509911798701; Sun, 05 Nov 2017 11:56:38 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Sun, 5 Nov 2017 11:56:38 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c96d:b7be:45de:c872] In-Reply-To: References: <201711051938.vA5Jcpnc033399@repo.freebsd.org> From: Warner Losh Date: Sun, 5 Nov 2017 12:56:38 -0700 X-Google-Sender-Auth: qHccbQizBZgjQvqvp8nYNLWqcGU Message-ID: Subject: Re: svn commit: r325443 - in head: . lib/libclang_rt share/mk To: Ngie Cooper Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 19:56:39 -0000 On Sun, Nov 5, 2017 at 12:52 PM, Warner Losh wrote: > > > On Sun, Nov 5, 2017 at 12:38 PM, Ngie Cooper wrote: > >> Author: ngie >> Date: Sun Nov 5 19:38:51 2017 >> New Revision: 325443 >> URL: https://svnweb.freebsd.org/changeset/base/325443 >> >> Log: >> Fix paths for cross-built versions of lib/libclang_rt and hardfloat arm >> variants >> >> - Define TARGET_CPUARCH and use in libclang_rt as the basis for CRTARCH >> >> When cross-compiling, the wrong architecture was being embedded in the >> libclang_rt binary filenames. It should be based on TARGET_ARCH >> (target), not >> MACHINE_ARCH (host). >> > MACHINE_ARCH, btw, is always the target we are compiling for in the Makefiles that are not Makefile.inc1 at the top level. We do not define TARGET* anything below that. Warner > If TARGET_ARCH isn't defined (host-builds), fallback to MACHINE_ARCH. >> >> - Define CRTARCH to armhf when TARGET/TARGET_ARCH are set to >> arm/armv[67] >> >> TARGET_ABI/TARGET_CPU in Makefile.inc1 sets the ABI to gnueabihf, >> which >> affects the clang lookup path per `getArchNameForCompilerRTLib(..)` >> in >> contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp, so chase clang and >> Linux's assumed naming convention for hard-float arm architectures. >> >> CROSSENV (in Makefile.inc1) sets CPUTYPE/MACHINE(_ARCH)? to the >> TARGET*-relevant values when building the `libraries` target, so test >> those variables instead. >> >> - Add OLD_FILES/OLD_LIBS entries for TARGET/TARGET_ARCH == >> arm/armv[67]. This >> impacts only arm/armv6 and arm/armv7. >> >> PR: 222925 >> >> Modified: >> head/ObsoleteFiles.inc >> head/lib/libclang_rt/Makefile.inc >> head/share/mk/sys.mk >> Directory Properties: >> head/ (props changed) >> >> Modified: head/ObsoleteFiles.inc >> ============================================================ >> ================== >> --- head/ObsoleteFiles.inc Sun Nov 5 19:25:06 2017 (r325442) >> +++ head/ObsoleteFiles.inc Sun Nov 5 19:38:51 2017 (r325443) >> @@ -38,6 +38,21 @@ >> # xargs -n1 | sort | uniq -d; >> # done >> >> +# 20171105: fixing lib/libclang_rt CRTARCH for arm:armv[67]. >> +.if ${MACHINE} == "arm" >> +.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" >> +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan >> -preinit-arm.a >> +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.a >> +OLD_LIBS+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.so >> +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a >> +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-arm.a >> +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-arm.a >> +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-arm.a >> +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stat >> s_client-arm.a >> +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsa >> n_standalone-arm.a >> +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsa >> n_standalone_cxx-arm.a >> +.endif >> +.endif >> # 20171104: libcap_random should be in /lib not in /usr/lib >> OLD_LIBS+=usr/lib/libcap_random.so.0 >> # 20171104: Casper can work only as shared library >> >> Modified: head/lib/libclang_rt/Makefile.inc >> ============================================================ >> ================== >> --- head/lib/libclang_rt/Makefile.inc Sun Nov 5 19:25:06 2017 >> (r325442) >> +++ head/lib/libclang_rt/Makefile.inc Sun Nov 5 19:38:51 2017 >> (r325443) >> @@ -2,7 +2,14 @@ >> >> .include >> >> -CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} >> +# NOTE: based on TARGET_ABI/TARGET_CPUTYPE, set in Makefile.inc1 . >> +.if ${MACHINE} == "arm" >> +.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" >> +CRTARCH= armhf >> +.endif >> +.endif >> + >> +CRTARCH?= ${TARGET_CPUARCH:C/amd64/x86_64/} >> CRTSRC= ${SRCTOP}/contrib/compiler-rt >> >> .PATH: ${CRTSRC}/lib >> >> Modified: head/share/mk/sys.mk >> ============================================================ >> ================== >> --- head/share/mk/sys.mk Sun Nov 5 19:25:06 2017 (r325442) >> +++ head/share/mk/sys.mk Sun Nov 5 19:38:51 2017 (r325443) >> @@ -15,6 +15,11 @@ unix ?= We run FreeBSD, not UNIX. >> # >> __TO_CPUARCH=C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?( >> eb)?/arm/:C/powerpc(64|spe)/powerpc/:C/riscv64(sf)?/riscv/ >> MACHINE_CPUARCH=${MACHINE_ARCH:${__TO_CPUARCH}} >> +.ifdef TARGET_ARCH >> +TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}} >> +.else >> +TARGET_CPUARCH=${MACHINE_CPUARCH} >> +.endif >> .endif >> > > Please back this out. This os wrong. TARGET_* is never to be defined > outside of Makefile.inc1. There are a couple of places in the tree that > have TARGET_ stuff defined that have a private meaning to the places in the > tree where it is defined. It is never a global setting. > > Warner > > From owner-svn-src-all@freebsd.org Sun Nov 5 20:01:01 2017 Return-Path: Delivered-To: svn-src-all@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 B4A21E4FD31; Sun, 5 Nov 2017 20:01:01 +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 8F24C6852D; Sun, 5 Nov 2017 20:01:01 +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 vA5K10NO042018; Sun, 5 Nov 2017 20:01:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5K107E042015; Sun, 5 Nov 2017 20:01:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711052001.vA5K107E042015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 20:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325446 - in head: . lib/libclang_rt share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: . lib/libclang_rt share/mk X-SVN-Commit-Revision: 325446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 20:01:01 -0000 Author: ngie Date: Sun Nov 5 20:01:00 2017 New Revision: 325446 URL: https://svnweb.freebsd.org/changeset/base/325446 Log: Revert r325443 Despite the fact that it's a working solution, it doesn't follow the design philosophy of only doing TARGET_* in Makefile.inc1 and special locations in the source tree. PR: 222925 Requested by: imp Modified: head/ObsoleteFiles.inc head/lib/libclang_rt/Makefile.inc head/share/mk/sys.mk Directory Properties: head/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 5 19:52:11 2017 (r325445) +++ head/ObsoleteFiles.inc Sun Nov 5 20:01:00 2017 (r325446) @@ -38,21 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20171105: fixing lib/libclang_rt CRTARCH for arm:armv[67]. -.if ${MACHINE} == "arm" -.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.a -OLD_LIBS+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.so -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-arm.a -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-arm.a -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-arm.a -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-arm.a -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a -.endif -.endif # 20171104: libcap_random should be in /lib not in /usr/lib OLD_LIBS+=usr/lib/libcap_random.so.0 # 20171104: Casper can work only as shared library Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Sun Nov 5 19:52:11 2017 (r325445) +++ head/lib/libclang_rt/Makefile.inc Sun Nov 5 20:01:00 2017 (r325446) @@ -2,14 +2,7 @@ .include -# NOTE: based on TARGET_ABI/TARGET_CPUTYPE, set in Makefile.inc1 . -.if ${MACHINE} == "arm" -.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" -CRTARCH= armhf -.endif -.endif - -CRTARCH?= ${TARGET_CPUARCH:C/amd64/x86_64/} +CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} CRTSRC= ${SRCTOP}/contrib/compiler-rt .PATH: ${CRTSRC}/lib Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sun Nov 5 19:52:11 2017 (r325445) +++ head/share/mk/sys.mk Sun Nov 5 20:01:00 2017 (r325446) @@ -15,11 +15,6 @@ unix ?= We run FreeBSD, not UNIX. # __TO_CPUARCH=C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?(eb)?/arm/:C/powerpc(64|spe)/powerpc/:C/riscv64(sf)?/riscv/ MACHINE_CPUARCH=${MACHINE_ARCH:${__TO_CPUARCH}} -.ifdef TARGET_ARCH -TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}} -.else -TARGET_CPUARCH=${MACHINE_CPUARCH} -.endif .endif __DEFAULT_YES_OPTIONS+= \ From owner-svn-src-all@freebsd.org Sun Nov 5 20:03:58 2017 Return-Path: Delivered-To: svn-src-all@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 D6941E4FF83; Sun, 5 Nov 2017 20:03:58 +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 A4510687CA; Sun, 5 Nov 2017 20:03:58 +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 vA5K3vfD045749; Sun, 5 Nov 2017 20:03:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5K3vNF045748; Sun, 5 Nov 2017 20:03:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711052003.vA5K3vNF045748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 Nov 2017 20:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325447 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 325447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 20:03:59 -0000 Author: kib Date: Sun Nov 5 20:03:57 2017 New Revision: 325447 URL: https://svnweb.freebsd.org/changeset/base/325447 Log: Zero the structure instead of the pointer to it. Reported by: Don Morris MFC after: 4 days Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Nov 5 20:01:00 2017 (r325446) +++ head/sys/amd64/amd64/pmap.c Sun Nov 5 20:03:57 2017 (r325447) @@ -2915,7 +2915,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l PG_G = PG_A = PG_M = PG_RW = 0; SLIST_INIT(&free); bzero(&pc_marker_b, sizeof(pc_marker_b)); - bzero(&pc_marker_end, sizeof(pc_marker_end)); + bzero(&pc_marker_end_b, sizeof(pc_marker_end_b)); pc_marker = (struct pv_chunk *)&pc_marker_b; pc_marker_end = (struct pv_chunk *)&pc_marker_end_b; From owner-svn-src-all@freebsd.org Sun Nov 5 20:10:06 2017 Return-Path: Delivered-To: svn-src-all@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 18A5EE501AC for ; Sun, 5 Nov 2017 20:10:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::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 D166468B3D for ; Sun, 5 Nov 2017 20:10:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id n195so2324367itg.1 for ; Sun, 05 Nov 2017 12:10:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9qRtGYR+avo7kqpeBrT7jlF+F6XveeL/+VQImGw32HM=; b=gVphr5gPb/6z/vGW37cU33NrUH8HaVKChVVKvopmd/tAsp3dW+5+cADFU0QmKorBjO RCtevNloRImTW8xTyMJheIiusmwDdzVoCHz0tOG+6BwiqHOgzKSLLX0+4UbdAR2Apwgs AteVU/9zdsP5gK6SROA67YyjknmVk07tbQKVvNzCf8KaRveiryiVFC9k5bQIm4tdgOM0 blehAjznIQcZYGgCGpS6HeEgXg+0IOeo+l/lXwXPAjO7ae/Yj/4QsDbFcTVgLISp62ie nfaSo4TxyHWFJvniyxMK5zkpp4fuWIWA+iFiQuHaOo4Az/NtUYI3tdn+e/K/7DUEjAPV kvPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9qRtGYR+avo7kqpeBrT7jlF+F6XveeL/+VQImGw32HM=; b=WtbPD401x5cxPo/nL+bWjEU8iFMl11DuAn998XwupHTeGMrQzUfwXOSd/FecSO+S5n voonVuLxsMVdZktMr6OJZparjrf3t4fM8StCBmQOfRZaEPB6rxHOiY3oiV/+rWWA2/8O Iw2x2oySm8sPyoG1BsqTS/4EbU+IdRTY5Ln7jsPdQy3w/wCFBAQlxAFAA10gaKvA0snk OwpGL6phFxSN6brznfny36UvYkKi6xM6HigJ65P/dTdUURLSmo4E4Nvg2L8A91fQ3mpm 22qnHjl7vVSJU2gvYUU1v68L88/6IJvlvGhUUynzDbuTVFc61Q7qbW3ZwGNRGILZRPCy oV1A== X-Gm-Message-State: AJaThX6MUGFz87/Be1/V6vPCJZs4F3bDMnVYq3GwkAJR1cuLXAbK0zDC XstIDUjQ995w+PAntP6jcvWNoQyXVMfiZuandFp0CA== X-Google-Smtp-Source: ABhQp+Rd7yOkarp05FABcqf3qzXUtE892Bd4wQnEgExK46c2U0F3i9esxC55tK1Hl0pyUn81snevKfuKrzytd7uqQtU= X-Received: by 10.36.118.81 with SMTP id z78mr6804981itb.97.1509912605182; Sun, 05 Nov 2017 12:10:05 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Sun, 5 Nov 2017 12:10:04 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c96d:b7be:45de:c872] In-Reply-To: <201711052001.vA5K107E042015@repo.freebsd.org> References: <201711052001.vA5K107E042015@repo.freebsd.org> From: Warner Losh Date: Sun, 5 Nov 2017 13:10:04 -0700 X-Google-Sender-Auth: ocdY7o4TKF-SQe9xeut6aNQNsIM Message-ID: Subject: Re: svn commit: r325446 - in head: . lib/libclang_rt share/mk To: Ngie Cooper Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 20:10:06 -0000 On Sun, Nov 5, 2017 at 1:01 PM, Ngie Cooper wrote: > Author: ngie > Date: Sun Nov 5 20:01:00 2017 > New Revision: 325446 > URL: https://svnweb.freebsd.org/changeset/base/325446 > > Log: > Revert r325443 > > Despite the fact that it's a working solution, it doesn't follow the > design philosophy of only doing TARGET_* in Makefile.inc1 and special locations > in > the source tree. > Except for the things it could break, sure. PR: 222925 > Requested by: imp > > Modified: > head/ObsoleteFiles.inc > head/lib/libclang_rt/Makefile.inc > head/share/mk/sys.mk > Directory Properties: > head/ (props changed) > > Modified: head/ObsoleteFiles.inc > ============================================================ > ================== > --- head/ObsoleteFiles.inc Sun Nov 5 19:52:11 2017 (r325445) > +++ head/ObsoleteFiles.inc Sun Nov 5 20:01:00 2017 (r325446) > @@ -38,21 +38,6 @@ > # xargs -n1 | sort | uniq -d; > # done > > -# 20171105: fixing lib/libclang_rt CRTARCH for arm:armv[67]. > -.if ${MACHINE} == "arm" > -.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" > This was fine. > -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a > -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.a > -OLD_LIBS+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.so > -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a > -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-arm.a > -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-arm.a > -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-arm.a > -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-arm.a > -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt. > ubsan_standalone-arm.a > -OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt. > ubsan_standalone_cxx-arm.a > -.endif > -.endif > # 20171104: libcap_random should be in /lib not in /usr/lib > OLD_LIBS+=usr/lib/libcap_random.so.0 > # 20171104: Casper can work only as shared library > > Modified: head/lib/libclang_rt/Makefile.inc > ============================================================ > ================== > --- head/lib/libclang_rt/Makefile.inc Sun Nov 5 19:52:11 2017 > (r325445) > +++ head/lib/libclang_rt/Makefile.inc Sun Nov 5 20:01:00 2017 > (r325446) > @@ -2,14 +2,7 @@ > > .include > > -# NOTE: based on TARGET_ABI/TARGET_CPUTYPE, set in Makefile.inc1 . > -.if ${MACHINE} == "arm" > -.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" > -CRTARCH= armhf > -.endif > -.endif > - > -CRTARCH?= ${TARGET_CPUARCH:C/amd64/x86_64/} > +CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} > CRTSRC= ${SRCTOP}/contrib/compiler-r > It worked because you tested MACHINE* here. It further worked because you polluted things with TARGET_CPUARCH based on MACHINE_CPUARCH, that is, everything was ultimately derived from MACHINE* variables... But you shouldn't test MACHINE here at all (it's only for kernel stuff, and this isn't kernel stuff). Thankfully, it's completely redundant here, and can be removed completely. With that, if you retain the current CRTARCH line, but turn it into ?= it should be good. You'll need to fix the comments, or better yet, just remove them. .PATH: ${CRTSRC}/lib > > Modified: head/share/mk/sys.mk > ============================================================ > ================== > --- head/share/mk/sys.mk Sun Nov 5 19:52:11 2017 (r325445) > +++ head/share/mk/sys.mk Sun Nov 5 20:01:00 2017 (r325446) > @@ -15,11 +15,6 @@ unix ?= We run FreeBSD, not UNIX. > # > __TO_CPUARCH=C/mips(n32|64)?(el)?(hf)?/mips/:C/arm(v[67])?( > eb)?/arm/:C/powerpc(64|spe)/powerpc/:C/riscv64(sf)?/riscv/ > MACHINE_CPUARCH=${MACHINE_ARCH:${__TO_CPUARCH}} > -.ifdef TARGET_ARCH > -TARGET_CPUARCH=${TARGET_ARCH:${__TO_CPUARCH}} > -.else > -TARGET_CPUARCH=${MACHINE_CPUARCH} > -.endif > .endif > This part should not return. Warner From owner-svn-src-all@freebsd.org Sun Nov 5 20:15:13 2017 Return-Path: Delivered-To: svn-src-all@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 4A256E5040F; Sun, 5 Nov 2017 20:15:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 B309D6954C; Sun, 5 Nov 2017 20:15:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA5KF3Sc089089 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 5 Nov 2017 22:15:03 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA5KF3Sc089089 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA5KF3qD089088; Sun, 5 Nov 2017 22:15:03 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 5 Nov 2017 22:15:03 +0200 From: Konstantin Belousov To: Ian Lepore Cc: cem@freebsd.org, Andriy Gapon , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r325386 - head/sys/kern Message-ID: <20171105201503.GH2566@kib.kiev.ua> References: <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> <20171105190214.GG2566@kib.kiev.ua> <20f694b3-c60c-1b6d-76a1-2ef14cbdd698@FreeBSD.org> <1509910670.99235.70.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1509910670.99235.70.camel@freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 20:15:13 -0000 On Sun, Nov 05, 2017 at 12:37:50PM -0700, Ian Lepore wrote: > IMO, the only reason ASSERT-style macros exist is to hide the > conditional-on-build-type part of the operation. šThat is, to avoid > having #ifdef INVARIANTS scattered everywhere. bde' point is that KASSERT() is badly designed, and I agree with him. Now we could at least remove the () around the message formatting part, but it is too late. > > Creating a macro to generate always-on error detection and reporting > code just because there exists a macro to do so conditionally seems to > turn the world on its head. I agree with this statement. if()panic(); construct is good enough, IMO. From owner-svn-src-all@freebsd.org Sun Nov 5 20:26:25 2017 Return-Path: Delivered-To: svn-src-all@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 E6382E506DC; Sun, 5 Nov 2017 20:26:25 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x230.google.com (mail-qt0-x230.google.com [IPv6:2607:f8b0:400d:c0d::230]) (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 8C994699BF; Sun, 5 Nov 2017 20:26:25 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x230.google.com with SMTP id z28so8688578qtz.13; Sun, 05 Nov 2017 12:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WlgZAS9bw2bcdLVQFJewOzv5HoRQwZu28J2SWtrpgoE=; b=n/LyFm8FivUfojnu8D+drH3xu1R/Gg3CQgkomM1LuNqm8ttyp8rP0YUx7cOpeBEsoW Pr03r3oMjNjD5mQXTowu8s/vte6nUEO5NbfTcbq+HGZsg7PHy7yLmFDdecGhpKRh3A1j Jtsl/nDaKjaUKsWeefCoeUsKzFg60k5tgilBiTgL8hl2r48du2c0uZY9zvihuqzeDL8z V88v5ZK3Dp1R7QtFPsXEvn6p9Ui6cOgpIpSLv+XzF3f+r/yNNtyhxL05h4eEpkzM1N0N rFplLx9t9GGmKugMllfkzHCaCWlfNVX8Ohm5eazxzxqLgdtHtmIdxMOTjhbXsDhZKDWE b50g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WlgZAS9bw2bcdLVQFJewOzv5HoRQwZu28J2SWtrpgoE=; b=g7csL05CeGqxoUGinJnwnwNw3xvd2aQRffs46bSm4tNfHELKyw7SANRiGRJAPcB1KB ryfcZPfi/PpAs7hV9OtHfupK1k1Iysl2Njolx8NA9BD/1OK07oGVsI43hD4Qu3Olk1sz 6rk8Trt97s6rhddt7lHFLHWxDIibaEPhzYBAduWmmBw06IHWO577wqhhqOHL33hCCKqe InFJgxZN/ynUBmogoYKSpAuLJQVB8zU4kv1vPq2Pj+9BmV0xuYQFhudV3oSv+l5Ot0jp RNf1+2aQdC/ks6YhVqtzKJTJQcNRKYLHVjAapazQX7hlhl8wAz3FlMP0c4T5aDQ0oKbY WkKQ== X-Gm-Message-State: AMCzsaWu6t3iPPOHOgNCOr2HmoKt3rS8sRoYgzozGH58KOJSrBMJpkww shNg7LX2ksW3MArIXVH2rDnlagu3i84DRcrQoDE= X-Google-Smtp-Source: ABhQp+Snale94xl1WHNiD+HhA7AV9ECuo+oMOpzxwU4Cz1nppMURhAYNlScBlxcGNQqexrIzpov/jV6rQh3zDDLHO+4= X-Received: by 10.200.57.55 with SMTP id s52mr20316982qtb.129.1509913584788; Sun, 05 Nov 2017 12:26:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.52.198 with HTTP; Sun, 5 Nov 2017 12:26:24 -0800 (PST) In-Reply-To: <20171105201503.GH2566@kib.kiev.ua> References: <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> <20171105190214.GG2566@kib.kiev.ua> <20f694b3-c60c-1b6d-76a1-2ef14cbdd698@FreeBSD.org> <1509910670.99235.70.camel@freebsd.org> <20171105201503.GH2566@kib.kiev.ua> From: Mateusz Guzik Date: Sun, 5 Nov 2017 21:26:24 +0100 Message-ID: Subject: Re: svn commit: r325386 - head/sys/kern To: Konstantin Belousov Cc: Ian Lepore , src-committers , "Conrad E. Meyer" , "svn-src-all@freebsd.org" , Andriy Gapon , "svn-src-head@freebsd.org" , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 20:26:26 -0000 On Sun, Nov 5, 2017 at 9:15 PM, Konstantin Belousov wrote: > On Sun, Nov 05, 2017 at 12:37:50PM -0700, Ian Lepore wrote: > > IMO, the only reason ASSERT-style macros exist is to hide the > > conditional-on-build-type part of the operation. That is, to avoid > > having #ifdef INVARIANTS scattered everywhere. > bde' point is that KASSERT() is badly designed, and I agree with him. > Now we could at least remove the () around the message formatting part, > but it is too late. > > > > > Creating a macro to generate always-on error detection and reporting > > code just because there exists a macro to do so conditionally seems to > > turn the world on its head. > I agree with this statement. if()panic(); construct is good enough, IMO. > I don't like our panic messages whatsoever, they are quite often not informative. For instance consider: if (obj->foo < bar) panic("bad foo %d, have fun looking for bar"); Instead a macro akin to PASS(obj->foo, <, bar, "obj %p", obj); can expand itself to stringify the first 3 terms and also show the compared values. Saves on boiler-plate written by hand. I think *all* panics should be accompanied with a linux's oops-like dump. I'm not volunteering for any of it though. -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sun Nov 5 20:28:29 2017 Return-Path: Delivered-To: svn-src-all@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 D9407E50775; Sun, 5 Nov 2017 20:28:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B496469B1E; Sun, 5 Nov 2017 20:28:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5KSSDn054486; Sun, 5 Nov 2017 20:28:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5KSSlF054484; Sun, 5 Nov 2017 20:28:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201711052028.vA5KSSlF054484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 5 Nov 2017 20:28: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: r325448 - stable/10/sys/fs/nfsserver X-SVN-Group: stable-10 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/10/sys/fs/nfsserver X-SVN-Commit-Revision: 325448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 20:28:30 -0000 Author: rmacklem Date: Sun Nov 5 20:28:28 2017 New Revision: 325448 URL: https://svnweb.freebsd.org/changeset/base/325448 Log: MFC: r324639 Fix the client IP address reported by nfsdumpstate for 64bit arch and NFSv4.1. The client IP address was not being reported for some NFSv4 mounts by nfsdumpstate. Upon investigation, two problems were found for mounts using IPv4. One was that the code (originally written and tested on i386) assumed that a "u_long" was a "uint32_t" and would exactly store an IPv4 host address. Not correct for 64bit arches. Also, for NFSv4.1 mounts, the field was not being filled in. This was basically correct, because NFSv4.1 does not use a callback address. However, it meant that nfsdumpstate could not report the client IP addr. This patch should fix both of these issues. For IPv6, the address will still not be reported. The original NFSv4 RFC only specified IPv4 callback addresses. I think this has changed and, if so, a future commit to fix reporting of IPv6 addresses will be needed. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Sun Nov 5 20:03:57 2017 (r325447) +++ stable/10/sys/fs/nfsserver/nfs_nfsdserv.c Sun Nov 5 20:28:28 2017 (r325448) @@ -3700,6 +3700,7 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused uint32_t sp4type, v41flags; uint64_t owner_minor; struct timespec verstime; + struct sockaddr_in *sad, *rad; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -3723,6 +3724,13 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused NFSINITSOCKMUTEX(&clp->lc_req.nr_mtx); NFSSOCKADDRALLOC(clp->lc_req.nr_nam); NFSSOCKADDRSIZE(clp->lc_req.nr_nam, sizeof (struct sockaddr_in)); + sad = NFSSOCKADDR(nd->nd_nam, struct sockaddr_in *); + rad = NFSSOCKADDR(clp->lc_req.nr_nam, struct sockaddr_in *); + rad->sin_family = AF_INET; + rad->sin_addr.s_addr = 0; + rad->sin_port = 0; + if (sad->sin_family == AF_INET) + rad->sin_addr.s_addr = sad->sin_addr.s_addr; clp->lc_req.nr_cred = NULL; NFSBCOPY(verf, clp->lc_verf, NFSX_VERF); clp->lc_idlen = idlen; Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sun Nov 5 20:03:57 2017 (r325447) +++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c Sun Nov 5 20:28:28 2017 (r325448) @@ -3888,11 +3888,11 @@ nfsrv_getclientipaddr(struct nfsrv_descript *nd, struc u_char protocol[5], addr[24]; int error = 0, cantparse = 0; union { - u_long ival; + in_addr_t ival; u_char cval[4]; } ip; union { - u_short sval; + in_port_t sval; u_char cval[2]; } port; @@ -3986,8 +3986,10 @@ nfsrv_getclientipaddr(struct nfsrv_descript *nd, struc } if (cantparse) { sad = NFSSOCKADDR(nd->nd_nam, struct sockaddr_in *); - rad->sin_addr.s_addr = sad->sin_addr.s_addr; - rad->sin_port = 0x0; + if (sad->sin_family == AF_INET) { + rad->sin_addr.s_addr = sad->sin_addr.s_addr; + rad->sin_port = 0x0; + } clp->lc_program = 0; } nfsmout: From owner-svn-src-all@freebsd.org Sun Nov 5 20:38:42 2017 Return-Path: Delivered-To: svn-src-all@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 24C96E50BA1; Sun, 5 Nov 2017 20:38:42 +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 CB5A469FE9; Sun, 5 Nov 2017 20:38:41 +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 vA5Kcet0058469; Sun, 5 Nov 2017 20:38:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5KcekG058467; Sun, 5 Nov 2017 20:38:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711052038.vA5KcekG058467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 20:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325449 - in head: . lib/libclang_rt X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: . lib/libclang_rt X-SVN-Commit-Revision: 325449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 20:38:42 -0000 Author: ngie Date: Sun Nov 5 20:38:40 2017 New Revision: 325449 URL: https://svnweb.freebsd.org/changeset/base/325449 Log: Choose a simpler, more philosophically correct version for CRTARCH with armv[67] This is a rework of r325443. PR: 222925 Tested with: make buildenv with appropriate TARGET/TARGET_ARCH pairs Modified: head/ObsoleteFiles.inc head/lib/libclang_rt/Makefile.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 5 20:28:28 2017 (r325448) +++ head/ObsoleteFiles.inc Sun Nov 5 20:38:40 2017 (r325449) @@ -38,6 +38,21 @@ # xargs -n1 | sort | uniq -d; # done +# 20171105: fixing lib/libclang_rt CRTARCH for arm:armv[67]. +.if ${MACHINE} == "arm" +.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.a +OLD_LIBS+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.safestack-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +.endif +.endif # 20171104: libcap_random should be in /lib not in /usr/lib OLD_LIBS+=usr/lib/libcap_random.so.0 # 20171104: Casper can work only as shared library Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Sun Nov 5 20:28:28 2017 (r325448) +++ head/lib/libclang_rt/Makefile.inc Sun Nov 5 20:38:40 2017 (r325449) @@ -2,7 +2,12 @@ .include -CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} +.if ${MACHINE} == "arm" +.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" +CRTARCH= armhf +.endif +.endif +CRTARCH?= ${MACHINE_CPUARCH:C/amd64/x86_64/} CRTSRC= ${SRCTOP}/contrib/compiler-rt .PATH: ${CRTSRC}/lib From owner-svn-src-all@freebsd.org Sun Nov 5 21:43:27 2017 Return-Path: Delivered-To: svn-src-all@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 DA04BE52FC8; Sun, 5 Nov 2017 21:43:27 +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 A71EF6D96E; Sun, 5 Nov 2017 21:43:27 +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 vA5LhQpL089800; Sun, 5 Nov 2017 21:43:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5LhQK9089799; Sun, 5 Nov 2017 21:43:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711052143.vA5LhQK9089799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 21:43:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325450 - head/bin/rm X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/bin/rm X-SVN-Commit-Revision: 325450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 21:43:28 -0000 Author: ngie Date: Sun Nov 5 21:43:26 2017 New Revision: 325450 URL: https://svnweb.freebsd.org/changeset/base/325450 Log: Fix cosmetic nit when printing out "override $mode" and "$owner/$group ..." The wrong index was being checked for == ' ' in the resulting stringified mode from strmode(3) -- it should have been the 11th value, not the 10th. MFC after: 3 days PR: 76711 Submitted by: Vasil Dimov Modified: head/bin/rm/rm.c Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Sun Nov 5 20:38:40 2017 (r325449) +++ head/bin/rm/rm.c Sun Nov 5 21:43:26 2017 (r325450) @@ -515,7 +515,7 @@ check(const char *path, const char *name, struct stat "%s: -P was specified, but file is not writable", path); (void)fprintf(stderr, "override %s%s%s/%s %s%sfor %s? ", - modep + 1, modep[9] == ' ' ? "" : " ", + modep + 1, modep[10] == ' ' ? "" : " ", user_from_uid(sp->st_uid, 0), group_from_gid(sp->st_gid, 0), *flagsp ? flagsp : "", *flagsp ? " " : "", From owner-svn-src-all@freebsd.org Sun Nov 5 21:59:40 2017 Return-Path: Delivered-To: svn-src-all@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 8FA7FE533E6; Sun, 5 Nov 2017 21:59:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2976E0E5; Sun, 5 Nov 2017 21:59:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5Lxdtq094282; Sun, 5 Nov 2017 21:59:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5Lxdr3094281; Sun, 5 Nov 2017 21:59:39 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711052159.vA5Lxdr3094281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Nov 2017 21:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325451 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 21:59:40 -0000 Author: mjg Date: Sun Nov 5 21:59:39 2017 New Revision: 325451 URL: https://svnweb.freebsd.org/changeset/base/325451 Log: namecache: skip locking in cache_lookup_nomakeentry if there is no entry Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Nov 5 21:43:26 2017 (r325450) +++ head/sys/kern/vfs_cache.c Sun Nov 5 21:59:39 2017 (r325451) @@ -1163,6 +1163,9 @@ retry_dotdot: hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); blp = HASH2BUCKETLOCK(hash); retry: + if (LIST_EMPTY(NCHHASH(hash))) + goto out_no_entry; + rw_rlock(blp); LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { @@ -1175,10 +1178,7 @@ retry: /* We failed to find an entry */ if (ncp == NULL) { rw_runlock(blp); - SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, - NULL); - counter_u64_add(nummisszap, 1); - return (0); + goto out_no_entry; } counter_u64_add(numposzaps, 1); @@ -1190,6 +1190,10 @@ retry: goto retry; } cache_free(ncp); + return (0); +out_no_entry: + SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, NULL); + counter_u64_add(nummisszap, 1); return (0); } From owner-svn-src-all@freebsd.org Sun Nov 5 22:00:56 2017 Return-Path: Delivered-To: svn-src-all@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 41567E53484; Sun, 5 Nov 2017 22:00:56 +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 033086E29A; Sun, 5 Nov 2017 22:00:55 +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 vA5M0t0Q094414; Sun, 5 Nov 2017 22:00:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5M0sx2094408; Sun, 5 Nov 2017 22:00:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711052200.vA5M0sx2094408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 5 Nov 2017 22:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325452 - in head: . rescue/rescue sbin sbin/badsect sys/mips/rmi usr.sbin/crunch/examples X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: . rescue/rescue sbin sbin/badsect sys/mips/rmi usr.sbin/crunch/examples X-SVN-Commit-Revision: 325452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:00:56 -0000 Author: kib Date: Sun Nov 5 22:00:54 2017 New Revision: 325452 URL: https://svnweb.freebsd.org/changeset/base/325452 Log: Remove badsect(8). Failure modes of the modern (that is, produced in the last 25 years) hard drives and SSDs made the utility outdated. Since the kernel interface to support it was removed in r324853, cut the userspace remnants as well. Discussed with: bde (who does not like the removal) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Deleted: head/sbin/badsect/ Modified: head/ObsoleteFiles.inc head/rescue/rescue/Makefile head/sbin/Makefile head/sys/mips/rmi/rootfs_list.txt head/usr.sbin/crunch/examples/fixit.conf head/usr.sbin/crunch/examples/really-big.conf Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 5 21:59:39 2017 (r325451) +++ head/ObsoleteFiles.inc Sun Nov 5 22:00:54 2017 (r325452) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20171108: badsect(8) removal +OLD_FILES+=sbin/badsect +OLD_FILES+=rescue/badsect +OLD_FILES+=usr/share/man/man8/badsect.8.gz # 20171105: fixing lib/libclang_rt CRTARCH for arm:armv[67]. .if ${MACHINE} == "arm" .if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Sun Nov 5 21:59:39 2017 (r325451) +++ head/rescue/rescue/Makefile Sun Nov 5 22:00:54 2017 (r325452) @@ -85,7 +85,7 @@ CRUNCH_SUPPRESS_LINK_-tcsh= 1 # headers in addition to the standard 'paths.h' header. # CRUNCH_SRCDIRS+= sbin -CRUNCH_PROGS_sbin= badsect \ +CRUNCH_PROGS_sbin= \ camcontrol clri devfs dmesg dump \ dumpfs dumpon fsck fsck_ffs fsck_msdosfs fsdb \ fsirand gbde geom ifconfig init \ Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Sun Nov 5 21:59:39 2017 (r325451) +++ head/sbin/Makefile Sun Nov 5 22:00:54 2017 (r325452) @@ -6,7 +6,6 @@ # XXX MISSING: icheck ncheck SUBDIR=adjkerntz \ - badsect \ camcontrol \ clri \ comcontrol \ Modified: head/sys/mips/rmi/rootfs_list.txt ============================================================================== --- head/sys/mips/rmi/rootfs_list.txt Sun Nov 5 21:59:39 2017 (r325451) +++ head/sys/mips/rmi/rootfs_list.txt Sun Nov 5 22:00:54 2017 (r325452) @@ -448,7 +448,6 @@ ./sbin ./sbin/adjkerntz ./sbin/atacontrol -./sbin/badsect ./sbin/bsdlabel ./sbin/camcontrol ./sbin/ccdconfig Modified: head/usr.sbin/crunch/examples/fixit.conf ============================================================================== --- head/usr.sbin/crunch/examples/fixit.conf Sun Nov 5 21:59:39 2017 (r325451) +++ head/usr.sbin/crunch/examples/fixit.conf Sun Nov 5 22:00:54 2017 (r325452) @@ -1,4 +1,5 @@ # fixit.conf - put in anything we think we might want on a fixit floppy +# $FreeBSD$ # first, we list the source dirs that our programs reside in. These are # searched in order listed to find the dir containing each program. @@ -21,7 +22,7 @@ ln sh -sh # init invokes the shell this way # /sbin stuff -progs badsect chown clri disklabel dump dmesg fdisk fsck ifconfig init +progs chown clri disklabel dump dmesg fdisk fsck ifconfig init progs mknod mount newfs ping reboot restore swapon umount ln dump rdump ln restore rrestore Modified: head/usr.sbin/crunch/examples/really-big.conf ============================================================================== --- head/usr.sbin/crunch/examples/really-big.conf Sun Nov 5 21:59:39 2017 (r325451) +++ head/usr.sbin/crunch/examples/really-big.conf Sun Nov 5 22:00:54 2017 (r325452) @@ -23,7 +23,7 @@ ln sh -sh srcdirs /usr/src/sbin -progs badsect bim clri disklabel dmesg dump dumpfs fdisk fsck halt +progs bim clri disklabel dmesg dump dumpfs fdisk fsck halt progs ifconfig init mknod modload modunload mount mount_isofs progs mount_lofs mount_msdosfs mountd progs newfs nfsd nfsiod ping quotacheck reboot restore route routed savecore From owner-svn-src-all@freebsd.org Sun Nov 5 22:10:00 2017 Return-Path: Delivered-To: svn-src-all@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 B3592E536B3; Sun, 5 Nov 2017 22:10:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75AC36E710; Sun, 5 Nov 2017 22:10:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5M9xku098534; Sun, 5 Nov 2017 22:09:59 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5M9xPD098533; Sun, 5 Nov 2017 22:09:59 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711052209.vA5M9xPD098533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 5 Nov 2017 22:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325453 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 325453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:10:00 -0000 Author: jhibbits Date: Sun Nov 5 22:09:59 2017 New Revision: 325453 URL: https://svnweb.freebsd.org/changeset/base/325453 Log: Fix an off-by-one error missed in the initial commit of this driver When the segment count is > 16 it spills into an 'indirect descriptor list', which immediately follows the main table, but the indirect list is entry 15, so needs to be skipped for the general list. Modified: head/sys/powerpc/mpc85xx/fsl_sata.c Modified: head/sys/powerpc/mpc85xx/fsl_sata.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sata.c Sun Nov 5 22:00:54 2017 (r325452) +++ head/sys/powerpc/mpc85xx/fsl_sata.c Sun Nov 5 22:09:59 2017 (r325453) @@ -988,11 +988,12 @@ fsl_sata_dmasetprd(void *arg, bus_dma_segment_t *segs, prd[j].dba = FSL_SATA_CTP_BUS(ch, slot) + FSL_SATA_PRD_OFFSET(j+1); j++; + extlen = 0; } len = segs[i].ds_len; len = roundup2(len, sizeof(uint32_t)); - prd[i].dba = htole32((uint32_t)segs[i].ds_addr); - prd[i].dwc_flg = htole32(FSL_SATA_PRD_SNOOP | len); + prd[j].dba = htole32((uint32_t)segs[i].ds_addr); + prd[j].dwc_flg = htole32(FSL_SATA_PRD_SNOOP | len); slot->ttl += len; if (j > FSL_SATA_PRD_MAX_DIRECT) extlen += len; From owner-svn-src-all@freebsd.org Sun Nov 5 22:28:41 2017 Return-Path: Delivered-To: svn-src-all@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 08FDCE53B14; Sun, 5 Nov 2017 22:28:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1DB86EFF6; Sun, 5 Nov 2017 22:28:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5MSd57006972; Sun, 5 Nov 2017 22:28:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5MSdqH006971; Sun, 5 Nov 2017 22:28:39 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711052228.vA5MSdqH006971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Nov 2017 22:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325456 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:28:41 -0000 Author: mjg Date: Sun Nov 5 22:28:39 2017 New Revision: 325456 URL: https://svnweb.freebsd.org/changeset/base/325456 Log: namecache: wlock buckets in cache_lookup_nomakeentry Since the case of an empty chain was already covered, it si very likely that the existing entry is matching. Skipping readlocking saves on lock upgrade. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Nov 5 22:22:22 2017 (r325455) +++ head/sys/kern/vfs_cache.c Sun Nov 5 22:28:39 2017 (r325456) @@ -984,6 +984,28 @@ out: } static int +cache_zap_wlocked_bucket(struct namecache *ncp, struct rwlock *blp) +{ + struct mtx *dvlp, *vlp; + + cache_assert_bucket_locked(ncp, RA_WLOCKED); + + dvlp = VP2VNODELOCK(ncp->nc_dvp); + vlp = NULL; + if (!(ncp->nc_flag & NCF_NEGATIVE)) + vlp = VP2VNODELOCK(ncp->nc_vp); + if (cache_trylock_vnodes(dvlp, vlp) == 0) { + cache_zap_locked(ncp, false); + rw_wunlock(blp); + cache_unlock_vnodes(dvlp, vlp); + return (0); + } + + rw_wunlock(blp); + return (EAGAIN); +} + +static int cache_zap_rlocked_bucket(struct namecache *ncp, struct rwlock *blp) { struct mtx *dvlp, *vlp; @@ -1166,7 +1188,7 @@ retry: if (LIST_EMPTY(NCHHASH(hash))) goto out_no_entry; - rw_rlock(blp); + rw_wlock(blp); LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { counter_u64_add(numchecks, 1); @@ -1177,13 +1199,13 @@ retry: /* We failed to find an entry */ if (ncp == NULL) { - rw_runlock(blp); + rw_wunlock(blp); goto out_no_entry; } counter_u64_add(numposzaps, 1); - error = cache_zap_rlocked_bucket(ncp, blp); + error = cache_zap_wlocked_bucket(ncp, blp); if (error != 0) { zap_and_exit_bucket_fail++; cache_maybe_yield(); From owner-svn-src-all@freebsd.org Sun Nov 5 22:29:35 2017 Return-Path: Delivered-To: svn-src-all@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 B7755E53BDD; Sun, 5 Nov 2017 22:29:35 +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 865876F147; Sun, 5 Nov 2017 22:29:35 +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 vA5MTY8e007046; Sun, 5 Nov 2017 22:29:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5MTY0v007045; Sun, 5 Nov 2017 22:29:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711052229.vA5MTY0v007045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 5 Nov 2017 22:29:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325457 - head/release/scripts X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/release/scripts X-SVN-Commit-Revision: 325457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:29:35 -0000 Author: bdrewery Date: Sun Nov 5 22:29:34 2017 New Revision: 325457 URL: https://svnweb.freebsd.org/changeset/base/325457 Log: Rework r325076: Just use the pre-existing OBJDIR. Like was done in usr.sbin/mergemaster in r249906, we can just use the already-built OBJDIR for install(1). Sponsored by: Dell EMC Isilon Modified: head/release/scripts/mm-mtree.sh Modified: head/release/scripts/mm-mtree.sh ============================================================================== --- head/release/scripts/mm-mtree.sh Sun Nov 5 22:28:39 2017 (r325456) +++ head/release/scripts/mm-mtree.sh Sun Nov 5 22:29:34 2017 (r325457) @@ -114,14 +114,10 @@ echo '' ${MM_MAKE} DESTDIR=${DESTDIR} distrib-dirs ;; esac - od=${TEMPROOT}/usr/obj ${MM_MAKE} DESTDIR=${TEMPROOT} distrib-dirs && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} kernel-toolchain \ - MK_TOOLCHAIN=no MK_CROSS_COMPILER=no \ - MK_CDDL=no MK_TESTS=no MK_RESCUE=no && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} everything SUBDIR_OVERRIDE=etc && - MAKEOBJDIRPREFIX=$od ${MM_MAKE} DESTDIR=${TEMPROOT} distribution;} || + ${MM_MAKE} _obj SUBDIR_OVERRIDE=etc && + ${MM_MAKE} everything SUBDIR_OVERRIDE=etc && + ${MM_MAKE} DESTDIR=${TEMPROOT} distribution;} || { echo ''; echo " *** FATAL ERROR: Cannot 'cd' to ${SOURCEDIR} and install files to"; echo " the temproot environment"; From owner-svn-src-all@freebsd.org Sun Nov 5 22:29:47 2017 Return-Path: Delivered-To: svn-src-all@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 3B509E53C2F; Sun, 5 Nov 2017 22:29:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 099196F1F2; Sun, 5 Nov 2017 22:29:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA5MTkOD007098; Sun, 5 Nov 2017 22:29:46 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5MTkuu007097; Sun, 5 Nov 2017 22:29:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711052229.vA5MTkuu007097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 5 Nov 2017 22:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325458 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:29:47 -0000 Author: mjg Date: Sun Nov 5 22:29:45 2017 New Revision: 325458 URL: https://svnweb.freebsd.org/changeset/base/325458 Log: namecache: bump numcache after dropping all locks This makes no difference correctness-wise, but shortens total hold time. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Nov 5 22:29:34 2017 (r325457) +++ head/sys/kern/vfs_cache.c Sun Nov 5 22:29:45 2017 (r325458) @@ -1606,6 +1606,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, int flag; int len; bool neg_locked; + int lnumcache; CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp, @@ -1745,7 +1746,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, dvp->v_cache_dd = ncp; } - atomic_add_rel_long(&numcache, 1); if (vp != NULL) { if (vp->v_type == VDIR) { if (flag != NCF_ISDOTDOT) { @@ -1798,7 +1798,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ncp->nc_name); } cache_enter_unlock(&cel); - if (numneg * ncnegfactor > numcache) + lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; + if (numneg * ncnegfactor > lnumcache) cache_negative_zap_one(); cache_free(ndd); return; From owner-svn-src-all@freebsd.org Sun Nov 5 22:31:58 2017 Return-Path: Delivered-To: svn-src-all@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 4B580E53E3B; Sun, 5 Nov 2017 22:31:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 174E76F5D2; Sun, 5 Nov 2017 22:31:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 42EE77A06; Sun, 5 Nov 2017 22:31:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3A4EE5802; Sun, 5 Nov 2017 22:31:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id pmNaQV2hB0Ki; Sun, 5 Nov 2017 22:31:53 +0000 (UTC) Subject: Re: svn commit: r325368 - head/sys/kern DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 8836D57FC To: Ian Lepore , Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201711031921.vA3JLakQ010001@repo.freebsd.org> <15dc8575-c699-1101-c846-b4fbdef3d1d1@FreeBSD.org> <1509908174.99235.60.camel@freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Sun, 5 Nov 2017 14:31:37 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1509908174.99235.60.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eKVbtsC7EcdvgcJCMVdgvuP3whRvnGfcc" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:31:58 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eKVbtsC7EcdvgcJCMVdgvuP3whRvnGfcc Content-Type: multipart/mixed; boundary="1ao93I0CubWAXmQhDMKN9xbHgMgL5pbDa"; protected-headers="v1" From: Bryan Drewery To: Ian Lepore , Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r325368 - head/sys/kern References: <201711031921.vA3JLakQ010001@repo.freebsd.org> <15dc8575-c699-1101-c846-b4fbdef3d1d1@FreeBSD.org> <1509908174.99235.60.camel@freebsd.org> In-Reply-To: <1509908174.99235.60.camel@freebsd.org> --1ao93I0CubWAXmQhDMKN9xbHgMgL5pbDa Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/5/2017 10:56 AM, Ian Lepore wrote: > On Fri, 2017-11-03 at 17:22 -0400, Ed Maste wrote: >> "On 3 November 2017 at 16:42, Bryan Drewery >> wrote: >>> >>> >>>> >>>> =C2=A0 Differential Revision:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0D12= 929 >>> Apparently this format closes the review now? I thought we needed a >>> full >>> URL? >> Interesting, Phabricator reports "We found a "Differential Revision" >> field with value "12929" in the commit message, and the domain on the >> URI matches this install, so we linked this commit to D12929."=C2=A0=C2= =A0It >> looks like Phabricator was changed to accept only the D##### tag, but >> not the "Explain why" text. >> >=20 > I like having the full URL, and would like that to remain the standard.= > =C2=A0It's very useful when you're perusing svn logs and you can just c= lick > on the url to get to the phab material cited in the commit. Yeah despite my "\o/", I ended up sticking to the URL format myself too. >=20 > If people want the convenience of typing the shorter info, could we > make the svn commit hooks expand it to an url? >=20 > -- Ian >=20 --=20 Regards, Bryan Drewery --1ao93I0CubWAXmQhDMKN9xbHgMgL5pbDa-- --eKVbtsC7EcdvgcJCMVdgvuP3whRvnGfcc 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 iQEcBAEBAgAGBQJZ/5FJAAoJEDXXcbtuRpfPjUsIAMtN6sew8eA4bZFCJ1KQU1UM qRjI4Z6mPZjZ4Jt6etFekxYf2JSjyx2yO1mYDJgmhNjVztiJ4ofqNJNMUbO5FZ43 VJ/yb6lq0TRG4zJS381WvM+H6QeSMYcM9LCUe/2DDvVLs7vd7hQ7s9pC+eTu4uPw Clt6g3H7raSwS64vYox2LmKhJdYWiIg7OPdT1akOKemuC7riS7kPggwfa8U4V1DG oh7tNMt0pfxAl6YPhWs5/6APtv7cB3SxPabfdNiW4fpxcZIdrfatesJ237iUtTfk 14Us7lTtNqU2dCJlvXNE4MhmrBZOPN0yUr74RxGKzDkbd2FaS0mmvwTel5tqpLY= =GNr+ -----END PGP SIGNATURE----- --eKVbtsC7EcdvgcJCMVdgvuP3whRvnGfcc-- From owner-svn-src-all@freebsd.org Sun Nov 5 22:33:43 2017 Return-Path: Delivered-To: svn-src-all@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 013F1E53ED1; Sun, 5 Nov 2017 22:33:43 +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 C43EB6F796; Sun, 5 Nov 2017 22:33:42 +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 vA5MXg71011128; Sun, 5 Nov 2017 22:33:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5MXg4t011127; Sun, 5 Nov 2017 22:33:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711052233.vA5MXg4t011127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 22:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325459 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 325459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:33:43 -0000 Author: ngie Date: Sun Nov 5 22:33:41 2017 New Revision: 325459 URL: https://svnweb.freebsd.org/changeset/base/325459 Log: MFC r324862: Clean up trailing whitespace in kdb_thr_ctx(..) Modified: stable/11/sys/kern/subr_kdb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_kdb.c ============================================================================== --- stable/11/sys/kern/subr_kdb.c Sun Nov 5 22:29:45 2017 (r325458) +++ stable/11/sys/kern/subr_kdb.c Sun Nov 5 22:33:41 2017 (r325459) @@ -513,12 +513,12 @@ kdb_reenter(void) struct pcb * kdb_thr_ctx(struct thread *thr) -{ +{ #if defined(SMP) && defined(KDB_STOPPEDPCB) struct pcpu *pc; #endif - - if (thr == curthread) + + if (thr == curthread) return (&kdb_pcb); #if defined(SMP) && defined(KDB_STOPPEDPCB) From owner-svn-src-all@freebsd.org Sun Nov 5 22:34:28 2017 Return-Path: Delivered-To: svn-src-all@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 87B0DE53F4F; Sun, 5 Nov 2017 22:34:28 +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 567FF6F8D6; Sun, 5 Nov 2017 22:34:28 +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 vA5MYRUL011219; Sun, 5 Nov 2017 22:34:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5MYREj011218; Sun, 5 Nov 2017 22:34:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711052234.vA5MYREj011218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 22:34: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: r325460 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 325460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:34:28 -0000 Author: ngie Date: Sun Nov 5 22:34:27 2017 New Revision: 325460 URL: https://svnweb.freebsd.org/changeset/base/325460 Log: MFC r324862: Clean up trailing whitespace in kdb_thr_ctx(..) Modified: stable/10/sys/kern/subr_kdb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_kdb.c ============================================================================== --- stable/10/sys/kern/subr_kdb.c Sun Nov 5 22:33:41 2017 (r325459) +++ stable/10/sys/kern/subr_kdb.c Sun Nov 5 22:34:27 2017 (r325460) @@ -515,12 +515,12 @@ kdb_reenter(void) struct pcb * kdb_thr_ctx(struct thread *thr) -{ +{ #if defined(SMP) && defined(KDB_STOPPEDPCB) struct pcpu *pc; #endif - - if (thr == curthread) + + if (thr == curthread) return (&kdb_pcb); #if defined(SMP) && defined(KDB_STOPPEDPCB) From owner-svn-src-all@freebsd.org Sun Nov 5 22:36:03 2017 Return-Path: Delivered-To: svn-src-all@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 8A181E53FD0; Sun, 5 Nov 2017 22:36:03 +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 51ABF6FA14; Sun, 5 Nov 2017 22:36:03 +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 vA5Ma2wG011396; Sun, 5 Nov 2017 22:36:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5Ma25D011394; Sun, 5 Nov 2017 22:36:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711052236.vA5Ma25D011394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 22:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325461 - stable/11/lib/libugidfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libugidfw X-SVN-Commit-Revision: 325461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:36:03 -0000 Author: ngie Date: Sun Nov 5 22:36:02 2017 New Revision: 325461 URL: https://svnweb.freebsd.org/changeset/base/325461 Log: MFC r324928,r324929: r324928: Remove dead stores The return value of various snprintf calls was stored in `len` and not used in many functions. r324929: Clean up trailing whitespace Modified: stable/11/lib/libugidfw/Makefile stable/11/lib/libugidfw/ugidfw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libugidfw/Makefile ============================================================================== --- stable/11/lib/libugidfw/Makefile Sun Nov 5 22:34:27 2017 (r325460) +++ stable/11/lib/libugidfw/Makefile Sun Nov 5 22:36:02 2017 (r325461) @@ -2,7 +2,7 @@ PACKAGE=lib${LIB} LIB= ugidfw -SHLIB_MAJOR= 5 +SHLIB_MAJOR= 5 SRCS= ugidfw.c INCS= ugidfw.h Modified: stable/11/lib/libugidfw/ugidfw.c ============================================================================== --- stable/11/lib/libugidfw/ugidfw.c Sun Nov 5 22:34:27 2017 (r325460) +++ stable/11/lib/libugidfw/ugidfw.c Sun Nov 5 22:36:02 2017 (r325461) @@ -194,7 +194,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, cur += len; } if (rule->mbr_subject.mbs_flags & MBS_PRISON_DEFINED) { - len = snprintf(cur, left, "jailid %d ", + len = snprintf(cur, left, "jailid %d ", rule->mbr_subject.mbs_prison); if (len < 0 || len > left) goto truncated; @@ -334,7 +334,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, &(mntbuf[i].f_fsid), sizeof(mntbuf[i].f_fsid)) == 0) break; - len = snprintf(cur, left, "filesys %s ", + len = snprintf(cur, left, "filesys %s ", i == numfs ? "???" : mntbuf[i].f_mntonname); if (len < 0 || len > left) goto truncated; @@ -512,7 +512,6 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max uid_t uid1, uid2; char *spec1, *spec2, *endp; unsigned long value; - size_t len; spec2 = spec; spec1 = strsep(&spec2, ":"); @@ -523,8 +522,7 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max else { value = strtoul(spec1, &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid uid: '%s'", spec1); + snprintf(errstr, buflen, "invalid uid: '%s'", spec1); return (-1); } uid1 = value; @@ -541,8 +539,7 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max else { value = strtoul(spec2, &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid uid: '%s'", spec2); + snprintf(errstr, buflen, "invalid uid: '%s'", spec2); return (-1); } uid2 = value; @@ -561,7 +558,6 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max gid_t gid1, gid2; char *spec1, *spec2, *endp; unsigned long value; - size_t len; spec2 = spec; spec1 = strsep(&spec2, ":"); @@ -572,8 +568,7 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max else { value = strtoul(spec1, &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid gid: '%s'", spec1); + snprintf(errstr, buflen, "invalid gid: '%s'", spec1); return (-1); } gid1 = value; @@ -590,8 +585,7 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max else { value = strtoul(spec2, &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid gid: '%s'", spec2); + snprintf(errstr, buflen, "invalid gid: '%s'", spec2); return (-1); } gid2 = value; @@ -613,7 +607,6 @@ bsde_parse_subject(int argc, char *argv[], uid_t uid_min, uid_max; gid_t gid_min, gid_max; int jid = 0; - size_t len; long value; current = 0; @@ -630,11 +623,11 @@ bsde_parse_subject(int argc, char *argv[], while (current < argc) { if (strcmp(argv[current], "uid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "uid short"); + snprintf(errstr, buflen, "uid short"); return (-1); } if (flags & MBS_UID_DEFINED) { - len = snprintf(errstr, buflen, "one uid only"); + snprintf(errstr, buflen, "one uid only"); return (-1); } if (bsde_parse_uidrange(argv[current+1], @@ -648,11 +641,11 @@ bsde_parse_subject(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "gid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "gid short"); + snprintf(errstr, buflen, "gid short"); return (-1); } if (flags & MBS_GID_DEFINED) { - len = snprintf(errstr, buflen, "one gid only"); + snprintf(errstr, buflen, "one gid only"); return (-1); } if (bsde_parse_gidrange(argv[current+1], @@ -666,17 +659,17 @@ bsde_parse_subject(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "jailid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "prison short"); + snprintf(errstr, buflen, "prison short"); return (-1); } if (flags & MBS_PRISON_DEFINED) { - len = snprintf(errstr, buflen, "one jail only"); + snprintf(errstr, buflen, "one jail only"); return (-1); } value = strtol(argv[current+1], &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid jid: '%s'", argv[current+1]); + snprintf(errstr, buflen, "invalid jid: '%s'", + argv[current+1]); return (-1); } jid = value; @@ -688,14 +681,13 @@ bsde_parse_subject(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "!") == 0) { if (nextnot) { - len = snprintf(errstr, buflen, - "double negative"); + snprintf(errstr, buflen, "double negative"); return (-1); } nextnot = 1; current += 1; } else { - len = snprintf(errstr, buflen, "'%s' not expected", + snprintf(errstr, buflen, "'%s' not expected", argv[current]); return (-1); } @@ -723,7 +715,6 @@ bsde_parse_subject(int argc, char *argv[], static int bsde_parse_type(char *spec, int *type, size_t buflen, char *errstr) { - size_t len; int i; *type = 0; @@ -755,10 +746,10 @@ bsde_parse_type(char *spec, int *type, size_t buflen, *type |= MBO_ALL_TYPE; break; default: - len = snprintf(errstr, buflen, "Unknown type code: %c", + snprintf(errstr, buflen, "Unknown type code: %c", spec[i]); return (-1); - } + } } return (0); @@ -767,11 +758,10 @@ bsde_parse_type(char *spec, int *type, size_t buflen, static int bsde_parse_fsid(char *spec, struct fsid *fsid, size_t buflen, char *errstr) { - size_t len; struct statfs buf; if (statfs(spec, &buf) < 0) { - len = snprintf(errstr, buflen, "Unable to get id for %s: %s", + snprintf(errstr, buflen, "Unable to get id for %s: %s", spec, strerror(errno)); return (-1); } @@ -791,7 +781,6 @@ bsde_parse_object(int argc, char *argv[], uid_t uid_min, uid_max; gid_t gid_min, gid_max; struct fsid fsid; - size_t len; current = 0; flags = 0; @@ -808,11 +797,11 @@ bsde_parse_object(int argc, char *argv[], while (current < argc) { if (strcmp(argv[current], "uid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "uid short"); + snprintf(errstr, buflen, "uid short"); return (-1); } if (flags & MBO_UID_DEFINED) { - len = snprintf(errstr, buflen, "one uid only"); + snprintf(errstr, buflen, "one uid only"); return (-1); } if (bsde_parse_uidrange(argv[current+1], @@ -826,11 +815,11 @@ bsde_parse_object(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "gid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "gid short"); + snprintf(errstr, buflen, "gid short"); return (-1); } if (flags & MBO_GID_DEFINED) { - len = snprintf(errstr, buflen, "one gid only"); + snprintf(errstr, buflen, "one gid only"); return (-1); } if (bsde_parse_gidrange(argv[current+1], @@ -844,11 +833,11 @@ bsde_parse_object(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "filesys") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "filesys short"); + snprintf(errstr, buflen, "filesys short"); return (-1); } if (flags & MBO_FSID_DEFINED) { - len = snprintf(errstr, buflen, "one fsid only"); + snprintf(errstr, buflen, "one fsid only"); return (-1); } if (bsde_parse_fsid(argv[current+1], &fsid, @@ -890,11 +879,11 @@ bsde_parse_object(int argc, char *argv[], current += 1; } else if (strcmp(argv[current], "type") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "type short"); + snprintf(errstr, buflen, "type short"); return (-1); } if (flags & MBO_TYPE_DEFINED) { - len = snprintf(errstr, buflen, "one type only"); + snprintf(errstr, buflen, "one type only"); return (-1); } if (bsde_parse_type(argv[current+1], &type, @@ -908,14 +897,14 @@ bsde_parse_object(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "!") == 0) { if (nextnot) { - len = snprintf(errstr, buflen, + snprintf(errstr, buflen, "double negative'"); return (-1); } nextnot = 1; current += 1; } else { - len = snprintf(errstr, buflen, "'%s' not expected", + snprintf(errstr, buflen, "'%s' not expected", argv[current]); return (-1); } @@ -946,16 +935,15 @@ int bsde_parse_mode(int argc, char *argv[], mode_t *mode, size_t buflen, char *errstr) { - size_t len; int i; if (argc == 0) { - len = snprintf(errstr, buflen, "mode expects mode value"); + snprintf(errstr, buflen, "mode expects mode value"); return (-1); } if (argc != 1) { - len = snprintf(errstr, buflen, "'%s' unexpected", argv[1]); + snprintf(errstr, buflen, "'%s' unexpected", argv[1]); return (-1); } @@ -981,10 +969,10 @@ bsde_parse_mode(int argc, char *argv[], mode_t *mode, /* ignore */ break; default: - len = snprintf(errstr, buflen, "Unknown mode letter: %c", + snprintf(errstr, buflen, "Unknown mode letter: %c", argv[0][i]); return (-1); - } + } } return (0); @@ -998,17 +986,16 @@ bsde_parse_rule(int argc, char *argv[], struct mac_bsd int object, object_elements, object_elements_length; int mode, mode_elements, mode_elements_length; int error, i; - size_t len; bzero(rule, sizeof(*rule)); if (argc < 1) { - len = snprintf(errstr, buflen, "Rule must begin with subject"); + snprintf(errstr, buflen, "Rule must begin with subject"); return (-1); } if (strcmp(argv[0], "subject") != 0) { - len = snprintf(errstr, buflen, "Rule must begin with subject"); + snprintf(errstr, buflen, "Rule must begin with subject"); return (-1); } subject = 0; @@ -1022,7 +1009,7 @@ bsde_parse_rule(int argc, char *argv[], struct mac_bsd object = i; if (object == -1) { - len = snprintf(errstr, buflen, "Rule must contain an object"); + snprintf(errstr, buflen, "Rule must contain an object"); return (-1); } @@ -1033,7 +1020,7 @@ bsde_parse_rule(int argc, char *argv[], struct mac_bsd mode = i; if (mode == -1) { - len = snprintf(errstr, buflen, "Rule must contain mode"); + snprintf(errstr, buflen, "Rule must contain mode"); return (-1); } @@ -1112,12 +1099,12 @@ bsde_check_version(size_t buflen, char *errstr) len = sizeof(version); error = sysctlbyname(MIB ".rule_version", &version, &len, NULL, 0); if (error) { - len = snprintf(errstr, buflen, "version check failed: %s", + snprintf(errstr, buflen, "version check failed: %s", strerror(errno)); return (-1); } if (version != MB_VERSION) { - len = snprintf(errstr, buflen, "module v%d != library v%d", + snprintf(errstr, buflen, "module v%d != library v%d", version, MB_VERSION); return (-1); } @@ -1134,11 +1121,11 @@ bsde_get_rule_count(size_t buflen, char *errstr) len = sizeof(rule_count); error = sysctlbyname(MIB ".rule_count", &rule_count, &len, NULL, 0); if (error) { - len = snprintf(errstr, buflen, "%s", strerror(errno)); + snprintf(errstr, buflen, "%s", strerror(errno)); return (-1); } if (len != sizeof(rule_count)) { - len = snprintf(errstr, buflen, "Data error in %s.rule_count", + snprintf(errstr, buflen, "Data error in %s.rule_count", MIB); return (-1); } @@ -1156,12 +1143,11 @@ bsde_get_rule_slots(size_t buflen, char *errstr) len = sizeof(rule_slots); error = sysctlbyname(MIB ".rule_slots", &rule_slots, &len, NULL, 0); if (error) { - len = snprintf(errstr, buflen, "%s", strerror(errno)); + snprintf(errstr, buflen, "%s", strerror(errno)); return (-1); } if (len != sizeof(rule_slots)) { - len = snprintf(errstr, buflen, "Data error in %s.rule_slots", - MIB); + snprintf(errstr, buflen, "Data error in %s.rule_slots", MIB); return (-1); } @@ -1187,7 +1173,7 @@ bsde_get_rule(int rulenum, struct mac_bsdextended_rule len = 10; error = bsde_get_mib(MIB ".rules", name, &len); if (error) { - len = snprintf(errstr, errlen, "%s: %s", MIB ".rules", + snprintf(errstr, errlen, "%s: %s", MIB ".rules", strerror(errno)); return (-1); } @@ -1199,11 +1185,11 @@ bsde_get_rule(int rulenum, struct mac_bsdextended_rule if (error == -1 && errno == ENOENT) return (-2); if (error) { - len = snprintf(errstr, errlen, "%s.%d: %s", MIB ".rules", + snprintf(errstr, errlen, "%s.%d: %s", MIB ".rules", rulenum, strerror(errno)); return (-1); } else if (size != sizeof(*rule)) { - len = snprintf(errstr, errlen, "Data error in %s.%d: %s", + snprintf(errstr, errlen, "Data error in %s.%d: %s", MIB ".rules", rulenum, strerror(errno)); return (-1); } @@ -1225,7 +1211,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *err len = 10; error = bsde_get_mib(MIB ".rules", name, &len); if (error) { - len = snprintf(errstr, buflen, "%s: %s", MIB ".rules", + snprintf(errstr, buflen, "%s: %s", MIB ".rules", strerror(errno)); return (-1); } @@ -1235,7 +1221,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *err error = sysctl(name, len, NULL, NULL, &rule, 0); if (error) { - len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", + snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", rulenum, strerror(errno)); return (-1); } @@ -1257,7 +1243,7 @@ bsde_set_rule(int rulenum, struct mac_bsdextended_rule len = 10; error = bsde_get_mib(MIB ".rules", name, &len); if (error) { - len = snprintf(errstr, buflen, "%s: %s", MIB ".rules", + snprintf(errstr, buflen, "%s: %s", MIB ".rules", strerror(errno)); return (-1); } @@ -1267,7 +1253,7 @@ bsde_set_rule(int rulenum, struct mac_bsdextended_rule error = sysctl(name, len, NULL, NULL, rule, sizeof(*rule)); if (error) { - len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", + snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", rulenum, strerror(errno)); return (-1); } @@ -1290,14 +1276,14 @@ bsde_add_rule(int *rulenum, struct mac_bsdextended_rul len = 10; error = bsde_get_mib(MIB ".rules", name, &len); if (error) { - len = snprintf(errstr, buflen, "%s: %s", MIB ".rules", + snprintf(errstr, buflen, "%s: %s", MIB ".rules", strerror(errno)); return (-1); } rule_slots = bsde_get_rule_slots(BUFSIZ, charstr); if (rule_slots == -1) { - len = snprintf(errstr, buflen, "unable to get rule slots: %s", + snprintf(errstr, buflen, "unable to get rule slots: %s", strerror(errno)); return (-1); } @@ -1307,7 +1293,7 @@ bsde_add_rule(int *rulenum, struct mac_bsdextended_rul error = sysctl(name, len, NULL, NULL, rule, sizeof(*rule)); if (error) { - len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", + snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", rule_slots, strerror(errno)); return (-1); } From owner-svn-src-all@freebsd.org Sun Nov 5 22:36:34 2017 Return-Path: Delivered-To: svn-src-all@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 0D080E54047; Sun, 5 Nov 2017 22:36:34 +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 CE2836FB45; Sun, 5 Nov 2017 22:36:33 +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 vA5MaWOc011457; Sun, 5 Nov 2017 22:36:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA5MaWP4011456; Sun, 5 Nov 2017 22:36:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711052236.vA5MaWP4011456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 5 Nov 2017 22:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r325462 - stable/10/lib/libugidfw X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libugidfw X-SVN-Commit-Revision: 325462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Nov 2017 22:36:34 -0000 Author: ngie Date: Sun Nov 5 22:36:32 2017 New Revision: 325462 URL: https://svnweb.freebsd.org/changeset/base/325462 Log: MFC r324928: Remove dead stores The return value of various snprintf calls was stored in `len` and not used in many functions. Modified: stable/10/lib/libugidfw/ugidfw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libugidfw/ugidfw.c ============================================================================== --- stable/10/lib/libugidfw/ugidfw.c Sun Nov 5 22:36:02 2017 (r325461) +++ stable/10/lib/libugidfw/ugidfw.c Sun Nov 5 22:36:32 2017 (r325462) @@ -513,7 +513,6 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max uid_t uid1, uid2; char *spec1, *spec2, *endp; unsigned long value; - size_t len; spec2 = spec; spec1 = strsep(&spec2, ":"); @@ -524,8 +523,7 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max else { value = strtoul(spec1, &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid uid: '%s'", spec1); + snprintf(errstr, buflen, "invalid uid: '%s'", spec1); return (-1); } uid1 = value; @@ -542,8 +540,7 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max else { value = strtoul(spec2, &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid uid: '%s'", spec2); + snprintf(errstr, buflen, "invalid uid: '%s'", spec2); return (-1); } uid2 = value; @@ -562,7 +559,6 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max gid_t gid1, gid2; char *spec1, *spec2, *endp; unsigned long value; - size_t len; spec2 = spec; spec1 = strsep(&spec2, ":"); @@ -573,8 +569,7 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max else { value = strtoul(spec1, &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid gid: '%s'", spec1); + snprintf(errstr, buflen, "invalid gid: '%s'", spec1); return (-1); } gid1 = value; @@ -591,8 +586,7 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max else { value = strtoul(spec2, &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid gid: '%s'", spec2); + snprintf(errstr, buflen, "invalid gid: '%s'", spec2); return (-1); } gid2 = value; @@ -614,7 +608,6 @@ bsde_parse_subject(int argc, char *argv[], uid_t uid_min, uid_max; gid_t gid_min, gid_max; int jid; - size_t len; long value; current = 0; @@ -631,11 +624,11 @@ bsde_parse_subject(int argc, char *argv[], while (current < argc) { if (strcmp(argv[current], "uid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "uid short"); + snprintf(errstr, buflen, "uid short"); return (-1); } if (flags & MBS_UID_DEFINED) { - len = snprintf(errstr, buflen, "one uid only"); + snprintf(errstr, buflen, "one uid only"); return (-1); } if (bsde_parse_uidrange(argv[current+1], @@ -649,11 +642,11 @@ bsde_parse_subject(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "gid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "gid short"); + snprintf(errstr, buflen, "gid short"); return (-1); } if (flags & MBS_GID_DEFINED) { - len = snprintf(errstr, buflen, "one gid only"); + snprintf(errstr, buflen, "one gid only"); return (-1); } if (bsde_parse_gidrange(argv[current+1], @@ -667,17 +660,17 @@ bsde_parse_subject(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "jailid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "prison short"); + snprintf(errstr, buflen, "prison short"); return (-1); } if (flags & MBS_PRISON_DEFINED) { - len = snprintf(errstr, buflen, "one jail only"); + snprintf(errstr, buflen, "one jail only"); return (-1); } value = strtol(argv[current+1], &endp, 10); if (*endp != '\0') { - len = snprintf(errstr, buflen, - "invalid jid: '%s'", argv[current+1]); + snprintf(errstr, buflen, "invalid jid: '%s'", + argv[current+1]); return (-1); } jid = value; @@ -689,14 +682,13 @@ bsde_parse_subject(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "!") == 0) { if (nextnot) { - len = snprintf(errstr, buflen, - "double negative"); + snprintf(errstr, buflen, "double negative"); return (-1); } nextnot = 1; current += 1; } else { - len = snprintf(errstr, buflen, "'%s' not expected", + snprintf(errstr, buflen, "'%s' not expected", argv[current]); return (-1); } @@ -724,7 +716,6 @@ bsde_parse_subject(int argc, char *argv[], int bsde_parse_type(char *spec, int *type, size_t buflen, char *errstr) { - size_t len; int i; *type = 0; @@ -756,10 +747,10 @@ bsde_parse_type(char *spec, int *type, size_t buflen, *type |= MBO_ALL_TYPE; break; default: - len = snprintf(errstr, buflen, "Unknown type code: %c", + snprintf(errstr, buflen, "Unknown type code: %c", spec[i]); return (-1); - } + } } return (0); @@ -768,11 +759,10 @@ bsde_parse_type(char *spec, int *type, size_t buflen, int bsde_parse_fsid(char *spec, struct fsid *fsid, size_t buflen, char *errstr) { - size_t len; struct statfs buf; if (statfs(spec, &buf) < 0) { - len = snprintf(errstr, buflen, "Unable to get id for %s: %s", + snprintf(errstr, buflen, "Unable to get id for %s: %s", spec, strerror(errno)); return (-1); } @@ -792,7 +782,6 @@ bsde_parse_object(int argc, char *argv[], gid_t gid_min, gid_max; int type; struct fsid fsid; - size_t len; current = 0; flags = 0; @@ -808,11 +797,11 @@ bsde_parse_object(int argc, char *argv[], while (current < argc) { if (strcmp(argv[current], "uid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "uid short"); + snprintf(errstr, buflen, "uid short"); return (-1); } if (flags & MBO_UID_DEFINED) { - len = snprintf(errstr, buflen, "one uid only"); + snprintf(errstr, buflen, "one uid only"); return (-1); } if (bsde_parse_uidrange(argv[current+1], @@ -826,11 +815,11 @@ bsde_parse_object(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "gid") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "gid short"); + snprintf(errstr, buflen, "gid short"); return (-1); } if (flags & MBO_GID_DEFINED) { - len = snprintf(errstr, buflen, "one gid only"); + snprintf(errstr, buflen, "one gid only"); return (-1); } if (bsde_parse_gidrange(argv[current+1], @@ -844,11 +833,11 @@ bsde_parse_object(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "filesys") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "filesys short"); + snprintf(errstr, buflen, "filesys short"); return (-1); } if (flags & MBO_FSID_DEFINED) { - len = snprintf(errstr, buflen, "one fsid only"); + snprintf(errstr, buflen, "one fsid only"); return (-1); } if (bsde_parse_fsid(argv[current+1], &fsid, @@ -890,11 +879,11 @@ bsde_parse_object(int argc, char *argv[], current += 1; } else if (strcmp(argv[current], "type") == 0) { if (current + 2 > argc) { - len = snprintf(errstr, buflen, "type short"); + snprintf(errstr, buflen, "type short"); return (-1); } if (flags & MBO_TYPE_DEFINED) { - len = snprintf(errstr, buflen, "one type only"); + snprintf(errstr, buflen, "one type only"); return (-1); } if (bsde_parse_type(argv[current+1], &type, @@ -908,14 +897,14 @@ bsde_parse_object(int argc, char *argv[], current += 2; } else if (strcmp(argv[current], "!") == 0) { if (nextnot) { - len = snprintf(errstr, buflen, + snprintf(errstr, buflen, "double negative'"); return (-1); } nextnot = 1; current += 1; } else { - len = snprintf(errstr, buflen, "'%s' not expected", + snprintf(errstr, buflen, "'%s' not expected", argv[current]); return (-1); } @@ -946,16 +935,15 @@ int bsde_parse_mode(int argc, char *argv[], mode_t *mode, size_t buflen, char *errstr) { - size_t len; int i; if (argc == 0) { - len = snprintf(errstr, buflen, "mode expects mode value"); + snprintf(errstr, buflen, "mode expects mode value"); return (-1); } if (argc != 1) { - len = snprintf(errstr, buflen, "'%s' unexpected", argv[1]); + snprintf(errstr, buflen, "'%s' unexpected", argv[1]); return (-1); } @@ -981,7 +969,7 @@ bsde_parse_mode(int argc, char *argv[], mode_t *mode, /* ignore */ break; default: - len = snprintf(errstr, buflen, "Unknown mode letter: %c", + snprintf(errstr, buflen, "Unknown mode letter: %c", argv[0][i]); return (-1); } @@ -998,17 +986,16 @@ bsde_parse_rule(int argc, char *argv[], struct mac_bsd int object, object_elements, object_elements_length; int mode, mode_elements, mode_elements_length; int error, i; - size_t len; bzero(rule, sizeof(*rule)); if (argc < 1) { - len = snprintf(errstr, buflen, "Rule must begin with subject"); + snprintf(errstr, buflen, "Rule must begin with subject"); return (-1); } if (strcmp(argv[0], "subject") != 0) { - len = snprintf(errstr, buflen, "Rule must begin with subject"); + snprintf(errstr, buflen, "Rule must begin with subject"); return (-1); } subject = 0; @@ -1022,7 +1009,7 @@ bsde_parse_rule(int argc, char *argv[], struct mac_bsd object = i; if (object == -1) { - len = snprintf(errstr, buflen, "Rule must contain an object"); + snprintf(errstr, buflen, "Rule must contain an object"); return (-1); } @@ -1033,7 +1020,7 @@ bsde_parse_rule(int argc, char *argv[], struct mac_bsd mode = i; if (mode == -1) { - len = snprintf(errstr, buflen, "Rule must contain mode"); + snprintf(errstr, buflen, "Rule must contain mode"); return (-1); } @@ -1112,12 +1099,12 @@ bsde_check_version(size_t buflen, char *errstr) len = sizeof(version); error = sysctlbyname(MIB ".rule_version", &version, &len, NULL, 0); if (error) { - len = snprintf(errstr, buflen, "version check failed: %s", + snprintf(errstr, buflen, "version check failed: %s", strerror(errno)); return (-1); } if (version != MB_VERSION) { - len = snprintf(errstr, buflen, "module v%d != library v%d", + snprintf(errstr, buflen, "module v%d != library v%d", version, MB_VERSION); return (-1); } @@ -1134,11 +1121,11 @@ bsde_get_rule_count(size_t buflen, char *errstr) len = sizeof(rule_count); error = sysctlbyname(MIB ".rule_count", &rule_count, &len, NULL, 0); if (error) { - len = snprintf(errstr, buflen, "%s", strerror(errno)); + snprintf(errstr, buflen, "%s", strerror(errno)); return (-1); } if (len != sizeof(rule_count)) { - len = snprintf(errstr, buflen, "Data error in %s.rule_count", + snprintf(errstr, buflen, "Data error in %s.rule_count", MIB); return (-1); } @@ -1156,12 +1143,11 @@ bsde_get_rule_slots(size_t buflen, char *errstr) len = sizeof(rule_slots); error = sysctlbyname(MIB ".rule_slots", &rule_slots, &len, NULL, 0); if (error) { - len = snprintf(errstr, buflen, "%s", strerror(errno)); + snprintf(errstr, buflen, "%s", strerror(errno)); return (-1); } if (len != sizeof(rule_slots)) { - len = snprintf(errstr, buflen, "Data error in %s.rule_slots", - MIB); + snprintf(errstr, buflen, "Data error in %s.rule_slots", MIB); return (-1); } @@ -1187,7 +1173,7 @@ bsde_get_rule(int rulenum, struct mac_bsdextended_rule len = 10; error = bsde_get_mib(MIB ".rules", name, &len); if (error) { - len = snprintf(errstr, errlen, "%s: %s", MIB ".rules", + snprintf(errstr, errlen, "%s: %s", MIB ".rules", strerror(errno)); return (-1); } @@ -1199,11 +1185,11 @@ bsde_get_rule(int rulenum, struct mac_bsdextended_rule if (error == -1 && errno == ENOENT) return (-2); if (error) { - len = snprintf(errstr, errlen, "%s.%d: %s", MIB ".rules", + snprintf(errstr, errlen, "%s.%d: %s", MIB ".rules", rulenum, strerror(errno)); return (-1); } else if (size != sizeof(*rule)) { - len = snprintf(errstr, errlen, "Data error in %s.%d: %s", + snprintf(errstr, errlen, "Data error in %s.%d: %s", MIB ".rules", rulenum, strerror(errno)); return (-1); } @@ -1225,7 +1211,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *err len = 10; error = bsde_get_mib(MIB ".rules", name, &len); if (error) { - len = snprintf(errstr, buflen, "%s: %s", MIB ".rules", + snprintf(errstr, buflen, "%s: %s", MIB ".rules", strerror(errno)); return (-1); } @@ -1236,7 +1222,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *err size = sizeof(rule); error = sysctl(name, len, NULL, NULL, &rule, 0); if (error) { - len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", + snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", rulenum, strerror(errno)); return (-1); } @@ -1258,7 +1244,7 @@ bsde_set_rule(int rulenum, struct mac_bsdextended_rule len = 10; error = bsde_get_mib(MIB ".rules", name, &len); if (error) { - len = snprintf(errstr, buflen, "%s: %s", MIB ".rules", + snprintf(errstr, buflen, "%s: %s", MIB ".rules", strerror(errno)); return (-1); } @@ -1269,7 +1255,7 @@ bsde_set_rule(int rulenum, struct mac_bsdextended_rule size = sizeof(*rule); error = sysctl(name, len, NULL, NULL, rule, size); if (error) { - len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", + snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", rulenum, strerror(errno)); return (-1); } @@ -1292,14 +1278,14 @@ bsde_add_rule(int *rulenum, struct mac_bsdextended_rul len = 10; error = bsde_get_mib(MIB ".rules", name, &len); if (error) { - len = snprintf(errstr, buflen, "%s: %s", MIB ".rules", + snprintf(errstr, buflen, "%s: %s", MIB ".rules", strerror(errno)); return (-1); } rule_slots = bsde_get_rule_slots(BUFSIZ, charstr); if (rule_slots == -1) { - len = snprintf(errstr, buflen, "unable to get rule slots: %s", + snprintf(errstr, buflen, "unable to get rule slots: %s", strerror(errno)); return (-1); } @@ -1310,7 +1296,7 @@ bsde_add_rule(int *rulenum, struct mac_bsdextended_rul size = sizeof(*rule); error = sysctl(name, len, NULL, NULL, rule, size); if (error) { - len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", + snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", rule_slots, strerror(errno)); return (-1); } From owner-svn-src-all@freebsd.org Mon Nov 6 05:09:19 2017 Return-Path: Delivered-To: svn-src-all@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 76B11E59D0E; Mon, 6 Nov 2017 05:09:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4176A7CEEC; Mon, 6 Nov 2017 05:09:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA659ItU074516; Mon, 6 Nov 2017 05:09:18 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA659IBZ074515; Mon, 6 Nov 2017 05:09:18 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711060509.vA659IBZ074515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 6 Nov 2017 05:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325468 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 325468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 05:09:19 -0000 Author: jhibbits Date: Mon Nov 6 05:09:18 2017 New Revision: 325468 URL: https://svnweb.freebsd.org/changeset/base/325468 Log: Set the PRD extension list base address in little endian All data accesses with the SATA controller are little endian. This was missed when writing the extension code. Modified: head/sys/powerpc/mpc85xx/fsl_sata.c Modified: head/sys/powerpc/mpc85xx/fsl_sata.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sata.c Mon Nov 6 04:43:43 2017 (r325467) +++ head/sys/powerpc/mpc85xx/fsl_sata.c Mon Nov 6 05:09:18 2017 (r325468) @@ -985,8 +985,8 @@ fsl_sata_dmasetprd(void *arg, bus_dma_segment_t *segs, for (i = 0, j = 0; i < nsegs; i++, j++) { if (j == FSL_SATA_PRD_EXT_INDEX && FSL_SATA_PRD_MAX_DIRECT < nsegs) { - prd[j].dba = FSL_SATA_CTP_BUS(ch, slot) + - FSL_SATA_PRD_OFFSET(j+1); + prd[j].dba = htole32(FSL_SATA_CTP_BUS(ch, slot) + + FSL_SATA_PRD_OFFSET(j+1)); j++; extlen = 0; } From owner-svn-src-all@freebsd.org Mon Nov 6 05:14:06 2017 Return-Path: Delivered-To: svn-src-all@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 A8A67E59F54; Mon, 6 Nov 2017 05:14:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C4FE7D2F4; Mon, 6 Nov 2017 05:14:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA65E5KL078530; Mon, 6 Nov 2017 05:14:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA65E5OE078529; Mon, 6 Nov 2017 05:14:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711060514.vA65E5OE078529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 6 Nov 2017 05:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325469 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 05:14:06 -0000 Author: mjg Date: Mon Nov 6 05:14:05 2017 New Revision: 325469 URL: https://svnweb.freebsd.org/changeset/base/325469 Log: rwlock: fix up compilation without KDTRACE_HOOKS after r324787 Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Mon Nov 6 05:09:18 2017 (r325468) +++ head/sys/kern/kern_rwlock.c Mon Nov 6 05:14:05 2017 (r325469) @@ -842,12 +842,12 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui struct lock_delay_arg lda; #endif #ifdef KDTRACE_HOOKS - uintptr_t state; u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) + uintptr_t state; int doing_lockprof; #endif From owner-svn-src-all@freebsd.org Mon Nov 6 05:33:28 2017 Return-Path: Delivered-To: svn-src-all@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 1AD70E4B413; Mon, 6 Nov 2017 05:33:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id B64F67A1; Mon, 6 Nov 2017 05:33:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.104] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 30C44D627BF; Mon, 6 Nov 2017 16:03:35 +1100 (AEDT) Date: Mon, 6 Nov 2017 16:03:34 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325444 - head/sys/kern In-Reply-To: <201711051949.vA5JniU4037526@repo.freebsd.org> Message-ID: <20171106144303.P987@besplex.bde.org> References: <201711051949.vA5JniU4037526@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cK6QihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=wCP3Pv7mfX1hg_B8BXEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 05:33:28 -0000 On Sun, 5 Nov 2017, Ed Maste wrote: > Log: > ANSIfy sys/kern/md4c.c > > PR: 223453 > Submitted by: ota@j.email.ne.jp > MFC After: 2 weeks This doesn't ANSIfy md4c.c, but churns its style away from both the vendor version and the copy in libmd. The style is very non-KNF, but is preserved to avoid churning. md4c.c already had prototypes, by declaring extern ones in the headers (there are further bugs from inconsistent churning in the headers. includes , but renames its functions using excessively ifdefed defines, so its functions don't actually have the name in their prototypes; repeats everything in except and then makes them inconsistent but still uses macros to obfuscate the names. The inconsistencies are: - libmd MD4Update and MD4Data take a const void *, but kernel MD4Update and MD4Data take a const unsigned char * - libmd MD4Final takes an unsigned char [16], but kernel MD4Final takes an unsigned char [__min_size(16)]; old versions hard-coded __min_size() and failed to compile with C90 and earlier compilers (also with the distribution version of gcc-4.2.1 -std=c99, since it implements n869.txt and not C99 in this area); now the kernel version is only the same as the libmd version for compilers that don't implement C99. C99 - user parts of sys/md4.h are under !_KERNEL . This is bogus since only md4.h should be used if !_KERNEL. These parts include MD4Final which has inconsistent prototypes, so including both headers would fail. - sys/md4 doesn't declare the FreeBSD extensions MD4Fd, MD4FdChunk and MD4FileChunk even under its bogus ifdef. > Modified: head/sys/kern/md4c.c > ============================================================================== > --- head/sys/kern/md4c.c Sun Nov 5 19:38:51 2017 (r325443) > +++ head/sys/kern/md4c.c Sun Nov 5 19:49:44 2017 (r325444) Before this commit, diffs with libmd/md4c.c were only 97 lines, with less than half the changes for churning and other style bugs. Some are: - __FBSDID() is misplaced in the libmd version - only the libmd version is obfuscated using the CONST_POINTER typedef. Both are obfuscated using the POINTER typedef. (POINTER was to make RSA md portable to pre-C90 compilers. It is harmlessly wrong on C90 for const pointers, except -Wcast-qual detects the error and -Werror makes it harmfully wrong. The correct cast for C90 with prototypes is none, to let the protoype convert.) - only the libmd version has the good name 'input' for a parameter weakened to 'in'. This might be related to the next renaming. - only the libmd version has the not so good name 'index' for a parameter changed to 'idx'. The kernel no longer has index(), so the name 'index' no longer cause -Wshadow warnings. -Wshadow has never been used for the the kernel, so these warnings didn't occur even when the kernel had index(). index() tends to get declared everywhere in libmd and the kerenel via namespace pollution in and , respectively. Most of the diffs are from renaming 'index'. - only the libmd version churns bcopy() to memcpy(). This also adds bogus casts to POINTER and CONST_POINTER. These casts are more bogus for memcpy where they are used than for bcopy where they are not used, since pre-C90 had bcopy() where the casts were needed but might not have memcpy() where the casts are not needed for C90 and later. - similarly to churn bzero() to memset(), except bzero() is better instead of different, and the churning also changes the parentheses style from KNF to gnu. - only the kernel version churns and breaks MD4Final(). It "ANSIfies" the function, apparently to change [16] to [static 16]. This is not ANSI. ANSI C is the earlier American version of C90. [static 16] is a syntax error in C90. The kernel md4c.c is only used by netsmb. I don't use netsmb, else this syntax error would break compiling with gcc-4.2.1. Altogther, only about 20 lines of the 97 lines diffs are needed (mainly 14 lines to add weak references). > @@ -90,8 +90,8 @@ static unsigned char PADDING[64] = { > > /* MD4 initialization. Begins an MD4 operation, writing a new context. > */ > -void MD4Init (context) > -MD4_CTX *context; /* context */ > +void > +MD4Init(MD4_CTX *context) "ANSIficication" also loses comments on parameter names. This is an improvements for banal comments like this, except it is a style bug. RSA style apparently requires comments. This also changes from gnu style to KNF for parentheses. Apparently the parentheses style change that accompanies churning bzero to memset is a style fix for some previous change involving bzero. > @@ -107,10 +107,9 @@ MD4_CTX *context; > operation, processing another message block, and updating the > context. > */ > -void MD4Update (context, input, inputLen) > -MD4_CTX *context; /* context */ > -const unsigned char *input; /* input block */ > -unsigned int inputLen; /* length of input block */ The comments are more useful here. In libmd, they are even more useful since the connection between input and inputlen is broken by renaming only the former. > @@ -164,7 +163,8 @@ MD4_CTX *context; > /* MD4 finalization. Ends an MD4 message-digest operation, writing the > the message digest and zeroizing the context. > */ > -void MD4Final (unsigned char digest[static 16], MD4_CTX *context) > +void > +MD4Final(unsigned char digest[static 16], MD4_CTX *context) This was already "ANSIfied". The churn is from gnu/RSA parentheses to KNF (as above), and also from RSA style for function types to KNF. Even gnu style puts the function name on a new line. Similarly for other changes. > @@ -254,10 +253,8 @@ const unsigned char block[64]; > /* Encodes input (UINT4) into output (unsigned char). Assumes len is > a multiple of 4. > */ > -static void Encode (output, input, len) > -unsigned char *output; > -UINT4 *input; > -unsigned int len; > +static void > +Encode(unsigned char *output, UINT4 *input, unsigned int len) Another bug in the libmd version is that it only renames 'input' to 'in' in one function. Many functions still have a parameter named 'input', so the change can't be for fixing a -Wshadow problem. Bruce From owner-svn-src-all@freebsd.org Mon Nov 6 05:46:57 2017 Return-Path: Delivered-To: svn-src-all@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 AFC26E4E20F; Mon, 6 Nov 2017 05:46:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 30492F98; Mon, 6 Nov 2017 05:46:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.104] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 0EA31104258B; Mon, 6 Nov 2017 16:46:54 +1100 (AEDT) Date: Mon, 6 Nov 2017 16:46:53 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mateusz Guzik cc: Konstantin Belousov , Ian Lepore , src-committers , "Conrad E. Meyer" , "svn-src-all@freebsd.org" , Andriy Gapon , "svn-src-head@freebsd.org" , Warner Losh Subject: Re: svn commit: r325386 - head/sys/kern In-Reply-To: Message-ID: <20171106162139.Q987@besplex.bde.org> References: <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> <20171105190214.GG2566@kib.kiev.ua> <20f694b3-c60c-1b6d-76a1-2ef14cbdd698@FreeBSD.org> <1509910670.99235.70.camel@freebsd.org> <20171105201503.GH2566@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=WX_ER7Zxp3DyPIdJMc0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 05:46:57 -0000 On Sun, 5 Nov 2017, Mateusz Guzik wrote: > On Sun, Nov 5, 2017 at 9:15 PM, Konstantin Belousov > wrote: > >> On Sun, Nov 05, 2017 at 12:37:50PM -0700, Ian Lepore wrote: >>> IMO, the only reason ASSERT-style macros exist is to hide the >>> conditional-on-build-type part of the operation. That is, to avoid >>> having #ifdef INVARIANTS scattered everywhere. >> bde' point is that KASSERT() is badly designed, and I agree with him. >> Now we could at least remove the () around the message formatting part, >> but it is too late. >>> >>> Creating a macro to generate always-on error detection and reporting >>> code just because there exists a macro to do so conditionally seems to >>> turn the world on its head. >> I agree with this statement. if()panic(); construct is good enough, IMO. I agree. > I don't like our panic messages whatsoever, they are quite often not > informative. I don't like our panic messages, since they are too long. > For instance consider: > if (obj->foo < bar) > panic("bad foo %d, have fun looking for bar"); I almost prefer panic(".") where the dot is rendered in red :-). The dot is too hard to grep for, so I acually prefer panic( ""). panic("%s", __func__) is even better than the dot for unreadability. Often the value of foo and bar and hundreds of other variables printed by a bloated panic statement are obvious or uninteresting, and you need to use a debugger and a compiler that does't optimize out or otherwise obfuscate anything. > Instead a macro akin to PASS(obj->foo, <, bar, "obj %p", obj); can > expand itself to stringify the first 3 terms and also show the compared > values. Saves on boiler-plate written by hand. > > I think *all* panics should be accompanied with a linux's oops-like dump. Dumps can be produced by debuggers or hd on core files. More than function names (also offsets within functions) can be produced by debuggers or addr2line, all without any space/time bloat for stringification. Some panics already occur via traps. Then trap() does a simple dump and panic() can't print anything more useful. Instead of the red dot panic, I also prefer a breakpoint or null pointer trap. Both are restartble using kdb, unlike panic(). If no backend is attached to kdb, then these traps turn into panics with a dump from trap(). Bruce From owner-svn-src-all@freebsd.org Mon Nov 6 06:23:36 2017 Return-Path: Delivered-To: svn-src-all@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 DF4F7E52430; Mon, 6 Nov 2017 06:23:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9DEC62672; Mon, 6 Nov 2017 06:23:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.104] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 4ED463C2F94; Mon, 6 Nov 2017 16:21:33 +1100 (AEDT) Date: Mon, 6 Nov 2017 16:21:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Warner Losh , "Conrad E. Meyer" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r325386 - head/sys/kern In-Reply-To: <20171105190214.GG2566@kib.kiev.ua> Message-ID: <20171106160346.D987@besplex.bde.org> References: <201711041049.vA4AnZUE096709@repo.freebsd.org> <20171105130607.GA2566@kib.kiev.ua> <20171105173032.GE2566@kib.kiev.ua> <20171105190214.GG2566@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=x6pKjin5z_QBVLWaVYcA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 06:23:37 -0000 On Sun, 5 Nov 2017, Konstantin Belousov wrote: > On Sun, Nov 05, 2017 at 11:42:51AM -0700, Warner Losh wrote: >> On Sun, Nov 5, 2017 at 11:32 AM, Conrad Meyer wrote: >> >>> E.g., >>> >>> --- a/sys/ufs/ffs/ffs_alloc.c >>> +++ b/sys/ufs/ffs/ffs_alloc.c >>> @@ -304,8 +304,7 @@ retry: >>> } >>> >>> if (bp->b_blkno == bp->b_lblkno) { >>> - if (lbprev >= UFS_NDADDR) >>> - panic("ffs_realloccg: lbprev out of range"); >>> + ASSERT(lbprev < UFS_NDADDR, "ffs_realloccg: lbprev out >>> of range"); >>> bp->b_blkno = fsbtodb(fs, bprev); >>> } >>> >> >> Just a side point: All these should be programming errors. The bogus data This certainly is a programming error. It has 2 style bugs: - it obfuscates a simple test and panic. This is only 4 bytes shorter - it misformats the new version using a long line. >> that comes or could come from the FS itself should remain always-on panics. >> Well, actually, they should transition from always-on panics to some sort >> of degraded mount that would be more resilient in the face of such >> corruption. But failing that, they should remain always-on panics :) > > This is what I said in my reply before the last. > > I still have no idea what is the point cem tries to express. As described in other replies, it is to obfuscate panic() using a macro in cases where the panic is not controlled by INVARIANTS. > Nor I know what should the ASSERT() macro do in the kernel. If the > patch above really about replacing panic() with _K_ASSERT, then I most > likely agree with it, since the error catched is not due to the on-disk > metadata corruption. KASSERT() can be used in this case. It is unclear which case applies. lbprev is the second parameter and it is unclear if it ever comes directly from the disk or has already been checked by callers when it did. The third parameter bprev often does come directly from the disk. A typical call is ffs_realloccg( ip, nb, dp->db[nb], ...). For this call, undefined behaviour has already occurred if nb is out of bounds, so KASSERT() is good enough, but if nb is really insane then the KASSERT() is unreachale since the invalid array access already paniced. Bruce From owner-svn-src-all@freebsd.org Mon Nov 6 11:10:44 2017 Return-Path: Delivered-To: svn-src-all@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 BCE7FE59F2F; Mon, 6 Nov 2017 11:10:44 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7F8306A1C4; Mon, 6 Nov 2017 11:10:44 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6BAh2M026975; Mon, 6 Nov 2017 11:10:43 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6BAhfw026974; Mon, 6 Nov 2017 11:10:43 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711061110.vA6BAhfw026974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 6 Nov 2017 11:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325471 - stable/11/libexec/ftpd X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/libexec/ftpd X-SVN-Commit-Revision: 325471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 11:10:44 -0000 Author: eugen (ports committer) Date: Mon Nov 6 11:10:43 2017 New Revision: 325471 URL: https://svnweb.freebsd.org/changeset/base/325471 Log: MFC r324364: ftpd(8): fix user context handling Apply authenticated user context after update of wtmp(5) at start of session, so that ftpd process is not killed by kernel with SIGXFSZ when user has "filesize" limit lower than size of system wtmp file. Same applies to session finalization: revert to super-user context before update of wtmp. If ftpd hits limit while writing a file at user request, do not get killed with SIGXFSZ instantly but apparently ignore the signal, process error and report it to the user, and continue with the session. PR: 143570 Approved by: mav (mentor) Modified: stable/11/libexec/ftpd/ftpd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/ftpd/ftpd.c ============================================================================== --- stable/11/libexec/ftpd/ftpd.c Mon Nov 6 06:05:54 2017 (r325470) +++ stable/11/libexec/ftpd/ftpd.c Mon Nov 6 11:10:43 2017 (r325471) @@ -430,6 +430,10 @@ main(int argc, char *argv[], char **envp) } } + /* handle filesize limit gracefully */ + sa.sa_handler = SIG_IGN; + (void)sigaction(SIGXFSZ, &sa, NULL); + if (daemon_mode) { int *ctl_sock, fd, maxfd = -1, nfds, i; fd_set defreadfds, readfds; @@ -1196,14 +1200,14 @@ end_login(void) #endif (void) seteuid(0); - if (logged_in && dowtmp) - ftpd_logwtmp(wtmpid, NULL, NULL); - pw = NULL; #ifdef LOGIN_CAP setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN | LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH | LOGIN_SETENV)); #endif + if (logged_in && dowtmp) + ftpd_logwtmp(wtmpid, NULL, NULL); + pw = NULL; #ifdef USE_PAM if (pamh) { if ((e = pam_setcred(pamh, PAM_DELETE_CRED)) != PAM_SUCCESS) @@ -1478,7 +1482,7 @@ skip: } } setusercontext(lc, pw, 0, LOGIN_SETALL & - ~(LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV)); + ~(LOGIN_SETRESOURCES | LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV)); #else setlogin(pw->pw_name); (void) initgroups(pw->pw_name, pw->pw_gid); @@ -1520,6 +1524,10 @@ skip: (struct sockaddr *)&his_addr); logged_in = 1; +#ifdef LOGIN_CAP + setusercontext(lc, pw, 0, LOGIN_SETRESOURCES); +#endif + if (guest && stats && statfd < 0) #ifdef VIRTUAL_HOSTING statfd = open(thishost->statfile, O_WRONLY|O_APPEND); @@ -2770,6 +2778,11 @@ dologout(int status) if (logged_in && dowtmp) { (void) seteuid(0); +#ifdef LOGIN_CAP + setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN | + LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH | + LOGIN_SETENV)); +#endif ftpd_logwtmp(wtmpid, NULL, NULL); } /* beware of flushing buffers after a SIGPIPE */ From owner-svn-src-all@freebsd.org Mon Nov 6 11:11:45 2017 Return-Path: Delivered-To: svn-src-all@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 5D395E5A0D9; Mon, 6 Nov 2017 11:11:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3A04B6A4AA; Mon, 6 Nov 2017 11:11:45 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6BBixt030142; Mon, 6 Nov 2017 11:11:44 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6BBilN030141; Mon, 6 Nov 2017 11:11:44 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711061111.vA6BBilN030141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 6 Nov 2017 11:11: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: r325472 - stable/10/libexec/ftpd X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/libexec/ftpd X-SVN-Commit-Revision: 325472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 11:11:45 -0000 Author: eugen (ports committer) Date: Mon Nov 6 11:11:44 2017 New Revision: 325472 URL: https://svnweb.freebsd.org/changeset/base/325472 Log: MFC r324364: ftpd(8): fix user context handling Apply authenticated user context after update of wtmp(5) at start of session, so that ftpd process is not killed by kernel with SIGXFSZ when user has "filesize" limit lower than size of system wtmp file. Same applies to session finalization: revert to super-user context before update of wtmp. If ftpd hits limit while writing a file at user request, do not get killed with SIGXFSZ instantly but apparently ignore the signal, process error and report it to the user, and continue with the session. PR: 143570 Approved by: mav (mentor) Modified: stable/10/libexec/ftpd/ftpd.c Modified: stable/10/libexec/ftpd/ftpd.c ============================================================================== --- stable/10/libexec/ftpd/ftpd.c Mon Nov 6 11:10:43 2017 (r325471) +++ stable/10/libexec/ftpd/ftpd.c Mon Nov 6 11:11:44 2017 (r325472) @@ -420,6 +420,10 @@ main(int argc, char *argv[], char **envp) } } + /* handle filesize limit gracefully */ + sa.sa_handler = SIG_IGN; + (void)sigaction(SIGXFSZ, &sa, NULL); + if (daemon_mode) { int *ctl_sock, fd, maxfd = -1, nfds, i; fd_set defreadfds, readfds; @@ -1185,14 +1189,14 @@ end_login(void) #endif (void) seteuid(0); - if (logged_in && dowtmp) - ftpd_logwtmp(wtmpid, NULL, NULL); - pw = NULL; #ifdef LOGIN_CAP setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN | LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH | LOGIN_SETENV)); #endif + if (logged_in && dowtmp) + ftpd_logwtmp(wtmpid, NULL, NULL); + pw = NULL; #ifdef USE_PAM if (pamh) { if ((e = pam_setcred(pamh, PAM_DELETE_CRED)) != PAM_SUCCESS) @@ -1464,7 +1468,7 @@ skip: } } setusercontext(lc, pw, 0, LOGIN_SETALL & - ~(LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV)); + ~(LOGIN_SETRESOURCES | LOGIN_SETUSER | LOGIN_SETPATH | LOGIN_SETENV)); #else setlogin(pw->pw_name); (void) initgroups(pw->pw_name, pw->pw_gid); @@ -1506,6 +1510,10 @@ skip: (struct sockaddr *)&his_addr); logged_in = 1; +#ifdef LOGIN_CAP + setusercontext(lc, pw, 0, LOGIN_SETRESOURCES); +#endif + if (guest && stats && statfd < 0) #ifdef VIRTUAL_HOSTING statfd = open(thishost->statfile, O_WRONLY|O_APPEND); @@ -2756,6 +2764,11 @@ dologout(int status) if (logged_in && dowtmp) { (void) seteuid(0); +#ifdef LOGIN_CAP + setusercontext(NULL, getpwuid(0), 0, LOGIN_SETALL & ~(LOGIN_SETLOGIN | + LOGIN_SETUSER | LOGIN_SETGROUP | LOGIN_SETPATH | + LOGIN_SETENV)); +#endif ftpd_logwtmp(wtmpid, NULL, NULL); } /* beware of flushing buffers after a SIGPIPE */ From owner-svn-src-all@freebsd.org Mon Nov 6 12:44:28 2017 Return-Path: Delivered-To: svn-src-all@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 5790EE5D11C; Mon, 6 Nov 2017 12:44:28 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2A8126DA15; Mon, 6 Nov 2017 12:44:28 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6CiRDS068494; Mon, 6 Nov 2017 12:44:27 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6CiRmk068492; Mon, 6 Nov 2017 12:44:27 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711061244.vA6CiRmk068492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 6 Nov 2017 12:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325473 - stable/11/usr.bin/rsh X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/usr.bin/rsh X-SVN-Commit-Revision: 325473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 12:44:28 -0000 Author: eugen (ports committer) Date: Mon Nov 6 12:44:26 2017 New Revision: 325473 URL: https://svnweb.freebsd.org/changeset/base/325473 Log: MFC r324212: rsh: introduce new option -N disabling shutdown of socket sending path. PR: 205144 Approved by: mav (mentor) Modified: stable/11/usr.bin/rsh/rsh.1 stable/11/usr.bin/rsh/rsh.c Modified: stable/11/usr.bin/rsh/rsh.1 ============================================================================== --- stable/11/usr.bin/rsh/rsh.1 Mon Nov 6 11:11:44 2017 (r325472) +++ stable/11/usr.bin/rsh/rsh.1 Mon Nov 6 12:44:26 2017 (r325473) @@ -36,7 +36,7 @@ .Nd remote shell .Sh SYNOPSIS .Nm -.Op Fl 46dn +.Op Fl 46dnN .Op Fl l Ar username .Op Fl t Ar timeout .Ar host @@ -87,12 +87,22 @@ By default, the remote username is the same as the loc Authorization is determined as in .Xr rlogin 1 . +.It Fl N +Opposite to +.Fl n +option: do not send the "end of file" (EOF) indication for input stream +to the remote host. This option makes the +.Nm +utility compatible with protocol implementations confused by receiving +EOF, like some Cisco IOS versions. Disables +.Fl n . .It Fl n Redirect input from the special device .Pa /dev/null (see the .Sx BUGS -section of this manual page). +section of this manual page). Disables +.Fl N . .It Fl t Ar timeout Allow a .Ar timeout Modified: stable/11/usr.bin/rsh/rsh.c ============================================================================== --- stable/11/usr.bin/rsh/rsh.c Mon Nov 6 11:11:44 2017 (r325472) +++ stable/11/usr.bin/rsh/rsh.c Mon Nov 6 12:44:26 2017 (r325473) @@ -85,7 +85,7 @@ static char rlogin[] = "rlogin"; void connect_timeout(int); char *copyargs(char * const *); void sendsig(int); -void talk(int, long, pid_t, int, int); +void talk(int, int, long, pid_t, int, int); void usage(void); int @@ -94,13 +94,13 @@ main(int argc, char *argv[]) struct passwd const *pw; struct servent const *sp; long omask; - int argoff, asrsh, ch, dflag, nflag, one, rem; + int argoff, asrsh, ch, dflag, nflag, Nflag, one, rem; pid_t pid = 0; uid_t uid; char *args, *host, *p, *user; int timeout = 0; - argoff = asrsh = dflag = nflag = 0; + argoff = asrsh = dflag = nflag = Nflag = 0; one = 1; host = user = NULL; @@ -120,7 +120,7 @@ main(int argc, char *argv[]) argoff = 1; } -#define OPTIONS "468Lde:l:nt:w" +#define OPTIONS "468LNde:l:nt:w" while ((ch = getopt(argc - argoff, argv + argoff, OPTIONS)) != -1) switch(ch) { case '4': @@ -131,6 +131,10 @@ main(int argc, char *argv[]) family = PF_INET6; break; + case 'N': + Nflag = 1; + nflag = 0; + break; case 'L': /* -8Lew are ignored to allow rlogin aliases */ case 'e': case 'w': @@ -144,6 +148,7 @@ main(int argc, char *argv[]) break; case 'n': nflag = 1; + Nflag = 0; break; case 't': timeout = atoi(optarg); @@ -227,7 +232,7 @@ main(int argc, char *argv[]) (void)ioctl(rfd2, FIONBIO, &one); (void)ioctl(rem, FIONBIO, &one); - talk(nflag, omask, pid, rem, timeout); + talk(nflag, Nflag, omask, pid, rem, timeout); if (!nflag) (void)kill(pid, SIGKILL); @@ -235,7 +240,7 @@ main(int argc, char *argv[]) } void -talk(int nflag, long omask, pid_t pid, int rem, int timeout) +talk(int nflag, int Nflag, long omask, pid_t pid, int rem, int timeout) { int cc, wc; fd_set readfrom, ready, rembits; @@ -276,8 +281,8 @@ rewrite: if (cc == 0) goto reread; goto rewrite; -done: - (void)shutdown(rem, SHUT_WR); +done: if (!Nflag) + (void)shutdown(rem, SHUT_WR); exit(0); } @@ -371,6 +376,6 @@ usage(void) { (void)fprintf(stderr, - "usage: rsh [-46dn] [-l username] [-t timeout] host [command]\n"); + "usage: rsh [-46Ndn] [-l username] [-t timeout] host [command]\n"); exit(1); } From owner-svn-src-all@freebsd.org Mon Nov 6 12:45:53 2017 Return-Path: Delivered-To: svn-src-all@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 69E00E5D4CD; Mon, 6 Nov 2017 12:45:53 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2C5136DD1A; Mon, 6 Nov 2017 12:45:53 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6Cjqj4068610; Mon, 6 Nov 2017 12:45:52 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6CjqAf068608; Mon, 6 Nov 2017 12:45:52 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711061245.vA6CjqAf068608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 6 Nov 2017 12:45: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: r325474 - stable/10/usr.bin/rsh X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/usr.bin/rsh X-SVN-Commit-Revision: 325474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 12:45:53 -0000 Author: eugen (ports committer) Date: Mon Nov 6 12:45:51 2017 New Revision: 325474 URL: https://svnweb.freebsd.org/changeset/base/325474 Log: MFC r324212: rsh: introduce new option -N disabling shutdown of socket sending path. PR: 205144 Approved by: mav (mentor) Modified: stable/10/usr.bin/rsh/rsh.1 stable/10/usr.bin/rsh/rsh.c Modified: stable/10/usr.bin/rsh/rsh.1 ============================================================================== --- stable/10/usr.bin/rsh/rsh.1 Mon Nov 6 12:44:26 2017 (r325473) +++ stable/10/usr.bin/rsh/rsh.1 Mon Nov 6 12:45:51 2017 (r325474) @@ -36,7 +36,7 @@ .Nd remote shell .Sh SYNOPSIS .Nm -.Op Fl 46dn +.Op Fl 46dnN .Op Fl l Ar username .Op Fl t Ar timeout .Ar host @@ -87,12 +87,22 @@ By default, the remote username is the same as the loc Authorization is determined as in .Xr rlogin 1 . +.It Fl N +Opposite to +.Fl n +option: do not send the "end of file" (EOF) indication for input stream +to the remote host. This option makes the +.Nm +utility compatible with protocol implementations confused by receiving +EOF, like some Cisco IOS versions. Disables +.Fl n . .It Fl n Redirect input from the special device .Pa /dev/null (see the .Sx BUGS -section of this manual page). +section of this manual page). Disables +.Fl N . .It Fl t Ar timeout Allow a .Ar timeout Modified: stable/10/usr.bin/rsh/rsh.c ============================================================================== --- stable/10/usr.bin/rsh/rsh.c Mon Nov 6 12:44:26 2017 (r325473) +++ stable/10/usr.bin/rsh/rsh.c Mon Nov 6 12:45:51 2017 (r325474) @@ -85,7 +85,7 @@ char rlogin[] = "rlogin"; void connect_timeout(int); char *copyargs(char * const *); void sendsig(int); -void talk(int, long, pid_t, int, int); +void talk(int, int, long, pid_t, int, int); void usage(void); int @@ -94,13 +94,13 @@ main(int argc, char *argv[]) struct passwd const *pw; struct servent const *sp; long omask; - int argoff, asrsh, ch, dflag, nflag, one, rem; + int argoff, asrsh, ch, dflag, nflag, Nflag, one, rem; pid_t pid = 0; uid_t uid; char *args, *host, *p, *user; int timeout = 0; - argoff = asrsh = dflag = nflag = 0; + argoff = asrsh = dflag = nflag = Nflag = 0; one = 1; host = user = NULL; @@ -120,7 +120,7 @@ main(int argc, char *argv[]) argoff = 1; } -#define OPTIONS "468Lde:l:nt:w" +#define OPTIONS "468LNde:l:nt:w" while ((ch = getopt(argc - argoff, argv + argoff, OPTIONS)) != -1) switch(ch) { case '4': @@ -131,6 +131,10 @@ main(int argc, char *argv[]) family = PF_INET6; break; + case 'N': + Nflag = 1; + nflag = 0; + break; case 'L': /* -8Lew are ignored to allow rlogin aliases */ case 'e': case 'w': @@ -144,6 +148,7 @@ main(int argc, char *argv[]) break; case 'n': nflag = 1; + Nflag = 0; break; case 't': timeout = atoi(optarg); @@ -227,7 +232,7 @@ main(int argc, char *argv[]) (void)ioctl(rfd2, FIONBIO, &one); (void)ioctl(rem, FIONBIO, &one); - talk(nflag, omask, pid, rem, timeout); + talk(nflag, Nflag, omask, pid, rem, timeout); if (!nflag) (void)kill(pid, SIGKILL); @@ -235,7 +240,7 @@ main(int argc, char *argv[]) } void -talk(int nflag, long omask, pid_t pid, int rem, int timeout) +talk(int nflag, int Nflag, long omask, pid_t pid, int rem, int timeout) { int cc, wc; fd_set readfrom, ready, rembits; @@ -276,8 +281,8 @@ rewrite: if (cc == 0) goto reread; goto rewrite; -done: - (void)shutdown(rem, SHUT_WR); +done: if (!Nflag) + (void)shutdown(rem, SHUT_WR); exit(0); } @@ -371,6 +376,6 @@ usage(void) { (void)fprintf(stderr, - "usage: rsh [-46dn] [-l username] [-t timeout] host [command]\n"); + "usage: rsh [-46Ndn] [-l username] [-t timeout] host [command]\n"); exit(1); } From owner-svn-src-all@freebsd.org Mon Nov 6 13:56:04 2017 Return-Path: Delivered-To: svn-src-all@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 60CDCE5EC8F; Mon, 6 Nov 2017 13:56:04 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2E24A70032; Mon, 6 Nov 2017 13:56:04 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6Du3Ze097938; Mon, 6 Nov 2017 13:56:03 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6Du3Pa097937; Mon, 6 Nov 2017 13:56:03 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711061356.vA6Du3Pa097937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 6 Nov 2017 13:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325475 - stable/11/usr.sbin/ppp X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/usr.sbin/ppp X-SVN-Commit-Revision: 325475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 13:56:04 -0000 Author: eugen (ports committer) Date: Mon Nov 6 13:56:03 2017 New Revision: 325475 URL: https://svnweb.freebsd.org/changeset/base/325475 Log: MFC r325157,325158: Fix ppp(8) to add RTF_HOST flag to created host route. Reported by: Mike Tancsa Approved by: mav (mentor) Modified: stable/11/usr.sbin/ppp/route.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ppp/route.c ============================================================================== --- stable/11/usr.sbin/ppp/route.c Mon Nov 6 12:45:51 2017 (r325474) +++ stable/11/usr.sbin/ppp/route.c Mon Nov 6 13:56:03 2017 (r325475) @@ -801,7 +801,8 @@ rt_Set(struct bundle *bundle, int cmd, const struct nc if (!ncprange_ishost(dst)) { cp += memcpy_roundup(cp, &samask, samask.ss_len); rtmes.m_rtm.rtm_addrs |= RTA_NETMASK; - } + } else + rtmes.m_rtm.rtm_flags |= RTF_HOST; nb = cp - (char *)&rtmes; rtmes.m_rtm.rtm_msglen = nb; @@ -905,7 +906,8 @@ rt_Update(struct bundle *bundle, const struct sockaddr if (mask) { rtmes.m_rtm.rtm_addrs |= RTA_NETMASK; p += memcpy_roundup(p, mask, mask->sa_len); - } + } else + rtmes.m_rtm.rtm_flags |= RTF_HOST; if (ifa && ifp && ifp->sa_family == AF_LINK) { rtmes.m_rtm.rtm_addrs |= RTA_IFP; From owner-svn-src-all@freebsd.org Mon Nov 6 14:15:12 2017 Return-Path: Delivered-To: svn-src-all@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 5BD47E5F2DC; Mon, 6 Nov 2017 14:15:12 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 110C070A3A; Mon, 6 Nov 2017 14:15:11 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6EFBAp006665; Mon, 6 Nov 2017 14:15:11 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6EFBG4006664; Mon, 6 Nov 2017 14:15:11 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711061415.vA6EFBG4006664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 6 Nov 2017 14:15:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325476 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 325476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 14:15:12 -0000 Author: eugen (ports committer) Date: Mon Nov 6 14:15:10 2017 New Revision: 325476 URL: https://svnweb.freebsd.org/changeset/base/325476 Log: r325473 (MFC r324212) missed mergeinfo for unknown reason. Fix it. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Mon Nov 6 15:12:31 2017 Return-Path: Delivered-To: svn-src-all@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 BC7D3E60442; Mon, 6 Nov 2017 15:12:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2A472916; Mon, 6 Nov 2017 15:12:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FCUOj032093; Mon, 6 Nov 2017 15:12:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FCUvl032091; Mon, 6 Nov 2017 15:12:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711061512.vA6FCUvl032091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 6 Nov 2017 15:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r325477 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: avg X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 325477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:12:31 -0000 Author: avg Date: Mon Nov 6 15:12:30 2017 New Revision: 325477 URL: https://svnweb.freebsd.org/changeset/base/325477 Log: Belatedly upgrade Eugene Grosbein (eugen) to a src committer. Eugene has been committing as an approved src committer since September, but he did so under a port committer hat because of my oversight. Also add to mentors as well. Approved by: core Pointyhat to: avg Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon Nov 6 14:15:10 2017 (r325476) +++ svnadmin/conf/access Mon Nov 6 15:12:30 2017 (r325477) @@ -72,6 +72,7 @@ emaste emax eri erj +eugen fabient fanf fsu Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Nov 6 14:15:10 2017 (r325476) +++ svnadmin/conf/mentors Mon Nov 6 15:12:30 2017 (r325477) @@ -15,6 +15,7 @@ anish neel Co-mentor: grehan arichardson jhb Co-mentor: brooks def pjd eri ae Co-mentor: thompsa +eugene avg Co-mentor: mav fsu pfg gordon delphij Co-mentor: emaste ivadasz adrian Co-mentor: cognet From owner-svn-src-all@freebsd.org Mon Nov 6 15:21:41 2017 Return-Path: Delivered-To: svn-src-all@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 C7121E6086D; Mon, 6 Nov 2017 15:21:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3E0672E20; Mon, 6 Nov 2017 15:21:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FLeIK036194; Mon, 6 Nov 2017 15:21:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FLetF036182; Mon, 6 Nov 2017 15:21:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711061521.vA6FLetF036182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 Nov 2017 15:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325478 - in head/sys/boot: . libsa32 powerpc powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . libsa32 powerpc powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot X-SVN-Commit-Revision: 325478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:21:41 -0000 Author: imp Date: Mon Nov 6 15:21:39 2017 New Revision: 325478 URL: https://svnweb.freebsd.org/changeset/base/325478 Log: Powerpc is a 32-bit boot loader. Stop building libsa32 on powerpc. Build everything on powerpc64 -m32. Transition to using LIBSA from LIBSA32. This elimiantes the useless build of libsa on powerpc64 (nothing used to use it) and should be a more direct way of saying this. Sponsored by: Netflix Modified: head/sys/boot/Makefile.powerpc head/sys/boot/defs.mk head/sys/boot/libsa32/Makefile head/sys/boot/powerpc/Makefile.inc head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile Modified: head/sys/boot/Makefile.powerpc ============================================================================== --- head/sys/boot/Makefile.powerpc Mon Nov 6 15:12:30 2017 (r325477) +++ head/sys/boot/Makefile.powerpc Mon Nov 6 15:21:39 2017 (r325478) @@ -4,6 +4,5 @@ SUBDIR+= fdt .endif -SUBDIR+= libsa32 SUBDIR+= ofw SUBDIR+= uboot Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Mon Nov 6 15:12:30 2017 (r325477) +++ head/sys/boot/defs.mk Mon Nov 6 15:21:39 2017 (r325478) @@ -86,4 +86,10 @@ CFLAGS+= -DLOADER_GELI_SUPPORT .endif .endif +# All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc +# or powerpc64. +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -m32 -mcpu=powerpc +.endif + .endif # __BOOT_DEFS_MK__ Modified: head/sys/boot/libsa32/Makefile ============================================================================== --- head/sys/boot/libsa32/Makefile Mon Nov 6 15:12:30 2017 (r325477) +++ head/sys/boot/libsa32/Makefile Mon Nov 6 15:21:39 2017 (r325478) @@ -9,7 +9,7 @@ LIBSA_CPUARCH=i386 LIBSA_CPUARCH=${MACHINE_CPUARCH} .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_ARCH} == "amd64" CFLAGS+= -m32 -I. .endif Modified: head/sys/boot/powerpc/Makefile.inc ============================================================================== --- head/sys/boot/powerpc/Makefile.inc Mon Nov 6 15:12:30 2017 (r325477) +++ head/sys/boot/powerpc/Makefile.inc Mon Nov 6 15:21:39 2017 (r325478) @@ -1,7 +1,3 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -.endif - .include "../Makefile.inc" Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Mon Nov 6 15:12:30 2017 (r325477) +++ head/sys/boot/powerpc/kboot/Makefile Mon Nov 6 15:21:39 2017 (r325478) @@ -51,8 +51,8 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe # 64-bit bridge extensions CFLAGS+= -Wa,-mppc64bridge -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} loader.help: help.common help.kboot ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Nov 6 15:12:30 2017 (r325477) +++ head/sys/boot/powerpc/ofw/Makefile Mon Nov 6 15:21:39 2017 (r325478) @@ -55,8 +55,8 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} loader.help: help.common help.ofw ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Mon Nov 6 15:12:30 2017 (r325477) +++ head/sys/boot/powerpc/ps3/Makefile Mon Nov 6 15:21:39 2017 (r325478) @@ -47,8 +47,8 @@ CFLAGS+= -DRELOC=${RELOC} LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc -DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA} SC_DFLT_FONT=cp437 Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Mon Nov 6 15:12:30 2017 (r325477) +++ head/sys/boot/powerpc/uboot/Makefile Mon Nov 6 15:21:39 2017 (r325478) @@ -35,8 +35,8 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe .include "${BOOTSRC}/uboot.mk" -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt cat ${.ALLSRC} | \ From owner-svn-src-all@freebsd.org Mon Nov 6 15:21:46 2017 Return-Path: Delivered-To: svn-src-all@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 C4B35E60894; Mon, 6 Nov 2017 15:21:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9291B72E72; Mon, 6 Nov 2017 15:21:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FLjdM036249; Mon, 6 Nov 2017 15:21:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FLjsI036247; Mon, 6 Nov 2017 15:21:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711061521.vA6FLjsI036247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 Nov 2017 15:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325479 - in head/sys/boot: . i386/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . i386/loader X-SVN-Commit-Revision: 325479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:21:46 -0000 Author: imp Date: Mon Nov 6 15:21:45 2017 New Revision: 325479 URL: https://svnweb.freebsd.org/changeset/base/325479 Log: Define LIBFICL32 to be libficl.a on i386 and libficl32.a on amd64. Sponsored by: Netflix Modified: head/sys/boot/defs.mk head/sys/boot/i386/loader/Makefile Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Mon Nov 6 15:21:39 2017 (r325478) +++ head/sys/boot/defs.mk Mon Nov 6 15:21:45 2017 (r325479) @@ -25,7 +25,11 @@ BINDIR?= /boot # NB: The makefiles depend on these being empty when we don't build forth. .if ${MK_FORTH} != "no" LIBFICL= ${BOOTOBJ}/ficl/libficl.a +.if ${MACHINE} == "i386" +LIBFICL32= ${LIBFICL} +.else LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a +.endif .endif LIBSA= ${BOOTOBJ}/libsa/libsa.a .if ${MACHINE} == "i386" Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Nov 6 15:21:39 2017 (r325478) +++ head/sys/boot/i386/loader/Makefile Mon Nov 6 15:21:45 2017 (r325479) @@ -101,15 +101,8 @@ FILES+= loader.rc menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -# XXX not happy with this construct, revisit -.if ${MACHINE_CPUARCH} == "amd64" -FICL= ${LIBFICL32} -.else -FICL= ${LIBFICL} -.endif - -DPADD= ${FICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} -LDADD= ${FICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +DPADD= ${LIBFICL32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +LDADD= ${LIBFICL32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} .include From owner-svn-src-all@freebsd.org Mon Nov 6 15:21:53 2017 Return-Path: Delivered-To: svn-src-all@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 3D03BE608D1; Mon, 6 Nov 2017 15:21:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15DF472F1E; Mon, 6 Nov 2017 15:21:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FLqm0036308; Mon, 6 Nov 2017 15:21:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FLpCp036302; Mon, 6 Nov 2017 15:21:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711061521.vA6FLpCp036302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 Nov 2017 15:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325480 - in head/sys/boot: . ficl ficl32 libsa32 zfs zfs32 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . ficl ficl32 libsa32 zfs zfs32 X-SVN-Commit-Revision: 325480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:21:53 -0000 Author: imp Date: Mon Nov 6 15:21:51 2017 New Revision: 325480 URL: https://svnweb.freebsd.org/changeset/base/325480 Log: Use DO32 for all the places that we need to flag we're building a 32 bit version of a library. Use a generic name since this may be usefule elsewhere. Sponsored by: Netflix Modified: head/sys/boot/ficl.mk head/sys/boot/ficl/Makefile head/sys/boot/ficl32/Makefile head/sys/boot/libsa32/Makefile head/sys/boot/zfs/Makefile head/sys/boot/zfs32/Makefile Modified: head/sys/boot/ficl.mk ============================================================================== --- head/sys/boot/ficl.mk Mon Nov 6 15:21:45 2017 (r325479) +++ head/sys/boot/ficl.mk Mon Nov 6 15:21:51 2017 (r325480) @@ -4,7 +4,7 @@ .include "defs.mk" -.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 FICL_CPUARCH= i386 .elif ${MACHINE_ARCH:Mmips64*} != "" FICL_CPUARCH= mips64 @@ -15,7 +15,7 @@ FICL_CPUARCH= ${MACHINE_CPUARCH} .PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH} .if ${MACHINE_CPUARCH} == "amd64" -.if defined(FICL32) +.if ${DO32:U0} == 1 CFLAGS+= -m32 -I. .else CFLAGS+= -fPIC @@ -30,7 +30,7 @@ CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I$ CFLAGS+= -DBOOT_FORTH CFLAGS+= -DBF_DICTSIZE=15000 -.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 .if !exists(machine) ${SRCS:M*.c:R:S/$/.o/g}: machine Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Mon Nov 6 15:21:45 2017 (r325479) +++ head/sys/boot/ficl/Makefile Mon Nov 6 15:21:51 2017 (r325480) @@ -10,9 +10,13 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o .if ${MACHINE_CPUARCH} == "i386" || \ - (${MACHINE_CPUARCH} == "amd64" && defined(FICL32)) + (${MACHINE_CPUARCH} == "amd64" && defined(DO32)) CFLAGS+= -march=i386 .endif +.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) +CFLAGS+= -m32 +.endif + .if defined(HAVE_PNP) CFLAGS+= -DHAVE_PNP .endif Modified: head/sys/boot/ficl32/Makefile ============================================================================== --- head/sys/boot/ficl32/Makefile Mon Nov 6 15:21:45 2017 (r325479) +++ head/sys/boot/ficl32/Makefile Mon Nov 6 15:21:51 2017 (r325480) @@ -1,5 +1,5 @@ # $FreeBSD$ -FICL32= +DO32=1 .include "${.CURDIR}/../ficl/Makefile" Modified: head/sys/boot/libsa32/Makefile ============================================================================== --- head/sys/boot/libsa32/Makefile Mon Nov 6 15:21:45 2017 (r325479) +++ head/sys/boot/libsa32/Makefile Mon Nov 6 15:21:51 2017 (r325480) @@ -1,5 +1,7 @@ # $FreeBSD$ +DO32=1 + .include LIB=sa32 Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Mon Nov 6 15:21:45 2017 (r325479) +++ head/sys/boot/zfs/Makefile Mon Nov 6 15:21:51 2017 (r325480) @@ -17,16 +17,16 @@ CFLAGS+= -I${SYSDIR}/cddl/boot/zfs CFLAGS+= -I${SYSDIR}/crypto/skein .if ${MACHINE_CPUARCH} == "i386" || \ - (${MACHINE_CPUARCH} == "amd64" && defined(ZFS32)) + (${MACHINE_CPUARCH} == "amd64" && defined(DO32)) CFLAGS+= -march=i386 .endif -.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32) +.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) CFLAGS+= -m32 .endif CFLAGS+= -Wformat -Wall -.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32) +.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) CLEANFILES+= machine machine: .NOMETA ln -sf ${SYSDIR}/i386/include machine @@ -35,7 +35,7 @@ machine: .NOMETA .include .include -.if ${MACHINE_CPUARCH} == "amd64" && defined(ZFS32) +.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) .if !exists(machine) beforedepend ${OBJS}: machine .endif Modified: head/sys/boot/zfs32/Makefile ============================================================================== --- head/sys/boot/zfs32/Makefile Mon Nov 6 15:21:45 2017 (r325479) +++ head/sys/boot/zfs32/Makefile Mon Nov 6 15:21:51 2017 (r325480) @@ -1,5 +1,5 @@ # $FreeBSD$ -ZFS32=1 +DO32=1 .include "${.CURDIR}/../zfs/Makefile" From owner-svn-src-all@freebsd.org Mon Nov 6 15:21:58 2017 Return-Path: Delivered-To: svn-src-all@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 5FFA2E60924; Mon, 6 Nov 2017 15:21:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12BD072FC1; Mon, 6 Nov 2017 15:21:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FLvGl036361; Mon, 6 Nov 2017 15:21:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FLvNB036360; Mon, 6 Nov 2017 15:21:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711061521.vA6FLvNB036360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 Nov 2017 15:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325481 - head/sys/boot/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/libsa X-SVN-Commit-Revision: 325481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:21:58 -0000 Author: imp Date: Mon Nov 6 15:21:56 2017 New Revision: 325481 URL: https://svnweb.freebsd.org/changeset/base/325481 Log: Prefer bsd.init.mk to other constructs. Sponsored by: Netflix Modified: head/sys/boot/libsa/Makefile Modified: head/sys/boot/libsa/Makefile ============================================================================== --- head/sys/boot/libsa/Makefile Mon Nov 6 15:21:51 2017 (r325480) +++ head/sys/boot/libsa/Makefile Mon Nov 6 15:21:56 2017 (r325481) @@ -9,9 +9,7 @@ MK_PROFILE= no MK_SSP= no -.include - -.include "../Makefile.inc" +.include INTERNALLIB= LIBSA_CPUARCH?=${MACHINE_CPUARCH} From owner-svn-src-all@freebsd.org Mon Nov 6 15:22:07 2017 Return-Path: Delivered-To: svn-src-all@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 BFF85E6099E; Mon, 6 Nov 2017 15:22:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84FDD730FD; Mon, 6 Nov 2017 15:22:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FM6qY036456; Mon, 6 Nov 2017 15:22:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FM4Hg036436; Mon, 6 Nov 2017 15:22:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711061522.vA6FM4Hg036436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 Nov 2017 15:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325482 - in head/sys/boot: . efi/boot1 efi/fdt efi/loader i386 i386/boot2 i386/gptboot i386/gptzfsboot i386/libfirewire i386/libi386 i386/loader i386/zfsboot libsa32 ofw/libofw uboot/f... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . efi/boot1 efi/fdt efi/loader i386 i386/boot2 i386/gptboot i386/gptzfsboot i386/libfirewire i386/libi386 i386/loader i386/zfsboot libsa32 ofw/libofw uboot/fdt uboot/lib zfs X-SVN-Commit-Revision: 325482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:22:07 -0000 Author: imp Date: Mon Nov 6 15:22:04 2017 New Revision: 325482 URL: https://svnweb.freebsd.org/changeset/base/325482 Log: Move machine and other link creation to defs.mk Steal the code from kmod.mk and use it to automatically create links. Modify it a little for the needs of the loader (no need to guess the OBJS dependency, and we have 32-on-64 cases to contend with). Remove 15 redundant implementations (which were mostly different, but kinda the same). A future commit should factor out this code and that of kmod.mk so we have only one copy of it in the tree. Sposnored by: Netflix Modified: head/sys/boot/defs.mk head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/ficl.mk head/sys/boot/i386/Makefile.inc head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/libfirewire/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/libsa32/Makefile head/sys/boot/ofw/libofw/Makefile head/sys/boot/uboot/fdt/Makefile head/sys/boot/uboot/lib/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/defs.mk Mon Nov 6 15:22:04 2017 (r325482) @@ -96,4 +96,43 @@ CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -m32 -mcpu=powerpc .endif +_ILINKS=machine +.if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" +_ILINKS+=${MACHINE_CPUARCH} +.endif +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +_ILINKS+=x86 +.endif +CLEANFILES+=${_ILINKS} + +all: ${PROG} + +beforedepend: ${_ILINKS} +beforebuild: ${_ILINKS} + +# Ensure that the links exist without depending on it when it exists which +# causes all the modules to be rebuilt when the directory pointed to changes. +.for _link in ${_ILINKS} +.if !exists(${.OBJDIR}/${_link}) +${OBJS}: ${_link} +.endif +.endfor + +.NOPATH: ${_ILINKS} + +${_ILINKS}: + @case ${.TARGET} in \ + machine) \ + if [ ${DO32:U0} -eq 0 ]; then \ + path=${SYSDIR}/${MACHINE}/include ; \ + else \ + path=${SYSDIR}/${MACHINE:C/amd64/i386/}/include ; \ + fi ;; \ + *) \ + path=${SYSDIR}/${.TARGET:T}/include ;; \ + esac ; \ + path=`(cd $$path && /bin/pwd)` ; \ + ${ECHO} ${.TARGET:T} "->" $$path ; \ + ln -fhs $$path ${.TARGET:T} + .endif # __BOOT_DEFS_MK__ Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/efi/boot1/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -129,18 +129,3 @@ boot1.efifat: boot1.efi CLEANFILES= boot1.efi boot1.efifat .include - -beforedepend ${OBJS}: machine - -CLEANFILES+= machine - -machine: .NOMETA - ln -sf ${SYSDIR}/${MACHINE}/include machine - -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -beforedepend ${OBJS}: x86 -CLEANFILES+= x86 - -x86: .NOMETA - ln -sf ${SYSDIR}/x86/include x86 -.endif Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/efi/fdt/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -27,11 +27,4 @@ CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. -machine: .NOMETA - ln -sf ${SYSDIR}/${MACHINE}/include machine - -CLEANFILES+= machine - .include - -beforedepend ${OBJS}: machine Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/efi/loader/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -133,18 +133,3 @@ DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} $ LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBZFSBOOT} ${LIBSA} .include - -beforedepend ${OBJS}: machine - -CLEANFILES+= machine - -machine: .NOMETA - ln -sf ${SYSDIR}/${MACHINE}/include machine - -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -beforedepend ${OBJS}: x86 -CLEANFILES+= x86 - -x86: .NOMETA - ln -sf ${SYSDIR}/x86/include x86 -.endif Modified: head/sys/boot/ficl.mk ============================================================================== --- head/sys/boot/ficl.mk Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/ficl.mk Mon Nov 6 15:22:04 2017 (r325482) @@ -29,16 +29,3 @@ CFLAGS+= -m32 -mcpu=powerpc -I. CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} CFLAGS+= -DBOOT_FORTH CFLAGS+= -DBF_DICTSIZE=15000 - -.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1 -.if !exists(machine) -${SRCS:M*.c:R:S/$/.o/g}: machine - -beforedepend ${OBJS}: machine -.endif - -machine: .NOMETA - ln -sf ${SYSDIR}/i386/include machine - -CLEANFILES+= machine -.endif Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/i386/Makefile.inc Mon Nov 6 15:22:04 2017 (r325482) @@ -30,6 +30,7 @@ ACFLAGS+= -m32 # LD_FLAGS is passed directly to ${LD}, not via ${CC}: LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 +DO32=1 .endif .include "../Makefile.inc" Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/i386/boot2/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -93,13 +93,6 @@ boot2.h: boot1.out ORG1=`printf "%d" ${ORG1}` \ REL1=`printf "%d" ${REL1}` > ${.TARGET} -.if ${MACHINE_CPUARCH} == "amd64" -beforedepend boot2.s: machine -CLEANFILES+= machine -machine: ${SYSDIR}/i386/include .NOMETA - ln -sf ${.ALLSRC} ${.TARGET} -.endif - .include # XXX: clang integrated-as doesn't grok .codeNN directives yet Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/i386/gptboot/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -76,13 +76,6 @@ gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o c gptboot.o: ${SASRC}/ufsread.c -.if ${MACHINE_CPUARCH} == "amd64" -beforedepend gptboot.o: machine -CLEANFILES+= machine -machine: .NOMETA - ln -sf ${SYSDIR}/i386/include machine -.endif - .include # XXX: clang integrated-as doesn't grok .codeNN directives yet Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/i386/gptzfsboot/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -88,13 +88,6 @@ gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o zfsboot.o: ${ZFSSRC}/zfsimpl.c -.if ${MACHINE_CPUARCH} == "amd64" -beforedepend zfsboot.o: machine -CLEANFILES+= machine -machine: .NOMETA - ln -sf ${SYSDIR}/i386/include machine -.endif - .include # XXX: clang integrated-as doesn't grok .codeNN directives yet Modified: head/sys/boot/i386/libfirewire/Makefile ============================================================================== --- head/sys/boot/i386/libfirewire/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/i386/libfirewire/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -17,15 +17,4 @@ CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -Wformat -Wall -.if ${MACHINE_CPUARCH} == "amd64" -CLEANFILES+= machine -machine: .NOMETA - ln -sf ${SYSDIR}/i386/include machine -.endif - .include - -.if ${MACHINE_CPUARCH} == "amd64" -beforedepend ${OBJS}: machine -.endif - Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/i386/libi386/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -58,18 +58,8 @@ CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} -.if ${MACHINE_CPUARCH} == "amd64" -CLEANFILES+= machine -machine: .NOMETA - ln -sf ${SYSDIR}/i386/include machine -.endif - .include # XXX: clang integrated-as doesn't grok .codeNN directives yet CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS} CFLAGS.multiboot_tramp.S= ${CLANG_NO_IAS} - -.if ${MACHINE_CPUARCH} == "amd64" -beforedepend ${OBJS}: machine -.endif Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/i386/loader/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -104,12 +104,8 @@ OBJS= ${BTXCRT} DPADD= ${LIBFICL32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} LDADD= ${LIBFICL32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} -.include - .if ${MACHINE_CPUARCH} == "amd64" -beforedepend ${OBJS}: machine -CLEANFILES+= machine CFLAGS+= -DLOADER_PREFER_AMD64 -machine: .NOMETA - ln -sf ${SYSDIR}/i386/include machine .endif + +.include Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/i386/zfsboot/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -87,13 +87,6 @@ zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o ut SRCS= zfsboot.c -.if ${MACHINE_CPUARCH} == "amd64" -beforedepend zfsboot.o: machine -CLEANFILES+= machine -machine: .NOMETA - ln -sf ${SYSDIR}/i386/include machine -.endif - .include # XXX: clang integrated-as doesn't grok .codeNN directives yet Modified: head/sys/boot/libsa32/Makefile ============================================================================== --- head/sys/boot/libsa32/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/libsa32/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -17,10 +17,3 @@ CFLAGS+= -m32 -I. .PATH: ${SASRC} .include "${SASRC}/Makefile" - -.if ${MACHINE_CPUARCH} == "amd64" -CLEANFILES+= machine -beforedepend ${OBJS}: machine -machine: .NOMETA - ln -fs ${SYSDIR}/i386/include machine -.endif Modified: head/sys/boot/ofw/libofw/Makefile ============================================================================== --- head/sys/boot/ofw/libofw/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/ofw/libofw/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -25,11 +25,4 @@ SRCS+= ppc64_elf_freebsd.c CFLAGS+= -DDISK_DEBUG .endif -machine: .NOMETA - ln -sf ${SYSDIR}/${MACHINE_CPUARCH}/include machine - -CLEANFILES+= machine - .include - -beforedepend ${OBJS}: machine Modified: head/sys/boot/uboot/fdt/Makefile ============================================================================== --- head/sys/boot/uboot/fdt/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/uboot/fdt/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -21,12 +21,5 @@ CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. -machine: .NOMETA - ln -sf ${SYSDIR}/${MACHINE_CPUARCH}/include machine - -CLEANFILES+= machine - .include .include - -beforedepend ${OBJS}: machine Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/uboot/lib/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -38,12 +38,5 @@ CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. CFLAGS+= -DDISK_DEBUG .endif -machine: .NOMETA - ln -sf ${SYSDIR}/${MACHINE_CPUARCH}/include machine - -CLEANFILES+= machine - .include .include - -beforedepend ${OBJS}: machine Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Mon Nov 6 15:21:56 2017 (r325481) +++ head/sys/boot/zfs/Makefile Mon Nov 6 15:22:04 2017 (r325482) @@ -26,17 +26,5 @@ CFLAGS+= -m32 CFLAGS+= -Wformat -Wall -.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) -CLEANFILES+= machine -machine: .NOMETA - ln -sf ${SYSDIR}/i386/include machine -.endif - .include .include - -.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) -.if !exists(machine) -beforedepend ${OBJS}: machine -.endif -.endif From owner-svn-src-all@freebsd.org Mon Nov 6 15:22:12 2017 Return-Path: Delivered-To: svn-src-all@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 B170AE609DD; Mon, 6 Nov 2017 15:22:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB3373180; Mon, 6 Nov 2017 15:22:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FMB6u036514; Mon, 6 Nov 2017 15:22:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FMBSs036513; Mon, 6 Nov 2017 15:22:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711061522.vA6FMBSs036513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 Nov 2017 15:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325483 - head/sys/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot X-SVN-Commit-Revision: 325483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:22:12 -0000 Author: imp Date: Mon Nov 6 15:22:11 2017 New Revision: 325483 URL: https://svnweb.freebsd.org/changeset/base/325483 Log: MACHINE can never be powerpc64, so cleanup code that thinks it can. Sponsored by: Netflix Modified: head/sys/boot/Makefile Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Mon Nov 6 15:22:04 2017 (r325482) +++ head/sys/boot/Makefile Mon Nov 6 15:22:11 2017 (r325483) @@ -13,10 +13,8 @@ SUBDIR+= man .include -# Pick the machine-dependent subdir based on the target architecture. -ADIR= ${MACHINE:S/powerpc64/powerpc/} -.if exists(${.CURDIR}/${ADIR}/.) -SUBDIR+= ${ADIR} +.if exists(${.CURDIR}/${MACHINE}/.) +SUBDIR+= ${MACHINE} .endif .include From owner-svn-src-all@freebsd.org Mon Nov 6 15:22:19 2017 Return-Path: Delivered-To: svn-src-all@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 352C4E60A3D; Mon, 6 Nov 2017 15:22:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE26D73260; Mon, 6 Nov 2017 15:22:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FMIWO036573; Mon, 6 Nov 2017 15:22:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FMH59036567; Mon, 6 Nov 2017 15:22:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711061522.vA6FMH59036567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 Nov 2017 15:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325484 - in head/sys/boot: . efi geli i386 man uboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . efi geli i386 man uboot X-SVN-Commit-Revision: 325484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:22:19 -0000 Author: imp Date: Mon Nov 6 15:22:17 2017 New Revision: 325484 URL: https://svnweb.freebsd.org/changeset/base/325484 Log: Prefer bsd.init.mk to src.opts.mk Final sweep to prefer bsd.init.mk to src.opts.mk everywhere as a design pattern. The rule is that all Makefiles in this subtree should start with .include so that we properly include ../Makefile.inc and defs.mk before anything else. Sponsored by: Netflix Modified: head/sys/boot/Makefile.inc head/sys/boot/efi/Makefile head/sys/boot/geli/Makefile head/sys/boot/i386/Makefile head/sys/boot/man/Makefile head/sys/boot/uboot/Makefile Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Mon Nov 6 15:22:11 2017 (r325483) +++ head/sys/boot/Makefile.inc Mon Nov 6 15:22:17 2017 (r325484) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .include "defs.mk" .if !defined(__BOOT_MAKEFILE_INC__) Modified: head/sys/boot/efi/Makefile ============================================================================== --- head/sys/boot/efi/Makefile Mon Nov 6 15:22:11 2017 (r325483) +++ head/sys/boot/efi/Makefile Mon Nov 6 15:22:17 2017 (r325484) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include # In-tree GCC does not support __attribute__((ms_abi)), but gcc newer # than 4.5 supports it. Modified: head/sys/boot/geli/Makefile ============================================================================== --- head/sys/boot/geli/Makefile Mon Nov 6 15:22:11 2017 (r325483) +++ head/sys/boot/geli/Makefile Mon Nov 6 15:22:17 2017 (r325484) @@ -3,9 +3,8 @@ MAN= -.include -MK_SSP= no .include +MK_SSP= no LIB= geliboot INTERNALLIB= Modified: head/sys/boot/i386/Makefile ============================================================================== --- head/sys/boot/i386/Makefile Mon Nov 6 15:22:11 2017 (r325483) +++ head/sys/boot/i386/Makefile Mon Nov 6 15:22:17 2017 (r325484) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ libi386 libfirewire loader Modified: head/sys/boot/man/Makefile ============================================================================== --- head/sys/boot/man/Makefile Mon Nov 6 15:22:11 2017 (r325483) +++ head/sys/boot/man/Makefile Mon Nov 6 15:22:17 2017 (r325484) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include MAN+= loader.8 .if ${MK_ZFS} != "no" Modified: head/sys/boot/uboot/Makefile ============================================================================== --- head/sys/boot/uboot/Makefile Mon Nov 6 15:22:11 2017 (r325483) +++ head/sys/boot/uboot/Makefile Mon Nov 6 15:22:17 2017 (r325484) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include SUBDIR= lib From owner-svn-src-all@freebsd.org Mon Nov 6 15:22:26 2017 Return-Path: Delivered-To: svn-src-all@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 56087E60AAD; Mon, 6 Nov 2017 15:22:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3003173346; Mon, 6 Nov 2017 15:22:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FMP4B036636; Mon, 6 Nov 2017 15:22:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FMOtZ036626; Mon, 6 Nov 2017 15:22:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711061522.vA6FMOtZ036626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 6 Nov 2017 15:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325485 - in head/sys/boot: . fdt ficl geli i386 libsa32 ofw uboot zfs X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . fdt ficl geli i386 libsa32 ofw uboot zfs X-SVN-Commit-Revision: 325485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:22:26 -0000 Author: imp Date: Mon Nov 6 15:22:24 2017 New Revision: 325485 URL: https://svnweb.freebsd.org/changeset/base/325485 Log: Centralize all 32-bit builds on 64-bit platform stuff. Move the addition of the -m32 and other flags to defs.mk. Remove redunant copies of -m32 that come from multiple locations. Sponsored by: Netflix Modified: head/sys/boot/defs.mk head/sys/boot/fdt/Makefile head/sys/boot/ficl.mk head/sys/boot/ficl/Makefile head/sys/boot/geli/Makefile head/sys/boot/i386/Makefile.inc head/sys/boot/libsa32/Makefile head/sys/boot/ofw/Makefile.inc head/sys/boot/uboot/Makefile.inc head/sys/boot/zfs/Makefile Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/defs.mk Mon Nov 6 15:22:24 2017 (r325485) @@ -96,6 +96,16 @@ CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -m32 -mcpu=powerpc .endif +# For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is +# build 32-bit and some 64-bit (lib*, efi). Centralize all the 32-bit magic here +# and activate it when DO32 is explicitly defined to be 1. +.if ${MACHINE_ARCH} == "amd64" && ${DO32:U0} == 1 +CFLAGS+= -m32 -mcpu=i386 +# LD_FLAGS is passed directly to ${LD}, not via ${CC}: +LD_FLAGS+= -m elf_i386_fbsd +AFLAGS+= --32 +.endif + _ILINKS=machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" _ILINKS+=${MACHINE_CPUARCH} Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/fdt/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -22,10 +22,6 @@ CFLAGS+= -ffreestanding CFLAGS+= -msoft-float .endif -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -.endif - CFLAGS+= -Wformat -Wall .include Modified: head/sys/boot/ficl.mk ============================================================================== --- head/sys/boot/ficl.mk Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/ficl.mk Mon Nov 6 15:22:24 2017 (r325485) @@ -14,16 +14,8 @@ FICL_CPUARCH= ${MACHINE_CPUARCH} .PATH: ${FICLSRC} ${FICLSRC}/${FICL_CPUARCH} -.if ${MACHINE_CPUARCH} == "amd64" -.if ${DO32:U0} == 1 -CFLAGS+= -m32 -I. -.else +.if ${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 0 CFLAGS+= -fPIC -.endif -.endif - -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/ficl/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -9,13 +9,6 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o -.if ${MACHINE_CPUARCH} == "i386" || \ - (${MACHINE_CPUARCH} == "amd64" && defined(DO32)) -CFLAGS+= -march=i386 -.endif -.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) -CFLAGS+= -m32 -.endif .if defined(HAVE_PNP) CFLAGS+= -DHAVE_PNP Modified: head/sys/boot/geli/Makefile ============================================================================== --- head/sys/boot/geli/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/geli/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -14,7 +14,7 @@ NO_PIC= .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 .endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_ARCH} == "amd64" CFLAGS+= -m32 .endif Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/i386/Makefile.inc Mon Nov 6 15:22:24 2017 (r325485) @@ -25,11 +25,6 @@ LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat LD_FLAGS_BIN=-static -N --gc-sections .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -ACFLAGS+= -m32 -# LD_FLAGS is passed directly to ${LD}, not via ${CC}: -LD_FLAGS+= -m elf_i386_fbsd -AFLAGS+= --32 DO32=1 .endif Modified: head/sys/boot/libsa32/Makefile ============================================================================== --- head/sys/boot/libsa32/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/libsa32/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -5,15 +5,9 @@ DO32=1 .include LIB=sa32 -.if ${MACHINE_CPUARCH} == "amd64" -LIBSA_CPUARCH=i386 -.else -LIBSA_CPUARCH=${MACHINE_CPUARCH} -.endif +LIBSA_CPUARCH=${MACHINE_CPUARCH:C/amd64/i386/} -.if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -m32 -I. -.endif +CFLAGS+= -I. .PATH: ${SASRC} .include "${SASRC}/Makefile" Modified: head/sys/boot/ofw/Makefile.inc ============================================================================== --- head/sys/boot/ofw/Makefile.inc Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/ofw/Makefile.inc Mon Nov 6 15:22:24 2017 (r325485) @@ -1,8 +1,3 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -LDFLAGS+= -m elf32ppc_fbsd -.endif - .include "../Makefile.inc" Modified: head/sys/boot/uboot/Makefile.inc ============================================================================== --- head/sys/boot/uboot/Makefile.inc Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/uboot/Makefile.inc Mon Nov 6 15:22:24 2017 (r325485) @@ -1,8 +1,3 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -LDFLAGS+= -m elf32ppc_fbsd -.endif - .include "../Makefile.inc" Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Mon Nov 6 15:22:17 2017 (r325484) +++ head/sys/boot/zfs/Makefile Mon Nov 6 15:22:24 2017 (r325485) @@ -16,14 +16,6 @@ CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. CFLAGS+= -I${SYSDIR}/cddl/boot/zfs CFLAGS+= -I${SYSDIR}/crypto/skein -.if ${MACHINE_CPUARCH} == "i386" || \ - (${MACHINE_CPUARCH} == "amd64" && defined(DO32)) -CFLAGS+= -march=i386 -.endif -.if ${MACHINE_CPUARCH} == "amd64" && defined(DO32) -CFLAGS+= -m32 -.endif - CFLAGS+= -Wformat -Wall .include From owner-svn-src-all@freebsd.org Mon Nov 6 15:29:34 2017 Return-Path: Delivered-To: svn-src-all@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 73873E60D1E; Mon, 6 Nov 2017 15:29:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4239673C1D; Mon, 6 Nov 2017 15:29:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6FTXCf037082; Mon, 6 Nov 2017 15:29:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6FTXvM037081; Mon, 6 Nov 2017 15:29:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711061529.vA6FTXvM037081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 6 Nov 2017 15:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325486 - head X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 15:29:34 -0000 Author: avg Date: Mon Nov 6 15:29:33 2017 New Revision: 325486 URL: https://svnweb.freebsd.org/changeset/base/325486 Log: Add an UPDATING entry for the posix_fallocate/ZFS change, r325320 Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Nov 6 15:22:24 2017 (r325485) +++ head/UPDATING Mon Nov 6 15:29:33 2017 (r325486) @@ -51,6 +51,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20171106: + The naive and non-compliant support of posix_fallocate(2) in ZFS + has been removed as of r325320. The system call now returns EINVAL + when used on a ZFS file. Although the new behavior complies with the + standard, some consumers are not prepared to cope with it. + One known victim is lld prior to r325420. + 20171102: Building in a FreeBSD src checkout will automatically create object directories now rather than store files in the current directory if From owner-svn-src-all@freebsd.org Mon Nov 6 16:23:22 2017 Return-Path: Delivered-To: svn-src-all@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 5E1FFE622E5; Mon, 6 Nov 2017 16:23:22 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 37FAB75CC0; Mon, 6 Nov 2017 16:23:22 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6GNLpi062640; Mon, 6 Nov 2017 16:23:21 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6GNLUB062639; Mon, 6 Nov 2017 16:23:21 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201711061623.vA6GNLUB062639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 6 Nov 2017 16:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325487 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 325487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 16:23:22 -0000 Author: shurd Date: Mon Nov 6 16:23:21 2017 New Revision: 325487 URL: https://svnweb.freebsd.org/changeset/base/325487 Log: Only chain non-LRO mbufs when LRO is not possible Preserve packet order between tcp_lro_rx() and if_input() to avoid creating extra corner cases. If no packets can be LROed, combine them into one chain for submission via if_input(). If any packet can potentially be LROed however, retain old behaviour and call if_input() for each packet. This should keep the 12% improvement for small packet forwarding intact, but mostly avoids impacting the LRO case. Reviewed by: cem, sbruno Approved by: sbruno (mentor) Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12876 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Nov 6 15:29:33 2017 (r325486) +++ head/sys/net/iflib.c Mon Nov 6 16:23:21 2017 (r325487) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -68,6 +69,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -2463,7 +2466,48 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) return (m); } +#if defined(INET6) || defined(INET) +/* + * Returns true if it's possible this packet could be LROed. + * if it returns false, it is guaranteed that tcp_lro_rx() + * would not return zero. + */ static bool +iflib_check_lro_possible(struct lro_ctrl *lc, struct mbuf *m) +{ + struct ether_header *eh; + uint16_t eh_type; + + eh = mtod(m, struct ether_header *); + eh_type = ntohs(eh->ether_type); + switch (eh_type) { + case ETHERTYPE_IPV6: + { + CURVNET_SET(lc->ifp->if_vnet); + if (VNET(ip6_forwarding) == 0) { + CURVNET_RESTORE(); + return true; + } + CURVNET_RESTORE(); + break; + } + case ETHERTYPE_IP: + { + CURVNET_SET(lc->ifp->if_vnet); + if (VNET(ipforwarding) == 0) { + CURVNET_RESTORE(); + return true; + } + CURVNET_RESTORE(); + break; + } + } + + return false; +} +#endif + +static bool iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) { if_ctx_t ctx = rxq->ifr_ctx; @@ -2476,6 +2520,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) iflib_fl_t fl; struct ifnet *ifp; int lro_enabled; + bool lro_possible = false; /* * XXX early demux data packets so that if_input processing only handles @@ -2555,8 +2600,6 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) mt = mf = NULL; while (mh != NULL) { m = mh; - if (mf == NULL) - mf = m; mh = mh->m_nextpkt; m->m_nextpkt = NULL; #ifndef __NO_STRICT_ALIGNMENT @@ -2566,12 +2609,27 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) rx_bytes += m->m_pkthdr.len; rx_pkts++; #if defined(INET6) || defined(INET) - if (lro_enabled && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) { - if (mf == m) - mf = NULL; - continue; + if (lro_enabled) { + if (!lro_possible) { + lro_possible = iflib_check_lro_possible(&rxq->ifr_lc, m); + if (lro_possible && mf != NULL) { + ifp->if_input(ifp, mf); + DBG_COUNTER_INC(rx_if_input); + mt = mf = NULL; + } + } + if (lro_possible && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) + continue; } #endif + if (lro_possible) { + ifp->if_input(ifp, m); + DBG_COUNTER_INC(rx_if_input); + continue; + } + + if (mf == NULL) + mf = m; if (mt != NULL) mt->m_nextpkt = m; mt = m; From owner-svn-src-all@freebsd.org Mon Nov 6 16:41:30 2017 Return-Path: Delivered-To: svn-src-all@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 617D9E62792; Mon, 6 Nov 2017 16:41:30 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3CE087650A; Mon, 6 Nov 2017 16:41:30 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6GfTc8070130; Mon, 6 Nov 2017 16:41:29 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6GfTAZ070129; Mon, 6 Nov 2017 16:41:29 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201711061641.vA6GfTAZ070129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 6 Nov 2017 16:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325488 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 325488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 16:41:30 -0000 Author: shurd Date: Mon Nov 6 16:41:29 2017 New Revision: 325488 URL: https://svnweb.freebsd.org/changeset/base/325488 Log: bnxt: Add support for new phy_types and speeds - Part #2 Use our ifm_list of supported media types rather than nested switch statements to find the current media type. Find a supported type that matches the current speed. Remove all workarounds while updating ifmr->ifm_active. For BNXT_IFMEDIA_ADD, added Three more speeds IFM_10G_T, IFM_2500_T & IFM_2500_KX. Submitted by: Bhargava Chenna Marreddy Reviewed by: shurd, sbruno Approved by: sbruno (mentor) Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D12896 Modified: head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Mon Nov 6 16:23:21 2017 (r325487) +++ head/sys/dev/bnxt/if_bnxt.c Mon Nov 6 16:41:29 2017 (r325488) @@ -1198,8 +1198,11 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if { struct bnxt_softc *softc = iflib_get_softc(ctx); struct bnxt_link_info *link_info = &softc->link_info; - uint8_t phy_type = get_phy_type(softc); + struct ifmedia_entry *next; + uint64_t target_baudrate = bnxt_get_baudrate(link_info); + int active_media = IFM_UNKNOWN; + bnxt_update_link(softc, true); ifmr->ifm_status = IFM_AVALID; @@ -1215,171 +1218,17 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if else ifmr->ifm_active |= IFM_HDX; - switch (link_info->link_speed) { - case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100MB: - ifmr->ifm_active |= IFM_100_T; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_1GB: - switch (phy_type) { - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX: - ifmr->ifm_active |= IFM_1000_KX; + /* + * Go through the list of supported media which got prepared + * as part of bnxt_add_media_types() using api ifmedia_add(). + */ + LIST_FOREACH(next, &(iflib_get_media(ctx)->ifm_list), ifm_list) { + if (ifmedia_baudrate(next->ifm_media) == target_baudrate) { + active_media = next->ifm_media; break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET: - ifmr->ifm_active |= IFM_1000_T; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY: - ifmr->ifm_active |= IFM_1000_SGMII; - break; - default: - /* - * Workaround: - * Don't return IFM_UNKNOWN until - * Stratus return proper media_type - */ - ifmr->ifm_active |= IFM_1000_KX; - break; } - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_2_5GB: - switch (phy_type) { - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX: - ifmr->ifm_active |= IFM_2500_KX; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET: - ifmr->ifm_active |= IFM_2500_T; - break; - default: - ifmr->ifm_active |= IFM_UNKNOWN; - break; - } - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_10GB: - switch (phy_type) { - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR: - ifmr->ifm_active |= IFM_10G_CR1; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR: - ifmr->ifm_active |= IFM_10G_KR; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR: - ifmr->ifm_active |= IFM_10G_LR; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR: - ifmr->ifm_active |= IFM_10G_SR; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX: - ifmr->ifm_active |= IFM_10G_KX4; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET: - ifmr->ifm_active |= IFM_10G_T; - break; - default: - /* - * Workaround: - * Don't return IFM_UNKNOWN until - * Stratus return proper media_type - */ - ifmr->ifm_active |= IFM_10G_CR1; - break; - } - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_20GB: - ifmr->ifm_active |= IFM_20G_KR2; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_25GB: - switch (phy_type) { - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR: - ifmr->ifm_active |= IFM_25G_CR; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR: - ifmr->ifm_active |= IFM_25G_KR; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR: - ifmr->ifm_active |= IFM_25G_SR; - break; - default: - /* - * Workaround: - * Don't return IFM_UNKNOWN until - * Stratus return proper media_type - */ - ifmr->ifm_active |= IFM_25G_CR; - break; - } - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_40GB: - switch (phy_type) { - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR: - ifmr->ifm_active |= IFM_40G_CR4; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR: - ifmr->ifm_active |= IFM_40G_KR4; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR: - ifmr->ifm_active |= IFM_40G_LR4; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR: - ifmr->ifm_active |= IFM_40G_SR4; - break; - default: - ifmr->ifm_active |= IFM_UNKNOWN; - break; - } - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_50GB: - switch (phy_type) { - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR: - ifmr->ifm_active |= IFM_50G_CR2; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR: - ifmr->ifm_active |= IFM_50G_KR2; - break; - default: - /* - * Workaround: - * Don't return IFM_UNKNOWN until - * Stratus return proper media_type - */ - ifmr->ifm_active |= IFM_50G_CR2; - break; - } - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_LINK_SPEED_100GB: - switch (phy_type) { - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASECR: - ifmr->ifm_active |= IFM_100G_CR4; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2: - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR: - ifmr->ifm_active |= IFM_100G_KR4; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR: - ifmr->ifm_active |= IFM_100G_LR4; - break; - case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASESR: - ifmr->ifm_active |= IFM_100G_SR4; - break; - default: - /* - * Workaround: - * Don't return IFM_UNKNOWN until - * Stratus return proper media_type - */ - ifmr->ifm_active |= IFM_100G_CR4; - break; - } - default: - return; } + ifmr->ifm_active |= active_media; if (link_info->flow_ctrl.rx) ifmr->ifm_active |= IFM_ETH_RXPAUSE; @@ -2184,6 +2033,8 @@ bnxt_add_media_types(struct bnxt_softc *softc) case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE: + BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_T); + BNXT_IFMEDIA_ADD(supported, SPEEDS_2_5GB, IFM_2500_T); BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_T); BNXT_IFMEDIA_ADD(supported, SPEEDS_100MB, IFM_100_T); BNXT_IFMEDIA_ADD(supported, SPEEDS_10MB, IFM_10_T); @@ -2191,6 +2042,7 @@ bnxt_add_media_types(struct bnxt_softc *softc) case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX: BNXT_IFMEDIA_ADD(supported, SPEEDS_10GB, IFM_10G_KR); + BNXT_IFMEDIA_ADD(supported, SPEEDS_2_5GB, IFM_2500_KX); BNXT_IFMEDIA_ADD(supported, SPEEDS_1GB, IFM_1000_KX); break; From owner-svn-src-all@freebsd.org Mon Nov 6 17:27:51 2017 Return-Path: Delivered-To: svn-src-all@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 C8208E632F7; Mon, 6 Nov 2017 17:27:51 +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 965837780A; Mon, 6 Nov 2017 17:27:51 +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 vA6HRotS088115; Mon, 6 Nov 2017 17:27:50 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6HRo0n088114; Mon, 6 Nov 2017 17:27:50 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711061727.vA6HRo0n088114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 6 Nov 2017 17:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325489 - stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Commit-Revision: 325489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 17:27:51 -0000 Author: gjb Date: Mon Nov 6 17:27:50 2017 New Revision: 325489 URL: https://svnweb.freebsd.org/changeset/base/325489 Log: Document issuing 'vagrant up' a second time will boot properly if the virtual machine does not yet have a MAC address. PR: 223474 (related) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Mon Nov 6 16:41:29 2017 (r325488) +++ stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Mon Nov 6 17:27:50 2017 (r325489) @@ -196,6 +196,23 @@ boot The other utilities mentioned in the entry in the release notes, however, are unchanged. + + + [2017-11-06] An issue with &os; virtual machines with + vagrant was discovered that + affects the VirtualBox where the + virtual machine will not start on the initial boot invoked + with vagrant up. + + The issue is due to the virtual machine + MAC being unset, as &os; does not provide + a default Vagrantfile. + + It has been observed, however, that a subsequent + invocation of vagrant up will allow the + virtual machine to successfully boot, allowing access via + vagrant ssh. + From owner-svn-src-all@freebsd.org Mon Nov 6 17:59:05 2017 Return-Path: Delivered-To: svn-src-all@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 5D991E63DCC; Mon, 6 Nov 2017 17:59:05 +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 2B9517CE39; Mon, 6 Nov 2017 17:59:05 +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 vA6Hx4nY001579; Mon, 6 Nov 2017 17:59:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6Hx4E1001578; Mon, 6 Nov 2017 17:59:04 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711061759.vA6Hx4E1001578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 6 Nov 2017 17:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325490 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 325490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 17:59:05 -0000 Author: gjb Date: Mon Nov 6 17:59:04 2017 New Revision: 325490 URL: https://svnweb.freebsd.org/changeset/base/325490 Log: Specify WITH_UNIFIED_OBJDIR in chroot_arm_build_release() to ensure the output image is created in the correct .OBJDIR. Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Mon Nov 6 17:27:50 2017 (r325489) +++ head/release/release.sh Mon Nov 6 17:59:04 2017 (r325490) @@ -350,9 +350,6 @@ chroot_build_release() { # chroot_arm_build_release(): Create arm SD card image. chroot_arm_build_release() { load_target_env - MAKE_FLAGS="${MAKE_FLAGS} TARGET=${EMBEDDED_TARGET}" - MAKE_FLAGS="${MAKE_FLAGS} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" - eval chroot ${CHROOTDIR} make ${MAKE_FLAGS} -C /usr/src/release obj case ${EMBEDDED_TARGET} in arm|arm64) if [ -e "${RELENGDIR}/tools/arm.subr" ]; then @@ -363,11 +360,14 @@ chroot_arm_build_release() { ;; esac [ ! -z "${RELEASECONF}" ] && . "${RELEASECONF}" - WORLDDIR="$(eval chroot ${CHROOTDIR} make ${MAKE_FLAGS} -C /usr/src/release -V WORLDDIR)" - OBJDIR="$(eval chroot ${CHROOTDIR} make ${MAKE_FLAGS} -C /usr/src/release -V .OBJDIR)" - DESTDIR="${OBJDIR}/${KERNEL}" - IMGBASE="${CHROOTDIR}/${OBJDIR}/${KERNEL}.img" - OSRELEASE="$(eval chroot ${CHROOTDIR} make ${MAKE_FLAGS} -C /usr/src/release \ + export MAKE_FLAGS="${MAKE_FLAGS} TARGET=${EMBEDDED_TARGET}" + export MAKE_FLAGS="${MAKE_FLAGS} TARGET_ARCH=${EMBEDDED_TARGET_ARCH}" + eval chroot ${CHROOTDIR} env WITH_UNIFIED_OBJDIR=1 make ${MAKE_FLAGS} -C /usr/src/release obj + export WORLDDIR="$(eval chroot ${CHROOTDIR} make ${MAKE_FLAGS} -C /usr/src/release -V WORLDDIR)" + export OBJDIR="$(eval chroot ${CHROOTDIR} env WITH_UNIFIED_OBJDIR=1 make ${MAKE_FLAGS} -C /usr/src/release -V .OBJDIR)" + export DESTDIR="${OBJDIR}/${KERNEL}" + export IMGBASE="${CHROOTDIR}/${OBJDIR}/${KERNEL}.img" + export OSRELEASE="$(eval chroot ${CHROOTDIR} make ${MAKE_FLAGS} -C /usr/src/release \ TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ -V OSRELEASE)" chroot ${CHROOTDIR} mkdir -p ${DESTDIR} From owner-svn-src-all@freebsd.org Mon Nov 6 18:07:24 2017 Return-Path: Delivered-To: svn-src-all@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 CE9BFE6405D; Mon, 6 Nov 2017 18:07:24 +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 9B8247D38E; Mon, 6 Nov 2017 18:07:24 +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 vA6I7NuD006061; Mon, 6 Nov 2017 18:07:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6I7Nh9006060; Mon, 6 Nov 2017 18:07:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711061807.vA6I7Nh9006060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 6 Nov 2017 18:07: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: r325491 - in stable: 10/release/tools 11/release/tools X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/tools 11/release/tools X-SVN-Commit-Revision: 325491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 18:07:24 -0000 Author: gjb Date: Mon Nov 6 18:07:23 2017 New Revision: 325491 URL: https://svnweb.freebsd.org/changeset/base/325491 Log: MFC r325156: Set a default hostname for virtual machine images. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/tools/vmimage.subr Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/tools/vmimage.subr Directory Properties: stable/11/ (props changed) Modified: stable/10/release/tools/vmimage.subr ============================================================================== --- stable/10/release/tools/vmimage.subr Mon Nov 6 17:59:04 2017 (r325490) +++ stable/10/release/tools/vmimage.subr Mon Nov 6 18:07:23 2017 (r325491) @@ -134,6 +134,10 @@ vm_install_base() { >> ${DESTDIR}/etc/fstab fi + local hostname + hostname="$(echo $(uname -o) | tr '[:upper:]' '[:lower:]')" + echo "hostname=\"${hostname}\"" >> ${DESTDIR}/etc/rc.conf + mkdir -p ${DESTDIR}/dev mount -t devfs devfs ${DESTDIR}/dev chroot ${DESTDIR} /usr/bin/newaliases From owner-svn-src-all@freebsd.org Mon Nov 6 18:07:25 2017 Return-Path: Delivered-To: svn-src-all@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 3A7FFE64061; Mon, 6 Nov 2017 18:07:25 +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 07B057D38F; Mon, 6 Nov 2017 18:07:24 +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 vA6I7O4v006067; Mon, 6 Nov 2017 18:07:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6I7Orq006066; Mon, 6 Nov 2017 18:07:24 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711061807.vA6I7Orq006066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 6 Nov 2017 18:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325491 - in stable: 10/release/tools 11/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/tools 11/release/tools X-SVN-Commit-Revision: 325491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 18:07:25 -0000 Author: gjb Date: Mon Nov 6 18:07:23 2017 New Revision: 325491 URL: https://svnweb.freebsd.org/changeset/base/325491 Log: MFC r325156: Set a default hostname for virtual machine images. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/tools/vmimage.subr Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/release/tools/vmimage.subr Directory Properties: stable/10/ (props changed) Modified: stable/11/release/tools/vmimage.subr ============================================================================== --- stable/11/release/tools/vmimage.subr Mon Nov 6 17:59:04 2017 (r325490) +++ stable/11/release/tools/vmimage.subr Mon Nov 6 18:07:23 2017 (r325491) @@ -140,6 +140,10 @@ vm_install_base() { >> ${DESTDIR}/etc/fstab fi + local hostname + hostname="$(echo $(uname -o) | tr '[:upper:]' '[:lower:]')" + echo "hostname=\"${hostname}\"" >> ${DESTDIR}/etc/rc.conf + mkdir -p ${DESTDIR}/dev mount -t devfs devfs ${DESTDIR}/dev chroot ${DESTDIR} /usr/bin/newaliases From owner-svn-src-all@freebsd.org Mon Nov 6 18:09:01 2017 Return-Path: Delivered-To: svn-src-all@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 283B6E64150; Mon, 6 Nov 2017 18:09:01 +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 EC3947D5FB; Mon, 6 Nov 2017 18:09:00 +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 vA6I90vt006176; Mon, 6 Nov 2017 18:09:00 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6I8x5C006174; Mon, 6 Nov 2017 18:09:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201711061809.vA6I8x5C006174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 6 Nov 2017 18:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325492 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 325492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 18:09:01 -0000 Author: sbruno Date: Mon Nov 6 18:08:59 2017 New Revision: 325492 URL: https://svnweb.freebsd.org/changeset/base/325492 Log: Fix ixgbe(4) support for ifconfig's vlanhwtag flag. Disabling this flag will now prevent the driver from stripping vlan tags from packets. PR: 219390 Submitted by: Piotr Pietruszewski Reported by: Charles Goncalves Obtained from: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D12795 Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Mon Nov 6 18:07:23 2017 (r325491) +++ head/sys/dev/ixgbe/if_ix.c Mon Nov 6 18:08:59 2017 (r325492) @@ -1754,15 +1754,17 @@ ixgbe_setup_vlan_hw_support(struct adapter *adapter) return; /* Setup the queues for vlans */ - for (i = 0; i < adapter->num_queues; i++) { - 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(rxr->me)); - ctrl |= IXGBE_RXDCTL_VME; - IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl); + if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) { + for (i = 0; i < adapter->num_queues; i++) { + 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(rxr->me)); + ctrl |= IXGBE_RXDCTL_VME; + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl); + } + rxr->vtag_strip = TRUE; } - rxr->vtag_strip = TRUE; } if ((ifp->if_capenable & IFCAP_VLAN_HWFILTER) == 0) From owner-svn-src-all@freebsd.org Mon Nov 6 19:33:51 2017 Return-Path: Delivered-To: svn-src-all@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 C6309E6601F; Mon, 6 Nov 2017 19:33:51 +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 95A9080580; Mon, 6 Nov 2017 19:33:51 +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 vA6JXoN7061245; Mon, 6 Nov 2017 19:33:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6JXo95061243; Mon, 6 Nov 2017 19:33:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711061933.vA6JXo95061243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 6 Nov 2017 19:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325493 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 19:33:51 -0000 Author: bdrewery Date: Mon Nov 6 19:33:50 2017 New Revision: 325493 URL: https://svnweb.freebsd.org/changeset/base/325493 Log: Reapply r295227: Stop hiding link install commands. This was lost in the release-pkg merge in r298107. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.incs.mk head/share/mk/bsd.links.mk Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Mon Nov 6 18:08:59 2017 (r325492) +++ head/share/mk/bsd.incs.mk Mon Nov 6 19:33:50 2017 (r325493) @@ -89,7 +89,6 @@ _${group}INS: ${_${group}INCS} .if defined(INCSLINKS) && !empty(INCSLINKS) installincludes: .for s t in ${INCSLINKS} - @${ECHO} "${DESTDIR}${t} -> ${s}" ; \ ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} ${s} ${DESTDIR}${t} .endfor .endif Modified: head/share/mk/bsd.links.mk ============================================================================== --- head/share/mk/bsd.links.mk Mon Nov 6 18:08:59 2017 (r325492) +++ head/share/mk/bsd.links.mk Mon Nov 6 19:33:50 2017 (r325493) @@ -15,10 +15,8 @@ afterinstall: _installlinks .ORDER: realinstall _installlinks _installlinks: .for s t in ${LINKS} - @${ECHO} "${t} -> ${s}" ;\ ${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}${s} ${DESTDIR}${t} .endfor .for s t in ${SYMLINKS} - @${ECHO} "${t} -> ${s}" ;\ ${INSTALL_SYMLINK} ${TAG_ARGS} ${s} ${DESTDIR}${t} .endfor From owner-svn-src-all@freebsd.org Mon Nov 6 19:54:27 2017 Return-Path: Delivered-To: svn-src-all@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 6D52AE668EB; Mon, 6 Nov 2017 19:54:27 +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 3873581261; Mon, 6 Nov 2017 19:54:27 +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 vA6JsQGO069871; Mon, 6 Nov 2017 19:54:26 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6JsQOs069870; Mon, 6 Nov 2017 19:54:26 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201711061954.vA6JsQOs069870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 6 Nov 2017 19:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325494 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 325494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 19:54:27 -0000 Author: sbruno Date: Mon Nov 6 19:54:25 2017 New Revision: 325494 URL: https://svnweb.freebsd.org/changeset/base/325494 Log: Fix NOINET/NOINET6 build during compilation of iflib. Reported by: kib Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Nov 6 19:33:50 2017 (r325493) +++ head/sys/net/iflib.c Mon Nov 6 19:54:25 2017 (r325494) @@ -2481,6 +2481,7 @@ iflib_check_lro_possible(struct lro_ctrl *lc, struct m eh = mtod(m, struct ether_header *); eh_type = ntohs(eh->ether_type); switch (eh_type) { +#if defined(INET6) case ETHERTYPE_IPV6: { CURVNET_SET(lc->ifp->if_vnet); @@ -2491,6 +2492,8 @@ iflib_check_lro_possible(struct lro_ctrl *lc, struct m CURVNET_RESTORE(); break; } +#endif +#if defined (INET) case ETHERTYPE_IP: { CURVNET_SET(lc->ifp->if_vnet); @@ -2501,6 +2504,7 @@ iflib_check_lro_possible(struct lro_ctrl *lc, struct m CURVNET_RESTORE(); break; } +#endif } return false; From owner-svn-src-all@freebsd.org Mon Nov 6 20:08:01 2017 Return-Path: Delivered-To: svn-src-all@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 B31D6E66C5E; Mon, 6 Nov 2017 20:08:01 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 85B2B8187E; Mon, 6 Nov 2017 20:08:01 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6K80K9074308; Mon, 6 Nov 2017 20:08:00 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6K80Xb074306; Mon, 6 Nov 2017 20:08:00 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201711062008.vA6K80Xb074306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 6 Nov 2017 20:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325495 - in stable/11: lib/libmt usr.bin/mt X-SVN-Group: stable-11 X-SVN-Commit-Author: ken X-SVN-Commit-Paths: in stable/11: lib/libmt usr.bin/mt X-SVN-Commit-Revision: 325495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 20:08:01 -0000 Author: ken Date: Mon Nov 6 20:08:00 2017 New Revision: 325495 URL: https://svnweb.freebsd.org/changeset/base/325495 Log: MFC r325371 ------------------------------------------------------------------------ r325371 | ken | 2017-11-03 15:04:22 -0600 (Fri, 03 Nov 2017) | 19 lines Add the LTO-8 Type M density code (0x5d, LTO-8M) to libmt and the mt(1) man page. LTO-8 Type M (also known as M8) is a pristine LTO-7 cartridge formatted in a LTO-8 drive in a new, higher density format. It has a separate density code, and is only readable in an LTO-8 drive. lib/libmt/mtlib.c: Add the LTO-8 Type M density code to the density table in libmt. usr.bin/mt/mt.1: Add the LTO-8 Type M density code to the density table in the mt(1) man page. Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/11/lib/libmt/mtlib.c stable/11/usr.bin/mt/mt.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libmt/mtlib.c ============================================================================== --- stable/11/lib/libmt/mtlib.c Mon Nov 6 19:54:25 2017 (r325494) +++ stable/11/lib/libmt/mtlib.c Mon Nov 6 20:08:00 2017 (r325495) @@ -645,6 +645,7 @@ static struct densities { { 0x58, 15142, 384607, "LTO-5" }, { 0x5A, 15142, 384607, "LTO-6" }, { 0x5C, 19107, 485318, "LTO-7" }, + { 0x5D, 19107, 485318, "LTO-M8" }, { 0x5E, 20669, 524993, "LTO-8" }, { 0x71, 11800, 299720, "3592A1 (encrypted)" }, { 0x72, 11800, 299720, "3592A2 (encrypted)" }, Modified: stable/11/usr.bin/mt/mt.1 ============================================================================== --- stable/11/usr.bin/mt/mt.1 Mon Nov 6 19:54:25 2017 (r325494) +++ stable/11/usr.bin/mt/mt.1 Mon Nov 6 20:08:00 2017 (r325495) @@ -29,7 +29,7 @@ .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 11, 2017 +.Dd November 3, 2017 .Dt MT 1 .Os .Sh NAME @@ -522,6 +522,7 @@ Value Width Tracks Density Code Typ 0x58 12.7 (0.5) 1280 15,142 (384,607) C LTO-5 0x5A 12.7 (0.5) 2176 15,142 (384,607) C LTO-6 0x5C 12.7 (0.5) 3584 19,107 (485,318) C LTO-7 +0x5D 12.7 (0.5) 5376 19,107 (485,318) C LTO-M8 14 0x5E 12.7 (0.5) 6656 20,669 (524,993) C LTO-8 0x71 12.7 (0.5) 512 11,800 (299,720) C 3592A1 (encrypted) 0x72 12.7 (0.5) 896 11,800 (299,720) C 3592A2 (encrypted) @@ -565,6 +566,10 @@ NOTES 12. This is Exabyte 8500 uncompressed format. The compressed format density code is 0x8c. 13. This density code (0x48) was also used for DAT-160. +14. Officially known as LTO-8 Type M, abbreviated M8. This is a pristine + LTO-7 cartridge initialized with a higher density format by an LTO-8 + drive. It cannot be read by an LTO-7 drive. Uncompressed capacity + is 9TB, compared to 6TB for LTO-7 and 12TB for LTO-8. .Ed .Bd -literal -offset 2n NOTE ON QIC STREAMERS From owner-svn-src-all@freebsd.org Mon Nov 6 20:08:03 2017 Return-Path: Delivered-To: svn-src-all@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 D9193E66C68; Mon, 6 Nov 2017 20:08:03 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9BAF881880; Mon, 6 Nov 2017 20:08:03 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA6K82iM074358; Mon, 6 Nov 2017 20:08:02 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA6K8299074356; Mon, 6 Nov 2017 20:08:02 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201711062008.vA6K8299074356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 6 Nov 2017 20:08: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: r325496 - in stable/10: lib/libmt usr.bin/mt X-SVN-Group: stable-10 X-SVN-Commit-Author: ken X-SVN-Commit-Paths: in stable/10: lib/libmt usr.bin/mt X-SVN-Commit-Revision: 325496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 20:08:04 -0000 Author: ken Date: Mon Nov 6 20:08:02 2017 New Revision: 325496 URL: https://svnweb.freebsd.org/changeset/base/325496 Log: MFC r325371 ------------------------------------------------------------------------ r325371 | ken | 2017-11-03 15:04:22 -0600 (Fri, 03 Nov 2017) | 19 lines Add the LTO-8 Type M density code (0x5d, LTO-8M) to libmt and the mt(1) man page. LTO-8 Type M (also known as M8) is a pristine LTO-7 cartridge formatted in a LTO-8 drive in a new, higher density format. It has a separate density code, and is only readable in an LTO-8 drive. lib/libmt/mtlib.c: Add the LTO-8 Type M density code to the density table in libmt. usr.bin/mt/mt.1: Add the LTO-8 Type M density code to the density table in the mt(1) man page. Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/10/lib/libmt/mtlib.c stable/10/usr.bin/mt/mt.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libmt/mtlib.c ============================================================================== --- stable/10/lib/libmt/mtlib.c Mon Nov 6 20:08:00 2017 (r325495) +++ stable/10/lib/libmt/mtlib.c Mon Nov 6 20:08:02 2017 (r325496) @@ -645,6 +645,7 @@ static struct densities { { 0x58, 15142, 384607, "LTO-5" }, { 0x5A, 15142, 384607, "LTO-6" }, { 0x5C, 19107, 485318, "LTO-7" }, + { 0x5D, 19107, 485318, "LTO-M8" }, { 0x5E, 20669, 524993, "LTO-8" }, { 0x71, 11800, 299720, "3592A1 (encrypted)" }, { 0x72, 11800, 299720, "3592A2 (encrypted)" }, Modified: stable/10/usr.bin/mt/mt.1 ============================================================================== --- stable/10/usr.bin/mt/mt.1 Mon Nov 6 20:08:00 2017 (r325495) +++ stable/10/usr.bin/mt/mt.1 Mon Nov 6 20:08:02 2017 (r325496) @@ -29,7 +29,7 @@ .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 11, 2017 +.Dd November 3, 2017 .Dt MT 1 .Os .Sh NAME @@ -522,6 +522,7 @@ Value Width Tracks Density Code Typ 0x58 12.7 (0.5) 1280 15,142 (384,607) C LTO-5 0x5A 12.7 (0.5) 2176 15,142 (384,607) C LTO-6 0x5C 12.7 (0.5) 3584 19,107 (485,318) C LTO-7 +0x5D 12.7 (0.5) 5376 19,107 (485,318) C LTO-M8 14 0x5E 12.7 (0.5) 6656 20,669 (524,993) C LTO-8 0x71 12.7 (0.5) 512 11,800 (299,720) C 3592A1 (encrypted) 0x72 12.7 (0.5) 896 11,800 (299,720) C 3592A2 (encrypted) @@ -565,6 +566,10 @@ NOTES 12. This is Exabyte 8500 uncompressed format. The compressed format density code is 0x8c. 13. This density code (0x48) was also used for DAT-160. +14. Officially known as LTO-8 Type M, abbreviated M8. This is a pristine + LTO-7 cartridge initialized with a higher density format by an LTO-8 + drive. It cannot be read by an LTO-7 drive. Uncompressed capacity + is 9TB, compared to 6TB for LTO-7 and 12TB for LTO-8. .Ed .Bd -literal -offset 2n NOTE ON QIC STREAMERS From owner-svn-src-all@freebsd.org Mon Nov 6 23:40:14 2017 Return-Path: Delivered-To: svn-src-all@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 BDB10E69C2E; Mon, 6 Nov 2017 23:40:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 990A3650CA; Mon, 6 Nov 2017 23:40:14 +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 mail.baldwin.cx (Postfix) with ESMTPSA id D46F810A87D; Mon, 6 Nov 2017 18:40:06 -0500 (EST) From: John Baldwin To: Ngie Cooper Cc: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325320 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Mon, 06 Nov 2017 14:52:18 -0800 Message-ID: <188800397.5yAOiIDbtG@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <5199F871-5DE2-4434-87F2-FEF88DB34037@gmail.com> References: <201711021349.vA2Dn8Yg063559@repo.freebsd.org> <5199F871-5DE2-4434-87F2-FEF88DB34037@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 06 Nov 2017 18:40:06 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 23:40:14 -0000 On Thursday, November 02, 2017 10:38:49 AM Ngie Cooper wrote: >=20 > > On Nov 2, 2017, at 06:49, Andriy Gapon wrote: > >=20 > > Author: avg > > Date: Thu Nov 2 13:49:08 2017 > > New Revision: 325320 > > URL: https://svnweb.freebsd.org/changeset/base/325320 > >=20 > > Log: > > Disable posix_fallocate(2) for ZFS > >=20 > > The generic (naive) implementation of posix_fallocate cannot provi= de the > > standard mandated guarantee that overwrites would never fail due t= o the lack > > of free space. The fundamental reason is the copy-on-write archit= ecture > > of ZFS. Other features like compression and deduplication can als= o > > increase the size difference between the (pre-)allocated dummy con= tent > > and the future content. > >=20 > > So, until ZFS can properly implement the feature it's better to re= port > > that it is unsupported rather than providing an ersatz implementat= ion. > > Please note that EINVAL is used to report that the underlying file= system > > does not support the operation (POSIX.1-2008). > >=20 > > illumos and ZoL seem to do the same. > >=20 > > MFC after: 3 weeks > > Sponsored by: Panzura >=20 > It=E2=80=99d be nice if it worked though and was reported via the fil= e system. Posix suggests it should be, as of 2013: http://austingroupb= ugs.net/view.php?id=3D687 . >=20 > Need to go poking around and see what=E2=80=99s in freebsd later on t= onight. Bug filed: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D= 223383 . The austingroup link is just about adding a new pathconf() variable. posix_fallocate() would seem to be fundamentally incompatible with COW filesystems and can never work reliably for those. Even if you reserve= d N free blocks somehow until the first write, that doesn't allow multiple writes to the same file blocks while avoiding block allocation. falloc= ate only makes sense for overwriting filesystems like UFS. --=20 John Baldwin From owner-svn-src-all@freebsd.org Tue Nov 7 01:08:34 2017 Return-Path: Delivered-To: svn-src-all@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 20198E6B004; Tue, 7 Nov 2017 01:08:34 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 D4E166A654; Tue, 7 Nov 2017 01:08:33 +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 vA717HYe099345; Tue, 7 Nov 2017 01:07:17 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA717HCQ099344; Tue, 7 Nov 2017 01:07:17 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201711070107.vA717HCQ099344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 7 Nov 2017 01:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r325497 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 325497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 01:08:34 -0000 Author: sbruno Date: Tue Nov 7 01:07:17 2017 New Revision: 325497 URL: https://svnweb.freebsd.org/changeset/base/325497 Log: Add shurd <-> sbruno mentor relationship, so I can delete it. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Nov 6 20:08:02 2017 (r325496) +++ svnadmin/conf/mentors Tue Nov 7 01:07:17 2017 (r325497) @@ -28,6 +28,7 @@ mahrens mckusick mjoras rstone peterj jhb Co-mentor: grog rgrimes grehan +shurd sbruno slm ken Co-mentor: scottl, ambrisko stevek sjg wulf gonzo Co-mentor: bapt From owner-svn-src-all@freebsd.org Tue Nov 7 01:08:55 2017 Return-Path: Delivered-To: svn-src-all@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 C2952E6B052; Tue, 7 Nov 2017 01:08:55 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 910306A6BD; Tue, 7 Nov 2017 01:08:55 +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 vA717dTu099401; Tue, 7 Nov 2017 01:07:39 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA717dE6099400; Tue, 7 Nov 2017 01:07:39 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201711070107.vA717dE6099400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 7 Nov 2017 01:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r325498 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 325498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 01:08:55 -0000 Author: sbruno Date: Tue Nov 7 01:07:39 2017 New Revision: 325498 URL: https://svnweb.freebsd.org/changeset/base/325498 Log: Release shurd from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Nov 7 01:07:17 2017 (r325497) +++ svnadmin/conf/mentors Tue Nov 7 01:07:39 2017 (r325498) @@ -28,7 +28,6 @@ mahrens mckusick mjoras rstone peterj jhb Co-mentor: grog rgrimes grehan -shurd sbruno slm ken Co-mentor: scottl, ambrisko stevek sjg wulf gonzo Co-mentor: bapt From owner-svn-src-all@freebsd.org Tue Nov 7 04:56:39 2017 Return-Path: Delivered-To: svn-src-all@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 66017E4E4ED; Tue, 7 Nov 2017 04:56:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 340007ACA8; Tue, 7 Nov 2017 04:56: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 vA74tNqf090605; Tue, 7 Nov 2017 04:55:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA74tNnr090604; Tue, 7 Nov 2017 04:55:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711070455.vA74tNnr090604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 7 Nov 2017 04:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325500 - head/lib/libclang_rt X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libclang_rt X-SVN-Commit-Revision: 325500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 04:56:39 -0000 Author: ngie Date: Tue Nov 7 04:55:23 2017 New Revision: 325500 URL: https://svnweb.freebsd.org/changeset/base/325500 Log: Use bsd.compiler.mk instead of src.opts.mk - MK_PROFILE is controlled in bsd.opts.mk, which is pulled in via bsd.own.mk, which is pulled in via bsd.init.mk . All upstream Makefiles which build off of this one use bsd.init.mk. - COMPILER_{TYPE,VERSION} is set via bsd.compiler.mk . This reduces the namespace pollution/complexity somewhat. MFC after: 1 week Modified: head/lib/libclang_rt/Makefile.inc Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Tue Nov 7 04:26:57 2017 (r325499) +++ head/lib/libclang_rt/Makefile.inc Tue Nov 7 04:55:23 2017 (r325500) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include +.include .if ${MACHINE} == "arm" .if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" From owner-svn-src-all@freebsd.org Tue Nov 7 04:58:10 2017 Return-Path: Delivered-To: svn-src-all@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 2A397E4E5AA; Tue, 7 Nov 2017 04:58:10 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 EBCE97ADBA; Tue, 7 Nov 2017 04:58:09 +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 vA74us6s090677; Tue, 7 Nov 2017 04:56:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA74usDF090676; Tue, 7 Nov 2017 04:56:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711070456.vA74usDF090676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 7 Nov 2017 04:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325501 - head/lib/libclang_rt X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libclang_rt X-SVN-Commit-Revision: 325501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 04:58:10 -0000 Author: ngie Date: Tue Nov 7 04:56:53 2017 New Revision: 325501 URL: https://svnweb.freebsd.org/changeset/base/325501 Log: Remove unnecessary src.opts.mk .include MK_ isn't used in lib/libcompiler_rt/Makefile at all. Remove it to reduce namespace pollution. MFC after: 1 week Modified: head/lib/libclang_rt/Makefile Modified: head/lib/libclang_rt/Makefile ============================================================================== --- head/lib/libclang_rt/Makefile Tue Nov 7 04:55:23 2017 (r325500) +++ head/lib/libclang_rt/Makefile Tue Nov 7 04:56:53 2017 (r325501) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" SUBDIR+= include SUBDIR+= asan From owner-svn-src-all@freebsd.org Tue Nov 7 05:03:53 2017 Return-Path: Delivered-To: svn-src-all@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 3BA4DE4E98D; Tue, 7 Nov 2017 05:03:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 0B4C97B72C; Tue, 7 Nov 2017 05:03:52 +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 vA752bMb094624; Tue, 7 Nov 2017 05:02:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA752bG7094623; Tue, 7 Nov 2017 05:02:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711070502.vA752bG7094623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 7 Nov 2017 05:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325502 - head/lib/libclang_rt X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libclang_rt X-SVN-Commit-Revision: 325502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 05:03:53 -0000 Author: ngie Date: Tue Nov 7 05:02:36 2017 New Revision: 325502 URL: https://svnweb.freebsd.org/changeset/base/325502 Log: Handle arm/armv[67] hosted/targeted builds gracefully CPUTYPE (apparently) isn't defined in non-cross-builds, which caused arm/armv[67] hosted/targeted builds to fail when evaluating CPUTYPE. Add the :U modifier to CPUTYPE so it evaluates to "". This allows armv[67] to get past the conditional successfully. MFC after: 1 week Reported by: bob prohaska Modified: head/lib/libclang_rt/Makefile.inc Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Tue Nov 7 04:56:53 2017 (r325501) +++ head/lib/libclang_rt/Makefile.inc Tue Nov 7 05:02:36 2017 (r325502) @@ -3,7 +3,7 @@ .include .if ${MACHINE} == "arm" -.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" +.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:U:M*soft*} == "" CRTARCH= armhf .endif .endif From owner-svn-src-all@freebsd.org Tue Nov 7 06:28:04 2017 Return-Path: Delivered-To: svn-src-all@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 5D69CE50187; Tue, 7 Nov 2017 06:28:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 2DB1764FD9; Tue, 7 Nov 2017 06:28:04 +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 vA76QmKZ025928; Tue, 7 Nov 2017 06:26:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA76QmnV025927; Tue, 7 Nov 2017 06:26:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201711070626.vA76QmnV025927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 7 Nov 2017 06:26:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325504 - head/lib/libclang_rt X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libclang_rt X-SVN-Commit-Revision: 325504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 06:28:04 -0000 Author: ngie Date: Tue Nov 7 06:26:48 2017 New Revision: 325504 URL: https://svnweb.freebsd.org/changeset/base/325504 Log: Redo r325502 :U:Mfoo expands to :Mfoo, apparently. Explicit check for CPUTYPE being defined, and test for it's value not containing *soft* before calling CRTARCH armhf. Tested, somewhat. Unfortunately recent changes appear to have affected cross-builds where it no longer works, per my tests after universe12a being upgraded from 07/2017 to 11/2017 sources (DESTDIR isn't being used in WORLDTMP; MK_SYSTEM_COMPILER might be causing issues right now). MFC after: 1 week MFC with: r325502 Reported by: imp Modified: head/lib/libclang_rt/Makefile.inc Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Tue Nov 7 05:07:09 2017 (r325503) +++ head/lib/libclang_rt/Makefile.inc Tue Nov 7 06:26:48 2017 (r325504) @@ -3,7 +3,8 @@ .include .if ${MACHINE} == "arm" -.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:U:M*soft*} == "" +.if ${MACHINE_ARCH:Marmv[67]*} != "" && \ + (defined(CPUTYPE) && ${CPUTYPE:M*soft*} == "") CRTARCH= armhf .endif .endif From owner-svn-src-all@freebsd.org Tue Nov 7 09:30:31 2017 Return-Path: Delivered-To: svn-src-all@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 6235DE5397C; Tue, 7 Nov 2017 09:30:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 3D3E2730EF; Tue, 7 Nov 2017 09:30:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA79TFqV096112; Tue, 7 Nov 2017 09:29:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA79TFTc096109; Tue, 7 Nov 2017 09:29:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711070929.vA79TFTc096109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Nov 2017 09:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325506 - in head: sbin/ifconfig sys/net sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net sys/sys X-SVN-Commit-Revision: 325506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 09:30:31 -0000 Author: kib Date: Tue Nov 7 09:29:14 2017 New Revision: 325506 URL: https://svnweb.freebsd.org/changeset/base/325506 Log: Add a place for a driver to report rx timestamps in nanoseconds from boot for the received packets. The rcv_tstmp field overlaps the place of Ln header length indicators, not used by received packets. The basic pkthdr rearrangement change in sys/mbuf.h was provided by gallatin. There are two accompanying M_ flags: M_TSTMP means that there is the timestamp (and it was generated by hardware). Another flag M_TSTMP_HPREC indicates that the timestamp is high-precision. Practically M_TSTMP_HPREC means that hardware provided additional precision comparing with the stamps when the flag is not set. E.g., for ConnectX all packets are stamped by hardware when PCIe transaction to write out the completion descriptor is performed, but PTP packet are stamped on port. For Intel cards, when PTP assist is enabled, only PTP packets are stamped in the limited number of registers, so if Intel cards ever start support this mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if hardware timestamp is present for the given packet. Add IFCAP_HWRXTSTMP interface capability to indicate the support for hardware rx timestamping, and ifconfig(8) command to toggle it. Based on the patch by: gallatin Reviewed by: gallatin (previous version), hselasky Sponsored by: Mellanox Technologies MFC after: 2 weeks (? mbuf KBI issue) X-Differential revision: https://reviews.freebsd.org/D12638 Modified: head/sbin/ifconfig/ifconfig.c head/sys/net/if.h head/sys/sys/mbuf.h Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Nov 7 08:39:14 2017 (r325505) +++ head/sbin/ifconfig/ifconfig.c Tue Nov 7 09:29:14 2017 (r325506) @@ -1143,7 +1143,7 @@ unsetifdescr(const char *val, int value, int s, const "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT" +"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT\32HWRXTSTMP" /* * Print the status of the interface. If an address family was @@ -1456,6 +1456,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-wol_magic", -IFCAP_WOL_MAGIC, setifcap), DEF_CMD("txrtlmt", IFCAP_TXRTLMT, setifcap), DEF_CMD("-txrtlmt", -IFCAP_TXRTLMT, setifcap), + DEF_CMD("hwrxtsmp", IFCAP_HWRXTSTMP, setifcap), + DEF_CMD("-hwrxtsmp", -IFCAP_HWRXTSTMP, setifcap), DEF_CMD("normal", -IFF_LINK0, setifflags), DEF_CMD("compress", IFF_LINK0, setifflags), DEF_CMD("noicmp", IFF_LINK1, setifflags), Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Tue Nov 7 08:39:14 2017 (r325505) +++ head/sys/net/if.h Tue Nov 7 09:29:14 2017 (r325506) @@ -240,6 +240,7 @@ struct if_data { #define IFCAP_TXCSUM_IPV6 0x400000 /* can offload checksum on IPv6 TX */ #define IFCAP_HWSTATS 0x800000 /* manages counters internally */ #define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */ +#define IFCAP_HWRXTSTMP 0x2000000 /* hardware rx timestamping */ #define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6) Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Nov 7 08:39:14 2017 (r325505) +++ head/sys/sys/mbuf.h Tue Nov 7 09:29:14 2017 (r325506) @@ -154,15 +154,21 @@ struct pkthdr { /* Layer crossing persistent information. */ uint32_t flowid; /* packet's 4-tuple system */ - uint64_t csum_flags; /* checksum and offload features */ + uint32_t csum_flags; /* checksum and offload features */ uint16_t fibnum; /* this packet should use this fib */ uint8_t cosqos; /* class/quality of service */ uint8_t rsstype; /* hash type */ - uint8_t l2hlen; /* layer 2 header length */ - uint8_t l3hlen; /* layer 3 header length */ - uint8_t l4hlen; /* layer 4 header length */ - uint8_t l5hlen; /* layer 5 header length */ union { + uint64_t rcv_tstmp; /* timestamp in ns */ + struct { + uint8_t l2hlen; /* layer 2 hdr len */ + uint8_t l3hlen; /* layer 3 hdr len */ + uint8_t l4hlen; /* layer 4 hdr len */ + uint8_t l5hlen; /* layer 5 hdr len */ + uint32_t spare; + }; + }; + union { uint8_t eight[8]; uint16_t sixteen[4]; uint32_t thirtytwo[2]; @@ -293,6 +299,10 @@ struct mbuf { #define M_VLANTAG 0x00000080 /* ether_vtag is valid */ #define M_UNUSED_8 0x00000100 /* --available-- */ #define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */ +#define M_TSTMP 0x00000400 /* rcv_tstmp field is valid */ +#define M_TSTMP_HPREC 0x00000800 /* rcv_tstmp is high-prec, typically + hw-stamped on port (useful for IEEE 1588 + and 802.1AS) */ #define M_PROTO1 0x00001000 /* protocol-specific */ #define M_PROTO2 0x00002000 /* protocol-specific */ @@ -320,15 +330,15 @@ struct mbuf { * Flags preserved when copying m_pkthdr. */ #define M_COPYFLAGS \ - (M_PKTHDR|M_EOR|M_RDONLY|M_BCAST|M_MCAST|M_PROMISC|M_VLANTAG| \ - M_PROTOFLAGS) + (M_PKTHDR|M_EOR|M_RDONLY|M_BCAST|M_MCAST|M_PROMISC|M_VLANTAG|M_TSTMP| \ + M_TSTMP_HPREC|M_PROTOFLAGS) /* * Mbuf flag description for use with printf(9) %b identifier. */ #define M_FLAG_BITS \ "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_BCAST\6M_MCAST" \ - "\7M_PROMISC\10M_VLANTAG" + "\7M_PROMISC\10M_VLANTAG\13M_TSTMP\14M_TSTMP_HPREC" #define M_FLAG_PROTOBITS \ "\15M_PROTO1\16M_PROTO2\17M_PROTO3\20M_PROTO4\21M_PROTO5" \ "\22M_PROTO6\23M_PROTO7\24M_PROTO8\25M_PROTO9\26M_PROTO10" \ @@ -1347,6 +1357,18 @@ mbufq_concat(struct mbufq *mq_dst, struct mbufq *mq_sr STAILQ_CONCAT(&mq_dst->mq_head, &mq_src->mq_head); mq_src->mq_len = 0; } + +#ifdef _SYS_TIMESPEC_H_ +static inline void +mbuf_tstmp2timespec(struct mbuf *m, struct timespec *ts) +{ + + KASSERT((m->m_flags & M_PKTHDR) != 0, ("mbuf %p no M_PKTHDR", m)); + KASSERT((m->m_flags & M_TSTMP) != 0, ("mbuf %p no M_TSTMP", m)); + ts->tv_sec = m->m_pkthdr.rcv_tstmp / 1000000000; + ts->tv_nsec = m->m_pkthdr.rcv_tstmp % 1000000000; +} +#endif #endif /* _KERNEL */ #endif /* !_SYS_MBUF_H_ */ From owner-svn-src-all@freebsd.org Tue Nov 7 09:46:28 2017 Return-Path: Delivered-To: svn-src-all@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 2FB4DE53EDC; Tue, 7 Nov 2017 09:46:28 +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 0C7F274AC7; Tue, 7 Nov 2017 09:46:27 +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 vA79kRth003940; Tue, 7 Nov 2017 09:46:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA79kRs0003937; Tue, 7 Nov 2017 09:46:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711070946.vA79kRs0003937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Nov 2017 09:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325507 - in head/sys: netinet netinet6 sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: netinet netinet6 sys X-SVN-Commit-Revision: 325507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 09:46:28 -0000 Author: kib Date: Tue Nov 7 09:46:26 2017 New Revision: 325507 URL: https://svnweb.freebsd.org/changeset/base/325507 Log: Use hardware timestamps to report packet timestamps for SO_TIMESTAMP and other similar socket options. Provide new control message SCM_TIME_INFO to supply information about timestamp. Currently it indicates that the timestamp was hardware-assisted and high-precision, for software timestamps the message is not returned. Reserved fields are added to ABI to report additional info about it, it is expected that raw hardware clock value might be useful for some applications. Reviewed by: gallatin (previous version), hselasky Sponsored by: Mellanox Technologies MFC after: 2 weeks X-Differential revision: https://reviews.freebsd.org/D12638 Modified: head/sys/netinet/ip_input.c head/sys/netinet6/ip6_input.c head/sys/sys/socket.h Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Tue Nov 7 09:29:14 2017 (r325506) +++ head/sys/netinet/ip_input.c Tue Nov 7 09:46:26 2017 (r325507) @@ -1143,40 +1143,96 @@ void ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip, struct mbuf *m) { + bool stamped; + stamped = false; if ((inp->inp_socket->so_options & SO_BINTIME) || CHECK_SO_CT(inp->inp_socket, SO_TS_BINTIME)) { - struct bintime bt; + struct bintime boottimebin, bt; + struct timespec ts1; - bintime(&bt); + if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | + M_TSTMP)) { + mbuf_tstmp2timespec(m, &ts1); + timespec2bintime(&ts1, &bt); + getboottimebin(&boottimebin); + bintime_add(&bt, &boottimebin); + } else { + bintime(&bt); + } *mp = sbcreatecontrol((caddr_t)&bt, sizeof(bt), SCM_BINTIME, SOL_SOCKET); - if (*mp) + if (*mp != NULL) { mp = &(*mp)->m_next; + stamped = true; + } } if (CHECK_SO_CT(inp->inp_socket, SO_TS_REALTIME_MICRO)) { + struct bintime boottimebin, bt1; + struct timespec ts1;; struct timeval tv; - microtime(&tv); + if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | + M_TSTMP)) { + mbuf_tstmp2timespec(m, &ts1); + timespec2bintime(&ts1, &bt1); + getboottimebin(&boottimebin); + bintime_add(&bt1, &boottimebin); + bintime2timeval(&bt1, &tv); + } else { + microtime(&tv); + } *mp = sbcreatecontrol((caddr_t)&tv, sizeof(tv), SCM_TIMESTAMP, SOL_SOCKET); - if (*mp) + if (*mp != NULL) { mp = &(*mp)->m_next; + stamped = true; + } } else if (CHECK_SO_CT(inp->inp_socket, SO_TS_REALTIME)) { - struct timespec ts; + struct bintime boottimebin; + struct timespec ts, ts1; - nanotime(&ts); + if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | + M_TSTMP)) { + mbuf_tstmp2timespec(m, &ts); + getboottimebin(&boottimebin); + bintime2timespec(&boottimebin, &ts1); + timespecadd(&ts, &ts1); + } else { + nanotime(&ts); + } *mp = sbcreatecontrol((caddr_t)&ts, sizeof(ts), SCM_REALTIME, SOL_SOCKET); - if (*mp) + if (*mp != NULL) { mp = &(*mp)->m_next; + stamped = true; + } } else if (CHECK_SO_CT(inp->inp_socket, SO_TS_MONOTONIC)) { struct timespec ts; - nanouptime(&ts); + if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | + M_TSTMP)) + mbuf_tstmp2timespec(m, &ts); + else + nanouptime(&ts); *mp = sbcreatecontrol((caddr_t)&ts, sizeof(ts), SCM_MONOTONIC, SOL_SOCKET); - if (*mp) + if (*mp != NULL) { + mp = &(*mp)->m_next; + stamped = true; + } + } + if (stamped && (m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | + M_TSTMP)) { + struct sock_timestamp_info sti; + + bzero(&sti, sizeof(sti)); + sti.st_info_flags = ST_INFO_HW; + if ((m->m_flags & M_TSTMP_HPREC) != 0) + sti.st_info_flags |= ST_INFO_HW_HPREC; + *mp = sbcreatecontrol((caddr_t)&sti, sizeof(sti), SCM_TIME_INFO, + SOL_SOCKET); + if (*mp != NULL) mp = &(*mp)->m_next; } if (inp->inp_flags & INP_RECVDSTADDR) { Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Tue Nov 7 09:29:14 2017 (r325506) +++ head/sys/netinet6/ip6_input.c Tue Nov 7 09:46:26 2017 (r325507) @@ -1221,42 +1221,96 @@ ip6_savecontrol_v4(struct inpcb *inp, struct mbuf *m, struct bintime bt; struct timespec ts; } t; + struct bintime boottimebin, bt1; + struct timespec ts1; + bool stamped; + stamped = false; switch (inp->inp_socket->so_ts_clock) { case SO_TS_REALTIME_MICRO: - microtime(&t.tv); + if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | + M_TSTMP)) { + mbuf_tstmp2timespec(m, &ts1); + timespec2bintime(&ts1, &bt1); + getboottimebin(&boottimebin); + bintime_add(&bt1, &boottimebin); + bintime2timeval(&bt1, &t.tv); + } else { + microtime(&t.tv); + } *mp = sbcreatecontrol((caddr_t) &t.tv, sizeof(t.tv), SCM_TIMESTAMP, SOL_SOCKET); - if (*mp) + if (*mp != NULL) { mp = &(*mp)->m_next; + stamped = true; + } break; case SO_TS_BINTIME: - bintime(&t.bt); + if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | + M_TSTMP)) { + mbuf_tstmp2timespec(m, &ts1); + timespec2bintime(&ts1, &t.bt); + getboottimebin(&boottimebin); + bintime_add(&t.bt, &boottimebin); + } else { + bintime(&t.bt); + } *mp = sbcreatecontrol((caddr_t)&t.bt, sizeof(t.bt), SCM_BINTIME, SOL_SOCKET); - if (*mp) + if (*mp != NULL) { mp = &(*mp)->m_next; + stamped = true; + } break; case SO_TS_REALTIME: - nanotime(&t.ts); + if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | + M_TSTMP)) { + mbuf_tstmp2timespec(m, &t.ts); + getboottimebin(&boottimebin); + bintime2timespec(&boottimebin, &ts1); + timespecadd(&t.ts, &ts1); + } else { + nanotime(&t.ts); + } *mp = sbcreatecontrol((caddr_t)&t.ts, sizeof(t.ts), SCM_REALTIME, SOL_SOCKET); - if (*mp) + if (*mp != NULL) { mp = &(*mp)->m_next; + stamped = true; + } break; case SO_TS_MONOTONIC: - nanouptime(&t.ts); + if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | + M_TSTMP)) + mbuf_tstmp2timespec(m, &t.ts); + else + nanouptime(&t.ts); *mp = sbcreatecontrol((caddr_t)&t.ts, sizeof(t.ts), SCM_MONOTONIC, SOL_SOCKET); - if (*mp) + if (*mp != NULL) { mp = &(*mp)->m_next; + stamped = true; + } break; default: panic("unknown (corrupted) so_ts_clock"); + } + if (stamped && (m->m_flags & (M_PKTHDR | M_TSTMP)) == + (M_PKTHDR | M_TSTMP)) { + struct sock_timestamp_info sti; + + bzero(&sti, sizeof(sti)); + sti.st_info_flags = ST_INFO_HW; + if ((m->m_flags & M_TSTMP_HPREC) != 0) + sti.st_info_flags |= ST_INFO_HW_HPREC; + *mp = sbcreatecontrol((caddr_t)&sti, sizeof(sti), + SCM_TIME_INFO, SOL_SOCKET); + if (*mp != NULL) + mp = &(*mp)->m_next; } } #endif Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Tue Nov 7 09:29:14 2017 (r325506) +++ head/sys/sys/socket.h Tue Nov 7 09:46:26 2017 (r325507) @@ -563,6 +563,17 @@ struct sockcred { #define SCM_BINTIME 0x04 /* timestamp (struct bintime) */ #define SCM_REALTIME 0x05 /* timestamp (struct timespec) */ #define SCM_MONOTONIC 0x06 /* timestamp (struct timespec) */ +#define SCM_TIME_INFO 0x07 /* timestamp info */ + +struct sock_timestamp_info { + __uint32_t st_info_flags; + __uint32_t st_info_pad0; + __uint64_t st_info_rsv[7]; +}; + +#define ST_INFO_HW 0x0001 /* SCM_TIMESTAMP was hw */ +#define ST_INFO_HW_HPREC 0x0002 /* SCM_TIMESTAMP was hw-assisted + on entrance */ #endif #if __BSD_VISIBLE From owner-svn-src-all@freebsd.org Tue Nov 7 09:47:56 2017 Return-Path: Delivered-To: svn-src-all@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 2D758E53FE2; Tue, 7 Nov 2017 09:47:56 +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 EFAF974C35; Tue, 7 Nov 2017 09:47:55 +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 vA79ltIB004055; Tue, 7 Nov 2017 09:47:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA79ltY0004054; Tue, 7 Nov 2017 09:47:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711070947.vA79ltY0004054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 7 Nov 2017 09:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325509 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 325509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 09:47:56 -0000 Author: kib Date: Tue Nov 7 09:47:54 2017 New Revision: 325509 URL: https://svnweb.freebsd.org/changeset/base/325509 Log: Bump __FreeBSD_version after struct mbuf KBI breakage in r325506. Sponsored by: Mellanox Technologies Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Nov 7 09:47:05 2017 (r325508) +++ head/sys/sys/param.h Tue Nov 7 09:47:54 2017 (r325509) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200052 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200053 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Nov 7 09:48:21 2017 Return-Path: Delivered-To: svn-src-all@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 9950CE54035; Tue, 7 Nov 2017 09:48:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 691FB74D08; Tue, 7 Nov 2017 09:48:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA79l501003997; Tue, 7 Nov 2017 09:47:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA79l5Er003996; Tue, 7 Nov 2017 09:47:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711070947.vA79l5Er003996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 7 Nov 2017 09:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325508 - head/lib/libclang_rt X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libclang_rt X-SVN-Commit-Revision: 325508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 09:48:21 -0000 Author: imp Date: Tue Nov 7 09:47:05 2017 New Revision: 325508 URL: https://svnweb.freebsd.org/changeset/base/325508 Log: Correct the detection of hard float arm * Don't test MACHINE, it's irrelevant to userland and should never be used in userland Makefiles. * If we match armv[67] and CPUTYPE is undefined OR it doesn't have 'soft' in it, choose armhf. * Add a note that the soft float on armv[67] may be broken. Sponsored by: Netflix Modified: head/lib/libclang_rt/Makefile.inc Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Tue Nov 7 09:46:26 2017 (r325507) +++ head/lib/libclang_rt/Makefile.inc Tue Nov 7 09:47:05 2017 (r325508) @@ -2,11 +2,11 @@ .include -.if ${MACHINE} == "arm" +# armv[67] is a bit special since we allow a soft-floating version via +# CPUTYPE matching *soft*. This variant is may not actually work though. .if ${MACHINE_ARCH:Marmv[67]*} != "" && \ - (defined(CPUTYPE) && ${CPUTYPE:M*soft*} == "") + (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") CRTARCH= armhf -.endif .endif CRTARCH?= ${MACHINE_CPUARCH:C/amd64/x86_64/} CRTSRC= ${SRCTOP}/contrib/compiler-rt From owner-svn-src-all@freebsd.org Tue Nov 7 09:58:42 2017 Return-Path: Delivered-To: svn-src-all@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 9FEDAE542F4; Tue, 7 Nov 2017 09:58:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 6FF697589E; Tue, 7 Nov 2017 09:58:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA79vQKa007929; Tue, 7 Nov 2017 09:57:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA79vQF9007928; Tue, 7 Nov 2017 09:57:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711070957.vA79vQF9007928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 7 Nov 2017 09:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325510 - head/lib/libthr/tests X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libthr/tests X-SVN-Commit-Revision: 325510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 09:58:42 -0000 Author: imp Date: Tue Nov 7 09:57:26 2017 New Revision: 325510 URL: https://svnweb.freebsd.org/changeset/base/325510 Log: Use MACHINE_CPUARCH in preference MACHINE for userland. Sponsored by: Netflix Modified: head/lib/libthr/tests/Makefile Modified: head/lib/libthr/tests/Makefile ============================================================================== --- head/lib/libthr/tests/Makefile Tue Nov 7 09:47:54 2017 (r325509) +++ head/lib/libthr/tests/Makefile Tue Nov 7 09:57:26 2017 (r325510) @@ -23,7 +23,7 @@ NETBSD_ATF_TESTS_C+= sigmask_test NETBSD_ATF_TESTS_C+= sigsuspend_test NETBSD_ATF_TESTS_C+= siglongjmp_test NETBSD_ATF_TESTS_C+= sleep_test -.if ${MACHINE} != "arm64" # ARM64TODO: Missing makecontext +.if ${MACHINE_CPUARCH} != "aarch64" # ARM64TODO: Missing makecontext NETBSD_ATF_TESTS_C+= swapcontext_test .endif NETBSD_ATF_TESTS_C+= timedmutex_test From owner-svn-src-all@freebsd.org Tue Nov 7 13:20:42 2017 Return-Path: Delivered-To: svn-src-all@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 BD48EE5882F; Tue, 7 Nov 2017 13:20:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9A34E64F31; Tue, 7 Nov 2017 13:20:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA7DKfdR087650; Tue, 7 Nov 2017 13:20:41 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7DKfjW087649; Tue, 7 Nov 2017 13:20:41 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711071320.vA7DKfjW087649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 7 Nov 2017 13:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325511 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 13:20:42 -0000 Author: mw Date: Tue Nov 7 13:20:41 2017 New Revision: 325511 URL: https://svnweb.freebsd.org/changeset/base/325511 Log: Fix ENA driver error handling in attach and basic style fixes The patch contains following changes: * In conditional checks, always check for NULL or 0 instead of negating values * Use malloc and free explicitely, instead of ENA_MEM_FREE and ENA_MEM_FREE (the dmadev passed to macro is never used, and could be a little misleading) * Always check for NULL after calling malloc (few checks were missing) * Rework naming of the goto tags in ena_attach() for consistency * Fix error handling in ena_attach() - few goto instructions were leading to the wrong tag * Destroy MMIO req read request if attach failed * Remove checking for NULL after calling malloc with M_WAITOK flag Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon.com, Inc. Differential Revision: https://reviews.freebsd.org/D12853 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Tue Nov 7 09:57:26 2017 (r325510) +++ head/sys/dev/ena/ena.c Tue Nov 7 13:20:41 2017 (r325511) @@ -91,7 +91,7 @@ static inline void ena_free_counters(counter_u64_t *, static inline void ena_reset_counters(counter_u64_t *, int); static void ena_init_io_rings_common(struct ena_adapter *, struct ena_ring *, uint16_t); -static int ena_init_io_rings(struct ena_adapter *); +static void ena_init_io_rings(struct ena_adapter *); static void ena_free_io_ring_resources(struct ena_adapter *, unsigned int); static void ena_free_all_io_rings_resources(struct ena_adapter *); static int ena_setup_tx_dma_tag(struct ena_adapter *); @@ -420,14 +420,13 @@ ena_init_io_rings_common(struct ena_adapter *adapter, ring->ena_dev = adapter->ena_dev; } -static int +static void ena_init_io_rings(struct ena_adapter *adapter) { struct ena_com_dev *ena_dev; struct ena_ring *txr, *rxr; struct ena_que *que; int i; - int rc; ena_dev = adapter->ena_dev; @@ -449,12 +448,6 @@ ena_init_io_rings(struct ena_adapter *adapter) /* Allocate a buf ring */ txr->br = buf_ring_alloc(ena_buf_ring_size, M_DEVBUF, M_WAITOK, &txr->ring_mtx); - if (txr->br == NULL) { - device_printf(adapter->pdev, - "Error while setting up bufring\n"); - rc = ENOMEM; - goto err_bufr_free; - } /* Alloc TX statistics. */ ena_alloc_counters((counter_u64_t *)&txr->tx_stats, @@ -487,14 +480,6 @@ ena_init_io_rings(struct ena_adapter *adapter) txr->que = que; rxr->que = que; } - - return 0; - -err_bufr_free: - while (i--) - ena_free_io_ring_resources(adapter, i); - - return (rc); } static void @@ -621,12 +606,12 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size; tx_ring->tx_buffer_info = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); - if (!tx_ring->tx_buffer_info) + if (tx_ring->tx_buffer_info == NULL) goto err_tx_buffer_info; size = sizeof(uint16_t) * tx_ring->ring_size; tx_ring->free_tx_ids = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); - if (!tx_ring->free_tx_ids) + if (tx_ring->free_tx_ids == NULL) goto err_tx_reqs; /* Req id stack for TX OOO completions */ @@ -685,9 +670,9 @@ err_tx_map: bus_dmamap_destroy(adapter->tx_buf_tag, tx_ring->tx_buffer_info[i].map); } - ENA_MEM_FREE(adapter->ena_dev->dmadev, tx_ring->free_tx_ids); + free(tx_ring->free_tx_ids, M_DEVBUF); err_tx_reqs: - ENA_MEM_FREE(adapter->ena_dev->dmadev, tx_ring->tx_buffer_info); + free(tx_ring->tx_buffer_info, M_DEVBUF); err_tx_buffer_info: return (ENOMEM); } @@ -726,10 +711,10 @@ ena_free_tx_resources(struct ena_adapter *adapter, int ENA_RING_MTX_UNLOCK(tx_ring); /* And free allocated memory. */ - ENA_MEM_FREE(adapter->ena_dev->dmadev, tx_ring->tx_buffer_info); + free(tx_ring->tx_buffer_info, M_DEVBUF); tx_ring->tx_buffer_info = NULL; - ENA_MEM_FREE(adapter->ena_dev->dmadev, tx_ring->free_tx_ids); + free(tx_ring->free_tx_ids, M_DEVBUF); tx_ring->free_tx_ids = NULL; } @@ -746,7 +731,7 @@ ena_setup_all_tx_resources(struct ena_adapter *adapter for (i = 0; i < adapter->num_queues; i++) { rc = ena_setup_tx_resources(adapter, i); - if (!rc) + if (rc == 0) continue; device_printf(adapter->pdev, @@ -805,9 +790,7 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un */ size += sizeof(struct ena_rx_buffer); - rx_ring->rx_buffer_info = ENA_MEM_ALLOC(adapter->ena_dev->dmadev, size); - if (!rx_ring->rx_buffer_info) - return (ENOMEM); + rx_ring->rx_buffer_info = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); /* Reset RX statistics. */ ena_reset_counters((counter_u64_t *)&rx_ring->rx_stats, @@ -848,7 +831,7 @@ err_rx_dma: rx_ring->rx_buffer_info[i].map); } - ENA_MEM_FREE(adapter->ena_dev->dmadev, rx_ring->rx_buffer_info); + free(rx_ring->rx_buffer_info, M_DEVBUF); rx_ring->rx_buffer_info = NULL; ena_trace(ENA_ALERT, "RX resource allocation fail"); return (ENOMEM); @@ -882,7 +865,7 @@ ena_free_rx_resources(struct ena_adapter *adapter, uns tcp_lro_free(&rx_ring->lro); /* free allocated memory */ - ENA_MEM_FREE(adapter->ena_dev->dmadev, rx_ring->rx_buffer_info); + free(rx_ring->rx_buffer_info, M_DEVBUF); rx_ring->rx_buffer_info = NULL; return; @@ -901,7 +884,7 @@ ena_setup_all_rx_resources(struct ena_adapter *adapter for (i = 0; i < adapter->num_queues; i++) { rc = ena_setup_rx_resources(adapter, i); - if (!rc) + if (rc == 0) continue; device_printf(adapter->pdev, @@ -949,7 +932,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, /* Get mbuf using UMA allocator */ rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); - if (!rx_info->mbuf) { + if (rx_info->mbuf == NULL) { counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); return (ENOMEM); } @@ -993,7 +976,7 @@ ena_free_rx_mbuf(struct ena_adapter *adapter, struct e struct ena_rx_buffer *rx_info) { - if (!rx_info->mbuf) + if (rx_info->mbuf == NULL) return; bus_dmamap_unload(adapter->rx_buf_tag, rx_info->map); @@ -1716,14 +1699,9 @@ ena_enable_msix(struct ena_adapter *adapter) /* Reserved the max msix vectors we might need */ msix_vecs = ENA_MAX_MSIX_VEC(adapter->num_queues); - adapter->msix_entries = ENA_MEM_ALLOC(adapter->ena_dev->dmadev, - msix_vecs * sizeof(struct msix_entry)); - if (!adapter->msix_entries) { - device_printf(dev, - "Failed to allocate msix_entries, vectors %d\n", msix_vecs); - rc = ENOMEM; - goto error; - } + adapter->msix_entries = malloc(msix_vecs * sizeof(struct msix_entry), + M_DEVBUF, M_WAITOK | M_ZERO); + device_printf(dev, "Allocated msix_entries, vectors (cnt: %d)\n", msix_vecs); @@ -1737,7 +1715,7 @@ ena_enable_msix(struct ena_adapter *adapter) if (rc != 0) { device_printf(dev, "Failed to enable MSIX, vectors %d rc %d\n", msix_vecs, rc); - ENA_MEM_FREE(adapter->ena_dev->dmadev, adapter->msix_entries); + free(adapter->msix_entries, M_DEVBUF); adapter->msix_entries = NULL; rc = ENOSPC; goto error; @@ -2025,7 +2003,7 @@ ena_disable_msix(struct ena_adapter *adapter) pci_release_msi(adapter->pdev); adapter->msix_vecs = 0; - ENA_MEM_FREE(adapter->ena_dev->dmadev, adapter->msix_entries); + free(adapter->msix_entries, M_DEVBUF); adapter->msix_entries = NULL; } @@ -3319,7 +3297,7 @@ static void check_for_missing_tx_completions(struct en } budget--; - if (!budget) { + if (budget == 0) { i++; break; } @@ -3502,16 +3480,12 @@ ena_attach(device_t pdev) if (rc) { device_printf(pdev, "PCI resource allocation failed!\n"); ena_free_pci_resources(adapter); - goto err_pci_res; + return (rc); } /* Allocate memory for ena_dev structure */ - ena_dev = ENA_MEM_ALLOC(pdev, sizeof(struct ena_com_dev)); - if (!ena_dev) { - device_printf(pdev, "allocating ena_dev failed\n"); - rc = ENOMEM; - goto err_select_region; - } + ena_dev = malloc(sizeof(struct ena_com_dev), M_DEVBUF, + M_WAITOK | M_ZERO); adapter->ena_dev = ena_dev; ena_dev->dmadev = pdev; @@ -3527,7 +3501,7 @@ ena_attach(device_t pdev) if (((struct ena_bus*)(ena_dev->bus))->reg_bar_h == 0) { device_printf(pdev, "failed to pmap registers bar\n"); rc = ENXIO; - goto err_dev_free; + goto err_bus_free; } ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; @@ -3579,25 +3553,21 @@ ena_attach(device_t pdev) /* set up dma tags for rx and tx buffers */ rc = ena_setup_tx_dma_tag(adapter); if (rc) - goto dma_tx_err; + goto err_com_free; rc = ena_setup_rx_dma_tag(adapter); if (rc) - goto dma_rx_err; + goto err_tx_tag_free; /* initialize rings basic information */ device_printf(pdev, "initalize %d io queues\n", io_queue_num); - rc = ena_init_io_rings(adapter); - if (rc) { - device_printf(pdev,"Error with initialization of IO rings\n"); - goto err_io_init; - } + ena_init_io_rings(adapter); /* setup network interface */ rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); if (rc) { device_printf(pdev,"Error with network interface setup\n"); - goto err_com_free; + goto err_io_free; } rc = ena_enable_msix_and_set_admin_interrupts(adapter, io_queue_num); @@ -3611,11 +3581,6 @@ ena_attach(device_t pdev) TASK_INIT(&adapter->reset_task, 0, ena_reset_task, adapter); adapter->reset_tq = taskqueue_create("ena_reset_enqueue", M_WAITOK | M_ZERO, taskqueue_thread_enqueue, &adapter->reset_tq); - if (adapter->reset_tq == NULL) { - device_printf(adapter->pdev, - "Unable to create reset task queue\n"); - goto err_reset_tq; - } taskqueue_start_threads(&adapter->reset_tq, 1, PI_NET, "%s rstq", device_get_nameunit(adapter->pdev)); @@ -3632,29 +3597,23 @@ ena_attach(device_t pdev) adapter->running = true; return (0); -err_reset_tq: - ena_com_dev_reset(ena_dev, ENA_REGS_RESET_INIT_ERR); - ena_free_mgmnt_irq(adapter); - ena_disable_msix(adapter); err_ifp_free: if_detach(adapter->ifp); if_free(adapter->ifp); -err_com_free: +err_io_free: ena_free_all_io_rings_resources(adapter); -err_io_init: ena_free_rx_dma_tag(adapter); -dma_rx_err: +err_tx_tag_free: ena_free_tx_dma_tag(adapter); -dma_tx_err: +err_com_free: ena_com_admin_destroy(ena_dev); ena_com_delete_host_info(ena_dev); + ena_com_mmio_reg_read_request_destroy(ena_dev); err_bus_free: free(ena_dev->bus, M_DEVBUF); -err_dev_free: free(ena_dev, M_DEVBUF); -err_select_region: ena_free_pci_resources(adapter); -err_pci_res: + return (rc); } From owner-svn-src-all@freebsd.org Tue Nov 7 13:26:13 2017 Return-Path: Delivered-To: svn-src-all@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 21A41E58B87; Tue, 7 Nov 2017 13:26:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E25ED657DC; Tue, 7 Nov 2017 13:26:12 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA7DQBCa091349; Tue, 7 Nov 2017 13:26:11 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7DQBJZ091348; Tue, 7 Nov 2017 13:26:11 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711071326.vA7DQBJZ091348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 7 Nov 2017 13:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325512 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 13:26:13 -0000 Author: mw Date: Tue Nov 7 13:26:11 2017 New Revision: 325512 URL: https://svnweb.freebsd.org/changeset/base/325512 Log: Change function validate_tx_req_id() to inline in ENA driver The function is in hot path of the driver (TX) and asking compiler for making this function inline was changed for consistency and higher readability. Submitted by: Michal Krawczyk Reviewed by: rlibby, byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12854 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Tue Nov 7 13:20:41 2017 (r325511) +++ head/sys/dev/ena/ena.c Tue Nov 7 13:26:11 2017 (r325512) @@ -122,7 +122,7 @@ static void ena_destroy_all_io_queues(struct ena_adapt static int ena_create_io_queues(struct ena_adapter *); static int ena_tx_cleanup(struct ena_ring *); static int ena_rx_cleanup(struct ena_ring *); -static int validate_tx_req_id(struct ena_ring *, uint16_t); +static inline int validate_tx_req_id(struct ena_ring *, uint16_t); static void ena_rx_hash_mbuf(struct ena_ring *, struct ena_com_rx_ctx *, struct mbuf *); static struct mbuf* ena_rx_mbuf(struct ena_ring *, struct ena_com_rx_buf_info *, @@ -1165,7 +1165,7 @@ ena_destroy_all_io_queues(struct ena_adapter *adapter) ena_destroy_all_rx_queues(adapter); } -static int +static inline int validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id) { struct ena_tx_buffer *tx_info = NULL; From owner-svn-src-all@freebsd.org Tue Nov 7 14:26:26 2017 Return-Path: Delivered-To: svn-src-all@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 3D055E5A7AE; Tue, 7 Nov 2017 14:26:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 05F946A51F; Tue, 7 Nov 2017 14:26:25 +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 vA7EPAFw015286; Tue, 7 Nov 2017 14:25:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7EPAL4015285; Tue, 7 Nov 2017 14:25:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711071425.vA7EPAL4015285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Nov 2017 14:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325513 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 325513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 14:26:26 -0000 Author: pfg Date: Tue Nov 7 14:25:09 2017 New Revision: 325513 URL: https://svnweb.freebsd.org/changeset/base/325513 Log: MFC r325397: ANSI-fy exec_shell_imgact(). Fix a stray space while here. PR: 223317 Modified: stable/11/sys/kern/imgact_shell.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/imgact_shell.c ============================================================================== --- stable/11/sys/kern/imgact_shell.c Tue Nov 7 13:26:11 2017 (r325512) +++ stable/11/sys/kern/imgact_shell.c Tue Nov 7 14:25:09 2017 (r325513) @@ -97,8 +97,7 @@ CTASSERT(MAXSHELLCMDLEN >= MAXINTERP + 3); * 6.x branch on May 28, 2005 (matching __FreeBSD_version 600029). */ int -exec_shell_imgact(imgp) - struct image_params *imgp; +exec_shell_imgact(struct image_params *imgp) { const char *image_header = imgp->image_header; const char *ihp, *interpb, *interpe, *maxp, *optb, *opte, *fname; @@ -125,7 +124,7 @@ exec_shell_imgact(imgp) * However, we don't know how far into the page the contents are * valid -- the actual file might be much shorter than the page. * So find out the file size. - */ + */ error = VOP_GETATTR(imgp->vp, &vattr, imgp->proc->p_ucred); if (error) return (error); From owner-svn-src-all@freebsd.org Tue Nov 7 14:28:11 2017 Return-Path: Delivered-To: svn-src-all@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 6D946E5A85B; Tue, 7 Nov 2017 14:28:11 +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 3CCFB6A7C4; Tue, 7 Nov 2017 14:28:11 +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 vA7ESA9l015501; Tue, 7 Nov 2017 14:28:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7ESAW7015500; Tue, 7 Nov 2017 14:28:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711071428.vA7ESAW7015500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 7 Nov 2017 14:28: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: r325514 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 325514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 14:28:11 -0000 Author: pfg Date: Tue Nov 7 14:28:10 2017 New Revision: 325514 URL: https://svnweb.freebsd.org/changeset/base/325514 Log: MFC r325397: ANSI-fy exec_shell_imgact(). Fix a stray space while here. PR: 223317 Modified: stable/10/sys/kern/imgact_shell.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/imgact_shell.c ============================================================================== --- stable/10/sys/kern/imgact_shell.c Tue Nov 7 14:25:09 2017 (r325513) +++ stable/10/sys/kern/imgact_shell.c Tue Nov 7 14:28:10 2017 (r325514) @@ -97,8 +97,7 @@ CTASSERT(MAXSHELLCMDLEN >= MAXINTERP + 3); * 6.x branch on May 28, 2005 (matching __FreeBSD_version 600029). */ int -exec_shell_imgact(imgp) - struct image_params *imgp; +exec_shell_imgact(struct image_params *imgp) { const char *image_header = imgp->image_header; const char *ihp, *interpb, *interpe, *maxp, *optb, *opte, *fname; @@ -125,7 +124,7 @@ exec_shell_imgact(imgp) * However, we don't know how far into the page the contents are * valid -- the actual file might be much shorter than the page. * So find out the file size. - */ + */ error = VOP_GETATTR(imgp->vp, &vattr, imgp->proc->p_ucred); if (error) return (error); From owner-svn-src-all@freebsd.org Tue Nov 7 15:02:54 2017 Return-Path: Delivered-To: svn-src-all@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 ED683E5B119; Tue, 7 Nov 2017 15:02:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 B7D2A6CF50; Tue, 7 Nov 2017 15:02:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA7F1cCQ028128; Tue, 7 Nov 2017 15:01:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7F1c5H028127; Tue, 7 Nov 2017 15:01:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711071501.vA7F1c5H028127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 7 Nov 2017 15:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325515 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 15:02:55 -0000 Author: imp Date: Tue Nov 7 15:01:38 2017 New Revision: 325515 URL: https://svnweb.freebsd.org/changeset/base/325515 Log: Note interactive shell errors for make buildenv and add a warning for people tempted to add back the || true to get rid of them. Sponsored by: Netflix Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Nov 7 14:28:10 2017 (r325514) +++ head/Makefile.inc1 Tue Nov 7 15:01:38 2017 (r325515) @@ -988,6 +988,14 @@ buildenvvars: .PHONY .endif .endif BUILDENV_DIR?= ${.CURDIR} +# +# Note: make will report any errors the shell reports. This can +# be odd if the last command in an interactive shell generates an +# error or is terminated by SIGINT. These reported errors look bad, +# but are harmless. Allowing them also allows BUIDLENV_SHELL to +# be a complex command whose status will be returned to the caller. +# Some scripts in tools rely on this behavior to report build errors. +# buildenv: .PHONY @echo Entering world for ${TARGET_ARCH}:${TARGET} .if ${BUILDENV_SHELL:M*zsh*} From owner-svn-src-all@freebsd.org Tue Nov 7 15:14:49 2017 Return-Path: Delivered-To: svn-src-all@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 389ADE5B6EF; Tue, 7 Nov 2017 15:14:49 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 02D796DE7B; Tue, 7 Nov 2017 15:14:48 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA7FDXZf035040; Tue, 7 Nov 2017 15:13:33 GMT (envelope-from robak@FreeBSD.org) Received: (from robak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7FDXHa035038; Tue, 7 Nov 2017 15:13:33 GMT (envelope-from robak@FreeBSD.org) Message-Id: <201711071513.vA7FDXHa035038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: robak set sender to robak@FreeBSD.org using -f From: Bartek Rutkowski Date: Tue, 7 Nov 2017 15:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325516 - in head: lib/libc/gen sys/kern X-SVN-Group: head X-SVN-Commit-Author: robak X-SVN-Commit-Paths: in head: lib/libc/gen sys/kern X-SVN-Commit-Revision: 325516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 15:14:49 -0000 Author: robak (ports committer) Date: Tue Nov 7 15:13:32 2017 New Revision: 325516 URL: https://svnweb.freebsd.org/changeset/base/325516 Log: Make sysctl_kern_proc_umask execute fast path when requested pid in curproc->p_pid or 0, avoiding unnecessary locking. Update libc consumer to skip calling getpid(). Submitted by: Pawel Biernacki Reviewed by: mjg, robak Approved by: mjg Sponsored by: Mysterious Code Ltd. Differential Revision: D12972 Modified: head/lib/libc/gen/setmode.c head/sys/kern/kern_proc.c Modified: head/lib/libc/gen/setmode.c ============================================================================== --- head/lib/libc/gen/setmode.c Tue Nov 7 15:01:38 2017 (r325515) +++ head/lib/libc/gen/setmode.c Tue Nov 7 15:13:32 2017 (r325516) @@ -356,7 +356,7 @@ getumask(void) * security.bsd.unprivileged_proc_debug is set to 0. */ len = sizeof(smask); - if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, getpid() }, + if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, 0 }, 4, &smask, &len, NULL, 0) == 0) return (smask); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Nov 7 15:01:38 2017 (r325515) +++ head/sys/kern/kern_proc.c Tue Nov 7 15:13:32 2017 (r325516) @@ -2770,18 +2770,25 @@ sysctl_kern_proc_umask(SYSCTL_HANDLER_ARGS) struct proc *p; int error; u_short fd_cmask; + pid_t pid; if (namelen != 1) return (EINVAL); - error = pget((pid_t)name[0], PGET_WANTREAD, &p); + pid = (pid_t)name[0]; + p = curproc; + if (pid == p->p_pid || pid == 0) { + fd_cmask = p->p_fd->fd_cmask; + goto out; + } + + error = pget(pid, PGET_WANTREAD, &p); if (error != 0) return (error); - FILEDESC_SLOCK(p->p_fd); fd_cmask = p->p_fd->fd_cmask; - FILEDESC_SUNLOCK(p->p_fd); PRELE(p); +out: error = SYSCTL_OUT(req, &fd_cmask, sizeof(fd_cmask)); return (error); } From owner-svn-src-all@freebsd.org Tue Nov 7 15:21:58 2017 Return-Path: Delivered-To: svn-src-all@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 49E25E5BA3A; Tue, 7 Nov 2017 15:21:58 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::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 C281E6E516; Tue, 7 Nov 2017 15:21:57 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x229.google.com with SMTP id a132so14922530lfa.7; Tue, 07 Nov 2017 07:21:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=bKP9qgP2U4CiRboPV2SODMLgEbWJOdu3MUue17LqSw8=; b=qeqmaNmHR+ObKkv+48eyb4Ikic9EAD2NsWzk0PQfd2Ma1Vo6fyPOUq+oVFGhUJnCVn 7kPVsZByeUPQ2VlsDhY73NW6o2NCeiKeHakZGz0iMXP8KDcNrjZvHE+oZQLakYbS3hUt ac5JMp4wfzyKQznmtWXrRf2Pc8YmCnxzi+xWidInNPQi+v1kOwb99rcXPx+JHxqcRyfi kloDCtEckb3wnQviit5uhQNP3c6w+9O8bfNaIoEVGj2/MuCrqrrV+aZ5REM1yHCZe9Bg kJBAamUKNAKflr5/LJ5aLzSXkwlePw7OkxsvpKLzFf0TfSKIzRmCTyspFkDWe0EkN1Sd rt5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=bKP9qgP2U4CiRboPV2SODMLgEbWJOdu3MUue17LqSw8=; b=hmcBTjoa9j/Ia1T8FXZCCuexjsznY0tlhCq3qULtithP7TaFACCxRVEb/AxE5hZpxj LUq5LmYHdSzYbfb34CXjF9OaPWSkuIuxJHuWp8J/J39IPEnRsZXbNu47lOCLYfweJ9Pf Tmex89NsW0JXcj94vj+NBi0n2GtYVJcbhkyvBe4CFiig/RFOvUks1e628LFFxKiLieQG qtbzV/QAqveYamy5/lam/1pjvu73H43IzZX+1mfJcKnhYDkiWH/iPKECo8tkUwc3bizN B+ipRrXFuT6KVWXBrpVTrhWPeTS8rv/diHdDw0uvg6u2pDQOyWtEirhVvlX5DugJsk4i Ykbg== X-Gm-Message-State: AJaThX5gvXiiDLR804YU2kgt3uRfhoz+tbgR2vOefq8QSOfcMqKtSRi2 ujJTjxoWL/ecuvCdoPukknljDvsBQJJ9Ro4DXDc= X-Google-Smtp-Source: ABhQp+Ra15MBEOEyF1h0vGZ8/vtMrhO8TtoULsebYIbOl5qCDnetQg9EVf7HRpIlbyWtj6d1ZbmHqOFhL9b9Hw5WrVU= X-Received: by 10.46.88.73 with SMTP id x9mr2779052ljd.80.1510068115478; Tue, 07 Nov 2017 07:21:55 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.93.24 with HTTP; Tue, 7 Nov 2017 07:21:54 -0800 (PST) In-Reply-To: <201711041438.vA4Ec0vx097305@repo.freebsd.org> References: <201711041438.vA4Ec0vx097305@repo.freebsd.org> From: Alan Somers Date: Tue, 7 Nov 2017 08:21:54 -0700 X-Google-Sender-Auth: paW7ZUbKOf__jKqgqWNeqIzNpUQ Message-ID: Subject: Re: svn commit: r325392 - head/etc/autofs To: Edward Tomasz Napierala Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 15:21:58 -0000 On Sat, Nov 4, 2017 at 8:38 AM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Nov 4 14:38:00 2017 > New Revision: 325392 > URL: https://svnweb.freebsd.org/changeset/base/325392 > > Log: > Add NIS automounter map, which supports rewriting of self-hosted locations > to make them nullfs. > > PR: 221010 > Submitted by: G. Paul Ziemba > MFC after: 2 weeks This is not generally safe with NFSv4. If vfs.nfsd.issue_delegations==1, then the server will allow NFS clients to delay flushing writes back to the server. The protocol handles multiple clients that want delegations for the same file, but it doesn't handle local access. So if somebody tries to automount a locally-hosted NFSv4 volume with delegations enabled, but accidentally mounts it with nullfs instead, file corruption could result. The simplest solution would be to never use nullfs if vfs.nfsd.issue_delgations==1. -Alan From owner-svn-src-all@freebsd.org Tue Nov 7 16:59:54 2017 Return-Path: Delivered-To: svn-src-all@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 1795AE5DE28; Tue, 7 Nov 2017 16:59:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7A9D764FE; Tue, 7 Nov 2017 16:59:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA7GxrEY075597; Tue, 7 Nov 2017 16:59:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7GxqTt075593; Tue, 7 Nov 2017 16:59:52 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201711071659.vA7GxqTt075593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 7 Nov 2017 16:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325517 - in head: share/man/man4 sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: share/man/man4 sys/cam/ctl X-SVN-Commit-Revision: 325517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 16:59:54 -0000 Author: manu Date: Tue Nov 7 16:59:52 2017 New Revision: 325517 URL: https://svnweb.freebsd.org/changeset/base/325517 Log: ctl: Make max_luns and max_ports tunable variables instead of hardcoded defines. Reviewed by: trasz (earlier version), bapt (earlier version), bcr (manpages) MFC after: 2 Weeks Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D12836 Modified: head/share/man/man4/ctl.4 head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_ioctl.h head/sys/cam/ctl/ctl_private.h Modified: head/share/man/man4/ctl.4 ============================================================================== --- head/share/man/man4/ctl.4 Tue Nov 7 15:13:32 2017 (r325516) +++ head/share/man/man4/ctl.4 Tue Nov 7 16:59:52 2017 (r325517) @@ -191,6 +191,15 @@ If there is no primary node (both nodes are secondary, no connection to primary one), secondary node(s) report Transitioning state. State with two primary nodes is illegal (split brain condition). .El +.Sh TUNABLE VARIABLES +The following variables are available as +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va kern.cam.ctl.max_luns +Specifies the maximum number of LUNs we support, must be a power of 2. (Default 1024) +.It Va kern.cam.ctl.max_ports +Specifies the maximum number of ports we support, must be a power of 2. (Default 256) .Sh SEE ALSO .Xr cfiscsi 4 , .Xr cfumass 4 , Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Nov 7 15:13:32 2017 (r325516) +++ head/sys/cam/ctl/ctl.c Tue Nov 7 16:59:52 2017 (r325517) @@ -415,6 +415,29 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, time_io_secs, CTLF #endif /* + * Maximum number of LUNs we support. MUST be a power of 2. + */ +#define CTL_DEFAULT_MAX_LUNS 1024 +static int ctl_max_luns = CTL_DEFAULT_MAX_LUNS; +TUNABLE_INT("kern.cam.ctl.max_luns", &ctl_max_luns); +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, max_luns, CTLFLAG_RDTUN, + &ctl_max_luns, CTL_DEFAULT_MAX_LUNS, "Maximum number of LUNs"); + +/* + * Maximum number of ports registered at one time. + */ +#define CTL_DEFAULT_MAX_PORTS 256 +static int ctl_max_ports = CTL_DEFAULT_MAX_PORTS; +TUNABLE_INT("kern.cam.ctl.max_ports", &ctl_max_ports); +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, max_ports, CTLFLAG_RDTUN, + &ctl_max_ports, CTL_DEFAULT_MAX_LUNS, "Maximum number of ports"); + +/* + * Maximum number of initiators we support. + */ +#define CTL_MAX_INITIATORS (CTL_MAX_INIT_PER_PORT * ctl_max_ports) + +/* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), * Extended INQUIRY Data (0x86), Mode Page Policy (0x87), * SCSI Ports (0x88), Third-party Copy (0x8F), Block limits (0xB0), @@ -1005,8 +1028,8 @@ ctl_isc_ha_link_up(struct ctl_softc *softc) msg.login.version = CTL_HA_VERSION; msg.login.ha_mode = softc->ha_mode; msg.login.ha_id = softc->ha_id; - msg.login.max_luns = CTL_MAX_LUNS; - msg.login.max_ports = CTL_MAX_PORTS; + msg.login.max_luns = ctl_max_luns; + msg.login.max_ports = ctl_max_ports; msg.login.max_init_per_port = CTL_MAX_INIT_PER_PORT; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg.login, sizeof(msg.login), M_WAITOK); @@ -1069,7 +1092,7 @@ ctl_isc_ua(struct ctl_softc *softc, union ctl_ha_msg * uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_mapped_lun >= CTL_MAX_LUNS || + if (msg->hdr.nexus.targ_mapped_lun >= ctl_max_luns || (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1103,7 +1126,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc, union ctl_ha targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1325,8 +1348,8 @@ ctl_isc_login(struct ctl_softc *softc, union ctl_ha_ms ctl_ha_msg_abort(CTL_HA_CHAN_CTL); return; } - if (msg->login.max_luns != CTL_MAX_LUNS || - msg->login.max_ports != CTL_MAX_PORTS || + if (msg->login.max_luns != ctl_max_luns || + msg->login.max_ports != ctl_max_ports || msg->login.max_init_per_port != CTL_MAX_INIT_PER_PORT) { printf("CTL HA peers have different limits\n"); ctl_ha_msg_abort(CTL_HA_CHAN_CTL); @@ -1343,7 +1366,7 @@ ctl_isc_mode_sync(struct ctl_softc *softc, union ctl_h targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1873,6 +1896,26 @@ ctl_init(void) OID_AUTO, "ha_mode", CTLFLAG_RDTUN, (int *)&softc->ha_mode, 0, "HA mode (0 - act/stby, 1 - serialize only, 2 - xfer)"); + if (ctl_max_luns <= 0 || powerof2(ctl_max_luns) == 0) { + printf("Bad value %d for kern.cam.ctl.max_luns, must be a power of two, using %d\n", + ctl_max_luns, CTL_DEFAULT_MAX_LUNS); + ctl_max_luns = CTL_DEFAULT_MAX_LUNS; + } + softc->ctl_luns = malloc(sizeof(struct ctl_lun *) * ctl_max_luns, + M_DEVBUF, M_WAITOK | M_ZERO); + softc->ctl_lun_mask = malloc(sizeof(uint32_t) * + ((ctl_max_luns + 31) / 32), M_DEVBUF, M_WAITOK | M_ZERO); + if (ctl_max_ports <= 0 || powerof2(ctl_max_ports) == 0) { + printf("Bad value %d for kern.cam.ctl.max_ports, must be a power of two, using %d\n", + ctl_max_ports, CTL_DEFAULT_MAX_PORTS); + ctl_max_ports = CTL_DEFAULT_MAX_PORTS; + } + softc->ctl_port_mask = malloc(sizeof(uint32_t) * + ((ctl_max_ports + 31) / 32), M_DEVBUF, M_WAITOK | M_ZERO); + softc->ctl_ports = malloc(sizeof(struct ctl_port *) * ctl_max_ports, + M_DEVBUF, M_WAITOK | M_ZERO); + + /* * In Copan's HA scheme, the "master" and "slave" roles are * figured out through the slot the controller is in. Although it @@ -1884,10 +1927,10 @@ ctl_init(void) if (softc->ha_id == 0 || softc->ha_id > NUM_HA_SHELVES) { softc->flags |= CTL_FLAG_ACTIVE_SHELF; softc->is_single = 1; - softc->port_cnt = CTL_MAX_PORTS; + softc->port_cnt = ctl_max_ports; softc->port_min = 0; } else { - softc->port_cnt = CTL_MAX_PORTS / NUM_HA_SHELVES; + softc->port_cnt = ctl_max_ports / NUM_HA_SHELVES; softc->port_min = (softc->ha_id - 1) * softc->port_cnt; } softc->port_max = softc->port_min + softc->port_cnt; @@ -1988,6 +2031,11 @@ ctl_shutdown(void) uma_zdestroy(softc->io_zone); mtx_destroy(&softc->ctl_lock); + free(softc->ctl_luns, M_DEVBUF); + free(softc->ctl_lun_mask, M_DEVBUF); + free(softc->ctl_port_mask, M_DEVBUF); + free(softc->ctl_ports, M_DEVBUF); + sysctl_ctx_free(&softc->sysctl_ctx); free(softc, M_DEVBUF); @@ -2249,7 +2297,7 @@ ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) /* Make sure that we know about this LUN. */ mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); @@ -2717,7 +2765,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, mtx_lock(&softc->ctl_lock); if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 && - (ooa_hdr->lun_num >= CTL_MAX_LUNS || + (ooa_hdr->lun_num >= ctl_max_luns || softc->ctl_luns[ooa_hdr->lun_num] == NULL)) { mtx_unlock(&softc->ctl_lock); free(entries, M_CTL); @@ -2770,7 +2818,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, #ifdef CTL_IO_DELAY mtx_lock(&softc->ctl_lock); - if (delay_info->lun_id >= CTL_MAX_LUNS || + if (delay_info->lun_id >= ctl_max_luns || (lun = softc->ctl_luns[delay_info->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); delay_info->status = CTL_DELAY_STATUS_INVALID_LUN; @@ -2849,7 +2897,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, bcopy(err_desc, new_err_desc, sizeof(*new_err_desc)); mtx_lock(&softc->ctl_lock); - if (err_desc->lun_id >= CTL_MAX_LUNS || + if (err_desc->lun_id >= ctl_max_luns || (lun = softc->ctl_luns[err_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); free(new_err_desc, M_CTL); @@ -2893,7 +2941,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, delete_done = 0; mtx_lock(&softc->ctl_lock); - if (delete_desc->lun_id >= CTL_MAX_LUNS || + if (delete_desc->lun_id >= ctl_max_luns || (lun = softc->ctl_luns[delete_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); printf("%s: CTL_ERROR_INJECT_DELETE: invalid LUN %ju\n", @@ -2936,7 +2984,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, continue; } - for (j = 0; j < CTL_MAX_PORTS; j++) { + for (j = 0; j < ctl_max_ports; j++) { if (lun->pr_keys[j] == NULL) continue; for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ @@ -3411,7 +3459,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, if (lm->plun != UINT32_MAX) { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_unset(port, lm->plun); - else if (lm->lun < CTL_MAX_LUNS && + else if (lm->lun < ctl_max_luns && softc->ctl_luns[lm->lun] != NULL) retval = ctl_lun_map_set(port, lm->plun, lm->lun); else @@ -4519,6 +4567,13 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ if (lun_malloced) lun->flags = CTL_LUN_MALLOCED; + lun->pending_sense = malloc(sizeof(struct scsi_sense_data *) * + ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); + lun->pending_ua = malloc(sizeof(ctl_ua_type *) * ctl_max_ports, + M_DEVBUF, M_WAITOK | M_ZERO); + lun->pr_keys = malloc(sizeof(uint64_t *) * ctl_max_ports, + M_DEVBUF, M_WAITOK | M_ZERO); + /* Generate LUN ID. */ devidlen = max(CTL_DEVID_MIN_LEN, strnlen(be_lun->device_id, CTL_DEVID_LEN)); @@ -4605,13 +4660,13 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ * if it is available. Otherwise, allocate the first available LUN. */ if (be_lun->flags & CTL_LUN_FLAG_ID_REQ) { - if ((be_lun->req_lun_id > (CTL_MAX_LUNS - 1)) + if ((be_lun->req_lun_id > (ctl_max_luns - 1)) || (ctl_is_set(ctl_softc->ctl_lun_mask, be_lun->req_lun_id))) { mtx_unlock(&ctl_softc->ctl_lock); - if (be_lun->req_lun_id > (CTL_MAX_LUNS - 1)) { + if (be_lun->req_lun_id > (ctl_max_luns - 1)) { printf("ctl: requested LUN ID %d is higher " - "than CTL_MAX_LUNS - 1 (%d)\n", - be_lun->req_lun_id, CTL_MAX_LUNS - 1); + "than ctl_max_luns - 1 (%d)\n", + be_lun->req_lun_id, ctl_max_luns - 1); } else { /* * XXX KDM return an error, or just assign @@ -4630,7 +4685,7 @@ fail: } lun_number = be_lun->req_lun_id; } else { - lun_number = ctl_ffz(ctl_softc->ctl_lun_mask, 0, CTL_MAX_LUNS); + lun_number = ctl_ffz(ctl_softc->ctl_lun_mask, 0, ctl_max_luns); if (lun_number == -1) { mtx_unlock(&ctl_softc->ctl_lock); printf("ctl: can't allocate LUN, out of LUNs\n"); @@ -4697,7 +4752,9 @@ fail: lun->legacy_stats.blocksize = be_lun->blocksize; if (be_lun->blocksize == 0) lun->legacy_stats.flags = CTL_LUN_STATS_NO_BLOCKSIZE; - for (len = 0; len < CTL_MAX_PORTS; len++) + lun->legacy_stats.ports = malloc(sizeof(struct ctl_lun_io_port_stats) * + ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); + for (len = 0; len < ctl_max_ports; len++) lun->legacy_stats.ports[len].targ_port = len; #endif /* CTL_LEGACY_STATS */ lun->stats.item = lun_number; @@ -4760,10 +4817,12 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); - for (i = 0; i < CTL_MAX_PORTS; i++) + for (i = 0; i < ctl_max_ports; i++) free(lun->pending_ua[i], M_CTL); - for (i = 0; i < CTL_MAX_PORTS; i++) + free(lun->pending_ua, M_DEVBUF); + for (i = 0; i < ctl_max_ports; i++) free(lun->pr_keys[i], M_CTL); + free(lun->pr_keys, M_DEVBUF); free(lun->write_buffer, M_CTL); free(lun->prevent, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) @@ -8483,7 +8542,7 @@ ctl_hndl_per_res_out_on_other_sc(union ctl_io *io) targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -9010,7 +9069,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_report_luns\n")); num_luns = 0; - num_port_luns = port->lun_map ? port->lun_map_size : CTL_MAX_LUNS; + num_port_luns = port->lun_map ? port->lun_map_size : ctl_max_luns; mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0; targ_lun_id < num_port_luns; targ_lun_id++) { if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) @@ -11200,7 +11259,7 @@ ctl_failover_lun(union ctl_io *rio) /* Find and lock the LUN. */ mtx_lock(&softc->ctl_lock); - if (targ_lun > CTL_MAX_LUNS || + if (targ_lun > ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -11282,7 +11341,7 @@ ctl_scsiio_precheck(struct ctl_softc *softc, struct ct lun = NULL; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; - if (targ_lun < CTL_MAX_LUNS) + if (targ_lun < ctl_max_luns) lun = softc->ctl_luns[targ_lun]; if (lun) { /* @@ -11672,7 +11731,7 @@ ctl_do_lun_reset(struct ctl_lun *lun, uint32_t initidx xio->io_hdr.flags |= CTL_FLAG_ABORT | CTL_FLAG_ABORT_STATUS; } /* Clear CA. */ - for (i = 0; i < CTL_MAX_PORTS; i++) { + for (i = 0; i < ctl_max_ports; i++) { free(lun->pending_sense[i], M_CTL); lun->pending_sense[i] = NULL; } @@ -11705,7 +11764,7 @@ ctl_lun_reset(union ctl_io *io) targ_lun = io->io_hdr.nexus.targ_mapped_lun; initidx = ctl_get_initindex(&io->io_hdr.nexus); mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -11784,7 +11843,7 @@ ctl_abort_task_set(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -11886,7 +11945,7 @@ ctl_abort_task(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12010,7 +12069,7 @@ ctl_query_task(union ctl_io *io, int task_set) targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12049,7 +12108,7 @@ ctl_query_async_event(union ctl_io *io) targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12141,7 +12200,7 @@ ctl_handle_isc(union ctl_io *io) break; case CTL_MSG_R2R: /* Only used in SER_ONLY mode. */ entry = ctl_get_cmd_entry(&io->scsiio, NULL); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { ctl_done(io); break; @@ -12161,7 +12220,7 @@ ctl_handle_isc(union ctl_io *io) ctl_done(io); break; } - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { ctl_free_io(io); break; @@ -13130,7 +13189,7 @@ ctl_queue_sense(union ctl_io *io) * If we don't have a LUN for this, just toss the sense information. */ mtx_lock(&softc->ctl_lock); - if (targ_lun >= CTL_MAX_LUNS || + if (targ_lun >= ctl_max_luns || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); goto bailout; Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Tue Nov 7 15:13:32 2017 (r325516) +++ head/sys/cam/ctl/ctl_ioctl.h Tue Nov 7 16:59:52 2017 (r325517) @@ -59,25 +59,10 @@ #define CTL_MAX_TARGID 15 /* - * Maximum number of LUNs we support at the moment. MUST be a power of 2. - */ -#define CTL_MAX_LUNS 1024 - -/* * Maximum number of initiators per port. */ #define CTL_MAX_INIT_PER_PORT 2048 -/* - * Maximum number of ports registered at one time. - */ -#define CTL_MAX_PORTS 256 - -/* - * Maximum number of initiators we support. - */ -#define CTL_MAX_INITIATORS (CTL_MAX_INIT_PER_PORT * CTL_MAX_PORTS) - /* Hopefully this won't conflict with new misc devices that pop up */ #define CTL_MINOR 225 @@ -150,7 +135,7 @@ struct ctl_lun_io_stats { uint64_t lun_number; uint32_t blocksize; ctl_lun_stats_flags flags; - struct ctl_lun_io_port_stats ports[CTL_MAX_PORTS]; + struct ctl_lun_io_port_stats *ports; }; struct ctl_stats { Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Tue Nov 7 15:13:32 2017 (r325516) +++ head/sys/cam/ctl/ctl_private.h Tue Nov 7 16:59:52 2017 (r325517) @@ -390,8 +390,8 @@ struct ctl_lun { TAILQ_HEAD(ctl_ooaq, ctl_io_hdr) ooa_queue; TAILQ_HEAD(ctl_blockq,ctl_io_hdr) blocked_queue; STAILQ_ENTRY(ctl_lun) links; - struct scsi_sense_data *pending_sense[CTL_MAX_PORTS]; - ctl_ua_type *pending_ua[CTL_MAX_PORTS]; + struct scsi_sense_data **pending_sense; + ctl_ua_type **pending_ua; uint8_t ua_tpt_info[8]; time_t lasttpt; uint8_t ie_asc; /* Informational exceptions */ @@ -407,7 +407,7 @@ struct ctl_lun { struct ctl_io_stats stats; uint32_t res_idx; uint32_t pr_generation; - uint64_t *pr_keys[CTL_MAX_PORTS]; + uint64_t **pr_keys; int pr_key_count; uint32_t pr_res_idx; uint8_t pr_res_type; @@ -453,16 +453,16 @@ struct ctl_softc { struct sysctl_oid *sysctl_tree; void *othersc_pool; struct proc *ctl_proc; - uint32_t ctl_lun_mask[(CTL_MAX_LUNS + 31) / 32]; - struct ctl_lun *ctl_luns[CTL_MAX_LUNS]; - uint32_t ctl_port_mask[(CTL_MAX_PORTS + 31) / 32]; + uint32_t *ctl_lun_mask; + struct ctl_lun **ctl_luns; + uint32_t *ctl_port_mask; STAILQ_HEAD(, ctl_lun) lun_list; STAILQ_HEAD(, ctl_be_lun) pending_lun_queue; uint32_t num_frontends; STAILQ_HEAD(, ctl_frontend) fe_list; uint32_t num_ports; STAILQ_HEAD(, ctl_port) port_list; - struct ctl_port *ctl_ports[CTL_MAX_PORTS]; + struct ctl_port **ctl_ports; uint32_t num_backends; STAILQ_HEAD(, ctl_backend_driver) be_list; struct uma_zone *io_zone; From owner-svn-src-all@freebsd.org Tue Nov 7 17:09:01 2017 Return-Path: Delivered-To: svn-src-all@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 7A697E5E1FF; Tue, 7 Nov 2017 17:09:01 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 45D33772BE; Tue, 7 Nov 2017 17:09:01 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA7H7j2B079834; Tue, 7 Nov 2017 17:07:45 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7H7j8L079832; Tue, 7 Nov 2017 17:07:45 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201711071707.vA7H7j8L079832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Tue, 7 Nov 2017 17:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325518 - in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 325518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 17:09:01 -0000 Author: tijl Date: Tue Nov 7 17:07:45 2017 New Revision: 325518 URL: https://svnweb.freebsd.org/changeset/base/325518 Log: MFC r325232 Set the return address for stack entry points to zero. Stack unwinders treat zero as a stop condition. The value on the stack can be non-zero because thread stacks may be arbitrary memory provided via pthread_attr_setstack(3) or may be recycled from previous threads. Reference: https://lists.freebsd.org/pipermail/freebsd-current/2017-August/066855.html https://lists.freebsd.org/pipermail/freebsd-current/2017-October/067254.html Discussed with: kib Modified: stable/11/sys/amd64/amd64/vm_machdep.c stable/11/sys/i386/i386/vm_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/vm_machdep.c Tue Nov 7 16:59:52 2017 (r325517) +++ stable/11/sys/amd64/amd64/vm_machdep.c Tue Nov 7 17:07:45 2017 (r325518) @@ -511,6 +511,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * (((uintptr_t)stack->ss_sp + stack->ss_size - 4) & ~0x0f) - 4; td->td_frame->tf_rip = (uintptr_t)entry; + /* Return address sentinel value to stop stack unwinding. */ + suword32((void *)td->td_frame->tf_rsp, 0); + /* Pass the argument to the entry point. */ suword32((void *)(td->td_frame->tf_rsp + sizeof(int32_t)), (uint32_t)(uintptr_t)arg); @@ -533,6 +536,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * td->td_frame->tf_fs = _ufssel; td->td_frame->tf_gs = _ugssel; td->td_frame->tf_flags = TF_HASSEGS; + + /* Return address sentinel value to stop stack unwinding. */ + suword((void *)td->td_frame->tf_rsp, 0); /* Pass the argument to the entry point. */ td->td_frame->tf_rdi = (register_t)arg; Modified: stable/11/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/11/sys/i386/i386/vm_machdep.c Tue Nov 7 16:59:52 2017 (r325517) +++ stable/11/sys/i386/i386/vm_machdep.c Tue Nov 7 17:07:45 2017 (r325518) @@ -530,6 +530,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * (((int)stack->ss_sp + stack->ss_size - 4) & ~0x0f) - 4; td->td_frame->tf_eip = (int)entry; + /* Return address sentinel value to stop stack unwinding. */ + suword((void *)td->td_frame->tf_esp, 0); + /* Pass the argument to the entry point. */ suword((void *)(td->td_frame->tf_esp + sizeof(void *)), (int)arg); From owner-svn-src-all@freebsd.org Tue Nov 7 17:15:44 2017 Return-Path: Delivered-To: svn-src-all@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 6E658E5E77C; Tue, 7 Nov 2017 17:15:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 4A5907810A; Tue, 7 Nov 2017 17:15:43 +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 mail.baldwin.cx (Postfix) with ESMTPSA id 2AD2010A7DB; Tue, 7 Nov 2017 12:15:42 -0500 (EST) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325506 - in head: sbin/ifconfig sys/net sys/sys Date: Tue, 07 Nov 2017 09:06:52 -0800 Message-ID: <2707886.I9a5Fez8At@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201711070929.vA79TFTc096109@repo.freebsd.org> References: <201711070929.vA79TFTc096109@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.4.3 (mail.baldwin.cx); Tue, 07 Nov 2017 12:15:42 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 17:15:44 -0000 On Tuesday, November 07, 2017 09:29:15 AM Konstantin Belousov wrote: > Author: kib > Date: Tue Nov 7 09:29:14 2017 > New Revision: 325506 > URL: https://svnweb.freebsd.org/changeset/base/325506 > > Log: > Add a place for a driver to report rx timestamps in nanoseconds from > boot for the received packets. > > The rcv_tstmp field overlaps the place of Ln header length indicators, > not used by received packets. The basic pkthdr rearrangement change > in sys/mbuf.h was provided by gallatin. > > There are two accompanying M_ flags: M_TSTMP means that there is the > timestamp (and it was generated by hardware). > > Another flag M_TSTMP_HPREC indicates that the timestamp is > high-precision. Practically M_TSTMP_HPREC means that hardware > provided additional precision comparing with the stamps when the flag > is not set. E.g., for ConnectX all packets are stamped by hardware > when PCIe transaction to write out the completion descriptor is > performed, but PTP packet are stamped on port. For Intel cards, when > PTP assist is enabled, only PTP packets are stamped in the limited > number of registers, so if Intel cards ever start support this > mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if hardware > timestamp is present for the given packet. > > Add IFCAP_HWRXTSTMP interface capability to indicate the support for > hardware rx timestamping, and ifconfig(8) command to toggle it. Hmm, other NICs (Chelsio T4 and later for example) support timestamps that aren't in nanoseconds but some other frequency (which are themselves useful). It would be nice to have a more flexible interface that supports not only ns timestamps. Perhaps a way to expose a direct hardware timestamp as a "number" without a specific frequency? -- John Baldwin From owner-svn-src-all@freebsd.org Tue Nov 7 17:39:38 2017 Return-Path: Delivered-To: svn-src-all@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 7A81EE5F659; Tue, 7 Nov 2017 17:39:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 0904379B18; Tue, 7 Nov 2017 17:39:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA7HdQnq098169 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 7 Nov 2017 19:39:26 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA7HdQnq098169 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA7HdQUM098168; Tue, 7 Nov 2017 19:39:26 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 Nov 2017 19:39:26 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325506 - in head: sbin/ifconfig sys/net sys/sys Message-ID: <20171107173926.GP2566@kib.kiev.ua> References: <201711070929.vA79TFTc096109@repo.freebsd.org> <2707886.I9a5Fez8At@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2707886.I9a5Fez8At@ralph.baldwin.cx> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 17:39:38 -0000 On Tue, Nov 07, 2017 at 09:06:52AM -0800, John Baldwin wrote: > On Tuesday, November 07, 2017 09:29:15 AM Konstantin Belousov wrote: > > Author: kib > > Date: Tue Nov 7 09:29:14 2017 > > New Revision: 325506 > > URL: https://svnweb.freebsd.org/changeset/base/325506 > > > > Log: > > Add a place for a driver to report rx timestamps in nanoseconds from > > boot for the received packets. > > > > The rcv_tstmp field overlaps the place of Ln header length indicators, > > not used by received packets. The basic pkthdr rearrangement change > > in sys/mbuf.h was provided by gallatin. > > > > There are two accompanying M_ flags: M_TSTMP means that there is the > > timestamp (and it was generated by hardware). > > > > Another flag M_TSTMP_HPREC indicates that the timestamp is > > high-precision. Practically M_TSTMP_HPREC means that hardware > > provided additional precision comparing with the stamps when the flag > > is not set. E.g., for ConnectX all packets are stamped by hardware > > when PCIe transaction to write out the completion descriptor is > > performed, but PTP packet are stamped on port. For Intel cards, when > > PTP assist is enabled, only PTP packets are stamped in the limited > > number of registers, so if Intel cards ever start support this > > mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if hardware > > timestamp is present for the given packet. > > > > Add IFCAP_HWRXTSTMP interface capability to indicate the support for > > hardware rx timestamping, and ifconfig(8) command to toggle it. > > Hmm, other NICs (Chelsio T4 and later for example) support timestamps that > aren't in nanoseconds but some other frequency (which are themselves useful). > It would be nice to have a more flexible interface that supports not only ns > timestamps. Perhaps a way to expose a direct hardware timestamp as a > "number" without a specific frequency? ConnectX does not provide ns-clocked counter either. It is some internal clock driven by a cristal with > 100MHz frequency. There is no much space in the pkthdr, and the request to provide the timestamp was in the context where the wall clock or some closely related timer is needed. Of course, I can put raw hardware timestamp into the packet header, but only instead of the reduced value. Then the consumer of the timestamp would need to find the interface which received the packet and call its method to convert ? We have only one consumer in tree (SO_TIMESTAMP) and perhaps one possible another consumer (TCP) for this data, both of which require wall clock, so would need to call into the method. Also please see the discussion in the referenced review about accuracy of the convertion. Important example are Intel cards where is only limited number of latched registers, and only PtP packets are stamped. This (and some quirk in ConnectX) explains the high-precision flag. From owner-svn-src-all@freebsd.org Tue Nov 7 17:44:36 2017 Return-Path: Delivered-To: svn-src-all@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 F2977E5F959; Tue, 7 Nov 2017 17:44:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 812DA7A54B; Tue, 7 Nov 2017 17:44:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA7HiVfk099350 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 7 Nov 2017 19:44:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA7HiVfk099350 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA7HiVYK099349; Tue, 7 Nov 2017 19:44:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 Nov 2017 19:44:31 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325506 - in head: sbin/ifconfig sys/net sys/sys Message-ID: <20171107174431.GQ2566@kib.kiev.ua> References: <201711070929.vA79TFTc096109@repo.freebsd.org> <2707886.I9a5Fez8At@ralph.baldwin.cx> <20171107173926.GP2566@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171107173926.GP2566@kib.kiev.ua> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 17:44:37 -0000 On Tue, Nov 07, 2017 at 07:39:26PM +0200, Konstantin Belousov wrote: > On Tue, Nov 07, 2017 at 09:06:52AM -0800, John Baldwin wrote: > > On Tuesday, November 07, 2017 09:29:15 AM Konstantin Belousov wrote: > > > Author: kib > > > Date: Tue Nov 7 09:29:14 2017 > > > New Revision: 325506 > > > URL: https://svnweb.freebsd.org/changeset/base/325506 > > > > > > Log: > > > Add a place for a driver to report rx timestamps in nanoseconds from > > > boot for the received packets. > > > > > > The rcv_tstmp field overlaps the place of Ln header length indicators, > > > not used by received packets. The basic pkthdr rearrangement change > > > in sys/mbuf.h was provided by gallatin. > > > > > > There are two accompanying M_ flags: M_TSTMP means that there is the > > > timestamp (and it was generated by hardware). > > > > > > Another flag M_TSTMP_HPREC indicates that the timestamp is > > > high-precision. Practically M_TSTMP_HPREC means that hardware > > > provided additional precision comparing with the stamps when the flag > > > is not set. E.g., for ConnectX all packets are stamped by hardware > > > when PCIe transaction to write out the completion descriptor is > > > performed, but PTP packet are stamped on port. For Intel cards, when > > > PTP assist is enabled, only PTP packets are stamped in the limited > > > number of registers, so if Intel cards ever start support this > > > mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if hardware > > > timestamp is present for the given packet. > > > > > > Add IFCAP_HWRXTSTMP interface capability to indicate the support for > > > hardware rx timestamping, and ifconfig(8) command to toggle it. > > > > Hmm, other NICs (Chelsio T4 and later for example) support timestamps that > > aren't in nanoseconds but some other frequency (which are themselves useful). > > It would be nice to have a more flexible interface that supports not only ns > > timestamps. Perhaps a way to expose a direct hardware timestamp as a > > "number" without a specific frequency? > > ConnectX does not provide ns-clocked counter either. It is some internal > clock driven by a cristal with > 100MHz frequency. > > There is no much space in the pkthdr, and the request to provide the > timestamp was in the context where the wall clock or some closely related > timer is needed. Of course, I can put raw hardware timestamp into the > packet header, but only instead of the reduced value. Then the consumer > of the timestamp would need to find the interface which received the > packet and call its method to convert ? We have only one consumer in > tree (SO_TIMESTAMP) and perhaps one possible another consumer (TCP) for > this data, both of which require wall clock, so would need to call into > the method. > > Also please see the discussion in the referenced review about accuracy of > the convertion. > > Important example are Intel cards where is only limited number of > latched registers, and only PtP packets are stamped. This (and some > quirk in ConnectX) explains the high-precision flag. > And another consideration which was one of the strong argument for me when I thought about this stuff: the convertion of the hardware timestamp to the useful clock stamp depends on the clock calibraton data which might not be available long time after the packet receive. In other words, when the consumer would call into the interface method to convert raw timestamp, it might be already not convertable (in kern_tc.c terms, timehands were switched by tc_windup()). From owner-svn-src-all@freebsd.org Tue Nov 7 17:46:56 2017 Return-Path: Delivered-To: svn-src-all@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 10F54E5FB37; Tue, 7 Nov 2017 17:46:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 D0AD67ABD9; Tue, 7 Nov 2017 17:46:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA7HjdEM095884; Tue, 7 Nov 2017 17:45:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7Hjd5A095883; Tue, 7 Nov 2017 17:45:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201711071745.vA7Hjd5A095883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 7 Nov 2017 17:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325519 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 325519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 17:46:56 -0000 Author: jhb Date: Tue Nov 7 17:45:39 2017 New Revision: 325519 URL: https://svnweb.freebsd.org/changeset/base/325519 Log: Wrap to 80 columns. No functional change. Modified: head/lib/libsysdecode/flags.c Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Tue Nov 7 17:07:45 2017 (r325518) +++ head/lib/libsysdecode/flags.c Tue Nov 7 17:45:39 2017 (r325519) @@ -647,9 +647,11 @@ sysdecode_reboot_howto(FILE *fp, int howto, int *rem) /* * RB_AUTOBOOT is special in that its value is zero, but it is * also an implied argument if a different operation is not - * requested via RB_HALT, RB_POWERCYCLE, RB_POWEROFF, or RB_REROOT. + * requested via RB_HALT, RB_POWERCYCLE, RB_POWEROFF, or + * RB_REROOT. */ - if (howto != 0 && (howto & (RB_HALT | RB_POWEROFF | RB_REROOT | RB_POWERCYCLE)) == 0) { + if (howto != 0 && (howto & (RB_HALT | RB_POWEROFF | RB_REROOT | + RB_POWERCYCLE)) == 0) { fputs("RB_AUTOBOOT|", fp); printed = true; } else From owner-svn-src-all@freebsd.org Tue Nov 7 18:21:25 2017 Return-Path: Delivered-To: svn-src-all@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 19483E60E62; Tue, 7 Nov 2017 18:21:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 DD27F7D931; Tue, 7 Nov 2017 18:21:24 +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 vA7IK8vD007756; Tue, 7 Nov 2017 18:20:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7IK835007755; Tue, 7 Nov 2017 18:20:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711071820.vA7IK835007755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 7 Nov 2017 18:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325520 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 18:21:25 -0000 Author: bdrewery Date: Tue Nov 7 18:20:08 2017 New Revision: 325520 URL: https://svnweb.freebsd.org/changeset/base/325520 Log: Reenable AUTO_OBJ by default. The problem with it was a bogus .OBJDIR in some cases where creation of object directories were purposely not attempted, such as for 'make cleandir' and in etc/ sub-directories. In these cases bmake would start with a bogus .OBJDIR like etc/ due to MAKEOBJDIR being a dynamic value based on .CURDIR, SRCTOP, and OBJTOP. OBJTOP would not yet be defined but is during early src.sys.obj.mk. That file and auto.obj.mk both were not modifying .OBJDIR unless they expected to create the objdir. Thus in these cases the .OBJDIR was left as etc/* rather than fixed to the proper .CURDIR. The issues were fixed in r325404 and r325416. An assertion to avoid the bad .OBJDIR was added in r325405. Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Tue Nov 7 17:45:39 2017 (r325519) +++ head/share/mk/src.sys.obj.mk Tue Nov 7 18:20:08 2017 (r325520) @@ -105,7 +105,7 @@ __objdir:= ${MAKEOBJDIR} # Try to enable MK_AUTO_OBJ by default if we can write to the __objdir. Only # do this if AUTO_OBJ is not disabled by the user, not cleaning, and this is # the first make ran. -.if 0 && ${.MAKE.LEVEL} == 0 && \ +.if ${.MAKE.LEVEL} == 0 && \ ${MK_AUTO_OBJ} == "no" && empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) && \ !defined(WITHOUT_AUTO_OBJ) && !make(showconfig) && !make(print-dir) && \ !defined(NO_OBJ) && \ From owner-svn-src-all@freebsd.org Tue Nov 7 19:12:22 2017 Return-Path: Delivered-To: svn-src-all@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 1D6BFE62803; Tue, 7 Nov 2017 19:12:22 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E11CF202E; Tue, 7 Nov 2017 19:12:21 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA7JCKs0031258; Tue, 7 Nov 2017 19:12:20 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA7JCKDq031257; Tue, 7 Nov 2017 19:12:20 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201711071912.vA7JCKDq031257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Tue, 7 Nov 2017 19:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r325521 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: matthew X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 325521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 19:12:22 -0000 Author: matthew (ports committer) Date: Tue Nov 7 19:12:20 2017 New Revision: 325521 URL: https://svnweb.freebsd.org/changeset/base/325521 Log: Take in ngie's commit bit at their own request. Approved by: core (implicit) Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Nov 7 18:20:08 2017 (r325520) +++ svnadmin/conf/access Tue Nov 7 19:12:20 2017 (r325521) @@ -156,7 +156,6 @@ mw n_hibma devnull neel netchild -ngie np nwhitehorn nyan From owner-svn-src-all@freebsd.org Tue Nov 7 19:21:02 2017 Return-Path: Delivered-To: svn-src-all@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 4F1A6E62AD3; Tue, 7 Nov 2017 19:21:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 206602D68; Tue, 7 Nov 2017 19:21:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 326183C14; Tue, 7 Nov 2017 19:20:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 6309A11A51; Tue, 7 Nov 2017 19:20:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id tnRAuE7sjz7V; Tue, 7 Nov 2017 19:20:26 +0000 (UTC) Subject: Re: svn commit: r325504 - head/lib/libclang_rt DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 3D41211A4B To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711070626.vA76QmnV025927@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <0fc9d87c-2dc5-d229-f0a2-f45f53cf2144@FreeBSD.org> Date: Tue, 7 Nov 2017 11:20:25 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201711070626.vA76QmnV025927@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TTLLMPcX9LuCo4MJv39idPObVque1XN6R" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 19:21:02 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TTLLMPcX9LuCo4MJv39idPObVque1XN6R Content-Type: multipart/mixed; boundary="gdFsHkbV3hfkuEwIdIa4XK7G5v1ABlaKF"; protected-headers="v1" From: Bryan Drewery To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0fc9d87c-2dc5-d229-f0a2-f45f53cf2144@FreeBSD.org> Subject: Re: svn commit: r325504 - head/lib/libclang_rt References: <201711070626.vA76QmnV025927@repo.freebsd.org> In-Reply-To: <201711070626.vA76QmnV025927@repo.freebsd.org> --gdFsHkbV3hfkuEwIdIa4XK7G5v1ABlaKF Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/6/2017 10:26 PM, Ngie Cooper wrote: > Author: ngie > Date: Tue Nov 7 06:26:48 2017 > New Revision: 325504 > URL: https://svnweb.freebsd.org/changeset/base/325504 >=20 > Log: > Redo r325502 > =20 > :U:Mfoo expands to :Mfoo, apparently. Explicit check for CPUTYPE bein= g > defined, and test for it's value not containing *soft* before calling= CRTARCH > armhf. > =20 > Tested, somewhat. Unfortunately recent changes appear to have affecte= d > cross-builds where it no longer works, per my tests after universe12a= being > upgraded from 07/2017 to 11/2017 sources (DESTDIR isn't being used in= WORLDTMP; > MK_SYSTEM_COMPILER might be causing issues right now). > =20 In buildworld DESTDIR usually is set to WORLDTMP. But how does the comment relate to CPUTYPE? What "no longer works" about cross-builds? --=20 Regards, Bryan Drewery --gdFsHkbV3hfkuEwIdIa4XK7G5v1ABlaKF-- --TTLLMPcX9LuCo4MJv39idPObVque1XN6R 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 iQEcBAEBAgAGBQJaAgd5AAoJEDXXcbtuRpfPrmYIAJoTxS6wxgAeeu4twk0MlN/a v7HNYJJ9Mqe+x0RSZU0veSBrL4KAtShhKww4ial7E8Fjz/qLZjVSlRf53KCxP/j0 trFWy5X+tUXtA0wUpV3HfkYOdffOZwlzfgeF/Hj7sjrJ+YJ4kta6Tt7tfypTCue2 Od0QI9faG34cd3pvRuZaorL8efavxxyZauPMTMXiafzwbjpmeOJdJ5lt1ay/l0N2 YB8RYnI4KCSodtL6KWNDsLA1NrN4hxPQjoeCdSQofb+LcWEcJ+fkyYelvrjz5wBb 6ofbsZ/mBC9URMaF0E99bbaHaoKWQvqeX7eY8AX+AfxFO5KoeEVeWb4cteEpwmw= =hZzh -----END PGP SIGNATURE----- --TTLLMPcX9LuCo4MJv39idPObVque1XN6R-- From owner-svn-src-all@freebsd.org Tue Nov 7 21:17:12 2017 Return-Path: Delivered-To: svn-src-all@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 35AA6E650FA for ; Tue, 7 Nov 2017 21:17:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (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 EF2DA6C1AE for ; Tue, 7 Nov 2017 21:17:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id 143so371987itf.1 for ; Tue, 07 Nov 2017 13:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=u3HMHM5MxxXNR4U1eD9bUlIqhNYcZOiowb8usUjYnUY=; b=Ndo1Yp6h66ynIW19AbPlIAK7R1t9KzaG6f2HrBMjS94eGRerZdeJUwdPcUv5n+h8SG I+kP2Y1TppsqdrstY3gvzWDCYfTNHonoUGkknCWWbkYbYmEdHm3OxonkwPC2umY6BS0l yv/m47C0PS8UlsVQuuKTZ6Nlv3MBaDaYyYhM8B3dw/CEzljDQLfhnplMGtIpF1hUKl3W 16VK9M69xKyy70IVhPfRBSb6egE8LrBDc8KGxkjUYu3GmSsOPnZp9t5l4FO2IJT73EIe ZtCWhlEYBeWingv6kYPbA7fIU7wtR3FAgmkEE3n/khrHnY2q5PlDYLy8SBwLr/s9hATV bh0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=u3HMHM5MxxXNR4U1eD9bUlIqhNYcZOiowb8usUjYnUY=; b=OV49vKCREZ5uSVI35Nv0SDkJX3zPscgD0rlhl9+fjifsEaw76gTUjCC1CE5BEfWakM NzhgHaZaoeyfkvN+CvhQzTkmP8WyJt/9zS6rYDYnakdMpEUWIy44oKHqOZyRqg+DquKr imzhyD6jD+WjtWg4Tbo8aOFSV07sU2dyh5ylcCMxqTycq4Ux9efXEmkyQe2szwYOZJIQ hX/5Pum1tO6cHPk9xYJJMWuCImXxtG350oSexa5KGQ6Po+bj5dWpkoLzNssL4hEFoZW3 QmJG9wzKKqNtmATvzjvuPi49oas2fmmkjDVUeYnzrf5pcs3pjN6DGX0ddHobod9tkWyf 8rEA== X-Gm-Message-State: AJaThX5SRVW3KRTyO3usCnPM65jpikSwXattm9PPwZnI1pMRBVxTEuNu WryQw7886ppaQ3OcqZl6TlZ8fl/GJOQ8ZUQynUQVSA== X-Google-Smtp-Source: ABhQp+QZVVnU5Q3OIkY5n7IOSJF2inxprBNhtBOlqwGtJT4wapbRarVWKsYF82P+j4nz6Y/nt2+Bsg30zPNlr5yMQUY= X-Received: by 10.36.101.207 with SMTP id u198mr718603itb.50.1510089431153; Tue, 07 Nov 2017 13:17:11 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Tue, 7 Nov 2017 13:17:10 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:a004:68c9:b567:b3a8] In-Reply-To: <20171107174431.GQ2566@kib.kiev.ua> References: <201711070929.vA79TFTc096109@repo.freebsd.org> <2707886.I9a5Fez8At@ralph.baldwin.cx> <20171107173926.GP2566@kib.kiev.ua> <20171107174431.GQ2566@kib.kiev.ua> From: Warner Losh Date: Tue, 7 Nov 2017 14:17:10 -0700 X-Google-Sender-Auth: ElEoYQSibcasKuJxhlQ433Ob2Mk Message-ID: Subject: Re: svn commit: r325506 - in head: sbin/ifconfig sys/net sys/sys To: Konstantin Belousov Cc: John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 21:17:12 -0000 On Tue, Nov 7, 2017 at 10:44 AM, Konstantin Belousov wrote: > On Tue, Nov 07, 2017 at 07:39:26PM +0200, Konstantin Belousov wrote: > > On Tue, Nov 07, 2017 at 09:06:52AM -0800, John Baldwin wrote: > > > On Tuesday, November 07, 2017 09:29:15 AM Konstantin Belousov wrote: > > > > Author: kib > > > > Date: Tue Nov 7 09:29:14 2017 > > > > New Revision: 325506 > > > > URL: https://svnweb.freebsd.org/changeset/base/325506 > > > > > > > > Log: > > > > Add a place for a driver to report rx timestamps in nanoseconds > from > > > > boot for the received packets. > > > > > > > > The rcv_tstmp field overlaps the place of Ln header length > indicators, > > > > not used by received packets. The basic pkthdr rearrangement > change > > > > in sys/mbuf.h was provided by gallatin. > > > > > > > > There are two accompanying M_ flags: M_TSTMP means that there is > the > > > > timestamp (and it was generated by hardware). > > > > > > > > Another flag M_TSTMP_HPREC indicates that the timestamp is > > > > high-precision. Practically M_TSTMP_HPREC means that hardware > > > > provided additional precision comparing with the stamps when the > flag > > > > is not set. E.g., for ConnectX all packets are stamped by hardware > > > > when PCIe transaction to write out the completion descriptor is > > > > performed, but PTP packet are stamped on port. For Intel cards, > when > > > > PTP assist is enabled, only PTP packets are stamped in the limited > > > > number of registers, so if Intel cards ever start support this > > > > mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if > hardware > > > > timestamp is present for the given packet. > > > > > > > > Add IFCAP_HWRXTSTMP interface capability to indicate the support > for > > > > hardware rx timestamping, and ifconfig(8) command to toggle it. > > > > > > Hmm, other NICs (Chelsio T4 and later for example) support timestamps > that > > > aren't in nanoseconds but some other frequency (which are themselves > useful). > > > It would be nice to have a more flexible interface that supports not > only ns > > > timestamps. Perhaps a way to expose a direct hardware timestamp as a > > > "number" without a specific frequency? > > > > ConnectX does not provide ns-clocked counter either. It is some internal > > clock driven by a cristal with > 100MHz frequency. > > > > There is no much space in the pkthdr, and the request to provide the > > timestamp was in the context where the wall clock or some closely related > > timer is needed. Of course, I can put raw hardware timestamp into the > > packet header, but only instead of the reduced value. Then the consumer > > of the timestamp would need to find the interface which received the > > packet and call its method to convert ? We have only one consumer in > > tree (SO_TIMESTAMP) and perhaps one possible another consumer (TCP) for > > this data, both of which require wall clock, so would need to call into > > the method. > > > > Also please see the discussion in the referenced review about accuracy of > > the convertion. > > > > Important example are Intel cards where is only limited number of > > latched registers, and only PtP packets are stamped. This (and some > > quirk in ConnectX) explains the high-precision flag. > > > > And another consideration which was one of the strong argument for me > when I thought about this stuff: the convertion of the hardware timestamp > to the useful clock stamp depends on the clock calibraton data which might > not be available long time after the packet receive. In other words, when > the consumer would call into the interface method to convert raw timestamp, > it might be already not convertable (in kern_tc.c terms, timehands were > switched by tc_windup()). > On the other hand, if you are trying to steer or calibrate the clock in userland, doing the conversions may be losing data if the clocks are fast enough... But that was one of the big lessons I learned when doing timing gear: raw data is better than cooked data in userland, even if you instantly cook it in the same way you would have cooked it in the kernel before publishing. Given the quality of these clocks, though, I doubt it matters much at all... Warner From owner-svn-src-all@freebsd.org Tue Nov 7 22:10:56 2017 Return-Path: Delivered-To: svn-src-all@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 90950E65EE7; Tue, 7 Nov 2017 22:10:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.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 5017070958; Tue, 7 Nov 2017 22:10:56 +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 mail.baldwin.cx (Postfix) with ESMTPSA id EDE8D10A7DB; Tue, 7 Nov 2017 17:10:54 -0500 (EST) From: John Baldwin To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325506 - in head: sbin/ifconfig sys/net sys/sys Date: Tue, 07 Nov 2017 11:00:33 -0800 Message-ID: <5168224.cmPK861r6s@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20171107174431.GQ2566@kib.kiev.ua> References: <201711070929.vA79TFTc096109@repo.freebsd.org> <20171107173926.GP2566@kib.kiev.ua> <20171107174431.GQ2566@kib.kiev.ua> 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.4.3 (mail.baldwin.cx); Tue, 07 Nov 2017 17:10:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 22:10:56 -0000 On Tuesday, November 07, 2017 07:44:31 PM Konstantin Belousov wrote: > On Tue, Nov 07, 2017 at 07:39:26PM +0200, Konstantin Belousov wrote: > > On Tue, Nov 07, 2017 at 09:06:52AM -0800, John Baldwin wrote: > > > On Tuesday, November 07, 2017 09:29:15 AM Konstantin Belousov wrote: > > > > Author: kib > > > > Date: Tue Nov 7 09:29:14 2017 > > > > New Revision: 325506 > > > > URL: https://svnweb.freebsd.org/changeset/base/325506 > > > > > > > > Log: > > > > Add a place for a driver to report rx timestamps in nanoseconds from > > > > boot for the received packets. > > > > > > > > The rcv_tstmp field overlaps the place of Ln header length indicators, > > > > not used by received packets. The basic pkthdr rearrangement change > > > > in sys/mbuf.h was provided by gallatin. > > > > > > > > There are two accompanying M_ flags: M_TSTMP means that there is the > > > > timestamp (and it was generated by hardware). > > > > > > > > Another flag M_TSTMP_HPREC indicates that the timestamp is > > > > high-precision. Practically M_TSTMP_HPREC means that hardware > > > > provided additional precision comparing with the stamps when the flag > > > > is not set. E.g., for ConnectX all packets are stamped by hardware > > > > when PCIe transaction to write out the completion descriptor is > > > > performed, but PTP packet are stamped on port. For Intel cards, when > > > > PTP assist is enabled, only PTP packets are stamped in the limited > > > > number of registers, so if Intel cards ever start support this > > > > mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if hardware > > > > timestamp is present for the given packet. > > > > > > > > Add IFCAP_HWRXTSTMP interface capability to indicate the support for > > > > hardware rx timestamping, and ifconfig(8) command to toggle it. > > > > > > Hmm, other NICs (Chelsio T4 and later for example) support timestamps that > > > aren't in nanoseconds but some other frequency (which are themselves useful). > > > It would be nice to have a more flexible interface that supports not only ns > > > timestamps. Perhaps a way to expose a direct hardware timestamp as a > > > "number" without a specific frequency? > > > > ConnectX does not provide ns-clocked counter either. It is some internal > > clock driven by a cristal with > 100MHz frequency. > > > > There is no much space in the pkthdr, and the request to provide the > > timestamp was in the context where the wall clock or some closely related > > timer is needed. Of course, I can put raw hardware timestamp into the > > packet header, but only instead of the reduced value. Then the consumer > > of the timestamp would need to find the interface which received the > > packet and call its method to convert ? We have only one consumer in > > tree (SO_TIMESTAMP) and perhaps one possible another consumer (TCP) for > > this data, both of which require wall clock, so would need to call into > > the method. > > > > Also please see the discussion in the referenced review about accuracy of > > the convertion. > > > > Important example are Intel cards where is only limited number of > > latched registers, and only PtP packets are stamped. This (and some > > quirk in ConnectX) explains the high-precision flag. > > > > And another consideration which was one of the strong argument for me > when I thought about this stuff: the convertion of the hardware timestamp > to the useful clock stamp depends on the clock calibraton data which might > not be available long time after the packet receive. In other words, when > the consumer would call into the interface method to convert raw timestamp, > it might be already not convertable (in kern_tc.c terms, timehands were > switched by tc_windup()). When using the timestamps from Chelsio NICs previously, the codebase in question performed conversions in userland rather than in the kernel using other application-specific data in the received packets to aid in mapping the timestamp values to wall times. Reliably converting a random timestamp from the hardware to a wall time is indeed non-trivial. I had imagined having a variant of SO_TIMESTAMP (or perhaps a new option) so that userland could request the raw timestamp. To be clear, however, is the MLX5 timestamp steered by an on-card PTP implementation or is it just a free-running timer? (The Chelsio timer is a free-running timer.) -- John Baldwin From owner-svn-src-all@freebsd.org Tue Nov 7 22:43:08 2017 Return-Path: Delivered-To: svn-src-all@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 92498E66896; Tue, 7 Nov 2017 22:43:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 3A05073215; Tue, 7 Nov 2017 22:43:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA7Mgv73066115 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 8 Nov 2017 00:42:57 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA7Mgv73066115 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA7Mgvp7066114; Wed, 8 Nov 2017 00:42:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 8 Nov 2017 00:42:57 +0200 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325506 - in head: sbin/ifconfig sys/net sys/sys Message-ID: <20171107224257.GR2566@kib.kiev.ua> References: <201711070929.vA79TFTc096109@repo.freebsd.org> <20171107173926.GP2566@kib.kiev.ua> <20171107174431.GQ2566@kib.kiev.ua> <5168224.cmPK861r6s@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5168224.cmPK861r6s@ralph.baldwin.cx> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2017 22:43:08 -0000 On Tue, Nov 07, 2017 at 11:00:33AM -0800, John Baldwin wrote: > On Tuesday, November 07, 2017 07:44:31 PM Konstantin Belousov wrote: > > On Tue, Nov 07, 2017 at 07:39:26PM +0200, Konstantin Belousov wrote: > > > On Tue, Nov 07, 2017 at 09:06:52AM -0800, John Baldwin wrote: > > > > On Tuesday, November 07, 2017 09:29:15 AM Konstantin Belousov wrote: > > > > > Author: kib > > > > > Date: Tue Nov 7 09:29:14 2017 > > > > > New Revision: 325506 > > > > > URL: https://svnweb.freebsd.org/changeset/base/325506 > > > > > > > > > > Log: > > > > > Add a place for a driver to report rx timestamps in nanoseconds from > > > > > boot for the received packets. > > > > > > > > > > The rcv_tstmp field overlaps the place of Ln header length indicators, > > > > > not used by received packets. The basic pkthdr rearrangement change > > > > > in sys/mbuf.h was provided by gallatin. > > > > > > > > > > There are two accompanying M_ flags: M_TSTMP means that there is the > > > > > timestamp (and it was generated by hardware). > > > > > > > > > > Another flag M_TSTMP_HPREC indicates that the timestamp is > > > > > high-precision. Practically M_TSTMP_HPREC means that hardware > > > > > provided additional precision comparing with the stamps when the flag > > > > > is not set. E.g., for ConnectX all packets are stamped by hardware > > > > > when PCIe transaction to write out the completion descriptor is > > > > > performed, but PTP packet are stamped on port. For Intel cards, when > > > > > PTP assist is enabled, only PTP packets are stamped in the limited > > > > > number of registers, so if Intel cards ever start support this > > > > > mechanism, they would always set M_TSTMP | M_TSTMP_HPREC if hardware > > > > > timestamp is present for the given packet. > > > > > > > > > > Add IFCAP_HWRXTSTMP interface capability to indicate the support for > > > > > hardware rx timestamping, and ifconfig(8) command to toggle it. > > > > > > > > Hmm, other NICs (Chelsio T4 and later for example) support timestamps that > > > > aren't in nanoseconds but some other frequency (which are themselves useful). > > > > It would be nice to have a more flexible interface that supports not only ns > > > > timestamps. Perhaps a way to expose a direct hardware timestamp as a > > > > "number" without a specific frequency? > > > > > > ConnectX does not provide ns-clocked counter either. It is some internal > > > clock driven by a cristal with > 100MHz frequency. > > > > > > There is no much space in the pkthdr, and the request to provide the > > > timestamp was in the context where the wall clock or some closely related > > > timer is needed. Of course, I can put raw hardware timestamp into the > > > packet header, but only instead of the reduced value. Then the consumer > > > of the timestamp would need to find the interface which received the > > > packet and call its method to convert ? We have only one consumer in > > > tree (SO_TIMESTAMP) and perhaps one possible another consumer (TCP) for > > > this data, both of which require wall clock, so would need to call into > > > the method. > > > > > > Also please see the discussion in the referenced review about accuracy of > > > the convertion. > > > > > > Important example are Intel cards where is only limited number of > > > latched registers, and only PtP packets are stamped. This (and some > > > quirk in ConnectX) explains the high-precision flag. > > > > > > > And another consideration which was one of the strong argument for me > > when I thought about this stuff: the convertion of the hardware timestamp > > to the useful clock stamp depends on the clock calibraton data which might > > not be available long time after the packet receive. In other words, when > > the consumer would call into the interface method to convert raw timestamp, > > it might be already not convertable (in kern_tc.c terms, timehands were > > switched by tc_windup()). > > When using the timestamps from Chelsio NICs previously, the codebase in > question performed conversions in userland rather than in the kernel using > other application-specific data in the received packets to aid in mapping > the timestamp values to wall times. Reliably converting a random timestamp > from the hardware to a wall time is indeed non-trivial. I had imagined > having a variant of SO_TIMESTAMP (or perhaps a new option) so that userland > could request the raw timestamp. > > To be clear, however, is the MLX5 timestamp steered by an on-card PTP > implementation or is it just a free-running timer? (The Chelsio timer is > a free-running timer.) It is free-running timer for non-PtP packets. PtP packets are handled specially, and besides latching timestamp on port (for normal packets it is on PCIe write-out) they might be also corrected by card if parsed as PtP and internal card PtP engine synced already. But for the later I am not sure, and was not able to confirm. From owner-svn-src-all@freebsd.org Wed Nov 8 00:40:20 2017 Return-Path: Delivered-To: svn-src-all@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 805E6E68E85; Wed, 8 Nov 2017 00:40:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 49C377BD90; Wed, 8 Nov 2017 00:40:20 +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 vA80d4R7061726; Wed, 8 Nov 2017 00:39:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA80d4Vj061725; Wed, 8 Nov 2017 00:39:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711080039.vA80d4Vj061725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 8 Nov 2017 00:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325523 - stable/11/contrib/llvm/lib/Support/Unix X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/llvm/lib/Support/Unix X-SVN-Commit-Revision: 325523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 00:40:20 -0000 Author: emaste Date: Wed Nov 8 00:39:04 2017 New Revision: 325523 URL: https://svnweb.freebsd.org/changeset/base/325523 Log: MFC r325420: lld: accept EINVAL to indicate posix_fallocate is unsupported As of r325320 posix_fallocate on a ZFS filesystem returns EINVAL to indicate that the operation is not supported. (I think this is a strange choice of errno on the part of POSIX.) PR: 223383, 223440 Reported by: Mark Millard Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm/lib/Support/Unix/Path.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/lib/Support/Unix/Path.inc ============================================================================== --- stable/11/contrib/llvm/lib/Support/Unix/Path.inc Tue Nov 7 23:52:14 2017 (r325522) +++ stable/11/contrib/llvm/lib/Support/Unix/Path.inc Wed Nov 8 00:39:04 2017 (r325523) @@ -427,7 +427,7 @@ std::error_code resize_file(int FD, uint64_t Size) { // If we have posix_fallocate use it. Unlike ftruncate it always allocates // space, so we get an error if the disk is full. if (int Err = ::posix_fallocate(FD, 0, Size)) { - if (Err != EOPNOTSUPP) + if (Err != EINVAL && Err != EOPNOTSUPP) return std::error_code(Err, std::generic_category()); } #endif From owner-svn-src-all@freebsd.org Wed Nov 8 01:02:15 2017 Return-Path: Delivered-To: svn-src-all@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 773ABE69634; Wed, 8 Nov 2017 01:02:15 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 452787CF98; Wed, 8 Nov 2017 01:02:15 +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 vA810xgd070023; Wed, 8 Nov 2017 01:00:59 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA810xtO070022; Wed, 8 Nov 2017 01:00:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711080100.vA810xtO070022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 8 Nov 2017 01:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325524 - head/lib/libcasper/libcasper X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/lib/libcasper/libcasper X-SVN-Commit-Revision: 325524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 01:02:15 -0000 Author: gjb Date: Wed Nov 8 01:00:59 2017 New Revision: 325524 URL: https://svnweb.freebsd.org/changeset/base/325524 Log: Fix the 'casper' package, following r325062. Submitted by: woodsb02 Sponsored by: The FreeBSD Foundation Modified: head/lib/libcasper/libcasper/Makefile Modified: head/lib/libcasper/libcasper/Makefile ============================================================================== --- head/lib/libcasper/libcasper/Makefile Wed Nov 8 00:39:04 2017 (r325523) +++ head/lib/libcasper/libcasper/Makefile Wed Nov 8 01:00:59 2017 (r325524) @@ -4,7 +4,7 @@ SHLIBDIR?= /lib .include -PACKAGE=${LIB} +PACKAGE=casper .if ${MK_CASPER} != "no" SHLIB= casper From owner-svn-src-all@freebsd.org Wed Nov 8 01:24:53 2017 Return-Path: Delivered-To: svn-src-all@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 5392DE6A083; Wed, 8 Nov 2017 01:24:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 15E747E78E; Wed, 8 Nov 2017 01:24:53 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA81Nb7H081483; Wed, 8 Nov 2017 01:23:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA81NbSF081481; Wed, 8 Nov 2017 01:23:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711080123.vA81NbSF081481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 8 Nov 2017 01:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325525 - in head/sys/powerpc: booke powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: booke powerpc X-SVN-Commit-Revision: 325525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 01:24:53 -0000 Author: jhibbits Date: Wed Nov 8 01:23:37 2017 New Revision: 325525 URL: https://svnweb.freebsd.org/changeset/base/325525 Log: Clear the WE bit in C code rather than the asm According to EREF rlwinm is supposed to clear the upper 32 bits of the register of 64-bit cores. However, from experience it seems there's a bug in the e5500 which causes the result to be duplicated in the upper bits of the register. This causes problems when applied to stashed SRR1 accessed to retrieve context, as the upper bits are not masked out, so a set_mcontext() fails. This causes sigreturn() to in turn return with EINVAL, causing make(1) to exit with error. This bit is unused in e500mc derivatives (including e5500), so could just be conditional on non-powerpc64, but there may be other non-Freescale cores which do use it. This is also the same as the POW bit on Book-S, so could be cleared unconditionally with the only penalty being a few clock cycles for these two interrupts. Modified: head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/powerpc/interrupt.c Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Wed Nov 8 01:00:59 2017 (r325524) +++ head/sys/powerpc/booke/trap_subr.S Wed Nov 8 01:23:37 2017 (r325525) @@ -567,7 +567,7 @@ INTERRUPT(int_external_input) addi %r3, %r1, CALLSIZE bl CNAME(powerpc_interrupt) TOC_RESTORE - b clear_we + b trapexit INTERRUPT(int_alignment) @@ -607,7 +607,7 @@ INTERRUPT(int_decrementer) addi %r3, %r1, CALLSIZE bl CNAME(powerpc_interrupt) TOC_RESTORE - b clear_we + b trapexit /***************************************************************************** @@ -1090,12 +1090,6 @@ dbleave: FRAME_LEAVE(SPR_SRR0, SPR_SRR1) rfi #endif /* KDB */ - -clear_we: - LOAD %r3, (FRAME_SRR1+CALLSIZE)(%r1) - rlwinm %r3, %r3, 0, 14, 12 - STORE %r3, (FRAME_SRR1+CALLSIZE)(%r1) - b trapexit #ifdef SMP ENTRY(tlb_lock) Modified: head/sys/powerpc/powerpc/interrupt.c ============================================================================== --- head/sys/powerpc/powerpc/interrupt.c Wed Nov 8 01:00:59 2017 (r325524) +++ head/sys/powerpc/powerpc/interrupt.c Wed Nov 8 01:23:37 2017 (r325525) @@ -89,6 +89,9 @@ powerpc_interrupt(struct trapframe *framep) critical_enter(); PIC_DISPATCH(root_pic, framep); critical_exit(); +#ifdef BOOKE + framep->srr1 &= ~PSL_WE; +#endif break; case EXC_DECR: @@ -100,6 +103,9 @@ powerpc_interrupt(struct trapframe *framep) td->td_intr_frame = oldframe; atomic_subtract_int(&td->td_intr_nesting_level, 1); critical_exit(); +#ifdef BOOKE + framep->srr1 &= ~PSL_WE; +#endif break; #ifdef HWPMC_HOOKS case EXC_PERF: From owner-svn-src-all@freebsd.org Wed Nov 8 01:28:00 2017 Return-Path: Delivered-To: svn-src-all@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 CB166E6A135; Wed, 8 Nov 2017 01:28:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 A4E197EAFF; Wed, 8 Nov 2017 01:28:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA81Qipp081578; Wed, 8 Nov 2017 01:26:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA81QiQF081576; Wed, 8 Nov 2017 01:26:44 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711080126.vA81QiQF081576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 8 Nov 2017 01:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325526 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 325526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 01:28:00 -0000 Author: jhibbits Date: Wed Nov 8 01:26:44 2017 New Revision: 325526 URL: https://svnweb.freebsd.org/changeset/base/325526 Log: Add the ISEL feature macro for those powerpc cores that have it This is mostly for completeness, we don't currently use it for anything else. Modified: head/sys/powerpc/include/cpu.h head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Wed Nov 8 01:23:37 2017 (r325525) +++ head/sys/powerpc/include/cpu.h Wed Nov 8 01:26:44 2017 (r325526) @@ -68,6 +68,7 @@ extern int cpu_features2; #define PPC_FEATURE2_ARCH_2_07 0x80000000 #define PPC_FEATURE2_HAS_HTM 0x40000000 +#define PPC_FEATURE2_ISEL 0x08000000 #define PPC_FEATURE2_HAS_VCRYPTO 0x02000000 #define PPC_FEATURE_BITMASK \ @@ -77,7 +78,7 @@ extern int cpu_features2; "\011ARCH206\010VSX" #define PPC_FEATURE2_BITMASK \ "\20" \ - "\040ARCH207\037HTM\032VCRYPTO" + "\040ARCH207\037HTM\034ISEL\032VCRYPTO" #define TRAPF_USERMODE(frame) (((frame)->srr1 & PSL_PR) != 0) #define TRAPF_PC(frame) ((frame)->srr0) Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Wed Nov 8 01:23:37 2017 (r325525) +++ head/sys/powerpc/powerpc/cpu.c Wed Nov 8 01:26:44 2017 (r325526) @@ -153,13 +153,13 @@ static const struct cputab models[] = { PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | PPC_FEATURE_SMT | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 | PPC_FEATURE_HAS_VSX, - PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HAS_HTM | + PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HAS_HTM | PPC_FEATURE2_ISEL | PPC_FEATURE2_HAS_VCRYPTO, NULL }, { "IBM POWER8", IBMPOWER8, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | PPC_FEATURE_SMT | PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_ARCH_2_06 | PPC_FEATURE_HAS_VSX, - PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HAS_HTM | + PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HAS_HTM | PPC_FEATURE2_ISEL | PPC_FEATURE2_HAS_VCRYPTO, NULL }, { "Motorola PowerPC 7400", MPC7400, REVFMT_MAJMIN, PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, 0, cpu_6xx_setup }, @@ -181,19 +181,20 @@ static const struct cputab models[] = { PPC_FEATURE_HAS_FPU, 0, cpu_6xx_setup }, { "Freescale e500v1 core", FSL_E500v1, REVFMT_MAJMIN, PPC_FEATURE_BOOKE | PPC_FEATURE_HAS_SPE | PPC_FEATURE_HAS_EFP_SINGLE, - 0, cpu_booke_setup }, + PPC_FEATURE2_ISEL, cpu_booke_setup }, { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN, PPC_FEATURE_BOOKE | PPC_FEATURE_HAS_SPE | - PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_HAS_EFP_DOUBLE, 0, - cpu_booke_setup }, + PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_HAS_EFP_DOUBLE, + PPC_FEATURE2_ISEL, cpu_booke_setup }, { "Freescale e500mc core", FSL_E500mc, REVFMT_MAJMIN, - PPC_FEATURE_BOOKE | PPC_FEATURE_HAS_FPU, 0, cpu_booke_setup }, - { "Freescale e5500 core", FSL_E5500, REVFMT_MAJMIN, - PPC_FEATURE_BOOKE | PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, 0, + PPC_FEATURE_BOOKE | PPC_FEATURE_HAS_FPU, PPC_FEATURE2_ISEL, cpu_booke_setup }, + { "Freescale e5500 core", FSL_E5500, REVFMT_MAJMIN, + PPC_FEATURE_BOOKE | PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, + PPC_FEATURE2_ISEL, cpu_booke_setup }, { "Freescale e6500 core", FSL_E6500, REVFMT_MAJMIN, PPC_FEATURE_BOOKE | PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | - PPC_FEATURE_HAS_FPU, 0, cpu_booke_setup }, + PPC_FEATURE_HAS_FPU, PPC_FEATURE2_ISEL, cpu_booke_setup }, { "IBM Cell Broadband Engine", IBMCELLBE, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | PPC_FEATURE_SMT, 0, NULL}, From owner-svn-src-all@freebsd.org Wed Nov 8 01:29:36 2017 Return-Path: Delivered-To: svn-src-all@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 CDF3BE6A1AF; Wed, 8 Nov 2017 01:29:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 AA4567ED0D; Wed, 8 Nov 2017 01:29:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA81SKmf081638; Wed, 8 Nov 2017 01:28:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA81SKZx081636; Wed, 8 Nov 2017 01:28:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711080128.vA81SKZx081636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 8 Nov 2017 01:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325527 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 325527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 01:29:36 -0000 Author: jhibbits Date: Wed Nov 8 01:28:20 2017 New Revision: 325527 URL: https://svnweb.freebsd.org/changeset/base/325527 Log: DS1307: Add the mcp7941x enable bit Summary: Existing code recognizes the mcp7941x RTC, but this RTC has an enable bit at the same location as the "Clock Halt" bit on the ds1307, with an opposite assertion (set == on, whereas CH set == clock stopped). Thus the current code halts the clock, with no way to enable it. Reviewed By: ian MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12961 Modified: head/sys/dev/iicbus/ds1307.c head/sys/dev/iicbus/ds1307reg.h Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Wed Nov 8 01:26:44 2017 (r325526) +++ head/sys/dev/iicbus/ds1307.c Wed Nov 8 01:28:20 2017 (r325527) @@ -272,6 +272,7 @@ ds1307_start(void *xdev) struct sysctl_oid *tree_node; struct sysctl_oid_list *tree; uint8_t secs; + uint8_t osc_en; dev = (device_t)xdev; sc = device_get_softc(dev); @@ -286,7 +287,12 @@ ds1307_start(void *xdev) device_printf(sc->sc_dev, "cannot read from RTC.\n"); return; } - if ((secs & DS1307_SECS_CH) != 0) { + if (sc->sc_mcp7941x) + osc_en = 0x80; + else + osc_en = 0x00; + + if (((secs & DS1307_SECS_CH) ^ osc_en) != 0) { device_printf(sc->sc_dev, "WARNING: RTC clock stopped, check the battery.\n"); } @@ -318,7 +324,7 @@ ds1307_gettime(device_t dev, struct timespec *ts) int error; struct clocktime ct; struct ds1307_softc *sc; - uint8_t data[7], hourmask; + uint8_t data[7], hourmask, st_mask; sc = device_get_softc(dev); error = iicdev_readfrom(sc->sc_dev, DS1307_SECS, data, sizeof(data), @@ -329,7 +335,12 @@ ds1307_gettime(device_t dev, struct timespec *ts) } /* If the clock halted, we don't have good data. */ - if (data[DS1307_SECS] & DS1307_SECS_CH) + if (sc->sc_mcp7941x) + st_mask = 0x80; + else + st_mask = 0x00; + + if (((data[DS1307_SECS] & DS1307_SECS_CH) ^ st_mask) != 0) return (EINVAL); /* If chip is in AM/PM mode remember that. */ @@ -394,6 +405,13 @@ ds1307_settime(device_t dev, struct timespec *ts) data[DS1307_WEEKDAY] = ct.dow; data[DS1307_MONTH] = TOBCD(ct.mon); data[DS1307_YEAR] = TOBCD(ct.year % 100); + if (sc->sc_mcp7941x) { + data[DS1307_SECS] |= MCP7941X_SECS_ST; + data[DS1307_WEEKDAY] |= MCP7941X_WEEKDAY_VBATEN; + if ((ct.year % 4 == 0 && ct.year % 100 != 0) || + ct.year % 400 == 0) + data[DS1307_MONTH] |= MCP7941X_MONTH_LPYR; + } /* Write the time back to RTC. */ error = iicdev_writeto(sc->sc_dev, DS1307_SECS, data, sizeof(data), IIC_INTRWAIT); Modified: head/sys/dev/iicbus/ds1307reg.h ============================================================================== --- head/sys/dev/iicbus/ds1307reg.h Wed Nov 8 01:26:44 2017 (r325526) +++ head/sys/dev/iicbus/ds1307reg.h Wed Nov 8 01:28:20 2017 (r325527) @@ -36,6 +36,7 @@ #define DS1307_SECS 0x00 #define DS1307_SECS_MASK 0x7f #define DS1307_SECS_CH 0x80 +#define MCP7941X_SECS_ST 0x80 #define DS1307_MINS 0x01 #define DS1307_MINS_MASK 0x7f #define DS1307_HOUR 0x02 @@ -44,10 +45,12 @@ #define DS1307_HOUR_IS_PM 0x20 #define DS1307_HOUR_USE_AMPM 0x40 #define DS1307_WEEKDAY 0x03 +#define MCP7941X_WEEKDAY_VBATEN 0x08 #define DS1307_WEEKDAY_MASK 0x07 #define DS1307_DATE 0x04 #define DS1307_DATE_MASK 0x3f #define DS1307_MONTH 0x05 +#define MCP7941X_MONTH_LPYR 0x20 #define DS1307_MONTH_MASK 0x1f #define DS1307_YEAR 0x06 #define DS1307_YEAR_MASK 0xff From owner-svn-src-all@freebsd.org Wed Nov 8 01:54:19 2017 Return-Path: Delivered-To: svn-src-all@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 B1FB6E6AB69; Wed, 8 Nov 2017 01:54:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 8180B806CA; Wed, 8 Nov 2017 01:54:19 +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 vA81r3eR092899; Wed, 8 Nov 2017 01:53:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA81r3Sd092898; Wed, 8 Nov 2017 01:53:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711080153.vA81r3Sd092898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Nov 2017 01:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325528 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 325528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 01:54:19 -0000 Author: markj Date: Wed Nov 8 01:53:03 2017 New Revision: 325528 URL: https://svnweb.freebsd.org/changeset/base/325528 Log: Correct the type of foff. No functional change intended. Github PR: 124 Submitted by: Wuyang Chung MFC after: 1 week Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Wed Nov 8 01:28:20 2017 (r325527) +++ head/sys/vm/vm_mmap.c Wed Nov 8 01:53:03 2017 (r325528) @@ -1196,7 +1196,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, { struct vattr va; vm_object_t obj; - vm_offset_t foff; + vm_ooffset_t foff; struct ucred *cred; int error, flags, locktype; From owner-svn-src-all@freebsd.org Wed Nov 8 02:06:18 2017 Return-Path: Delivered-To: svn-src-all@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 9C60EE6AEC9; Wed, 8 Nov 2017 02:06:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (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 549741338; Wed, 8 Nov 2017 02:06:18 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id 143so827455itf.1; Tue, 07 Nov 2017 18:06:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yKLqntQgU94Gm30Hjeuui8xMfCR76Sq0foSxKmfhnbk=; b=oPlhRN0hM8oZVX2RTx6RnMt6aRFdVox4i7XYGEcGdUSr1L95mLZoGfuJP646Fg3nrp JUpNX60MjO8y7Ae12lwy/nRbSsgWFa92huT7XE2XNURRHrJSQehFDzr4QP5eN6ShWJBI K94Rk3p5u4fn8sLL/PL8FBHfof3kiSMjoNv8E2ncsygKWEtcwN7zYvONNr73RYKwIgqP 3afJqyJyZY5YlEMTv64Zt6EHOzNYhCs7Ok5nNnM1C8iqe4YQlKQ0eHKJOwKIE7PKpyOt ObKwaHnf6QIznV9FTI510lrJU7rUdTW2Bjvz8kWFcne6in2i3F6HSz47BAwK8NT1NCP+ rrYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=yKLqntQgU94Gm30Hjeuui8xMfCR76Sq0foSxKmfhnbk=; b=pwaZ0Gx+5VKnZ4Kzoeud4V1kSY3YWrUCTAWUuL123uZOXjri0VlaRbbK1JrGrmxa+s vQ176cSyhy/5M+ksD9BzSJHIo3Lvucb+N+LTZliKiiXHjpW/RrnJ/1T73wQcXEZz5yL2 CKzG7s/gII4lAQtnP+rPOTZnrCyYA8E8QKttAURUdGTonBb96CMbM9ODlXe3Liq31wYE tK3kb9FHDz7hCOKOfMzTlAL/bH0CJPq3Q73kmnoXHcduqbLmcamlsPADiRZbiuOnlrr5 SZdZ/w/mpUc2AyMD22k77YbVxGqlOYOVPJvPi5hYsuIKFS0ExfxX86xEmc+byR0ngMNF 6M0g== X-Gm-Message-State: AJaThX5gfljIaFdreA1YT+sFqvPONzSmaQ/kmBkZyO69T0mtfrOOQWG8 recNid49NeUM++Kg9UU6kNhrWw== X-Google-Smtp-Source: ABhQp+QE1EmWLh6241RQH/lyiGTGwAz35EbOkSOZL6GOV3AcnuIVTupU7BseyxxRiijhm5rnaOBxmQ== X-Received: by 10.36.252.68 with SMTP id b65mr1680504ith.151.1510106777010; Tue, 07 Nov 2017 18:06:17 -0800 (PST) Received: from raichu (toroon0560w-lp140-01-69-159-38-22.dsl.bell.ca. [69.159.38.22]) by smtp.gmail.com with ESMTPSA id p17sm1221282iod.40.2017.11.07.18.06.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 18:06:16 -0800 (PST) Sender: Mark Johnston Date: Tue, 7 Nov 2017 21:06:11 -0500 From: Mark Johnston To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325528 - head/sys/vm Message-ID: <20171108020611.GA62104@raichu> References: <201711080153.vA81r3Sd092898@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201711080153.vA81r3Sd092898@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 02:06:18 -0000 On Wed, Nov 08, 2017 at 01:53:03AM +0000, Mark Johnston wrote: > Author: markj > Date: Wed Nov 8 01:53:03 2017 > New Revision: 325528 > URL: https://svnweb.freebsd.org/changeset/base/325528 > > Log: > Correct the type of foff. > > No functional change intended. Sorry for not clarifying the second sentence. vm_offset_t is 32 bits wide on some architectures, while vm_ooffset_t is always 64 bits wide. However, foff is only used when allocating a vnode pager with vm_pager_allocate(), and vnode_pager_alloc()'s "offset" parameter is unused. So the bug was real, but had no effect. From owner-svn-src-all@freebsd.org Wed Nov 8 02:29:41 2017 Return-Path: Delivered-To: svn-src-all@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 49184E6B316; Wed, 8 Nov 2017 02:29:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 136B62629; Wed, 8 Nov 2017 02:29:40 +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 vA82SPEt004879; Wed, 8 Nov 2017 02:28:25 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA82SPcA004878; Wed, 8 Nov 2017 02:28:25 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711080228.vA82SPcA004878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Nov 2017 02:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325529 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 02:29:41 -0000 Author: bdrewery Date: Wed Nov 8 02:28:24 2017 New Revision: 325529 URL: https://svnweb.freebsd.org/changeset/base/325529 Log: AUTO_OBJ: Don't create TARGET. directories during 'make universe'. Reported by: rpokala Sponsored by: Dell EMC Isilon Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Nov 8 01:53:03 2017 (r325528) +++ head/Makefile Wed Nov 8 02:28:24 2017 (r325529) @@ -558,7 +558,7 @@ universe_${target}_kernels: universe_${target}_prologu "check _.${target}.makeLINT for details"| ${MAKEFAIL})) .endif @cd ${.CURDIR}; ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ - universe_kernels + universe_kernels MK_AUTO_OBJ=no .endif # !MAKE_JUST_WORLDS # Tell the user the worlds and kernels have completed From owner-svn-src-all@freebsd.org Wed Nov 8 02:40:55 2017 Return-Path: Delivered-To: svn-src-all@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 B61A4E6B617; Wed, 8 Nov 2017 02:40:55 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 7DC6133C3; Wed, 8 Nov 2017 02:40:55 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA82ddoI009183; Wed, 8 Nov 2017 02:39:39 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA82dbJ6009161; Wed, 8 Nov 2017 02:39:37 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201711080239.vA82dbJ6009161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Wed, 8 Nov 2017 02:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325530 - in head/sys: amd64/amd64 arm64/arm64 fs/tmpfs kern mips/mips powerpc/aim powerpc/powerpc sparc64/sparc64 vm x86/iommu X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 fs/tmpfs kern mips/mips powerpc/aim powerpc/powerpc sparc64/sparc64 vm x86/iommu X-SVN-Commit-Revision: 325530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 02:40:55 -0000 Author: jeff Date: Wed Nov 8 02:39:37 2017 New Revision: 325530 URL: https://svnweb.freebsd.org/changeset/base/325530 Log: Replace manyinstances of VM_WAIT with blocking page allocation flags similar to the kernel memory allocator. This simplifies NUMA allocation because the domain will be known at wait time and races between failure and sleeping are eliminated. This also reduces boilerplate code and simplifies callers. A wait primitive is supplied for uma zones for similar reasons. This eliminates some non-specific VM_WAIT calls in favor of more explicit sleeps that may be satisfied without new pages. Reviewed by: alc, kib, markj Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/uma_machdep.c head/sys/arm64/arm64/uma_machdep.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/kern/uipc_shm.c head/sys/kern/vfs_bio.c head/sys/mips/mips/uma_machdep.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/slb.c head/sys/powerpc/powerpc/uma_machdep.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/vm/phys_pager.c head/sys/vm/swap_pager.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/vm_kern.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_radix.c head/sys/vm/vm_radix.h head/sys/x86/iommu/intel_utils.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/amd64/amd64/pmap.c Wed Nov 8 02:39:37 2017 (r325530) @@ -2414,9 +2414,8 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, i /* * allocate the page directory page */ - while ((pml4pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) - VM_WAIT; + pml4pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | + VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_WAITOK); pml4phys = VM_PAGE_TO_PHYS(pml4pg); pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(pml4phys); Modified: head/sys/amd64/amd64/uma_machdep.c ============================================================================== --- head/sys/amd64/amd64/uma_machdep.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/amd64/amd64/uma_machdep.c Wed Nov 8 02:39:37 2017 (r325530) @@ -47,20 +47,12 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in vm_page_t m; vm_paddr_t pa; void *va; - int pflags; *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - else - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + if (m == NULL) + return (NULL); pa = m->phys_addr; if ((wait & M_NODUMP) == 0) dump_add_page(pa); Modified: head/sys/arm64/arm64/uma_machdep.c ============================================================================== --- head/sys/arm64/arm64/uma_machdep.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/arm64/arm64/uma_machdep.c Wed Nov 8 02:39:37 2017 (r325530) @@ -47,20 +47,12 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in vm_page_t m; vm_paddr_t pa; void *va; - int pflags; *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - else - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + if (m == NULL) + return (NULL); pa = m->phys_addr; if ((wait & M_NODUMP) == 0) dump_add_page(pa); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Nov 8 02:39:37 2017 (r325530) @@ -1407,13 +1407,10 @@ retry: goto retry; MPASS(m->valid == VM_PAGE_BITS_ALL); } else if (vm_pager_has_page(uobj, idx, NULL, NULL)) { - m = vm_page_alloc(uobj, idx, VM_ALLOC_NORMAL); - if (m == NULL) { - VM_OBJECT_WUNLOCK(uobj); - VM_WAIT; - VM_OBJECT_WLOCK(uobj); + m = vm_page_alloc(uobj, idx, VM_ALLOC_NORMAL | + VM_ALLOC_WAITFAIL); + if (m == NULL) goto retry; - } rv = vm_pager_get_pages(uobj, &m, 1, NULL, NULL); vm_page_lock(m); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/kern/uipc_shm.c Wed Nov 8 02:39:37 2017 (r325530) @@ -454,13 +454,10 @@ retry: if (vm_page_sleep_if_busy(m, "shmtrc")) goto retry; } else if (vm_pager_has_page(object, idx, NULL, NULL)) { - m = vm_page_alloc(object, idx, VM_ALLOC_NORMAL); - if (m == NULL) { - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); + m = vm_page_alloc(object, idx, + VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); + if (m == NULL) goto retry; - } rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); vm_page_lock(m); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/kern/vfs_bio.c Wed Nov 8 02:39:37 2017 (r325530) @@ -4515,18 +4515,14 @@ vm_hold_load_pages(struct buf *bp, vm_offset_t from, v index = (from - trunc_page((vm_offset_t)bp->b_data)) >> PAGE_SHIFT; for (pg = from; pg < to; pg += PAGE_SIZE, index++) { -tryagain: /* * note: must allocate system pages since blocking here * could interfere with paging I/O, no matter which * process we are. */ p = vm_page_alloc(NULL, 0, VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_COUNT((to - pg) >> PAGE_SHIFT)); - if (p == NULL) { - VM_WAIT; - goto tryagain; - } + VM_ALLOC_WIRED | VM_ALLOC_COUNT((to - pg) >> PAGE_SHIFT) | + VM_ALLOC_WAITOK); pmap_qenter(pg, &p, 1); bp->b_pages[index] = p; } Modified: head/sys/mips/mips/uma_machdep.c ============================================================================== --- head/sys/mips/mips/uma_machdep.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/mips/mips/uma_machdep.c Wed Nov 8 02:39:37 2017 (r325530) @@ -51,6 +51,10 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in *flags = UMA_SLAB_PRIV; pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; +#ifndef __mips_n64 + pflags &= ~(VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + pflags |= VM_ALLOC_NOWAIT; +#endif for (;;) { m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, pflags); Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Nov 8 02:39:37 2017 (r325530) @@ -1506,7 +1506,7 @@ moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes struct pvo_entry *pvo; vm_offset_t va; vm_page_t m; - int pflags, needed_lock; + int needed_lock; /* * This entire routine is a horrible hack to avoid bothering kmem @@ -1517,17 +1517,11 @@ moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes *flags = UMA_SLAB_PRIV; needed_lock = !PMAP_LOCKED(kernel_pmap); - pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); + if (m == NULL) + return (NULL); va = VM_PAGE_TO_PHYS(m); Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/powerpc/aim/slb.c Wed Nov 8 02:39:37 2017 (r325530) @@ -483,24 +483,16 @@ slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, u static vm_offset_t realmax = 0; void *va; vm_page_t m; - int pflags; if (realmax == 0) realmax = platform_real_maxaddr(); *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; - - for (;;) { - m = vm_page_alloc_contig(NULL, 0, pflags, 1, 0, realmax, - PAGE_SIZE, PAGE_SIZE, VM_MEMATTR_DEFAULT); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - VM_WAIT; - } else - break; - } + m = vm_page_alloc_contig(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED, + 1, 0, realmax, PAGE_SIZE, PAGE_SIZE, VM_MEMATTR_DEFAULT); + if (m == NULL) + return (NULL); va = (void *) VM_PAGE_TO_PHYS(m); Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/powerpc/powerpc/uma_machdep.c Wed Nov 8 02:39:37 2017 (r325530) @@ -56,20 +56,13 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in void *va; vm_paddr_t pa; vm_page_t m; - int pflags; *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); + if (m == NULL) + return (NULL); pa = VM_PAGE_TO_PHYS(m); Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/sparc64/sparc64/vm_machdep.c Wed Nov 8 02:39:37 2017 (r325530) @@ -394,24 +394,16 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, u_in { vm_paddr_t pa; vm_page_t m; - int pflags; void *va; PMAP_STATS_INC(uma_nsmall_alloc); *flags = UMA_SLAB_PRIV; - pflags = malloc2vm_flags(wait) | VM_ALLOC_WIRED; - for (;;) { - m = vm_page_alloc(NULL, 0, pflags | VM_ALLOC_NOOBJ); - if (m == NULL) { - if (wait & M_NOWAIT) - return (NULL); - else - VM_WAIT; - } else - break; - } + m = vm_page_alloc(NULL, 0, + malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); + if (m == NULL) + return (NULL); pa = VM_PAGE_TO_PHYS(m); if (dcache_color_ignore == 0 && m->md.color != DCACHE_COLOR(pa)) { Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/phys_pager.c Wed Nov 8 02:39:37 2017 (r325530) @@ -209,13 +209,10 @@ retry: if (m == NULL) { ahead = MIN(end - i, PHYSALLOC); m = vm_page_alloc(object, i, VM_ALLOC_NORMAL | - VM_ALLOC_ZERO | VM_ALLOC_COUNT(ahead)); - if (m == NULL) { - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); + VM_ALLOC_ZERO | VM_ALLOC_WAITFAIL | + VM_ALLOC_COUNT(ahead)); + if (m == NULL) goto retry; - } if ((m->flags & PG_ZERO) == 0) pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/swap_pager.c Wed Nov 8 02:39:37 2017 (r325530) @@ -1820,7 +1820,7 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t p vm_pageout_oom(VM_OOM_SWAPZ); pause("swzonxb", 10); } else - VM_WAIT; + uma_zwait(swblk_zone); VM_OBJECT_WLOCK(object); sb = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, rdpi); @@ -1850,7 +1850,7 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t p vm_pageout_oom(VM_OOM_SWAPZ); pause("swzonxp", 10); } else - VM_WAIT; + uma_zwait(swpctrie_zone); VM_OBJECT_WLOCK(object); sb1 = SWAP_PCTRIE_LOOKUP(&object->un_pager.swp.swp_blks, rdpi); Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/uma.h Wed Nov 8 02:39:37 2017 (r325530) @@ -366,6 +366,11 @@ uma_zfree(uma_zone_t zone, void *item) } /* + * Wait until the specified zone can allocate an item. + */ +void uma_zwait(uma_zone_t zone); + +/* * XXX The rest of the prototypes in this header are h0h0 magic for the VM. * If you think you need to use it for a normal zone you're probably incorrect. */ Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/uma_core.c Wed Nov 8 02:39:37 2017 (r325530) @@ -1109,7 +1109,8 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t npages = howmany(bytes, PAGE_SIZE); while (npages > 0) { p = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | - VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); + VM_ALLOC_WIRED | VM_ALLOC_NOOBJ | + (wait & M_WAITOK) ? VM_ALLOC_WAITOK : VM_ALLOC_NOWAIT); if (p != NULL) { /* * Since the page does not belong to an object, its @@ -1119,11 +1120,6 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t npages--; continue; } - if (wait & M_WAITOK) { - VM_WAIT; - continue; - } - /* * Page allocation failed, free intermediate pages and * exit. @@ -2024,6 +2020,15 @@ uma_zdestroy(uma_zone_t zone) sx_slock(&uma_drain_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); sx_sunlock(&uma_drain_lock); +} + +void +uma_zwait(uma_zone_t zone) +{ + void *item; + + item = uma_zalloc_arg(zone, NULL, M_WAITOK); + uma_zfree(zone, item); } /* See uma.h */ Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/vm_kern.c Wed Nov 8 02:39:37 2017 (r325530) @@ -172,6 +172,8 @@ kmem_alloc_attr(vmem_t *vmem, vm_size_t size, int flag return (0); offset = addr - VM_MIN_KERNEL_ADDRESS; pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + pflags |= VM_ALLOC_NOWAIT; VM_OBJECT_WLOCK(object); for (i = 0; i < size; i += PAGE_SIZE) { tries = 0; @@ -227,6 +229,8 @@ kmem_alloc_contig(struct vmem *vmem, vm_size_t size, i return (0); offset = addr - VM_MIN_KERNEL_ADDRESS; pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + pflags |= VM_ALLOC_NOWAIT; npages = atop(size); VM_OBJECT_WLOCK(object); tries = 0; @@ -338,10 +342,13 @@ kmem_back(vm_object_t object, vm_offset_t addr, vm_siz offset = addr - VM_MIN_KERNEL_ADDRESS; pflags = malloc2vm_flags(flags) | VM_ALLOC_NOBUSY | VM_ALLOC_WIRED; + pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + if (flags & M_WAITOK) + pflags |= VM_ALLOC_WAITFAIL; i = 0; -retry: VM_OBJECT_WLOCK(object); +retry: mpred = vm_radix_lookup_le(&object->rtree, atop(offset + i)); for (; i < size; i += PAGE_SIZE, mpred = m) { m = vm_page_alloc_after(object, atop(offset + i), pflags, @@ -353,11 +360,9 @@ retry: * aren't on any queues. */ if (m == NULL) { - VM_OBJECT_WUNLOCK(object); - if ((flags & M_NOWAIT) == 0) { - VM_WAIT; + if ((flags & M_NOWAIT) == 0) goto retry; - } + VM_OBJECT_WUNLOCK(object); kmem_unback(object, addr, i); return (KERN_NO_SPACE); } Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/vm_object.c Wed Nov 8 02:39:37 2017 (r325530) @@ -1471,7 +1471,7 @@ retry: if (vm_page_rename(m, new_object, idx)) { VM_OBJECT_WUNLOCK(new_object); VM_OBJECT_WUNLOCK(orig_object); - VM_WAIT; + vm_radix_wait(); VM_OBJECT_WLOCK(orig_object); VM_OBJECT_WLOCK(new_object); goto retry; @@ -1533,8 +1533,9 @@ vm_object_collapse_scan_wait(vm_object_t object, vm_pa vm_page_lock(p); VM_OBJECT_WUNLOCK(object); VM_OBJECT_WUNLOCK(backing_object); + /* The page is only NULL when rename fails. */ if (p == NULL) - VM_WAIT; + vm_radix_wait(); else vm_page_busy_sleep(p, "vmocol", false); VM_OBJECT_WLOCK(object); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/vm_page.c Wed Nov 8 02:39:37 2017 (r325530) @@ -172,6 +172,7 @@ static void vm_page_insert_radixdone(vm_page_t m, vm_o vm_page_t mpred); static int vm_page_reclaim_run(int req_class, u_long npages, vm_page_t m_run, vm_paddr_t high); +static int vm_page_alloc_fail(vm_object_t object, int req); SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init, NULL); @@ -1595,6 +1596,8 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), ("inconsistent object(%p)/req(%x)", object, req)); + KASSERT(object == NULL || (req & VM_ALLOC_WAITOK) == 0, + ("Can't sleep and retry object insertion.")); KASSERT(mpred == NULL || mpred->pindex < pindex, ("mpred %p doesn't precede pindex 0x%jx", mpred, (uintmax_t)pindex)); @@ -1613,6 +1616,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi * Allocate a page if the number of free pages exceeds the minimum * for the request class. */ +again: mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && @@ -1645,10 +1649,8 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi /* * Not allocatable, give up. */ - mtx_unlock(&vm_page_queue_free_mtx); - atomic_add_int(&vm_pageout_deficit, - max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); - pagedaemon_wakeup(); + if (vm_page_alloc_fail(object, req)) + goto again; return (NULL); } @@ -1700,6 +1702,11 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi m->busy_lock = VPB_UNBUSIED; /* Don't change PG_ZERO. */ vm_page_free_toq(m); + if (req & VM_ALLOC_WAITFAIL) { + VM_OBJECT_WUNLOCK(object); + vm_radix_wait(); + VM_OBJECT_WLOCK(object); + } return (NULL); } @@ -1777,6 +1784,8 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t p (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), ("vm_page_alloc_contig: inconsistent object(%p)/req(%x)", object, req)); + KASSERT(object == NULL || (req & VM_ALLOC_WAITOK) == 0, + ("Can't sleep and retry object insertion.")); if (object != NULL) { VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_FICTITIOUS) == 0, @@ -1802,6 +1811,7 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t p * Can we allocate the pages without the number of free pages falling * below the lower bound for the allocation class? */ +again: mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count >= npages + vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && @@ -1823,9 +1833,8 @@ retry: m_ret = vm_phys_alloc_contig(npages, low, high, alignment, boundary); } else { - mtx_unlock(&vm_page_queue_free_mtx); - atomic_add_int(&vm_pageout_deficit, npages); - pagedaemon_wakeup(); + if (vm_page_alloc_fail(object, req)) + goto again; return (NULL); } if (m_ret != NULL) @@ -1891,6 +1900,11 @@ retry: /* Don't change PG_ZERO. */ vm_page_free_toq(m); } + if (req & VM_ALLOC_WAITFAIL) { + VM_OBJECT_WUNLOCK(object); + vm_radix_wait(); + VM_OBJECT_WLOCK(object); + } return (NULL); } mpred = m; @@ -1963,18 +1977,17 @@ vm_page_alloc_freelist(int flind, int req) /* * Do not allocate reserved pages unless the req has asked for it. */ +again: mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && vm_cnt.v_free_count > vm_cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && - vm_cnt.v_free_count > 0)) + vm_cnt.v_free_count > 0)) { m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, 0); - else { - mtx_unlock(&vm_page_queue_free_mtx); - atomic_add_int(&vm_pageout_deficit, - max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); - pagedaemon_wakeup(); + } else { + if (vm_page_alloc_fail(NULL, req)) + goto again; return (NULL); } if (m == NULL) { @@ -2533,11 +2546,11 @@ vm_page_reclaim_contig(int req, u_long npages, vm_padd * Sleep until free pages are available for allocation. * - Called in various places before memory allocations. */ -void -vm_wait(void) +static void +_vm_wait(void) { - mtx_lock(&vm_page_queue_free_mtx); + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); if (curproc == pageproc) { vm_pageout_pages_needed = 1; msleep(&vm_pageout_pages_needed, &vm_page_queue_free_mtx, @@ -2555,7 +2568,47 @@ vm_wait(void) } } +void +vm_wait(void) +{ + + mtx_lock(&vm_page_queue_free_mtx); + _vm_wait(); +} + /* + * vm_page_alloc_fail: + * + * Called when a page allocation function fails. Informs the + * pagedaemon and performs the requested wait. Requires the + * page_queue_free and object lock on entry. Returns with the + * object lock held and free lock released. Returns an error when + * retry is necessary. + * + */ +static int +vm_page_alloc_fail(vm_object_t object, int req) +{ + + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); + + atomic_add_int(&vm_pageout_deficit, + max((u_int)req >> VM_ALLOC_COUNT_SHIFT, 1)); + pagedaemon_wakeup(); + if (req & (VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) { + if (object != NULL) + VM_OBJECT_WUNLOCK(object); + _vm_wait(); + if (object != NULL) + VM_OBJECT_WLOCK(object); + if (req & VM_ALLOC_WAITOK) + return (EAGAIN); + } else + mtx_unlock(&vm_page_queue_free_mtx); + return (0); +} + +/* * vm_waitpfault: (also see VM_WAITPFAULT macro) * * Sleep until free pages are available for allocation. @@ -3179,11 +3232,16 @@ vm_page_grab(vm_object_t object, vm_pindex_t pindex, i { vm_page_t m; int sleep; + int pflags; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 || (allocflags & VM_ALLOC_IGN_SBUSY) != 0, ("vm_page_grab: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY mismatch")); + pflags = allocflags & + ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); + if ((allocflags & VM_ALLOC_NOWAIT) == 0) + pflags |= VM_ALLOC_WAITFAIL; retrylookup: if ((m = vm_page_lookup(object, pindex)) != NULL) { sleep = (allocflags & VM_ALLOC_IGN_SBUSY) != 0 ? @@ -3217,13 +3275,10 @@ retrylookup: return (m); } } - m = vm_page_alloc(object, pindex, allocflags); + m = vm_page_alloc(object, pindex, pflags); if (m == NULL) { if ((allocflags & VM_ALLOC_NOWAIT) != 0) return (NULL); - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); goto retrylookup; } if (allocflags & VM_ALLOC_ZERO && (m->flags & PG_ZERO) == 0) @@ -3262,6 +3317,7 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pin vm_page_t *ma, int count) { vm_page_t m, mpred; + int pflags; int i; bool sleep; @@ -3276,6 +3332,10 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pin ("vm_page_grab_pages: VM_ALLOC_SBUSY/IGN_SBUSY mismatch")); if (count == 0) return (0); + pflags = allocflags & ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | + VM_ALLOC_WAITFAIL | VM_ALLOC_IGN_SBUSY); + if ((allocflags & VM_ALLOC_NOWAIT) == 0) + pflags |= VM_ALLOC_WAITFAIL; i = 0; retrylookup: m = vm_radix_lookup_le(&object->rtree, pindex + i); @@ -3316,14 +3376,10 @@ retrylookup: vm_page_sbusy(m); } else { m = vm_page_alloc_after(object, pindex + i, - (allocflags & ~VM_ALLOC_IGN_SBUSY) | - VM_ALLOC_COUNT(count - i), mpred); + pflags | VM_ALLOC_COUNT(count - i), mpred); if (m == NULL) { if ((allocflags & VM_ALLOC_NOWAIT) != 0) break; - VM_OBJECT_WUNLOCK(object); - VM_WAIT; - VM_OBJECT_WLOCK(object); goto retrylookup; } } Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/vm_page.h Wed Nov 8 02:39:37 2017 (r325530) @@ -415,6 +415,8 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_INTERRUPT 1 #define VM_ALLOC_SYSTEM 2 #define VM_ALLOC_CLASS_MASK 3 +#define VM_ALLOC_WAITOK 0x0008 /* (acf) Sleep and retry */ +#define VM_ALLOC_WAITFAIL 0x0010 /* (acf) Sleep and return error */ #define VM_ALLOC_WIRED 0x0020 /* (acfgp) Allocate a wired page */ #define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */ #define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ @@ -422,7 +424,7 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */ #define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ #define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ -#define VM_ALLOC_NOWAIT 0x8000 /* (gp) Do not sleep */ +#define VM_ALLOC_NOWAIT 0x8000 /* (acfgp) Do not sleep */ #define VM_ALLOC_COUNT_SHIFT 16 #define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) @@ -441,6 +443,10 @@ malloc2vm_flags(int malloc_flags) pflags |= VM_ALLOC_ZERO; if ((malloc_flags & M_NODUMP) != 0) pflags |= VM_ALLOC_NODUMP; + if ((malloc_flags & M_NOWAIT)) + pflags |= VM_ALLOC_NOWAIT; + if ((malloc_flags & M_WAITOK)) + pflags |= VM_ALLOC_WAITOK; return (pflags); } #endif Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/vm_radix.c Wed Nov 8 02:39:37 2017 (r325530) @@ -775,6 +775,12 @@ vm_radix_replace(struct vm_radix *rtree, vm_page_t new panic("%s: original replacing page not found", __func__); } +void +vm_radix_wait(void) +{ + uma_zwait(vm_radix_node_zone); +} + #ifdef DDB /* * Show details about the given radix node. Modified: head/sys/vm/vm_radix.h ============================================================================== --- head/sys/vm/vm_radix.h Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/vm/vm_radix.h Wed Nov 8 02:39:37 2017 (r325530) @@ -36,6 +36,7 @@ #ifdef _KERNEL int vm_radix_insert(struct vm_radix *rtree, vm_page_t page); +void vm_radix_wait(void); boolean_t vm_radix_is_singleton(struct vm_radix *rtree); vm_page_t vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index); vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index); Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Wed Nov 8 02:28:24 2017 (r325529) +++ head/sys/x86/iommu/intel_utils.c Wed Nov 8 02:39:37 2017 (r325530) @@ -270,7 +270,9 @@ dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int fla break; } m = vm_page_alloc_contig(obj, idx, VM_ALLOC_NOBUSY | - VM_ALLOC_SYSTEM | VM_ALLOC_NODUMP | zeroed, 1, 0, + VM_ALLOC_SYSTEM | VM_ALLOC_NODUMP | zeroed | + (flags & DMAR_PGF_WAITOK) ? + VM_ALLOC_WAITFAIL : VM_ALLOC_NOWAIT, 1, 0, dmar_high, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); if ((flags & DMAR_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); @@ -282,11 +284,6 @@ dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int fla } if ((flags & DMAR_PGF_WAITOK) == 0) break; - if ((flags & DMAR_PGF_OBJL) != 0) - VM_OBJECT_WUNLOCK(obj); - VM_WAIT; - if ((flags & DMAR_PGF_OBJL) != 0) - VM_OBJECT_WLOCK(obj); } return (m); } From owner-svn-src-all@freebsd.org Wed Nov 8 03:11:56 2017 Return-Path: Delivered-To: svn-src-all@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 E9E7AE6C299; Wed, 8 Nov 2017 03:11:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [96.47.72.37]) (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 BA5BF64512; Wed, 8 Nov 2017 03:11:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA83Ae9E024486; Wed, 8 Nov 2017 03:10:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA83Aesg024485; Wed, 8 Nov 2017 03:10:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711080310.vA83Aesg024485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 8 Nov 2017 03:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325531 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 03:11:57 -0000 Author: imp Date: Wed Nov 8 03:10:40 2017 New Revision: 325531 URL: https://svnweb.freebsd.org/changeset/base/325531 Log: Propagate the same condition for obsolete files as we use to generate the new armhf binaries. Sponsored by: Netflix Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Nov 8 02:39:37 2017 (r325530) +++ head/ObsoleteFiles.inc Wed Nov 8 03:10:40 2017 (r325531) @@ -43,8 +43,8 @@ OLD_FILES+=sbin/badsect OLD_FILES+=rescue/badsect OLD_FILES+=usr/share/man/man8/badsect.8.gz # 20171105: fixing lib/libclang_rt CRTARCH for arm:armv[67]. -.if ${MACHINE} == "arm" -.if ${MACHINE_ARCH:Marmv[67]*} != "" && ${CPUTYPE:M*soft*} == "" +.if ${MACHINE_ARCH:Marmv[67]*} != "" && \ + (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.a OLD_LIBS+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.asan-arm.so @@ -55,7 +55,6 @@ OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.stats_client-arm.a OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a OLD_FILES+=usr/lib/clang/5.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a -.endif .endif # 20171104: libcap_random should be in /lib not in /usr/lib OLD_LIBS+=usr/lib/libcap_random.so.0 From owner-svn-src-all@freebsd.org Wed Nov 8 04:00:48 2017 Return-Path: Delivered-To: svn-src-all@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 73FE6E6D0A7; Wed, 8 Nov 2017 04:00:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x229.google.com (mail-pg0-x229.google.com [IPv6:2607:f8b0:400e:c05::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 3D27166E27; Wed, 8 Nov 2017 04:00:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x229.google.com with SMTP id j3so1026203pga.1; Tue, 07 Nov 2017 20:00:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=/kLPAUcbcy2UKIdxsHo94Ygm5tcyxd9AKhPKHZ1XzUA=; b=SYsBPpRgbce0fOryUsbFd3eO87KneSzezHIeoR47+HwYQBti8oZWJ8lhw728THb0Bs kPHCkzWVlM+x8au2hPn9dS2Hs+D774Vh8ANy9jo1ByzqhwYFV0gfk9C4WJ9yAuxVHSvd zHsg6gj6+cuHmWs92715KboX5JXtl9wjLE7wVI+deryOwnYVxcxwDKaYfvEZBFxSaKs+ 25p9y14WAv6NLH/ZgJF83ca6t+QMO8N5rcuQLhSixiOQHSQB7n44rexa2PaMhS4XT9sB /UfLtOExpkAkOzql0+fNkOauDjHb8+1G0av9D5GEsqEZ7kiIkSmDB/9K1H29WZ8g45iq jz3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=/kLPAUcbcy2UKIdxsHo94Ygm5tcyxd9AKhPKHZ1XzUA=; b=FamF0+abqRNs6/nEBKZMxURzg5zNImFijy2v/6MMQqNYAHPrhKsfpLKM1tLl8mypwt yh2lwWHWWU5G74Lz9ucf9A4DjaXihDpIHzPovc3mcwqwUvQiC75my1ugrs0RVYO6x4sx lvbPWoqBuDwpl5AybMO2wsClLnNHRoEB2yY7evOYyKEr7H8fX6nX5ehbgk9GkYa9v1UN 6LaFGEcqwcrKzzD/IXl+fvy5irCdAQ1bxanqQyc+oFpAcP4Ec5NhnYASkRV0L5jmT5Tz nW10vW3KxkRGf0g5tQgxBp6BDJB7DSECojfSA3mZx7SDZi66hgxxmOeFf9pD36ouqTDV gL2w== X-Gm-Message-State: AJaThX6Yc9NcvnlGUKrEN7ZeOVG7oNyh6lQEKdtp5RYKN/6wkKqL5zan jyNJPVK1FqFA8zjAfMWxPEJ3+9dn X-Google-Smtp-Source: ABhQp+Q23Cd6WilbgQ2yASwiGRXvz63V6VPhTsgeg/tr1WZ+4JsiNy/NkkX1xge8p0UH44/yWQ0FpQ== X-Received: by 10.98.206.68 with SMTP id y65mr1055278pfg.138.1510113647345; Tue, 07 Nov 2017 20:00:47 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id g16sm6380688pfd.87.2017.11.07.20.00.46 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Nov 2017 20:00:46 -0800 (PST) Content-Type: multipart/signed; boundary="Apple-Mail=_4B502374-E50A-4641-9B7E-A4E8058B6815"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r325504 - head/lib/libclang_rt From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <0fc9d87c-2dc5-d229-f0a2-f45f53cf2144@FreeBSD.org> Date: Tue, 7 Nov 2017 20:00:45 -0800 Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201711070626.vA76QmnV025927@repo.freebsd.org> <0fc9d87c-2dc5-d229-f0a2-f45f53cf2144@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 04:00:48 -0000 --Apple-Mail=_4B502374-E50A-4641-9B7E-A4E8058B6815 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Nov 7, 2017, at 11:20, Bryan Drewery wrote: >=20 > On 11/6/2017 10:26 PM, Ngie Cooper wrote: >> Author: ngie >> Date: Tue Nov 7 06:26:48 2017 >> New Revision: 325504 >> URL: https://svnweb.freebsd.org/changeset/base/325504 >>=20 >> Log: >> Redo r325502 >>=20 >> :U:Mfoo expands to :Mfoo, apparently. Explicit check for CPUTYPE = being >> defined, and test for it's value not containing *soft* before = calling CRTARCH >> armhf. >>=20 >> Tested, somewhat. Unfortunately recent changes appear to have = affected >> cross-builds where it no longer works, per my tests after = universe12a being >> upgraded from 07/2017 to 11/2017 sources (DESTDIR isn't being used = in WORLDTMP; >> MK_SYSTEM_COMPILER might be causing issues right now). >>=20 >=20 > In buildworld DESTDIR usually is set to WORLDTMP. But how does the > comment relate to CPUTYPE? What "no longer works" about cross-builds? If I had my log, I would dig it up, but it=E2=80=99s easy to trigger = with =E2=80=9Cmake tinderbox TARGETS=3Darm=E2=80=9D on that branch :/. Basically, it wasn=E2=80=99t looking for libraries in the host = toolchain=E2=80=99s directory (`/usr/lib/=E2=80=A6`), not = `/usr/lib/=E2=80=A6`. Cheers, -Ngie --Apple-Mail=_4B502374-E50A-4641-9B7E-A4E8058B6815 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE5bk3FaGcY5rvqmb79YOpJmkwhhUFAloCgW0ACgkQ9YOpJmkw hhV7XA/9Ffw/Mm0lDhCw/DvTgOSHcF6irO6a6aeAdMxxbf1k4UqGHbIJET8/YAdR IhhSOC4xHLXieyFBl9xKa/ducaCG2LAYpM0L8vEXhjvE0tHb3JYyMILhe20RCLXx nrZUgeamM4Q1ZRXKYYjRwzo8n4OTMx5L+OoztNx2BSOsh8I/rU5r6IYhDJsRzN7g rF4XRJeQjPwtMaWHqTAIrFDf7E7D5AkuK0boX/jKvoyKfQxT7ZhwUIlv/5/boluY 0zvG/2UJtSfgWgANFKCvRrT2s1+liLjqve2+lbY8LiIugMvGDQdKZoOnirlXH6j0 1/wqAVS1LrtQGgBcdpglQ1iGf/TNnHOozTWNiknemU8DrZEwkjlNZoyrpwi3Q0i3 3mIlDfCq45x/FgZxJkROVhPLU92fOpJ1auPDcHhufzcgWu1QdZiOKz4d7vysY7Tp o+E5mZCs3Y3XZQz1K2dJHzph99acRWhv0mSyzZHozFTYd9HU1pKvjC7q2kGrP/Aq 6duvH0LTnYmnhxY8qH36mYXmSaMI0q4JiChRbKBxG29f4ZCADLM2s5G8fXo82hPt PCIHwSSm2OnzuhdQFLwSShOIJFt/NZffZvLsB5tMEtvpd0nw+skcFxfoMfvx6BWW WqGO/FgDOq0x4bc24HWBfHYV/jnhuOn1qxCeqDtBuuuIE4ha5mQ= =Lxjk -----END PGP SIGNATURE----- --Apple-Mail=_4B502374-E50A-4641-9B7E-A4E8058B6815-- From owner-svn-src-all@freebsd.org Wed Nov 8 08:21:19 2017 Return-Path: Delivered-To: svn-src-all@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 23DE9E7112F; Wed, 8 Nov 2017 08:21:19 +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 D127D6FE6F; Wed, 8 Nov 2017 08:21:18 +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 vA88LIuf050108; Wed, 8 Nov 2017 08:21:18 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA88LHOb050105; Wed, 8 Nov 2017 08:21:17 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711080821.vA88LHOb050105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 8 Nov 2017 08:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325532 - in head: share/man/man4 sys/dev/arcmsr X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/arcmsr X-SVN-Commit-Revision: 325532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 08:21:19 -0000 Author: delphij Date: Wed Nov 8 08:21:17 2017 New Revision: 325532 URL: https://svnweb.freebsd.org/changeset/base/325532 Log: Update arcmsr(4) to 1.40.00.01: - Fix clear doorbell queue buffer for ADAPTER_TYPE_B - Fix release memory resource when detach device - Add support for ARC-1216, 1226 SAS 12Gb controllers - Declare some functions as static - Change checking dword read/write for IOP rqbuffer. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 MFC after: 2 weeks Modified: head/share/man/man4/arcmsr.4 head/sys/dev/arcmsr/arcmsr.c head/sys/dev/arcmsr/arcmsr.h Modified: head/share/man/man4/arcmsr.4 ============================================================================== --- head/share/man/man4/arcmsr.4 Wed Nov 8 03:10:40 2017 (r325531) +++ head/share/man/man4/arcmsr.4 Wed Nov 8 08:21:17 2017 (r325532) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2017 +.Dd November 8, 2017 .Dt ARCMSR 4 .Os .Sh NAME @@ -104,6 +104,8 @@ ARC-1213 .It ARC-1214 .It +ARC-1216 +.It ARC-1220 .It ARC-1222 @@ -111,6 +113,8 @@ ARC-1222 ARC-1223 .It ARC-1224 +.It +ARC-1226 .It ARC-1230 .It Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Wed Nov 8 03:10:40 2017 (r325531) +++ head/sys/dev/arcmsr/arcmsr.c Wed Nov 8 08:21:17 2017 (r325532) @@ -78,6 +78,7 @@ ** 1.20.00.29 12/18/2013 Ching Huang Change simq allocation number, support ARC1883 ** 1.30.00.00 11/30/2015 Ching Huang Added support ARC1203 ** 1.40.00.00 07/11/2017 Ching Huang Added support ARC1884 +** 1.40.00.01 10/30/2017 Ching Huang Fixed release memory resource ****************************************************************************************** */ @@ -149,7 +150,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.40.00.00 2017-07-11" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.40.00.01 2017-10-30" #include /* ************************************************************************** @@ -187,7 +188,7 @@ static void arcmsr_polling_devmap(void *arg); static void arcmsr_srb_timeout(void *arg); static void arcmsr_hbd_postqueue_isr(struct AdapterControlBlock *acb); static void arcmsr_hbe_postqueue_isr(struct AdapterControlBlock *acb); -void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb); +static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb); #ifdef ARCMSR_DEBUG1 static void arcmsr_dump_data(struct AdapterControlBlock *acb); #endif @@ -910,6 +911,10 @@ static void arcmsr_drain_donequeue(struct AdapterContr /* check if command done with no error*/ switch (acb->adapter_type) { + case ACB_ADAPTER_TYPE_A: + case ACB_ADAPTER_TYPE_B: + srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ + break; case ACB_ADAPTER_TYPE_C: case ACB_ADAPTER_TYPE_D: srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb & 0xFFFFFFE0)); /*frame must be 32 bytes aligned*/ @@ -917,8 +922,6 @@ static void arcmsr_drain_donequeue(struct AdapterContr case ACB_ADAPTER_TYPE_E: srb = acb->psrb_pool[flag_srb]; break; - case ACB_ADAPTER_TYPE_A: - case ACB_ADAPTER_TYPE_B: default: srb = (struct CommandControlBlock *)(acb->vir2phy_offset+(flag_srb << 5));/*frame must be 32 bytes aligned*/ break; @@ -1585,8 +1588,7 @@ static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct u_int8_t *iop_data; u_int32_t iop_len; - if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) || - (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { + if(acb->adapter_type >= ACB_ADAPTER_TYPE_B) { return(arcmsr_Read_iop_rqbuffer_data_D(acb, prbuffer)); } iop_data = (u_int8_t *)prbuffer->data; @@ -1681,8 +1683,7 @@ static void arcmsr_Write_data_2iop_wqbuffer(struct Ada u_int8_t *iop_data; int32_t allxfer_len=0; - if((acb->adapter_type == ACB_ADAPTER_TYPE_C) || (acb->adapter_type == ACB_ADAPTER_TYPE_D) || - (acb->adapter_type == ACB_ADAPTER_TYPE_E)) { + if(acb->adapter_type >= ACB_ADAPTER_TYPE_B) { arcmsr_Write_data_2iop_wqbuffer_D(acb); return; } @@ -2495,7 +2496,7 @@ static void arcmsr_iop_parking(struct AdapterControlBl ** ************************************************************************ */ -u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_cmd, caddr_t arg) +static u_int32_t arcmsr_iop_ioctlcmd(struct AdapterControlBlock *acb, u_int32_t ioctl_cmd, caddr_t arg) { struct CMD_MESSAGE_FIELD *pcmdmessagefld; u_int32_t retvalue = EINVAL; @@ -2683,7 +2684,7 @@ static void arcmsr_free_srb(struct CommandControlBlock ************************************************************************** ************************************************************************** */ -struct CommandControlBlock *arcmsr_get_freesrb(struct AdapterControlBlock *acb) +static struct CommandControlBlock *arcmsr_get_freesrb(struct AdapterControlBlock *acb) { struct CommandControlBlock *srb = NULL; u_int32_t workingsrb_startindex, workingsrb_doneindex; @@ -4115,12 +4116,11 @@ static void arcmsr_clear_doorbell_queue_buffer( struct outbound_doorbell = CHIP_REG_READ32(HBA_MessageUnit, 0, outbound_doorbell); CHIP_REG_WRITE32(HBA_MessageUnit, 0, outbound_doorbell, outbound_doorbell); /*clear doorbell interrupt */ CHIP_REG_WRITE32(HBA_MessageUnit, 0, inbound_doorbell, ARCMSR_INBOUND_DRIVER_DATA_READ_OK); - } break; case ACB_ADAPTER_TYPE_B: { struct HBB_MessageUnit *phbbmu = (struct HBB_MessageUnit *)acb->pmu; - WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_MESSAGE_INT_CLEAR_PATTERN);/*clear interrupt and message state*/ + WRITE_CHIP_REG32(0, phbbmu->iop2drv_doorbell, ARCMSR_DOORBELL_INT_CLEAR_PATTERN);/*clear interrupt and message state*/ WRITE_CHIP_REG32(0, phbbmu->drv2iop_doorbell, ARCMSR_DRV2IOP_DATA_READ_OK); /* let IOP know data has been read */ } @@ -4139,7 +4139,6 @@ static void arcmsr_clear_doorbell_queue_buffer( struct outbound_doorbell = CHIP_REG_READ32(HBD_MessageUnit, 0, outbound_doorbell); CHIP_REG_WRITE32(HBD_MessageUnit, 0, outbound_doorbell, outbound_doorbell); /*clear doorbell interrupt */ CHIP_REG_WRITE32(HBD_MessageUnit, 0, inbound_doorbell, ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ); - } break; case ACB_ADAPTER_TYPE_E: { @@ -4353,7 +4352,8 @@ static void arcmsr_map_free_srb(void *arg, bus_dma_seg srb_phyaddr = srb_phyaddr + SRB_SIZE; srb_tmp = (struct CommandControlBlock *)((unsigned long)srb_tmp + SRB_SIZE); } - acb->pCompletionQ = (pCompletion_Q)srb_tmp; + if (acb->adapter_type == ACB_ADAPTER_TYPE_E) + acb->pCompletionQ = (pCompletion_Q)srb_tmp; acb->vir2phy_offset = (unsigned long)srb_tmp - (unsigned long)srb_phyaddr; } /* @@ -4414,7 +4414,9 @@ static u_int32_t arcmsr_initialize(device_t dev) case PCIDevVenIDARC1213: case PCIDevVenIDARC1223: { acb->adapter_type = ACB_ADAPTER_TYPE_C; - if (acb->sub_device_id == ARECA_SUB_DEV_ID_1883) + if ((acb->sub_device_id == ARECA_SUB_DEV_ID_1883) || + (acb->sub_device_id == ARECA_SUB_DEV_ID_1216) || + (acb->sub_device_id == ARECA_SUB_DEV_ID_1226)) acb->adapter_bus_speed = ACB_BUS_SPEED_12G; else acb->adapter_bus_speed = ACB_BUS_SPEED_6G; @@ -4598,7 +4600,7 @@ static u_int32_t arcmsr_initialize(device_t dev) acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); acb->pmu = (struct MessageUnit_UNION *)mem_base0; - acb->rid = 0; + acb->rid[0] = rid0; } break; case ACB_ADAPTER_TYPE_B: { @@ -4606,19 +4608,8 @@ static u_int32_t arcmsr_initialize(device_t dev) struct CommandControlBlock *freesrb; u_int32_t rid[]={ PCIR_BAR(0), PCIR_BAR(2) }; vm_offset_t mem_base[]={0,0}; - u_long size; - if (vendor_dev_id == PCIDevVenIDARC1203) - size = sizeof(struct HBB_DOORBELL_1203); - else - size = sizeof(struct HBB_DOORBELL); for(i=0; i < 2; i++) { - if(i == 0) { - acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid[i], - RF_ACTIVE); - } else { - acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid[i], - RF_ACTIVE); - } + acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid[i], RF_ACTIVE); if(acb->sys_res_arcmsr[i] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource %d failure!\n", device_get_unit(dev), i); @@ -4654,7 +4645,8 @@ static u_int32_t arcmsr_initialize(device_t dev) phbbmu->iop2drv_doorbell = offsetof(struct HBB_DOORBELL, iop2drv_doorbell); phbbmu->iop2drv_doorbell_mask = offsetof(struct HBB_DOORBELL, iop2drv_doorbell_mask); } - acb->rid = 0; + acb->rid[0] = rid[0]; + acb->rid[1] = rid[1]; } break; case ACB_ADAPTER_TYPE_C: { @@ -4681,7 +4673,7 @@ static u_int32_t arcmsr_initialize(device_t dev) acb->btag[0] = rman_get_bustag(acb->sys_res_arcmsr[0]); acb->bhandle[0] = rman_get_bushandle(acb->sys_res_arcmsr[0]); acb->pmu = (struct MessageUnit_UNION *)mem_base0; - acb->rid = 1; + acb->rid[0] = rid0; } break; case ACB_ADAPTER_TYPE_D: { @@ -4711,14 +4703,14 @@ static u_int32_t arcmsr_initialize(device_t dev) acb->pmu = (struct MessageUnit_UNION *)((unsigned long)acb->uncacheptr+ARCMSR_SRBS_POOL_SIZE); phbdmu = (struct HBD_MessageUnit0 *)acb->pmu; phbdmu->phbdmu = (struct HBD_MessageUnit *)mem_base0; - acb->rid = 0; + acb->rid[0] = rid0; } break; case ACB_ADAPTER_TYPE_E: { u_int32_t rid0 = PCIR_BAR(1); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, sizeof(struct HBE_MessageUnit), RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); @@ -4741,7 +4733,7 @@ static u_int32_t arcmsr_initialize(device_t dev) acb->doneq_index = 0; acb->in_doorbell = 0; acb->out_doorbell = 0; - acb->rid = 1; + acb->rid[0] = rid0; CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /*clear interrupt*/ CHIP_REG_WRITE32(HBE_MessageUnit, 0, iobound_doorbell, ARCMSR_HBEMU_DOORBELL_SYNC); /* synchronize doorbell to 0 */ } @@ -4773,7 +4765,7 @@ static int arcmsr_setup_msix(struct AdapterControlBloc int i; for (i = 0; i < acb->msix_vectors; i++) { - acb->irq_id[i] = acb->rid + i; + acb->irq_id[i] = 1 + i; acb->irqres[i] = bus_alloc_resource_any(acb->pci_dev, SYS_RES_IRQ, &acb->irq_id[i], RF_ACTIVE); if (acb->irqres[i] == NULL) { @@ -4825,7 +4817,7 @@ static int arcmsr_attach(device_t dev) if (arcmsr_setup_msix(acb) == TRUE) goto irqx; } - acb->irq_id[0] = acb->rid; + acb->irq_id[0] = 0; irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &acb->irq_id[0], RF_SHAREABLE | RF_ACTIVE); if(irqres == NULL || #if __FreeBSD_version >= 700025 @@ -4957,7 +4949,9 @@ static int arcmsr_probe(device_t dev) case PCIDevVenIDARC1882: case PCIDevVenIDARC1213: case PCIDevVenIDARC1223: - if (sub_device_id == ARECA_SUB_DEV_ID_1883) + if ((sub_device_id == ARECA_SUB_DEV_ID_1883) || + (sub_device_id == ARECA_SUB_DEV_ID_1216) || + (sub_device_id == ARECA_SUB_DEV_ID_1226)) type = "SAS 12G"; else type = "SAS 6G"; @@ -5027,7 +5021,7 @@ static int arcmsr_shutdown(device_t dev) ************************************************************************ ************************************************************************ */ -void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb) +static void arcmsr_teardown_intr(device_t dev, struct AdapterControlBlock *acb) { int i; @@ -5066,7 +5060,7 @@ static int arcmsr_detach(device_t dev) arcmsr_shutdown(dev); arcmsr_free_resource(acb); for(i=0; (acb->sys_res_arcmsr[i]!=NULL) && (i<2); i++) { - bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(i), acb->sys_res_arcmsr[i]); + bus_release_resource(dev, SYS_RES_MEMORY, acb->rid[i], acb->sys_res_arcmsr[i]); } ARCMSR_LOCK_ACQUIRE(&acb->isr_lock); xpt_async(AC_LOST_DEVICE, acb->ppath, NULL); @@ -5089,4 +5083,3 @@ static void arcmsr_dump_data(struct AdapterControlBloc printf("Queued Command Count =0x%x\n",acb->srboutstandingcount); } #endif - Modified: head/sys/dev/arcmsr/arcmsr.h ============================================================================== --- head/sys/dev/arcmsr/arcmsr.h Wed Nov 8 03:10:40 2017 (r325531) +++ head/sys/dev/arcmsr/arcmsr.h Wed Nov 8 08:21:17 2017 (r325532) @@ -125,8 +125,10 @@ #define ARECA_SUB_DEV_ID_1884 0x1884 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1216 0x1216 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */ #define ARECA_SUB_DEV_ID_1223 0x1223 /* Subsystem Device ID */ +#define ARECA_SUB_DEV_ID_1226 0x1226 /* Subsystem Device ID */ #define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ @@ -1326,7 +1328,7 @@ struct AdapterControlBlock { u_int32_t completionQ_entry; pCompletion_Q pCompletionQ; int msix_vectors; - int rid; + int rid[2]; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-all@freebsd.org Wed Nov 8 08:37:07 2017 Return-Path: Delivered-To: svn-src-all@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 35CC1E7156B; Wed, 8 Nov 2017 08:37:07 +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 F382E7069C; Wed, 8 Nov 2017 08:37:06 +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 vA88b6AP055183; Wed, 8 Nov 2017 08:37:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA88b6V8055182; Wed, 8 Nov 2017 08:37:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711080837.vA88b6V8055182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 8 Nov 2017 08:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325533 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 325533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 08:37:07 -0000 Author: hselasky Date: Wed Nov 8 08:37:05 2017 New Revision: 325533 URL: https://svnweb.freebsd.org/changeset/base/325533 Log: Make the dma_alloc_coherent() function in the LinuxKPI NULL safe with regard to the "dev" argument. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Wed Nov 8 08:21:17 2017 (r325532) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Wed Nov 8 08:37:05 2017 (r325533) @@ -127,7 +127,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dm size_t align; void *mem; - if (dev->dma_mask) + if (dev != NULL && dev->dma_mask) high = *dev->dma_mask; else if (flag & GFP_DMA32) high = BUS_SPACE_MAXADDR_32BIT; From owner-svn-src-all@freebsd.org Wed Nov 8 08:53:46 2017 Return-Path: Delivered-To: svn-src-all@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 6541EE71961; Wed, 8 Nov 2017 08:53:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F04CC70E72; Wed, 8 Nov 2017 08:53:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA88rjSt063401; Wed, 8 Nov 2017 08:53:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA88ribj063395; Wed, 8 Nov 2017 08:53:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711080853.vA88ribj063395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 8 Nov 2017 08:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325534 - in stable/11: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common cd... X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common cddl/contrib/opensolaris/li... X-SVN-Commit-Revision: 325534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 08:53:46 -0000 Author: avg Date: Wed Nov 8 08:53:44 2017 New Revision: 325534 URL: https://svnweb.freebsd.org/changeset/base/325534 Log: MFC r324163: MFV r323530,r323533,r323534: 7431 ZFS Channel Programs, and followups Also MFC-ed are the following fixes: - r324164 Add several new files to the files enabled by ZFS kernel option - r324178 unbreak kernel builds on sparc64 and powerpc - r324194 fix incorrect use of getzfsvfs_impl in r324163 - r324292 really unbreak kernel builds on sparc64 and powerpc64 Added: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 - copied unchanged from r324163, head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ - copied from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h - copied unchanged from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp_global.h - copied unchanged from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp_global.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp_iter.h - copied unchanged from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp_iter.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp_prop.h - copied unchanged from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp_prop.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c - copied unchanged from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c - copied, changed from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_get.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c - copied unchanged from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_iter.c - copied unchanged from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_iter.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c - copied unchanged from r324163, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/11/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/11/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h stable/11/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/11/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/11/cddl/lib/libzpool/Makefile stable/11/cddl/sbin/zfs/Makefile stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c stable/11/sys/cddl/compat/opensolaris/sys/sunddi.h stable/11/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/11/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/11/sys/conf/files stable/11/sys/conf/kern.pre.mk stable/11/sys/modules/zfs/Makefile Directory Properties: stable/11/ (props changed) Copied: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 (from r324163, head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Wed Nov 8 08:53:44 2017 (r325534, copy of r324163, head/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8) @@ -0,0 +1,499 @@ +.\" This file and its contents are supplied under the terms of the +.\" Common Development and Distribution License ("CDDL"), version 1.0. +.\" You may only use this file in accordance with the terms of version +.\" 1.0 of the CDDL. +.\" +.\" A full copy of the text of the CDDL should have accompanied this +.\" source. A copy of the CDDL is also available via the Internet at +.\" http://www.illumos.org/license/CDDL. +.\" +.\" +.\" Copyright (c) 2016 by Delphix. All Rights Reserved. +.\" +.Dd September 28, 2017 +.Dt ZFS-PROGRAM 1M +.Os +.Sh NAME +.Nm zfs program +.Nd executes ZFS channel programs +.Sh SYNOPSIS +.Cm zfs program +.Op Fl t Ar instruction-limit +.Op Fl m Ar memory-limit +.Ar pool +.Ar script +.\".Op Ar optional arguments to channel program +.Sh DESCRIPTION +The ZFS channel program interface allows ZFS administrative operations to be +run programmatically as a Lua script. +The entire script is executed atomically, with no other administrative +operations taking effect concurrently. +A library of ZFS calls is made available to channel program scripts. +Channel programs may only be run with root privileges. +.Pp +A modified version of the Lua 5.2 interpreter is used to run channel program +scripts. +The Lua 5.2 manual can be found at: +.Bd -centered -offset indent +.Lk http://www.lua.org/manual/5.2/ +.Ed +.Pp +The channel program given by +.Ar script +will be run on +.Ar pool , +and any attempts to access or modify other pools will cause an error. +.Sh OPTIONS +.Bl -tag -width "-t" +.It Fl t Ar instruction-limit +Execution time limit, in number of Lua instructions to execute. +If a channel program executes more than the specified number of instructions, +it will be stopped and an error will be returned. +The default limit is 10 million instructions, and it can be set to a maximum of +100 million instructions. +.It Fl m Ar memory-limit +Memory limit, in bytes. +If a channel program attempts to allocate more memory than the given limit, it +will be stopped and an error returned. +The default memory limit is 10 MB, and can be set to a maximum of 100 MB. +.El +.Pp +All remaining argument strings will be passed directly to the Lua script as +described in the +.Sx LUA INTERFACE +section below. +.Sh LUA INTERFACE +A channel program can be invoked either from the command line, or via a library +call to +.Fn lzc_channel_program . +.Ss Arguments +Arguments passed to the channel program are converted to a Lua table. +If invoked from the command line, extra arguments to the Lua script will be +accessible as an array stored in the argument table with the key 'argv': +.Bd -literal -offset indent +args = ... +argv = args["argv"] +-- argv == {1="arg1", 2="arg2", ...} +.Ed +.Pp +If invoked from the libZFS interface, an arbitrary argument list can be +passed to the channel program, which is accessible via the same +"..." syntax in Lua: +.Bd -literal -offset indent +args = ... +-- args == {"foo"="bar", "baz"={...}, ...} +.Ed +.Pp +Note that because Lua arrays are 1-indexed, arrays passed to Lua from the +libZFS interface will have their indices incremented by 1. +That is, the element +in +.Va arr[0] +in a C array passed to a channel program will be stored in +.Va arr[1] +when accessed from Lua. +.Ss Return Values +Lua return statements take the form: +.Bd -literal -offset indent +return ret0, ret1, ret2, ... +.Ed +.Pp +Return statements returning multiple values are permitted internally in a +channel program script, but attempting to return more than one value from the +top level of the channel program is not permitted and will throw an error. +However, tables containing multiple values can still be returned. +If invoked from the command line, a return statement: +.Bd -literal -offset indent +a = {foo="bar", baz=2} +return a +.Ed +.Pp +Will be output formatted as: +.Bd -literal -offset indent +Channel program fully executed with return value: + return: + baz: 2 + foo: 'bar' +.Ed +.Ss Fatal Errors +If the channel program encounters a fatal error while running, a non-zero exit +status will be returned. +If more information about the error is available, a singleton list will be +returned detailing the error: +.Bd -literal -offset indent +error: "error string, including Lua stack trace" +.Ed +.Pp +If a fatal error is returned, the channel program may have not executed at all, +may have partially executed, or may have fully executed but failed to pass a +return value back to userland. +.Pp +If the channel program exhausts an instruction or memory limit, a fatal error +will be generated and the program will be stopped, leaving the program partially +executed. +No attempt is made to reverse or undo any operations already performed. +Note that because both the instruction count and amount of memory used by a +channel program are deterministic when run against the same inputs and +filesystem state, as long as a channel program has run successfully once, you +can guarantee that it will finish successfully against a similar size system. +.Pp +If a channel program attempts to return too large a value, the program will +fully execute but exit with a nonzero status code and no return value. +.Pp +.Em Note: +ZFS API functions do not generate Fatal Errors when correctly invoked, they +return an error code and the channel program continues executing. +See the +.Sx ZFS API +section below for function-specific details on error return codes. +.Ss Lua to C Value Conversion +When invoking a channel program via the libZFS interface, it is necessary to +translate arguments and return values from Lua values to their C equivalents, +and vice-versa. +.Pp +There is a correspondence between nvlist values in C and Lua tables. +A Lua table which is returned from the channel program will be recursively +converted to an nvlist, with table values converted to their natural +equivalents: +.Bd -literal -offset indent +string -> string +number -> int64 +boolean -> boolean_value +nil -> boolean (no value) +table -> nvlist +.Ed +.Pp +Likewise, table keys are replaced by string equivalents as follows: +.Bd -literal -offset indent +string -> no change +number -> signed decimal string ("%lld") +boolean -> "true" | "false" +.Ed +.Pp +Any collision of table key strings (for example, the string "true" and a +true boolean value) will cause a fatal error. +.Pp +Lua numbers are represented internally as signed 64-bit integers. +.Sh LUA STANDARD LIBRARY +The following Lua built-in base library functions are available: +.Bd -literal -offset indent +assert rawlen +collectgarbage rawget +error rawset +getmetatable select +ipairs setmetatable +next tonumber +pairs tostring +rawequal type +.Ed +.Pp +All functions in the +.Em coroutine , +.Em string , +and +.Em table +built-in submodules are also available. +A complete list and documentation of these modules is available in the Lua +manual. +.Pp +The following functions base library functions have been disabled and are +not available for use in channel programs: +.Bd -literal -offset indent +dofile +loadfile +load +pcall +print +xpcall +.Ed +.Sh ZFS API +.Ss Function Arguments +Each API function takes a fixed set of required positional arguments and +optional keyword arguments. +For example, the destroy function takes a single positional string argument +(the name of the dataset to destroy) and an optional "defer" keyword boolean +argument. +When using parentheses to specify the arguments to a Lua function, only +positional arguments can be used: +.Bd -literal -offset indent +zfs.sync.destroy("rpool@snap") +.Ed +.Pp +To use keyword arguments, functions must be called with a single argument that +is a Lua table containing entries mapping integers to positional arguments and +strings to keyword arguments: +.Bd -literal -offset indent +zfs.sync.destroy({1="rpool@snap", defer=true}) +.Ed +.Pp +The Lua language allows curly braces to be used in place of parenthesis as +syntactic sugar for this calling convention: +.Bd -literal -offset indent +zfs.sync.snapshot{"rpool@snap", defer=true} +.Ed +.Ss Function Return Values +If an API function succeeds, it returns 0. +If it fails, it returns an error code and the channel program continues +executing. +API functions do not generate Fatal Errors except in the case of an +unrecoverable internal file system error. +.Pp +In addition to returning an error code, some functions also return extra +details describing what caused the error. +This extra description is given as a second return value, and will always be a +Lua table, or Nil if no error details were returned. +Different keys will exist in the error details table depending on the function +and error case. +Any such function may be called expecting a single return value: +.Bd -literal -offset indent +errno = zfs.sync.promote(dataset) +.Ed +.Pp +Or, the error details can be retrieved: +.Bd -literal -offset indent +errno, details = zfs.sync.promote(dataset) +if (errno == EEXIST) then + assert(details ~= Nil) + list_of_conflicting_snapshots = details +end +.Ed +.Pp +The following global aliases for API function error return codes are defined +for use in channel programs: +.Bd -literal -offset indent +EPERM ECHILD ENODEV ENOSPC +ENOENT EAGAIN ENOTDIR ESPIPE +ESRCH ENOMEM EISDIR EROFS +EINTR EACCES EINVAL EMLINK +EIO EFAULT ENFILE EPIPE +ENXIO ENOTBLK EMFILE EDOM +E2BIG EBUSY ENOTTY ERANGE +ENOEXEC EEXIST ETXTBSY EDQUOT +EBADF EXDEV EFBIG +.Ed +.Ss API Functions +For detailed descriptions of the exact behavior of any zfs administrative +operations, see the main +.Xr zfs 1 +manual page. +.Bl -tag -width "xx" +.It Em zfs.debug(msg) +Record a debug message in the zfs_dbgmsg log. +A log of these messages can be printed via mdb's "::zfs_dbgmsg" command, or +can be monitored live by running: +.Bd -literal -offset indent + dtrace -n 'zfs-dbgmsg{trace(stringof(arg0))}' +.Ed +.Pp +msg (string) +.Bd -ragged -compact -offset "xxxx" +Debug message to be printed. +.Ed +.It Em zfs.get_prop(dataset, property) +Returns two values. +First, a string, number or table containing the property value for the given +dataset. +Second, a string containing the source of the property (i.e. the name of the +dataset in which it was set or nil if it is readonly). +Throws a Lua error if the dataset is invalid or the property doesn't exist. +Note that Lua only supports int64 number types whereas ZFS number properties +are uint64. +This means very large values (like guid) may wrap around and appear negative. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Filesystem or snapshot path to retrieve properties from. +.Ed +.Pp +property (string) +.Bd -ragged -compact -offset "xxxx" +Name of property to retrieve. +All filesystem, snapshot and volume properties are supported except +for 'mounted' and 'iscsioptions.' +Also supports the 'written@snap' and 'written#bookmark' properties and +the '@id' properties, though the id must be in numeric +form. +.Ed +.El +.Bl -tag -width "xx" +.It Sy zfs.sync submodule +The sync submodule contains functions that modify the on-disk state. +They are executed in "syncing context". +.Pp +The available sync submodule functions are as follows: +.Bl -tag -width "xx" +.It Em zfs.sync.destroy(dataset, [defer=true|false]) +Destroy the given dataset. +Returns 0 on successful destroy, or a nonzero error code if the dataset could +not be destroyed (for example, if the dataset has any active children or +clones). +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Filesystem or snapshot to be destroyed. +.Ed +.Pp +[optional] defer (boolean) +.Bd -ragged -compact -offset "xxxx" +Valid only for destroying snapshots. +If set to true, and the snapshot has holds or clones, allows the snapshot to be +marked for deferred deletion rather than failing. +.Ed +.It Em zfs.sync.promote(dataset) +Promote the given clone to a filesystem. +Returns 0 on successful promotion, or a nonzero error code otherwise. +If EEXIST is returned, the second return value will be an array of the clone's +snapshots whose names collide with snapshots of the parent filesystem. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Clone to be promoted. +.Ed +.El +.It Sy zfs.check submodule +For each function in the zfs.sync submodule, there is a corresponding zfs.check +function which performs a "dry run" of the same operation. +Each takes the same arguments as its zfs.sync counterpart and returns 0 if the +operation would succeed, or a non-zero error code if it would fail, along with +any other error details. +That is, each has the same behavior as the corresponding sync function except +for actually executing the requested change. +For example, +.Em zfs.check.destroy("fs") +returns 0 if +.Em zfs.sync.destroy("fs") +would successfully destroy the dataset. +.Pp +The available zfs.check functions are: +.Bl -tag -width "xx" +.It Em zfs.check.destroy(dataset, [defer=true|false]) +.It Em zfs.check.promote(dataset) +.El +.It Sy zfs.list submodule +The zfs.list submodule provides functions for iterating over datasets and +properties. +Rather than returning tables, these functions act as Lua iterators, and are +generally used as follows: +.Bd -literal -offset indent +for child in zfs.list.children("rpool") do + ... +end +.Ed +.Pp +The available zfs.list functions are: +.Bl -tag -width "xx" +.It Em zfs.list.clones(snapshot) +Iterate through all clones of the given snapshot. +.Pp +snapshot (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid snapshot path in the current pool. +.Ed +.It Em zfs.list.snapshots(dataset) +Iterate through all snapshots of the given dataset. +Each snapshot is returned as a string containing the full dataset name, e.g. +"pool/fs@snap". +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid filesystem or volume. +.Ed +.It Em zfs.list.children(dataset) +Iterate through all direct children of the given dataset. +Each child is returned as a string containing the full dataset name, e.g. +"pool/fs/child". +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid filesystem or volume. +.Ed +.It Em zfs.list.properties(dataset) +Iterate through all user properties for the given dataset. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid filesystem, snapshot, or volume. +.Ed +.It Em zfs.list.system_properties(dataset) +Returns an array of strings, the names of the valid system (non-user defined) +properties for the given dataset. +Throws a Lua error if the dataset is invalid. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Must be a valid filesystem, snapshot or volume. +.Ed +.El +.El +.Sh EXAMPLES +.Ss Example 1 +The following channel program recursively destroys a filesystem and all its +snapshots and children in a naive manner. +Note that this does not involve any error handling or reporting. +.Bd -literal -offset indent +function destroy_recursive(root) + for child in zfs.list.children(root) do + destroy_recursive(child) + end + for snap in zfs.list.snapshots(root) do + zfs.sync.destroy(snap) + end + zfs.sync.destroy(root) +end +destroy_recursive("pool/somefs") +.Ed +.Ss Example 2 +A more verbose and robust version of the same channel program, which +properly detects and reports errors, and also takes the dataset to destroy +as a command line argument, would be as follows: +.Bd -literal -offset indent +succeeded = {} +failed = {} + +function destroy_recursive(root) + for child in zfs.list.children(root) do + destroy_recursive(child) + end + for snap in zfs.list.snapshots(root) do + err = zfs.sync.destroy(snap) + if (err ~= 0) then + failed[snap] = err + else + succeeded[snap] = err + end + end + err = zfs.sync.destroy(root) + if (err ~= 0) then + failed[root] = err + else + succeeded[root] = err + end +end + +args = ... +argv = args["argv"] + +destroy_recursive(argv[1]) + +results = {} +results["succeeded"] = succeeded +results["failed"] = failed +return results +.Ed +.Ss Example 3 +The following function performs a forced promote operation by attempting to +promote the given clone and destroying any conflicting snapshots. +.Bd -literal -offset indent +function force_promote(ds) + errno, details = zfs.check.promote(ds) + if (errno == EEXIST) then + assert(details ~= Nil) + for i, snap in ipairs(details) do + zfs.sync.destroy(ds .. "@" .. snap) + end + elseif (errno ~= 0) then + return errno + end + return zfs.sync.promote(ds) +end +.Ed Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Nov 8 08:37:05 2017 (r325533) +++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Wed Nov 8 08:53:44 2017 (r325534) @@ -286,6 +286,12 @@ .Ar snapshot .Op Ar snapshot Ns | Ns Ar filesystem .Nm +.Cm program +.Op Fl t Ar timeout +.Op Fl m Ar memory_limit +.Ar pool script +.Op Ar arg1 No ... +.Nm .Cm jail .Ar jailid Ns | Ns Ar jailname filesystem .Nm @@ -3284,6 +3290,48 @@ Give more parsable tab-separated output, without heade arrows. .It Fl t Display the path's inode change time as the first column of output. +.El +.It Xo +.Nm +.Cm program +.Op Fl t Ar timeout +.Op Fl m Ar memory_limit +.Ar pool script +.Op Ar arg1 No ... +.Xc +.Pp +Executes +.Ar script +as a ZFS channel program on +.Ar pool . +The ZFS channel +program interface allows ZFS administrative operations to be run +programmatically via a Lua script. +The entire script is executed atomically, with no other administrative +operations taking effect concurrently. +A library of ZFS calls is made available to channel program scripts. +Channel programs may only be run with root privileges. +.Pp +For full documentation of the ZFS channel program interface, see the manual +page for +.Xr zfs-program 8 . +.Bl -tag -width indent +.It Fl t Ar timeout +Execution time limit, in milliseconds. +If a channel program executes for longer than the provided timeout, it will +be stopped and an error will be returned. +The default timeout is 1000 ms, and can be set to a maximum of 10000 ms. +.It Fl m Ar memory-limit +Memory limit, in bytes. +If a channel program attempts to allocate more memory than the given limit, +it will be stopped and an error returned. +The default memory limit is 10 MB, and can be set to a maximum of 100 MB. +.Pp +All remaining argument strings are passed directly to the channel program as +arguments. +See +.Xr zfs-program 8 +for more information. .El .It Xo .Nm Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Nov 8 08:37:05 2017 (r325533) +++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Wed Nov 8 08:53:44 2017 (r325534) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -111,6 +112,7 @@ static int zfs_do_diff(int argc, char **argv); static int zfs_do_jail(int argc, char **argv); static int zfs_do_unjail(int argc, char **argv); static int zfs_do_bookmark(int argc, char **argv); +static int zfs_do_channel_program(int argc, char **argv); /* * Enable a reasonable set of defaults for libumem debugging on DEBUG builds. @@ -160,6 +162,7 @@ typedef enum { HELP_RELEASE, HELP_DIFF, HELP_BOOKMARK, + HELP_CHANNEL_PROGRAM, } zfs_help_t; typedef struct zfs_command { @@ -187,6 +190,7 @@ static zfs_command_t command_table[] = { { "promote", zfs_do_promote, HELP_PROMOTE }, { "rename", zfs_do_rename, HELP_RENAME }, { "bookmark", zfs_do_bookmark, HELP_BOOKMARK }, + { "program", zfs_do_channel_program, HELP_CHANNEL_PROGRAM }, { NULL }, { "list", zfs_do_list, HELP_LIST }, { NULL }, @@ -340,6 +344,10 @@ get_usage(zfs_help_t idx) "[snapshot|filesystem]\n")); case HELP_BOOKMARK: return (gettext("\tbookmark \n")); + case HELP_CHANNEL_PROGRAM: + return (gettext("\tprogram [-t ] " + "[-m ] " + "[lua args...]\n")); } abort(); @@ -368,6 +376,18 @@ safe_malloc(size_t size) return (data); } +void * +safe_realloc(void *data, size_t size) +{ + void *newp; + if ((newp = realloc(data, size)) == NULL) { + free(data); + nomem(); + } + + return (newp); +} + static char * safe_strdup(char *str) { @@ -7094,6 +7114,194 @@ zfs_do_bookmark(int argc, char **argv) dgettext(TEXT_DOMAIN, err_msg)); } + return (ret != 0); + +usage: + usage(B_FALSE); + return (-1); +} + +static int +zfs_do_channel_program(int argc, char **argv) +{ + int ret, fd; + char c; + char *progbuf, *filename, *poolname; + size_t progsize, progread; + nvlist_t *outnvl; + uint64_t instrlimit = ZCP_DEFAULT_INSTRLIMIT; + uint64_t memlimit = ZCP_DEFAULT_MEMLIMIT; + zpool_handle_t *zhp; + + /* check options */ + while (-1 != + (c = getopt(argc, argv, "t:(instr-limit)m:(memory-limit)"))) { + switch (c) { + case 't': + case 'm': { + uint64_t arg; + char *endp; + + errno = 0; + arg = strtoull(optarg, &endp, 0); + if (errno != 0 || *endp != '\0') { + (void) fprintf(stderr, gettext( + "invalid argument " + "'%s': expected integer\n"), optarg); + goto usage; + } + + if (c == 't') { + if (arg > ZCP_MAX_INSTRLIMIT || arg == 0) { + (void) fprintf(stderr, gettext( + "Invalid instruction limit: " + "%s\n"), optarg); + return (1); + } else { + instrlimit = arg; + } + } else { + ASSERT3U(c, ==, 'm'); + if (arg > ZCP_MAX_MEMLIMIT || arg == 0) { + (void) fprintf(stderr, gettext( + "Invalid memory limit: " + "%s\n"), optarg); + return (1); + } else { + memlimit = arg; + } + } + break; + } + case '?': + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + goto usage; + } + } + + argc -= optind; + argv += optind; + + if (argc < 2) { + (void) fprintf(stderr, + gettext("invalid number of arguments\n")); + goto usage; + } + + poolname = argv[0]; + filename = argv[1]; + if (strcmp(filename, "-") == 0) { + fd = 0; + filename = "standard input"; + } else if ((fd = open(filename, O_RDONLY)) < 0) { + (void) fprintf(stderr, gettext("cannot open '%s': %s\n"), + filename, strerror(errno)); + return (1); + } + + if ((zhp = zpool_open(g_zfs, poolname)) == NULL) { + (void) fprintf(stderr, gettext("cannot open pool '%s'"), + poolname); + return (1); + } + zpool_close(zhp); + + /* + * Read in the channel program, expanding the program buffer as + * necessary. + */ + progread = 0; + progsize = 1024; + progbuf = safe_malloc(progsize); + do { + ret = read(fd, progbuf + progread, progsize - progread); + progread += ret; + if (progread == progsize && ret > 0) { + progsize *= 2; + progbuf = safe_realloc(progbuf, progsize); + } + } while (ret > 0); + + if (fd != 0) + (void) close(fd); + if (ret < 0) { + free(progbuf); + (void) fprintf(stderr, + gettext("cannot read '%s': %s\n"), + filename, strerror(errno)); + return (1); + } + progbuf[progread] = '\0'; + + /* + * Any remaining arguments are passed as arguments to the lua script as + * a string array: + * { + * "argv" -> [ "arg 1", ... "arg n" ], + * } + */ + nvlist_t *argnvl = fnvlist_alloc(); + fnvlist_add_string_array(argnvl, ZCP_ARG_CLIARGV, argv + 2, argc - 2); + + ret = lzc_channel_program(poolname, progbuf, instrlimit, memlimit, + argnvl, &outnvl); + + if (ret != 0) { + /* + * On error, report the error message handed back by lua if one + * exists. Otherwise, generate an appropriate error message, + * falling back on strerror() for an unexpected return code. + */ + char *errstring = NULL; + if (nvlist_exists(outnvl, ZCP_RET_ERROR)) { + (void) nvlist_lookup_string(outnvl, + ZCP_RET_ERROR, &errstring); + if (errstring == NULL) + errstring = strerror(ret); + } else { + switch (ret) { + case EINVAL: + errstring = + "Invalid instruction or memory limit."; + break; + case ENOMEM: + errstring = "Return value too large."; + break; + case ENOSPC: + errstring = "Memory limit exhausted."; + break; +#ifdef illumos + case ETIME: +#else + case ETIMEDOUT: +#endif + errstring = "Timed out."; + break; + case EPERM: + errstring = "Permission denied. Channel " + "programs must be run as root."; + break; + default: + errstring = strerror(ret); + } + } + (void) fprintf(stderr, + gettext("Channel program execution failed:\n%s\n"), + errstring); + } else { + (void) printf("Channel program fully executed "); + if (nvlist_empty(outnvl)) { + (void) printf("with no return value.\n"); + } else { + (void) printf("with return value:\n"); + dump_nvlist(outnvl, 4); + } + } + + free(progbuf); + fnvlist_free(outnvl); + fnvlist_free(argnvl); return (ret != 0); usage: Modified: stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Nov 8 08:37:05 2017 (r325533) +++ stable/11/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Nov 8 08:53:44 2017 (r325534) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2012 by Frederik Wessels. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved. @@ -5253,6 +5253,11 @@ get_history_one(zpool_handle_t *zhp, void *data) (void) printf(" output:\n"); dump_nvlist(fnvlist_lookup_nvlist(rec, ZPOOL_HIST_OUTPUT_NVL), 8); + } + if (nvlist_exists(rec, ZPOOL_HIST_ERRNO)) { + (void) printf(" errno: %lld\n", + fnvlist_lookup_int64(rec, + ZPOOL_HIST_ERRNO)); } } else { if (!cb->internal) Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Nov 8 08:37:05 2017 (r325533) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Nov 8 08:53:44 2017 (r325534) @@ -2356,6 +2356,74 @@ zfs_get_clones_nvl(zfs_handle_t *zhp) } /* + * Accepts a property and value and checks that the value + * matches the one found by the channel program. If they are + * not equal, print both of them. + */ +void +zcp_check(zfs_handle_t *zhp, zfs_prop_t prop, uint64_t intval, + const char *strval) +{ + if (!zhp->zfs_hdl->libzfs_prop_debug) + return; + int error; + char *poolname = zhp->zpool_hdl->zpool_name; + const char *program = + "args = ...\n" + "ds = args['dataset']\n" + "prop = args['property']\n" + "value, setpoint = zfs.get_prop(ds, prop)\n" + "return {value=value, setpoint=setpoint}\n"; + nvlist_t *outnvl; + nvlist_t *retnvl; + nvlist_t *argnvl = fnvlist_alloc(); + + fnvlist_add_string(argnvl, "dataset", zhp->zfs_name); + fnvlist_add_string(argnvl, "property", zfs_prop_to_name(prop)); + + error = lzc_channel_program(poolname, program, + 10 * 1000 * 1000, 10 * 1024 * 1024, argnvl, &outnvl); + + if (error == 0) { + retnvl = fnvlist_lookup_nvlist(outnvl, "return"); + if (zfs_prop_get_type(prop) == PROP_TYPE_NUMBER) { + int64_t ans; + error = nvlist_lookup_int64(retnvl, "value", &ans); + if (error != 0) { + (void) fprintf(stderr, "zcp check error: %u\n", + error); + return; + } + if (ans != intval) { + (void) fprintf(stderr, + "%s: zfs found %lld, but zcp found %lld\n", + zfs_prop_to_name(prop), + (longlong_t)intval, (longlong_t)ans); + } + } else { + char *str_ans; + error = nvlist_lookup_string(retnvl, "value", &str_ans); + if (error != 0) { + (void) fprintf(stderr, "zcp check error: %u\n", + error); + return; + } + if (strcmp(strval, str_ans) != 0) { + (void) fprintf(stderr, + "%s: zfs found %s, but zcp found %s\n", + zfs_prop_to_name(prop), + strval, str_ans); + } + } + } else { + (void) fprintf(stderr, + "zcp check failed, channel program error: %u\n", error); + } + nvlist_free(argnvl); + nvlist_free(outnvl); +} + +/* * Retrieve a property from the given object. If 'literal' is specified, then * numbers are left as exact values. Otherwise, numbers are converted to a * human-readable form. @@ -2401,6 +2469,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char &t) == 0) (void) snprintf(propbuf, proplen, "%llu", val); } + zcp_check(zhp, prop, val, NULL); break; case ZFS_PROP_MOUNTPOINT: @@ -2469,7 +2538,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char /* 'legacy' or 'none' */ (void) strlcpy(propbuf, str, proplen); } - + zcp_check(zhp, prop, NULL, propbuf); break; case ZFS_PROP_ORIGIN: @@ -2477,6 +2546,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char if (str == NULL) return (-1); (void) strlcpy(propbuf, str, proplen); + zcp_check(zhp, prop, NULL, str); break; case ZFS_PROP_CLONES: @@ -2491,7 +2561,6 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char if (get_numeric_property(zhp, prop, src, &source, &val) != 0) return (-1); - /* * If quota or reservation is 0, we translate this into 'none' * (unless literal is set), and indicate that it's the default @@ -2510,6 +2579,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char else zfs_nicenum(val, propbuf, proplen); } + zcp_check(zhp, prop, val, NULL); break; case ZFS_PROP_FILESYSTEM_LIMIT: @@ -2534,6 +2604,8 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char } else { zfs_nicenum(val, propbuf, proplen); } + + zcp_check(zhp, prop, val, NULL); break; case ZFS_PROP_REFRATIO: @@ -2543,6 +2615,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char (void) snprintf(propbuf, proplen, "%llu.%02llux", (u_longlong_t)(val / 100), (u_longlong_t)(val % 100)); + zcp_check(zhp, prop, val, NULL); break; case ZFS_PROP_TYPE: @@ -2563,6 +2636,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char abort(); } (void) snprintf(propbuf, proplen, "%s", str); + zcp_check(zhp, prop, NULL, propbuf); break; case ZFS_PROP_MOUNTED: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Nov 8 09:11:51 2017 Return-Path: Delivered-To: svn-src-all@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 13359E71F47; Wed, 8 Nov 2017 09:11:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0A9D71836; Wed, 8 Nov 2017 09:11:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA89Bnvs069729; Wed, 8 Nov 2017 09:11:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA89Bn1g069727; Wed, 8 Nov 2017 09:11:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711080911.vA89Bn1g069727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 8 Nov 2017 09:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325535 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 325535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 09:11:51 -0000 Author: avg Date: Wed Nov 8 09:11:49 2017 New Revision: 325535 URL: https://svnweb.freebsd.org/changeset/base/325535 Log: MFC r324168: MFV r323531: 8521 nvlist memory leak in get_clones_stat() and spa_load_best() Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Nov 8 08:53:44 2017 (r325534) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Nov 8 09:11:49 2017 (r325535) @@ -1808,10 +1808,10 @@ get_clones_stat(dsl_dataset_t *ds, nvlist_t *nv) fnvlist_add_nvlist(propval, ZPROP_VALUE, val); fnvlist_add_nvlist(nv, zfs_prop_to_name(ZFS_PROP_CLONES), propval); - } else { - nvlist_free(val); - nvlist_free(propval); } + + nvlist_free(val); + nvlist_free(propval); } /* Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Nov 8 08:53:44 2017 (r325534) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Nov 8 09:11:49 2017 (r325535) @@ -3101,6 +3101,8 @@ spa_load_best(spa_t *spa, spa_load_state_t state, int if (config && (rewind_error || state != SPA_LOAD_RECOVER)) spa_config_set(spa, config); + else + nvlist_free(config); if (state == SPA_LOAD_RECOVER) { ASSERT3P(loadinfo, ==, NULL); From owner-svn-src-all@freebsd.org Wed Nov 8 09:15:11 2017 Return-Path: Delivered-To: svn-src-all@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 2C483E71FED; Wed, 8 Nov 2017 09:15:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEDAA71A1D; Wed, 8 Nov 2017 09:15:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA89F920072066; Wed, 8 Nov 2017 09:15:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA89F9Pl072064; Wed, 8 Nov 2017 09:15:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711080915.vA89F9Pl072064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 8 Nov 2017 09:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325536 - in stable/11: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 325536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 09:15:11 -0000 Author: avg Date: Wed Nov 8 09:15:09 2017 New Revision: 325536 URL: https://svnweb.freebsd.org/changeset/base/325536 Log: MFC r324170: MFV r323794: 8605 zfs channel programs: zfs.exists undocumented and non-working Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Wed Nov 8 09:11:49 2017 (r325535) +++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Wed Nov 8 09:15:09 2017 (r325536) @@ -289,6 +289,18 @@ msg (string) .Bd -ragged -compact -offset "xxxx" Debug message to be printed. .Ed +.It Em zfs.exists(dataset) +Returns true if the given dataset exists, or false if it doesn't. +A fatal error will be thrown if the dataset is not in the target pool. +That is, in a channel program running on rpool, +zfs.exists("rpool/nonexistent_fs") returns false, but +zfs.exists("somepool/fs_that_may_exist") will error. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Dataset to check for existence. +Must be in the target pool. +.Ed .It Em zfs.get_prop(dataset, property) Returns two values. First, a string, number or table containing the property value for the given Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Wed Nov 8 09:11:49 2017 (r325535) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Wed Nov 8 09:15:09 2017 (r325536) @@ -717,7 +717,7 @@ zcp_exists(lua_State *state) return (luaL_error(state, "unexpected error %d", error)); } - return (0); + return (1); } /* From owner-svn-src-all@freebsd.org Wed Nov 8 09:16:33 2017 Return-Path: Delivered-To: svn-src-all@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 3ACF1E72067; Wed, 8 Nov 2017 09:16:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED69671B8E; Wed, 8 Nov 2017 09:16:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA89GWD0072187; Wed, 8 Nov 2017 09:16:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA89GVnk072183; Wed, 8 Nov 2017 09:16:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711080916.vA89GVnk072183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 8 Nov 2017 09:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325537 - in stable/11: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 325537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 09:16:33 -0000 Author: avg Date: Wed Nov 8 09:16:31 2017 New Revision: 325537 URL: https://svnweb.freebsd.org/changeset/base/325537 Log: MFC r324196: MFV r323912: 8592 ZFS channel programs - rollback Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Wed Nov 8 09:15:09 2017 (r325536) +++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Wed Nov 8 09:16:31 2017 (r325537) @@ -8,9 +8,9 @@ .\" http://www.illumos.org/license/CDDL. .\" .\" -.\" Copyright (c) 2016 by Delphix. All Rights Reserved. +.\" Copyright (c) 2016, 2017 by Delphix. All rights reserved. .\" -.Dd September 28, 2017 +.Dd October 02, 2016 .Dt ZFS-PROGRAM 1M .Os .Sh NAME @@ -361,6 +361,17 @@ dataset (string) .Bd -ragged -compact -offset "xxxx" Clone to be promoted. .Ed +.It Em zfs.sync.rollback(filesystem) +Rollback to the previous snapshot for a dataset. +Returns 0 on successful rollback, or a nonzero error code otherwise. +Rollbacks can be performed on filesystems or zvols, but not on snapshots +or mounted datasets. +EBUSY is returned in the case where the filesystem is mounted. +.Pp +filesystem (string) +.Bd -ragged -compact -offset "xxxx" +Filesystem to rollback. +.Ed .El .It Sy zfs.check submodule For each function in the zfs.sync submodule, there is a corresponding zfs.check @@ -380,6 +391,7 @@ The available zfs.check functions are: .Bl -tag -width "xx" .It Em zfs.check.destroy(dataset, [defer=true|false]) .It Em zfs.check.promote(dataset) +.It Em zfs.check.rollback(filesystem) .El .It Sy zfs.list submodule The zfs.list submodule provides functions for iterating over datasets and Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Nov 8 09:15:09 2017 (r325536) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Nov 8 09:16:31 2017 (r325537) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright (c) 2011 Martin Matuska - * Copyright (c) 2011, 2016 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -2538,14 +2538,7 @@ dsl_dataset_handoff_check(dsl_dataset_t *ds, void *own return (0); } -typedef struct dsl_dataset_rollback_arg { - const char *ddra_fsname; - const char *ddra_tosnap; - void *ddra_owner; - nvlist_t *ddra_result; -} dsl_dataset_rollback_arg_t; - -static int +int dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx) { dsl_dataset_rollback_arg_t *ddra = arg; @@ -2653,7 +2646,7 @@ dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx) return (0); } -static void +void dsl_dataset_rollback_sync(void *arg, dmu_tx_t *tx) { dsl_dataset_rollback_arg_t *ddra = arg; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Wed Nov 8 09:15:09 2017 (r325536) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Wed Nov 8 09:16:31 2017 (r325537) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -237,6 +237,13 @@ typedef struct dsl_dataset_promote_arg { cred_t *cr; } dsl_dataset_promote_arg_t; +typedef struct dsl_dataset_rollback_arg { + const char *ddra_fsname; + const char *ddra_tosnap; + void *ddra_owner; + nvlist_t *ddra_result; +} dsl_dataset_rollback_arg_t; + /* * The max length of a temporary tag prefix is the number of hex digits * required to express UINT64_MAX plus one for the hyphen. @@ -375,6 +382,9 @@ void dsl_dataset_set_refreservation_sync_impl(dsl_data void dsl_dataset_zapify(dsl_dataset_t *ds, dmu_tx_t *tx); boolean_t dsl_dataset_is_zapified(dsl_dataset_t *ds); boolean_t dsl_dataset_has_resume_receive_state(dsl_dataset_t *ds); + +int dsl_dataset_rollback_check(void *arg, dmu_tx_t *tx); +void dsl_dataset_rollback_sync(void *arg, dmu_tx_t *tx); int dsl_dataset_rollback(const char *fsname, const char *tosnap, void *owner, nvlist_t *result); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Wed Nov 8 09:15:09 2017 (r325536) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Wed Nov 8 09:16:31 2017 (r325537) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ #include "lua.h" @@ -177,6 +177,37 @@ zcp_synctask_promote(lua_State *state, boolean_t sync, return (err); } +static int zcp_synctask_rollback(lua_State *, boolean_t, nvlist_t *err_details); +static zcp_synctask_info_t zcp_synctask_rollback_info = { + .name = "rollback", + .func = zcp_synctask_rollback, + .space_check = ZFS_SPACE_CHECK_RESERVED, + .blocks_modified = 1, + .pargs = { + {.za_name = "filesystem", .za_lua_type = LUA_TSTRING}, + {NULL, 0} + }, + .kwargs = { + {NULL, 0} + } +}; + +static int +zcp_synctask_rollback(lua_State *state, boolean_t sync, nvlist_t *err_details) +{ + int err; + const char *dsname = lua_tostring(state, 1); + dsl_dataset_rollback_arg_t ddra = { 0 }; + + ddra.ddra_fsname = dsname; + ddra.ddra_result = err_details; + + err = zcp_sync_task(state, dsl_dataset_rollback_check, + dsl_dataset_rollback_sync, &ddra, sync, dsname); + + return (err); +} + void zcp_synctask_wrapper_cleanup(void *arg) { @@ -247,6 +278,7 @@ zcp_load_synctask_lib(lua_State *state, boolean_t sync zcp_synctask_info_t *zcp_synctask_funcs[] = { &zcp_synctask_destroy_info, &zcp_synctask_promote_info, + &zcp_synctask_rollback_info, NULL }; From owner-svn-src-all@freebsd.org Wed Nov 8 09:22:07 2017 Return-Path: Delivered-To: svn-src-all@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 3FCBFE72259; Wed, 8 Nov 2017 09:22:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2B5771FA8; Wed, 8 Nov 2017 09:22:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA89M5gC075396; Wed, 8 Nov 2017 09:22:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA89M5Jr075387; Wed, 8 Nov 2017 09:22:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711080922.vA89M5Jr075387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 8 Nov 2017 09:22:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325538 - in stable/11: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/... X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 325538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 09:22:07 -0000 Author: avg Date: Wed Nov 8 09:22:04 2017 New Revision: 325538 URL: https://svnweb.freebsd.org/changeset/base/325538 Log: MFC r324197: MFV r323913: 8600 ZFS channel programs - snapshot Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 stable/11/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Wed Nov 8 09:16:31 2017 (r325537) +++ stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs-program.8 Wed Nov 8 09:22:04 2017 (r325538) @@ -10,7 +10,7 @@ .\" .\" Copyright (c) 2016, 2017 by Delphix. All rights reserved. .\" -.Dd October 02, 2016 +.Dd October 02, 2017 .Dt ZFS-PROGRAM 1M .Os .Sh NAME @@ -372,6 +372,18 @@ filesystem (string) .Bd -ragged -compact -offset "xxxx" Filesystem to rollback. .Ed +.It Em zfs.sync.snapshot(dataset) +Create a snapshot of a filesystem. +Returns 0 if the snapshot was successfully created, +and a nonzero error code otherwise. +.Pp +Note: Taking a snapshot will fail on any pool older than legacy version 27. +To enable taking snapshots from ZCP scripts, the pool must be upgraded. +.Pp +dataset (string) +.Bd -ragged -compact -offset "xxxx" +Name of snapshot to create. +.Ed .El .It Sy zfs.check submodule For each function in the zfs.sync submodule, there is a corresponding zfs.check @@ -392,6 +404,7 @@ The available zfs.check functions are: .It Em zfs.check.destroy(dataset, [defer=true|false]) .It Em zfs.check.promote(dataset) .It Em zfs.check.rollback(filesystem) +.It Em zfs.check.snapshot(dataset) .El .It Sy zfs.list submodule The zfs.list submodule provides functions for iterating over datasets and Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Nov 8 09:16:31 2017 (r325537) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Nov 8 09:22:04 2017 (r325538) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 RackTop Systems. @@ -160,7 +160,12 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name, if (resultp != NULL) { *resultp = NULL; - zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024); + if (ioc == ZFS_IOC_CHANNEL_PROGRAM) { + zc.zc_nvlist_dst_size = fnvlist_lookup_uint64(source, + ZCP_ARG_MEMLIMIT); + } else { + zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024); + } zc.zc_nvlist_dst = (uint64_t)(uintptr_t) malloc(zc.zc_nvlist_dst_size); #ifdef illumos @@ -178,7 +183,7 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name, * If ioctl exited with ENOMEM, we retry the ioctl after * increasing the size of the destination nvlist. * - * Channel programs that exit with ENOMEM probably ran over the + * Channel programs that exit with ENOMEM ran over the * lua memory sandbox; they should not be retried. */ if (errno == ENOMEM && resultp != NULL && Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Nov 8 09:16:31 2017 (r325537) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Nov 8 09:22:04 2017 (r325538) @@ -1134,13 +1134,6 @@ dsl_dataset_snapshot_reserve_space(dsl_dataset_t *ds, return (0); } -typedef struct dsl_dataset_snapshot_arg { - nvlist_t *ddsa_snaps; - nvlist_t *ddsa_props; - nvlist_t *ddsa_errors; - cred_t *ddsa_cr; -} dsl_dataset_snapshot_arg_t; - int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, dmu_tx_t *tx, boolean_t recv, uint64_t cnt, cred_t *cr) @@ -1200,7 +1193,7 @@ dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, con return (0); } -static int +int dsl_dataset_snapshot_check(void *arg, dmu_tx_t *tx) { dsl_dataset_snapshot_arg_t *ddsa = arg; @@ -1477,7 +1470,7 @@ dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, cons spa_history_log_internal_ds(ds->ds_prev, "snapshot", tx, ""); } -static void +void dsl_dataset_snapshot_sync(void *arg, dmu_tx_t *tx) { dsl_dataset_snapshot_arg_t *ddsa = arg; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Wed Nov 8 09:16:31 2017 (r325537) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Wed Nov 8 09:22:04 2017 (r325538) @@ -244,6 +244,13 @@ typedef struct dsl_dataset_rollback_arg { nvlist_t *ddra_result; } dsl_dataset_rollback_arg_t; +typedef struct dsl_dataset_snapshot_arg { + nvlist_t *ddsa_snaps; + nvlist_t *ddsa_props; + nvlist_t *ddsa_errors; + cred_t *ddsa_cr; +} dsl_dataset_snapshot_arg_t; + /* * The max length of a temporary tag prefix is the number of hex digits * required to express UINT64_MAX plus one for the hyphen. @@ -276,6 +283,8 @@ uint64_t dsl_dataset_create_sync(dsl_dir_t *pds, const dsl_dataset_t *origin, uint64_t flags, cred_t *, dmu_tx_t *); uint64_t dsl_dataset_create_sync_dd(dsl_dir_t *dd, dsl_dataset_t *origin, uint64_t flags, dmu_tx_t *tx); +void dsl_dataset_snapshot_sync(void *arg, dmu_tx_t *tx); +int dsl_dataset_snapshot_check(void *arg, dmu_tx_t *tx); int dsl_dataset_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t *errors); void dsl_dataset_promote_sync(void *arg, dmu_tx_t *tx); int dsl_dataset_promote_check(void *arg, dmu_tx_t *tx); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h Wed Nov 8 09:16:31 2017 (r325537) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zcp.h Wed Nov 8 09:22:04 2017 (r325538) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ #ifndef _SYS_ZCP_H @@ -136,8 +136,6 @@ typedef struct zcp_lib_info { const zcp_arg_t pargs[4]; const zcp_arg_t kwargs[2]; } zcp_lib_info_t; - -int zcp_nvlist_to_lua(lua_State *, nvlist_t *, char *, int); #ifdef __cplusplus } Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Wed Nov 8 09:16:31 2017 (r325537) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c Wed Nov 8 09:22:04 2017 (r325538) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ /* @@ -109,10 +109,15 @@ #define ETIME ETIMEDOUT #endif +#define ZCP_NVLIST_MAX_DEPTH 20 + uint64_t zfs_lua_check_instrlimit_interval = 100; uint64_t zfs_lua_max_instrlimit = ZCP_MAX_INSTRLIMIT; uint64_t zfs_lua_max_memlimit = ZCP_MAX_MEMLIMIT; +/* + * Forward declarations for mutually recursive functions + */ static int zcp_nvpair_value_to_lua(lua_State *, nvpair_t *, char *, int); static int zcp_lua_to_nvlist_impl(lua_State *, int, nvlist_t *, const char *, int); @@ -219,8 +224,6 @@ zcp_cleanup(lua_State *state) zcp_clear_cleanup(state); } } - -#define ZCP_NVLIST_MAX_DEPTH 20 /* * Convert the lua table at the given index on the Lua stack to an nvlist Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c Wed Nov 8 09:16:31 2017 (r325537) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_global.c Wed Nov 8 09:22:04 2017 (r325538) @@ -14,7 +14,7 @@ */ /* - * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2016, 2017 by Delphix. All rights reserved. */ #include @@ -62,7 +62,12 @@ static const zcp_errno_global_t errno_globals[] = { {"EPIPE", EPIPE}, {"EDOM", EDOM}, {"ERANGE", ERANGE}, + {"EDEADLK", EDEADLK}, + {"ENOLCK", ENOLCK}, + {"ECANCELED", ECANCELED}, + {"ENOTSUP", ENOTSUP}, {"EDQUOT", EDQUOT}, + {"ENAMETOOLONG", ENAMETOOLONG}, {NULL, 0} }; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Wed Nov 8 09:16:31 2017 (r325537) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c Wed Nov 8 09:22:04 2017 (r325538) @@ -39,10 +39,10 @@ typedef int (zcp_synctask_func_t)(lua_State *, boolean typedef struct zcp_synctask_info { const char *name; zcp_synctask_func_t *func; - zfs_space_check_t space_check; - int blocks_modified; const zcp_arg_t pargs[4]; const zcp_arg_t kwargs[2]; + zfs_space_check_t space_check; + int blocks_modified; } zcp_synctask_info_t; /* @@ -91,8 +91,6 @@ static int zcp_synctask_destroy(lua_State *, boolean_t static zcp_synctask_info_t zcp_synctask_destroy_info = { .name = "destroy", .func = zcp_synctask_destroy, - .space_check = ZFS_SPACE_CHECK_NONE, - .blocks_modified = 0, .pargs = { {.za_name = "filesystem | snapshot", .za_lua_type = LUA_TSTRING}, {NULL, 0} @@ -100,7 +98,9 @@ static zcp_synctask_info_t zcp_synctask_destroy_info = .kwargs = { {.za_name = "defer", .za_lua_type = LUA_TBOOLEAN}, {NULL, 0} - } + }, + .space_check = ZFS_SPACE_CHECK_NONE, + .blocks_modified = 0 }; /* ARGSUSED */ @@ -140,19 +140,19 @@ zcp_synctask_destroy(lua_State *state, boolean_t sync, return (err); } -static int zcp_synctask_promote(lua_State *, boolean_t, nvlist_t *err_details); +static int zcp_synctask_promote(lua_State *, boolean_t, nvlist_t *); static zcp_synctask_info_t zcp_synctask_promote_info = { .name = "promote", .func = zcp_synctask_promote, - .space_check = ZFS_SPACE_CHECK_RESERVED, - .blocks_modified = 3, .pargs = { {.za_name = "clone", .za_lua_type = LUA_TSTRING}, {NULL, 0} }, .kwargs = { {NULL, 0} - } + }, + .space_check = ZFS_SPACE_CHECK_RESERVED, + .blocks_modified = 3 }; static int @@ -208,6 +208,58 @@ zcp_synctask_rollback(lua_State *state, boolean_t sync return (err); } +static int zcp_synctask_snapshot(lua_State *, boolean_t, nvlist_t *); +static zcp_synctask_info_t zcp_synctask_snapshot_info = { + .name = "snapshot", + .func = zcp_synctask_snapshot, + .pargs = { + {.za_name = "filesystem@snapname | volume@snapname", + .za_lua_type = LUA_TSTRING}, + {NULL, 0} + }, + .kwargs = { + {NULL, 0} + }, + .space_check = ZFS_SPACE_CHECK_NORMAL, + .blocks_modified = 3 +}; + +/* ARGSUSED */ +static int +zcp_synctask_snapshot(lua_State *state, boolean_t sync, nvlist_t *err_details) +{ + int err; + dsl_dataset_snapshot_arg_t ddsa = { 0 }; + const char *dsname = lua_tostring(state, 1); + zcp_run_info_t *ri = zcp_run_info(state); + + /* + * We only allow for a single snapshot rather than a list, so the + * error list output is unnecessary. + */ + ddsa.ddsa_errors = NULL; + ddsa.ddsa_props = NULL; + ddsa.ddsa_cr = ri->zri_cred; + ddsa.ddsa_snaps = fnvlist_alloc(); + fnvlist_add_boolean(ddsa.ddsa_snaps, dsname); + + /* + * On old pools, the ZIL must not be active when a snapshot is created, + * but we can't suspend the ZIL because we're already in syncing + * context. + */ + if (spa_version(ri->zri_pool->dp_spa) < SPA_VERSION_FAST_SNAP) { + return (ENOTSUP); + } + + err = zcp_sync_task(state, dsl_dataset_snapshot_check, + dsl_dataset_snapshot_sync, &ddsa, sync, dsname); + + fnvlist_free(ddsa.ddsa_snaps); + + return (err); +} + void zcp_synctask_wrapper_cleanup(void *arg) { @@ -279,6 +331,7 @@ zcp_load_synctask_lib(lua_State *state, boolean_t sync &zcp_synctask_destroy_info, &zcp_synctask_promote_info, &zcp_synctask_rollback_info, + &zcp_synctask_snapshot_info, NULL }; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Nov 8 09:16:31 2017 (r325537) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Nov 8 09:22:04 2017 (r325538) @@ -27,7 +27,7 @@ * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014, 2016 Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2016 by Delphix. All rights reserved. + * Copyright (c) 2011, 2017 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -3789,7 +3789,7 @@ zfs_ioc_channel_program(const char *poolname, nvlist_t if (instrlimit == 0 || instrlimit > zfs_lua_max_instrlimit) return (EINVAL); - if (memlimit == 0 || memlimit > ZCP_MAX_MEMLIMIT) + if (memlimit == 0 || memlimit > zfs_lua_max_memlimit) return (EINVAL); return (zcp_eval(poolname, program, instrlimit, memlimit, From owner-svn-src-all@freebsd.org Wed Nov 8 09:25:33 2017 Return-Path: Delivered-To: svn-src-all@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 8FF06E723B8; Wed, 8 Nov 2017 09:25:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 590B1721E6; Wed, 8 Nov 2017 09:25:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA89PWAV076473; Wed, 8 Nov 2017 09:25:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA89PWXG076472; Wed, 8 Nov 2017 09:25:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711080925.vA89PWXG076472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 8 Nov 2017 09:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325539 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 325539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 09:25:33 -0000 Author: avg Date: Wed Nov 8 09:25:32 2017 New Revision: 325539 URL: https://svnweb.freebsd.org/changeset/base/325539 Log: MFC r324757: remove spa_sync_on assert from spa_async_thread_vd Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Nov 8 09:22:04 2017 (r325538) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Nov 8 09:25:32 2017 (r325539) @@ -6252,8 +6252,6 @@ spa_async_thread_vd(void *arg) spa_t *spa = arg; int tasks; - ASSERT(spa->spa_sync_on); - mutex_enter(&spa->spa_async_lock); tasks = spa->spa_async_tasks; retry: From owner-svn-src-all@freebsd.org Wed Nov 8 09:35:07 2017 Return-Path: Delivered-To: svn-src-all@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 5B01FE725F9; Wed, 8 Nov 2017 09:35:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2495472657; Wed, 8 Nov 2017 09:35:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA89Z6jI080706; Wed, 8 Nov 2017 09:35:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA89Z6xp080705; Wed, 8 Nov 2017 09:35:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711080935.vA89Z6xp080705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 8 Nov 2017 09:35: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: r325540 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 325540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 09:35:07 -0000 Author: avg Date: Wed Nov 8 09:35:06 2017 New Revision: 325540 URL: https://svnweb.freebsd.org/changeset/base/325540 Log: MFC r324757: remove spa_sync_on assert from spa_async_thread_vd Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.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 Wed Nov 8 09:25:32 2017 (r325539) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Wed Nov 8 09:35:06 2017 (r325540) @@ -6129,8 +6129,6 @@ spa_async_thread_vd(void *arg) spa_t *spa = arg; int tasks; - ASSERT(spa->spa_sync_on); - mutex_enter(&spa->spa_async_lock); tasks = spa->spa_async_tasks; retry: From owner-svn-src-all@freebsd.org Wed Nov 8 09:37:01 2017 Return-Path: Delivered-To: svn-src-all@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 8FAD8E7267B; Wed, 8 Nov 2017 09:37:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EDEE727C3; Wed, 8 Nov 2017 09:37:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA89b0Dh080835; Wed, 8 Nov 2017 09:37:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA89b056080828; Wed, 8 Nov 2017 09:37:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711080937.vA89b056080828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 8 Nov 2017 09:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325541 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 325541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 09:37:01 -0000 Author: avg Date: Wed Nov 8 09:36:59 2017 New Revision: 325541 URL: https://svnweb.freebsd.org/changeset/base/325541 Log: MFC r324195: MFV r323795: 8604 Avoid unnecessary work search in VFS when unmounting snapshots Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Wed Nov 8 09:35:06 2017 (r325540) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Wed Nov 8 09:36:59 2017 (r325541) @@ -488,23 +488,29 @@ dsl_destroy_snapshots_nvl(nvlist_t *snaps, boolean_t d if (nvlist_next_nvpair(snaps, NULL) == NULL) return (0); - nvlist_t *arg = fnvlist_alloc(); - nvlist_t *snaps_normalized = fnvlist_alloc(); /* * lzc_destroy_snaps() is documented to take an nvlist whose - * values "don't matter". We need to convert that nvlist to one - * that we know can be converted to LUA. + * values "don't matter". We need to convert that nvlist to + * one that we know can be converted to LUA. We also don't + * care about any duplicate entries because the nvlist will + * be converted to a LUA table which should take care of this. */ + nvlist_t *snaps_normalized; + VERIFY0(nvlist_alloc(&snaps_normalized, 0, KM_SLEEP)); for (nvpair_t *pair = nvlist_next_nvpair(snaps, NULL); pair != NULL; pair = nvlist_next_nvpair(snaps, pair)) { fnvlist_add_boolean_value(snaps_normalized, nvpair_name(pair), B_TRUE); } + + nvlist_t *arg; + VERIFY0(nvlist_alloc(&arg, 0, KM_SLEEP)); fnvlist_add_nvlist(arg, "snaps", snaps_normalized); fnvlist_free(snaps_normalized); fnvlist_add_boolean_value(arg, "defer", defer); - nvlist_t *wrapper = fnvlist_alloc(); + nvlist_t *wrapper; + VERIFY0(nvlist_alloc(&wrapper, 0, KM_SLEEP)); fnvlist_add_nvlist(wrapper, ZCP_ARG_ARGLIST, arg); fnvlist_free(arg); @@ -538,7 +544,7 @@ dsl_destroy_snapshots_nvl(nvlist_t *snaps, boolean_t d program, 0, zfs_lua_max_memlimit, - fnvlist_lookup_nvpair(wrapper, ZCP_ARG_ARGLIST), result); + nvlist_next_nvpair(wrapper, NULL), result); if (error != 0) { char *errorstr = NULL; (void) nvlist_lookup_string(result, ZCP_RET_ERROR, &errorstr); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Wed Nov 8 09:35:06 2017 (r325540) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Wed Nov 8 09:36:59 2017 (r325541) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved. - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2017 by Delphix. All rights reserved. * Copyright 2016 RackTop Systems. * Copyright (c) 2014 Integros [integros.com] */ @@ -424,9 +424,10 @@ extern int zfs_secpolicy_snapshot_perms(const char *, extern int zfs_secpolicy_rename_perms(const char *, const char *, cred_t *); extern int zfs_secpolicy_destroy_perms(const char *, cred_t *); extern int zfs_busy(void); -extern int zfs_unmount_snap(const char *); +extern void zfs_unmount_snap(const char *); extern void zfs_destroy_unmount_origin(const char *); extern int getzfsvfs_impl(struct objset *, struct zfsvfs **); +extern int getzfsvfs(const char *, struct zfsvfs **); /* * ZFS minor numbers can refer to either a control device instance or Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Nov 8 09:35:06 2017 (r325540) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Nov 8 09:36:59 2017 (r325541) @@ -1459,7 +1459,8 @@ getzfsvfs_impl(objset_t *os, zfsvfs_t **zfvp) return (error); } -static int +#ifdef illumos +int getzfsvfs(const char *dsname, zfsvfs_t **zfvp) { objset_t *os; @@ -1471,16 +1472,44 @@ getzfsvfs(const char *dsname, zfsvfs_t **zfvp) error = getzfsvfs_impl(os, zfvp); dmu_objset_rele(os, FTAG); - if (error == 0) { - error = vfs_busy((*zfvp)->z_vfs, 0); - vfs_rel((*zfvp)->z_vfs); - if (error != 0) { - *zfvp = NULL; - error = SET_ERROR(ESRCH); - } + return (error); +} + +#else + +static int +getzfsvfs_ref(const char *dsname, zfsvfs_t **zfvp) +{ + objset_t *os; + int error; + + error = dmu_objset_hold(dsname, FTAG, &os); + if (error != 0) + return (error); + + error = getzfsvfs_impl(os, zfvp); + dmu_objset_rele(os, FTAG); + return (error); +} + +int +getzfsvfs(const char *dsname, zfsvfs_t **zfvp) +{ + objset_t *os; + int error; + + error = getzfsvfs_ref(dsname, zfvp); + if (error != 0) + return (error); + error = vfs_busy((*zfvp)->z_vfs, 0); + vfs_rel((*zfvp)->z_vfs); + if (error != 0) { + *zfvp = NULL; + error = SET_ERROR(ESRCH); } return (error); } +#endif /* * Find a zfsvfs_t for a mounted filesystem, or create our own, in which @@ -3054,27 +3083,6 @@ zfs_ioc_get_fsacl(zfs_cmd_t *zc) return (error); } -/* - * Search the vfs list for a specified resource. Returns a pointer to it - * or NULL if no suitable entry is found. The caller of this routine - * is responsible for releasing the returned vfs pointer. - */ -static vfs_t * -zfs_get_vfs(const char *resource) -{ - vfs_t *vfsp; - - mtx_lock(&mountlist_mtx); - TAILQ_FOREACH(vfsp, &mountlist, mnt_list) { - if (strcmp(refstr_value(vfsp->vfs_resource), resource) == 0) { - vfs_ref(vfsp); - break; - } - } - mtx_unlock(&mountlist_mtx); - return (vfsp); -} - /* ARGSUSED */ static void zfs_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx) @@ -3556,30 +3564,29 @@ zfs_ioc_nextboot(const char *unused, nvlist_t *innvl, * Returns 0 if the argument is not a snapshot, or it is not currently a * filesystem, or we were able to unmount it. Returns error code otherwise. */ -int +void zfs_unmount_snap(const char *snapname) { - vfs_t *vfsp; - zfsvfs_t *zfsvfs; -#ifdef illumos - int err; -#endif + vfs_t *vfsp = NULL; + zfsvfs_t *zfsvfs = NULL; if (strchr(snapname, '@') == NULL) - return (0); + return; - vfsp = zfs_get_vfs(snapname); - if (vfsp == NULL) - return (0); + int err = getzfsvfs_ref(snapname, &zfsvfs); + if (err != 0) { + ASSERT3P(zfsvfs, ==, NULL); + return; + } + vfsp = zfsvfs->z_vfs; - zfsvfs = vfsp->vfs_data; ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os))); #ifdef illumos err = vn_vfswlock(vfsp->vfs_vnodecovered); VFS_RELE(vfsp); if (err != 0) - return (SET_ERROR(err)); + return; #endif /* @@ -3590,14 +3597,14 @@ zfs_unmount_snap(const char *snapname) #else (void) dounmount(vfsp, MS_FORCE, curthread); #endif - return (0); } /* ARGSUSED */ static int zfs_unmount_snap_cb(const char *snapname, void *arg) { - return (zfs_unmount_snap(snapname)); + zfs_unmount_snap(snapname); + return (0); } /* @@ -3620,7 +3627,7 @@ zfs_destroy_unmount_origin(const char *fsname) char originname[ZFS_MAX_DATASET_NAME_LEN]; dsl_dataset_name(ds->ds_prev, originname); dmu_objset_rele(os, FTAG); - (void) zfs_unmount_snap(originname); + zfs_unmount_snap(originname); } else { dmu_objset_rele(os, FTAG); } @@ -3661,9 +3668,7 @@ zfs_ioc_destroy_snaps(const char *poolname, nvlist_t * (name[poollen] != '/' && name[poollen] != '@')) return (SET_ERROR(EXDEV)); - error = zfs_unmount_snap(name); - if (error != 0) - return (error); + zfs_unmount_snap(nvpair_name(pair)); #if defined(__FreeBSD__) zvol_remove_minors(name); #endif @@ -3809,11 +3814,8 @@ zfs_ioc_destroy(zfs_cmd_t *zc) { int err; - if (zc->zc_objset_type == DMU_OST_ZFS) { - err = zfs_unmount_snap(zc->zc_name); - if (err != 0) - return (err); - } + if (zc->zc_objset_type == DMU_OST_ZFS) + zfs_unmount_snap(zc->zc_name); if (strchr(zc->zc_name, '@')) err = dsl_destroy_snapshot(zc->zc_name, zc->zc_defer_destroy); @@ -3885,7 +3887,9 @@ recursive_unmount(const char *fsname, void *arg) char fullname[ZFS_MAX_DATASET_NAME_LEN]; (void) snprintf(fullname, sizeof (fullname), "%s@%s", fsname, snapname); - return (zfs_unmount_snap(fullname)); + zfs_unmount_snap(fullname); + + return (0); } /* From owner-svn-src-all@freebsd.org Wed Nov 8 11:25:21 2017 Return-Path: Delivered-To: svn-src-all@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 3C14FE4F788; Wed, 8 Nov 2017 11:25:21 +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 1399C75826; Wed, 8 Nov 2017 11:25:20 +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 vA8BPKV8027440; Wed, 8 Nov 2017 11:25:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8BPJwH027434; Wed, 8 Nov 2017 11:25:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081125.vA8BPJwH027434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 11:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325542 - in stable/11/sys: amd64/amd64 i386/i386 i386/isa X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386 i386/isa X-SVN-Commit-Revision: 325542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 11:25:21 -0000 Author: kib Date: Wed Nov 8 11:25:19 2017 New Revision: 325542 URL: https://svnweb.freebsd.org/changeset/base/325542 Log: MFC r325270: Consistently ensure that we do not load MXCSR with reserved bits set. Modified: stable/11/sys/amd64/amd64/fpu.c stable/11/sys/amd64/amd64/machdep.c stable/11/sys/i386/i386/machdep.c stable/11/sys/i386/isa/npx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/fpu.c ============================================================================== --- stable/11/sys/amd64/amd64/fpu.c Wed Nov 8 09:36:59 2017 (r325541) +++ stable/11/sys/amd64/amd64/fpu.c Wed Nov 8 11:25:19 2017 (r325542) @@ -806,6 +806,7 @@ fpusetregs(struct thread *td, struct savefpu *addr, ch struct pcb *pcb; int error; + addr->sv_env.en_mxcsr &= cpu_mxcsr_mask; pcb = td->td_pcb; critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { Modified: stable/11/sys/amd64/amd64/machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/machdep.c Wed Nov 8 09:36:59 2017 (r325541) +++ stable/11/sys/amd64/amd64/machdep.c Wed Nov 8 11:25:19 2017 (r325542) @@ -2248,7 +2248,6 @@ static int set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate, size_t xfpustate_len) { - struct savefpu *fpstate; int error; if (mcp->mc_fpformat == _MC_FPFMT_NODEV) @@ -2261,9 +2260,8 @@ set_fpcontext(struct thread *td, mcontext_t *mcp, char error = 0; } else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - fpstate = (struct savefpu *)&mcp->mc_fpstate; - fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; - error = fpusetregs(td, fpstate, xfpustate, xfpustate_len); + error = fpusetregs(td, (struct savefpu *)&mcp->mc_fpstate, + xfpustate, xfpustate_len); } else return (EINVAL); return (error); Modified: stable/11/sys/i386/i386/machdep.c ============================================================================== --- stable/11/sys/i386/i386/machdep.c Wed Nov 8 09:36:59 2017 (r325541) +++ stable/11/sys/i386/i386/machdep.c Wed Nov 8 11:25:19 2017 (r325542) @@ -3147,7 +3147,6 @@ static int set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate, size_t xfpustate_len) { - union savefpu *fpstate; int error; if (mcp->mc_fpformat == _MC_FPFMT_NODEV) @@ -3161,10 +3160,8 @@ set_fpcontext(struct thread *td, mcontext_t *mcp, char error = 0; } else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - fpstate = (union savefpu *)&mcp->mc_fpstate; - if (cpu_fxsr) - fpstate->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; - error = npxsetregs(td, fpstate, xfpustate, xfpustate_len); + error = npxsetregs(td, (union savefpu *)&mcp->mc_fpstate, + xfpustate, xfpustate_len); } else return (EINVAL); return (error); Modified: stable/11/sys/i386/isa/npx.c ============================================================================== --- stable/11/sys/i386/isa/npx.c Wed Nov 8 09:36:59 2017 (r325541) +++ stable/11/sys/i386/isa/npx.c Wed Nov 8 11:25:19 2017 (r325542) @@ -1053,6 +1053,8 @@ npxsetregs(struct thread *td, union savefpu *addr, cha if (!hw_float) return (ENXIO); + if (cpu_fxsr) + addr->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; pcb = td->td_pcb; critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { From owner-svn-src-all@freebsd.org Wed Nov 8 11:39:43 2017 Return-Path: Delivered-To: svn-src-all@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 CA8A8E4FB43; Wed, 8 Nov 2017 11:39:43 +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 A199975D59; Wed, 8 Nov 2017 11:39:43 +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 vA8Bdgtk031635; Wed, 8 Nov 2017 11:39:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8BdgAn031630; Wed, 8 Nov 2017 11:39:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081139.vA8BdgAn031630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 11:39: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: r325543 - in stable/10/sys: amd64/amd64 i386/i386 i386/isa X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/10/sys: amd64/amd64 i386/i386 i386/isa X-SVN-Commit-Revision: 325543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 11:39:43 -0000 Author: kib Date: Wed Nov 8 11:39:42 2017 New Revision: 325543 URL: https://svnweb.freebsd.org/changeset/base/325543 Log: MFC r325270: Consistently ensure that we do not load MXCSR with reserved bits set. Modified: stable/10/sys/amd64/amd64/fpu.c stable/10/sys/amd64/amd64/machdep.c stable/10/sys/i386/i386/machdep.c stable/10/sys/i386/isa/npx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/fpu.c ============================================================================== --- stable/10/sys/amd64/amd64/fpu.c Wed Nov 8 11:25:19 2017 (r325542) +++ stable/10/sys/amd64/amd64/fpu.c Wed Nov 8 11:39:42 2017 (r325543) @@ -804,6 +804,7 @@ fpusetregs(struct thread *td, struct savefpu *addr, ch struct pcb *pcb; int error; + addr->sv_env.en_mxcsr &= cpu_mxcsr_mask; pcb = td->td_pcb; critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Wed Nov 8 11:25:19 2017 (r325542) +++ stable/10/sys/amd64/amd64/machdep.c Wed Nov 8 11:39:42 2017 (r325543) @@ -2529,7 +2529,6 @@ static int set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate, size_t xfpustate_len) { - struct savefpu *fpstate; int error; if (mcp->mc_fpformat == _MC_FPFMT_NODEV) @@ -2542,9 +2541,8 @@ set_fpcontext(struct thread *td, mcontext_t *mcp, char error = 0; } else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { - fpstate = (struct savefpu *)&mcp->mc_fpstate; - fpstate->sv_env.en_mxcsr &= cpu_mxcsr_mask; - error = fpusetregs(td, fpstate, xfpustate, xfpustate_len); + error = fpusetregs(td, (struct savefpu *)&mcp->mc_fpstate, + xfpustate, xfpustate_len); } else return (EINVAL); return (error); Modified: stable/10/sys/i386/i386/machdep.c ============================================================================== --- stable/10/sys/i386/i386/machdep.c Wed Nov 8 11:25:19 2017 (r325542) +++ stable/10/sys/i386/i386/machdep.c Wed Nov 8 11:39:42 2017 (r325543) @@ -3932,7 +3932,6 @@ static int set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate, size_t xfpustate_len) { - union savefpu *fpstate; int error; if (mcp->mc_fpformat == _MC_FPFMT_NODEV) @@ -3947,12 +3946,8 @@ set_fpcontext(struct thread *td, mcontext_t *mcp, char } else if (mcp->mc_ownedfp == _MC_FPOWNED_FPU || mcp->mc_ownedfp == _MC_FPOWNED_PCB) { #ifdef DEV_NPX - fpstate = (union savefpu *)&mcp->mc_fpstate; -#ifdef CPU_ENABLE_SSE - if (cpu_fxsr) - fpstate->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; -#endif - error = npxsetregs(td, fpstate, xfpustate, xfpustate_len); + error = npxsetregs(td, (union savefpu *)&mcp->mc_fpstate, + xfpustate, xfpustate_len); #else error = EINVAL; #endif Modified: stable/10/sys/i386/isa/npx.c ============================================================================== --- stable/10/sys/i386/isa/npx.c Wed Nov 8 11:25:19 2017 (r325542) +++ stable/10/sys/i386/isa/npx.c Wed Nov 8 11:39:42 2017 (r325543) @@ -1124,6 +1124,10 @@ npxsetregs(struct thread *td, union savefpu *addr, cha if (!hw_float) return (ENXIO); +#ifdef CPU_ENABLE_SSE + if (cpu_fxsr) + addr->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; +#endif pcb = td->td_pcb; critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { From owner-svn-src-all@freebsd.org Wed Nov 8 11:44:04 2017 Return-Path: Delivered-To: svn-src-all@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 143C9E4FE02; Wed, 8 Nov 2017 11:44:04 +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 DFAA6761C1; Wed, 8 Nov 2017 11:44:03 +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 vA8Bi2mI035477; Wed, 8 Nov 2017 11:44:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8Bi2ft035476; Wed, 8 Nov 2017 11:44:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081144.vA8Bi2ft035476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 11:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325544 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 325544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 11:44:04 -0000 Author: kib Date: Wed Nov 8 11:44:02 2017 New Revision: 325544 URL: https://svnweb.freebsd.org/changeset/base/325544 Log: MFC r325285, r325447: Restore an optimization that was temporary disabled by r324665. Modified: stable/11/sys/amd64/amd64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Wed Nov 8 11:39:42 2017 (r325543) +++ stable/11/sys/amd64/amd64/pmap.c Wed Nov 8 11:44:02 2017 (r325544) @@ -2896,8 +2896,8 @@ reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp) { - struct pv_chunk *pc, *pc_marker; - struct pv_chunk_header pc_marker_b; + struct pv_chunk *pc, *pc_marker, *pc_marker_end; + struct pv_chunk_header pc_marker_b, pc_marker_end_b; struct md_page *pvh; pd_entry_t *pde; pmap_t next_pmap, pmap; @@ -2910,6 +2910,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l uint64_t inuse; int bit, field, freed; bool start_di; + static int active_reclaims = 0; PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL")); @@ -2918,7 +2919,9 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l PG_G = PG_A = PG_M = PG_RW = 0; SLIST_INIT(&free); bzero(&pc_marker_b, sizeof(pc_marker_b)); + bzero(&pc_marker_end_b, sizeof(pc_marker_end_b)); pc_marker = (struct pv_chunk *)&pc_marker_b; + pc_marker_end = (struct pv_chunk *)&pc_marker_end_b; /* * A delayed invalidation block should already be active if @@ -2928,12 +2931,21 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l start_di = pmap_not_in_di(); mtx_lock(&pv_chunks_mutex); + active_reclaims++; TAILQ_INSERT_HEAD(&pv_chunks, pc_marker, pc_lru); - while ((pc = TAILQ_NEXT(pc_marker, pc_lru)) != NULL && + TAILQ_INSERT_TAIL(&pv_chunks, pc_marker_end, pc_lru); + while ((pc = TAILQ_NEXT(pc_marker, pc_lru)) != pc_marker_end && SLIST_EMPTY(&free)) { next_pmap = pc->pc_pmap; - if (next_pmap == NULL) /* marker */ + if (next_pmap == NULL) { + /* + * The next chunk is a marker. However, it is + * not our marker, so active_reclaims must be + * > 1. Consequently, the next_chunk code + * will not rotate the pv_chunks list. + */ goto next_chunk; + } mtx_unlock(&pv_chunks_mutex); /* @@ -3047,8 +3059,24 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l next_chunk: TAILQ_REMOVE(&pv_chunks, pc_marker, pc_lru); TAILQ_INSERT_AFTER(&pv_chunks, pc, pc_marker, pc_lru); + if (active_reclaims == 1 && pmap != NULL) { + /* + * Rotate the pv chunks list so that we do not + * scan the same pv chunks that could not be + * freed (because they contained a wired + * and/or superpage mapping) on every + * invocation of reclaim_pv_chunk(). + */ + while ((pc = TAILQ_FIRST(&pv_chunks)) != pc_marker) { + MPASS(pc->pc_pmap != NULL); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); + } + } } TAILQ_REMOVE(&pv_chunks, pc_marker, pc_lru); + TAILQ_REMOVE(&pv_chunks, pc_marker_end, pc_lru); + active_reclaims--; mtx_unlock(&pv_chunks_mutex); reclaim_pv_chunk_leave_pmap(pmap, locked_pmap, start_di); if (m_pc == NULL && !SLIST_EMPTY(&free)) { From owner-svn-src-all@freebsd.org Wed Nov 8 11:47:01 2017 Return-Path: Delivered-To: svn-src-all@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 DFF7DE5009F; Wed, 8 Nov 2017 11:47:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA3A97645D; Wed, 8 Nov 2017 11:47:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8Bl0j3035623; Wed, 8 Nov 2017 11:47:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8Bl0Mq035622; Wed, 8 Nov 2017 11:47:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081147.vA8Bl0Mq035622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 11:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325545 - stable/11/usr.bin/top X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/usr.bin/top X-SVN-Commit-Revision: 325545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 11:47:02 -0000 Author: kib Date: Wed Nov 8 11:47:00 2017 New Revision: 325545 URL: https://svnweb.freebsd.org/changeset/base/325545 Log: MFC r324972: Tweaks to the top swap size calculations. PR: 223149 Modified: stable/11/usr.bin/top/machine.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/top/machine.c ============================================================================== --- stable/11/usr.bin/top/machine.c Wed Nov 8 11:44:02 2017 (r325544) +++ stable/11/usr.bin/top/machine.c Wed Nov 8 11:47:00 2017 (r325545) @@ -1671,8 +1671,9 @@ static int swapmode(int *retavail, int *retfree) { int n; - int pagesize = getpagesize(); struct kvm_swap swapary[1]; + static int pagesize = 0; + static u_long swap_maxpages = 0; *retavail = 0; *retfree = 0; @@ -1682,6 +1683,16 @@ swapmode(int *retavail, int *retfree) n = kvm_getswapinfo(kd, swapary, 1, 0); if (n < 0 || swapary[0].ksw_total == 0) return (0); + + if (pagesize == 0) + pagesize = getpagesize(); + if (swap_maxpages == 0) + GETSYSCTL("vm.swap_maxpages", swap_maxpages); + + /* ksw_total contains the total size of swap all devices which may + exceed the maximum swap size allocatable in the system */ + if ( swapary[0].ksw_total > swap_maxpages ) + swapary[0].ksw_total = swap_maxpages; *retavail = CONVERT(swapary[0].ksw_total); *retfree = CONVERT(swapary[0].ksw_total - swapary[0].ksw_used); From owner-svn-src-all@freebsd.org Wed Nov 8 12:00:51 2017 Return-Path: Delivered-To: svn-src-all@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 29C79E50A71; Wed, 8 Nov 2017 12:00:51 +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 E7DD076DF9; Wed, 8 Nov 2017 12:00:50 +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 vA8C0nF8042405; Wed, 8 Nov 2017 12:00:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8C0npY042404; Wed, 8 Nov 2017 12:00:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081200.vA8C0npY042404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 12:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325546 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 325546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 12:00:51 -0000 Author: kib Date: Wed Nov 8 12:00:49 2017 New Revision: 325546 URL: https://svnweb.freebsd.org/changeset/base/325546 Log: MFC r325271: Use designated initializers for pmc sysent and module data. Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 8 11:47:00 2017 (r325545) +++ stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 8 12:00:49 2017 (r325546) @@ -311,27 +311,23 @@ SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_syspm /* The `sysent' for the new syscall */ static struct sysent pmc_sysent = { - 2, /* sy_narg */ - pmc_syscall_handler /* sy_call */ + .sy_narg = 2, + .sy_call = pmc_syscall_handler, }; static struct syscall_module_data pmc_syscall_mod = { - load, - NULL, - &pmc_syscall_num, - &pmc_sysent, -#if (__FreeBSD_version >= 1100000) - { 0, NULL }, - SY_THR_STATIC_KLD, -#else - { 0, NULL } -#endif + .chainevh = load, + .chainarg = NULL, + .offset = &pmc_syscall_num, + .new_sysent = &pmc_sysent, + .old_sysent = { .sy_narg = 0, .sy_call = NULL }, + .flags = SY_THR_STATIC_KLD, }; static moduledata_t pmc_mod = { - PMC_MODULE_NAME, - syscall_module_handler, - &pmc_syscall_mod + .name = PMC_MODULE_NAME, + .evhand = syscall_module_handler, + .priv = &pmc_syscall_mod, }; #ifdef EARLY_AP_STARTUP From owner-svn-src-all@freebsd.org Wed Nov 8 12:03:12 2017 Return-Path: Delivered-To: svn-src-all@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 B926DE510BF; Wed, 8 Nov 2017 12:03:12 +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 79E347729D; Wed, 8 Nov 2017 12:03:12 +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 vA8C3BJ7044220; Wed, 8 Nov 2017 12:03:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8C3BGi044219; Wed, 8 Nov 2017 12:03:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081203.vA8C3BGi044219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 12:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325547 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 325547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 12:03:12 -0000 Author: kib Date: Wed Nov 8 12:03:11 2017 New Revision: 325547 URL: https://svnweb.freebsd.org/changeset/base/325547 Log: MFC r325273: Minor style tweaks. Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 8 12:00:49 2017 (r325546) +++ stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 8 12:03:11 2017 (r325547) @@ -2876,8 +2876,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a error = 0; atomic_add_int(&pmc_stats.pm_syscalls, 1); - switch(op) - { + switch (op) { /* @@ -4037,7 +4036,7 @@ pmc_syscall_handler(struct thread *td, void *syscall_a PICKUP_GIANT(); - return error; + return (error); } /* From owner-svn-src-all@freebsd.org Wed Nov 8 12:07:03 2017 Return-Path: Delivered-To: svn-src-all@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 2D99AE51258; Wed, 8 Nov 2017 12:07:03 +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 EBFEB7749B; Wed, 8 Nov 2017 12:07:02 +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 vA8C714R044399; Wed, 8 Nov 2017 12:07:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8C71xd044398; Wed, 8 Nov 2017 12:07:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081207.vA8C71xd044398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 12:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325548 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 325548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 12:07:03 -0000 Author: kib Date: Wed Nov 8 12:07:01 2017 New Revision: 325548 URL: https://svnweb.freebsd.org/changeset/base/325548 Log: MFC r325274: There is no use for dropping Giant in the pmc syscall. Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 8 12:03:11 2017 (r325547) +++ stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 8 12:07:01 2017 (r325548) @@ -2860,8 +2860,6 @@ pmc_syscall_handler(struct thread *td, void *syscall_a PMC_GET_SX_XLOCK(ENOSYS); - DROP_GIANT(); - is_sx_downgraded = 0; is_sx_locked = 1; @@ -4033,8 +4031,6 @@ pmc_syscall_handler(struct thread *td, void *syscall_a if (error) atomic_add_int(&pmc_stats.pm_syscall_errors, 1); - - PICKUP_GIANT(); return (error); } From owner-svn-src-all@freebsd.org Wed Nov 8 12:10:15 2017 Return-Path: Delivered-To: svn-src-all@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 7ABE7E51330; Wed, 8 Nov 2017 12:10:15 +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 3D0BF7761C; Wed, 8 Nov 2017 12:10:15 +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 vA8CAE0Q044576; Wed, 8 Nov 2017 12:10:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8CAE8M044575; Wed, 8 Nov 2017 12:10:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081210.vA8CAE8M044575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 12:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325549 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 325549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 12:10:15 -0000 Author: kib Date: Wed Nov 8 12:10:14 2017 New Revision: 325549 URL: https://svnweb.freebsd.org/changeset/base/325549 Log: MFC r325275: In hwpmc, do not double-close the logging file. Modified: stable/11/sys/dev/hwpmc/hwpmc_logging.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 8 12:07:01 2017 (r325548) +++ stable/11/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 8 12:10:14 2017 (r325549) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -254,6 +255,7 @@ pmclog_loop(void *arg) struct ucred *ownercred; struct ucred *mycred; struct thread *td; + sigset_t unb; struct uio auio; struct iovec aiov; size_t nbytes; @@ -261,6 +263,11 @@ pmclog_loop(void *arg) po = (struct pmc_owner *) arg; p = po->po_owner; td = curthread; + + SIGEMPTYSET(unb); + SIGADDSET(unb, SIGHUP); + (void)kern_sigprocmask(td, SIG_UNBLOCK, &unb, NULL, 0); + mycred = td->td_ucred; PROC_LOCK(p); @@ -295,16 +302,8 @@ pmclog_loop(void *arg) mtx_unlock_spin(&po->po_mtx); /* No more buffers and shutdown required. */ - if (po->po_flags & PMC_PO_SHUTDOWN) { - mtx_unlock(&pmc_kthread_mtx); - /* - * Close the file to get PMCLOG_EOF - * error in pmclog(3). - */ - fo_close(po->po_file, curthread); - mtx_lock(&pmc_kthread_mtx); + if (po->po_flags & PMC_PO_SHUTDOWN) break; - } (void) msleep(po, &pmc_kthread_mtx, PWAIT, "pmcloop", 0); @@ -545,19 +544,16 @@ pmclog_schedule_io(struct pmc_owner *po) static void pmclog_stop_kthread(struct pmc_owner *po) { - /* - * Close the file to force the thread out of fo_write, - * unset flag, wakeup the helper thread, - * wait for it to exit - */ - if (po->po_file != NULL) - fo_close(po->po_file, curthread); - mtx_lock(&pmc_kthread_mtx); po->po_flags &= ~PMC_PO_OWNS_LOGFILE; + if (po->po_kthread != NULL) { + PROC_LOCK(po->po_kthread); + kern_psignal(po->po_kthread, SIGHUP); + PROC_UNLOCK(po->po_kthread); + } wakeup_one(po); - if (po->po_kthread) + while (po->po_kthread) msleep(po->po_kthread, &pmc_kthread_mtx, PPAUSE, "pmckstp", 0); mtx_unlock(&pmc_kthread_mtx); } From owner-svn-src-all@freebsd.org Wed Nov 8 12:11:56 2017 Return-Path: Delivered-To: svn-src-all@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 F384CE51446; Wed, 8 Nov 2017 12:11:55 +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 BDBD0779B8; Wed, 8 Nov 2017 12:11:55 +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 vA8CBs5F048323; Wed, 8 Nov 2017 12:11:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8CBsV6048322; Wed, 8 Nov 2017 12:11:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081211.vA8CBsV6048322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 12:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325550 - stable/11/sys/dev/hwpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 325550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 12:11:56 -0000 Author: kib Date: Wed Nov 8 12:11:54 2017 New Revision: 325550 URL: https://svnweb.freebsd.org/changeset/base/325550 Log: MFC r325276: Be protective and check the po_file validity before dropping the ref. Modified: stable/11/sys/dev/hwpmc/hwpmc_logging.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 8 12:10:14 2017 (r325549) +++ stable/11/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 8 12:11:54 2017 (r325550) @@ -685,8 +685,11 @@ pmclog_deconfigure_log(struct pmc_owner *po) } /* drop a reference to the fd */ - error = fdrop(po->po_file, curthread); - po->po_file = NULL; + if (po->po_file != NULL) { + error = fdrop(po->po_file, curthread); + po->po_file = NULL; + } else + error = 0; po->po_error = 0; return (error); From owner-svn-src-all@freebsd.org Wed Nov 8 12:13:27 2017 Return-Path: Delivered-To: svn-src-all@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 17060E51678; Wed, 8 Nov 2017 12:13:27 +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 E283F77B5E; Wed, 8 Nov 2017 12:13:26 +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 vA8CDPZY048446; Wed, 8 Nov 2017 12:13:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8CDPdA048443; Wed, 8 Nov 2017 12:13:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081213.vA8CDPdA048443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 12:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325551 - in stable/11/sys: dev/hwpmc sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: dev/hwpmc sys X-SVN-Commit-Revision: 325551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 12:13:27 -0000 Author: kib Date: Wed Nov 8 12:13:25 2017 New Revision: 325551 URL: https://svnweb.freebsd.org/changeset/base/325551 Log: MFC r325277: Do not run pmclog_configure_log() without pmc_sx protection. Modified: stable/11/sys/dev/hwpmc/hwpmc_logging.c stable/11/sys/dev/hwpmc/hwpmc_mod.c stable/11/sys/sys/pmclog.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 8 12:11:54 2017 (r325550) +++ stable/11/sys/dev/hwpmc/hwpmc_logging.c Wed Nov 8 12:13:25 2017 (r325551) @@ -239,6 +239,54 @@ pmclog_get_buffer(struct pmc_owner *po) return (plb ? 0 : ENOMEM); } +struct pmclog_proc_init_args { + struct proc *kthr; + struct pmc_owner *po; + bool exit; + bool acted; +}; + +int +pmclog_proc_create(struct thread *td, void **handlep) +{ + struct pmclog_proc_init_args *ia; + int error; + + ia = malloc(sizeof(*ia), M_TEMP, M_WAITOK | M_ZERO); + error = kproc_create(pmclog_loop, ia, &ia->kthr, + RFHIGHPID, 0, "hwpmc: proc(%d)", td->td_proc->p_pid); + if (error == 0) + *handlep = ia; + return (error); +} + +void +pmclog_proc_ignite(void *handle, struct pmc_owner *po) +{ + struct pmclog_proc_init_args *ia; + + ia = handle; + mtx_lock(&pmc_kthread_mtx); + MPASS(!ia->acted); + MPASS(ia->po == NULL); + MPASS(!ia->exit); + MPASS(ia->kthr != NULL); + if (po == NULL) { + ia->exit = true; + } else { + ia->po = po; + KASSERT(po->po_kthread == NULL, + ("[pmclog,%d] po=%p kthread (%p) already present", + __LINE__, po, po->po_kthread)); + po->po_kthread = ia->kthr; + } + wakeup(ia); + while (!ia->acted) + msleep(ia, &pmc_kthread_mtx, PWAIT, "pmclogw", 0); + mtx_unlock(&pmc_kthread_mtx); + free(ia, M_TEMP); +} + /* * Log handler loop. * @@ -248,7 +296,7 @@ pmclog_get_buffer(struct pmc_owner *po) static void pmclog_loop(void *arg) { - int error; + struct pmclog_proc_init_args *ia; struct pmc_owner *po; struct pmclog_buffer *lb; struct proc *p; @@ -259,15 +307,34 @@ pmclog_loop(void *arg) struct uio auio; struct iovec aiov; size_t nbytes; + int error; - po = (struct pmc_owner *) arg; - p = po->po_owner; td = curthread; SIGEMPTYSET(unb); SIGADDSET(unb, SIGHUP); (void)kern_sigprocmask(td, SIG_UNBLOCK, &unb, NULL, 0); + ia = arg; + MPASS(ia->kthr == curproc); + MPASS(!ia->acted); + mtx_lock(&pmc_kthread_mtx); + while (ia->po == NULL && !ia->exit) + msleep(ia, &pmc_kthread_mtx, PWAIT, "pmclogi", 0); + if (ia->exit) { + ia->acted = true; + wakeup(ia); + mtx_unlock(&pmc_kthread_mtx); + kproc_exit(0); + } + MPASS(ia->po != NULL); + po = ia->po; + ia->acted = true; + wakeup(ia); + mtx_unlock(&pmc_kthread_mtx); + ia = NULL; + + p = po->po_owner; mycred = td->td_ucred; PROC_LOCK(p); @@ -572,15 +639,11 @@ pmclog_stop_kthread(struct pmc_owner *po) int pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd) { - int error; struct proc *p; cap_rights_t rights; - /* - * As long as it is possible to get a LOR between pmc_sx lock and - * proctree/allproc sx locks used for adding a new process, assure - * the former is not held here. - */ - sx_assert(&pmc_sx, SA_UNLOCKED); + int error; + + sx_assert(&pmc_sx, SA_XLOCKED); PMCDBG2(LOG,CFG,1, "config po=%p logfd=%d", po, logfd); p = po->po_owner; @@ -589,9 +652,6 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_o if (po->po_flags & PMC_PO_OWNS_LOGFILE) return (EBUSY); - KASSERT(po->po_kthread == NULL, - ("[pmclog,%d] po=%p kthread (%p) already present", __LINE__, po, - po->po_kthread)); KASSERT(po->po_file == NULL, ("[pmclog,%d] po=%p file (%p) already present", __LINE__, po, po->po_file)); @@ -604,10 +664,6 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_o /* mark process as owning a log file */ po->po_flags |= PMC_PO_OWNS_LOGFILE; - error = kproc_create(pmclog_loop, po, &po->po_kthread, - RFHIGHPID, 0, "hwpmc: proc(%d)", p->p_pid); - if (error) - goto error; /* mark process as using HWPMCs */ PROC_LOCK(p); @@ -624,10 +680,6 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_o return (0); error: - /* shutdown the thread */ - if (po->po_kthread) - pmclog_stop_kthread(po); - KASSERT(po->po_kthread == NULL, ("[pmclog,%d] po=%p kthread not " "stopped", __LINE__, po)); Modified: stable/11/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 8 12:11:54 2017 (r325550) +++ stable/11/sys/dev/hwpmc/hwpmc_mod.c Wed Nov 8 12:13:25 2017 (r325551) @@ -2854,20 +2854,31 @@ static const char *pmc_op_to_name[] = { static int pmc_syscall_handler(struct thread *td, void *syscall_args) { - int error, is_sx_downgraded, is_sx_locked, op; + int error, is_sx_downgraded, op; struct pmc_syscall_args *c; + void *pmclog_proc_handle; void *arg; - PMC_GET_SX_XLOCK(ENOSYS); - - is_sx_downgraded = 0; - is_sx_locked = 1; - - c = (struct pmc_syscall_args *) syscall_args; - + c = (struct pmc_syscall_args *)syscall_args; op = c->pmop_code; arg = c->pmop_data; + if (op == PMC_OP_CONFIGURELOG) { + /* + * We cannot create the logging process inside + * pmclog_configure_log() because there is a LOR + * between pmc_sx and process structure locks. + * Instead, pre-create the process and ignite the loop + * if everything is fine, otherwise direct the process + * to exit. + */ + error = pmclog_proc_create(td, &pmclog_proc_handle); + if (error != 0) + goto done_syscall; + } + PMC_GET_SX_XLOCK(ENOSYS); + is_sx_downgraded = 0; + PMCDBG3(MOD,PMS,1, "syscall op=%d \"%s\" arg=%p", op, pmc_op_to_name[op], arg); @@ -2890,15 +2901,16 @@ pmc_syscall_handler(struct thread *td, void *syscall_a struct pmc_owner *po; struct pmc_op_configurelog cl; - sx_assert(&pmc_sx, SX_XLOCKED); - - if ((error = copyin(arg, &cl, sizeof(cl))) != 0) + if ((error = copyin(arg, &cl, sizeof(cl))) != 0) { + pmclog_proc_ignite(pmclog_proc_handle, NULL); break; + } /* mark this process as owning a log file */ p = td->td_proc; if ((po = pmc_find_owner_descriptor(p)) == NULL) if ((po = pmc_allocate_owner_descriptor(p)) == NULL) { + pmclog_proc_ignite(pmclog_proc_handle, NULL); error = ENOMEM; break; } @@ -2910,10 +2922,11 @@ pmc_syscall_handler(struct thread *td, void *syscall_a * de-configure it. */ if (cl.pm_logfd >= 0) { - sx_xunlock(&pmc_sx); - is_sx_locked = 0; error = pmclog_configure_log(md, po, cl.pm_logfd); + pmclog_proc_ignite(pmclog_proc_handle, error == 0 ? + po : NULL); } else if (po->po_flags & PMC_PO_OWNS_LOGFILE) { + pmclog_proc_ignite(pmclog_proc_handle, NULL); pmclog_process_closelog(po); error = pmclog_close(po); if (error == 0) { @@ -2923,11 +2936,10 @@ pmc_syscall_handler(struct thread *td, void *syscall_a pmc_stop(pm); error = pmclog_deconfigure_log(po); } - } else + } else { + pmclog_proc_ignite(pmclog_proc_handle, NULL); error = EINVAL; - - if (error) - break; + } } break; @@ -4022,13 +4034,11 @@ pmc_syscall_handler(struct thread *td, void *syscall_a break; } - if (is_sx_locked != 0) { - if (is_sx_downgraded) - sx_sunlock(&pmc_sx); - else - sx_xunlock(&pmc_sx); - } - + if (is_sx_downgraded) + sx_sunlock(&pmc_sx); + else + sx_xunlock(&pmc_sx); +done_syscall: if (error) atomic_add_int(&pmc_stats.pm_syscall_errors, 1); Modified: stable/11/sys/sys/pmclog.h ============================================================================== --- stable/11/sys/sys/pmclog.h Wed Nov 8 12:11:54 2017 (r325550) +++ stable/11/sys/sys/pmclog.h Wed Nov 8 12:13:25 2017 (r325551) @@ -260,6 +260,8 @@ int pmclog_deconfigure_log(struct pmc_owner *_po); int pmclog_flush(struct pmc_owner *_po); int pmclog_close(struct pmc_owner *_po); void pmclog_initialize(void); +int pmclog_proc_create(struct thread *td, void **handlep); +void pmclog_proc_ignite(void *handle, struct pmc_owner *po); void pmclog_process_callchain(struct pmc *_pm, struct pmc_sample *_ps); void pmclog_process_closelog(struct pmc_owner *po); void pmclog_process_dropnotify(struct pmc_owner *po); From owner-svn-src-all@freebsd.org Wed Nov 8 12:34:48 2017 Return-Path: Delivered-To: svn-src-all@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 BB5D7E52056; Wed, 8 Nov 2017 12:34:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92B9C78AE9; Wed, 8 Nov 2017 12:34:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8CYl6G057231; Wed, 8 Nov 2017 12:34:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8CYlf5057228; Wed, 8 Nov 2017 12:34:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201711081234.vA8CYlf5057228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 8 Nov 2017 12:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325552 - in head: lib/libnetgraph tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: lib/libnetgraph tools/build/mk X-SVN-Commit-Revision: 325552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 12:34:48 -0000 Author: mav Date: Wed Nov 8 12:34:47 2017 New Revision: 325552 URL: https://svnweb.freebsd.org/changeset/base/325552 Log: s/NgSendMsgReply/NgSendReplyMsg/ in man to match the code. Submitted by: Dmitry Luhtionov MFC after: 2 weeks Modified: head/lib/libnetgraph/Makefile head/lib/libnetgraph/netgraph.3 head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/lib/libnetgraph/Makefile ============================================================================== --- head/lib/libnetgraph/Makefile Wed Nov 8 12:13:25 2017 (r325551) +++ head/lib/libnetgraph/Makefile Wed Nov 8 12:34:47 2017 (r325552) @@ -15,7 +15,7 @@ MLINKS+= netgraph.3 NgMkSockNode.3 MLINKS+= netgraph.3 NgNameNode.3 MLINKS+= netgraph.3 NgSendMsg.3 MLINKS+= netgraph.3 NgSendAsciiMsg.3 -MLINKS+= netgraph.3 NgSendMsgReply.3 +MLINKS+= netgraph.3 NgSendReplyMsg.3 MLINKS+= netgraph.3 NgRecvMsg.3 MLINKS+= netgraph.3 NgAllocRecvMsg.3 MLINKS+= netgraph.3 NgRecvAsciiMsg.3 Modified: head/lib/libnetgraph/netgraph.3 ============================================================================== --- head/lib/libnetgraph/netgraph.3 Wed Nov 8 12:13:25 2017 (r325551) +++ head/lib/libnetgraph/netgraph.3 Wed Nov 8 12:34:47 2017 (r325552) @@ -43,7 +43,7 @@ .Nm NgNameNode , .Nm NgSendMsg , .Nm NgSendAsciiMsg , -.Nm NgSendMsgReply , +.Nm NgSendReplyMsg , .Nm NgRecvMsg , .Nm NgAllocRecvMsg , .Nm NgRecvAsciiMsg , @@ -70,7 +70,7 @@ .Ft int .Fn NgSendAsciiMsg "int cs" "const char *path" "const char *fmt" ... .Ft int -.Fo NgSendMsgReply +.Fo NgSendReplyMsg .Fa "int cs" "const char *path" "struct ng_mesg *msg" "const void *arg" .Fa "size_t arglen" .Fc @@ -162,7 +162,7 @@ header is returned. This value is typically used to associate replies. .Pp Use -.Fn NgSendMsgReply +.Fn NgSendReplyMsg to send reply to a previously received control message. The original message header should be pointed to by .Fa msg . Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Nov 8 12:13:25 2017 (r325551) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Nov 8 12:34:47 2017 (r325552) @@ -6153,7 +6153,7 @@ OLD_FILES+=usr/share/man/man3/NgRecvMsg.3.gz OLD_FILES+=usr/share/man/man3/NgSendAsciiMsg.3.gz OLD_FILES+=usr/share/man/man3/NgSendData.3.gz OLD_FILES+=usr/share/man/man3/NgSendMsg.3.gz -OLD_FILES+=usr/share/man/man3/NgSendMsgReply.3.gz +OLD_FILES+=usr/share/man/man3/NgSendReplyMsg.3.gz OLD_FILES+=usr/share/man/man3/NgSetDebug.3.gz OLD_FILES+=usr/share/man/man3/NgSetErrLog.3.gz OLD_FILES+=usr/share/man/man3/netgraph.3.gz From owner-svn-src-all@freebsd.org Wed Nov 8 13:05:15 2017 Return-Path: Delivered-To: svn-src-all@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 F1454E53085; Wed, 8 Nov 2017 13:05:15 +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 BBB5679C1C; Wed, 8 Nov 2017 13:05:15 +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 vA8D5Eni069689; Wed, 8 Nov 2017 13:05:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8D5Ese069688; Wed, 8 Nov 2017 13:05:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711081305.vA8D5Ese069688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 13:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325553 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 325553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 13:05:16 -0000 Author: kib Date: Wed Nov 8 13:05:14 2017 New Revision: 325553 URL: https://svnweb.freebsd.org/changeset/base/325553 Log: Remove useless DEBUG printfs in i386 sendsig() implementations. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Nov 8 12:34:47 2017 (r325552) +++ head/sys/i386/i386/machdep.c Wed Nov 8 13:05:14 2017 (r325553) @@ -430,9 +430,6 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mas * Copy the sigframe out to the user's stack. */ if (copyout(&sf, fp, sizeof(*fp)) != 0) { -#ifdef DEBUG - printf("process %ld has trashed its stack\n", (long)p->p_pid); -#endif PROC_LOCK(p); sigexit(td, SIGILL); } @@ -559,9 +556,6 @@ freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse * Copy the sigframe out to the user's stack. */ if (copyout(&sf, sfp, sizeof(*sfp)) != 0) { -#ifdef DEBUG - printf("process %ld has trashed its stack\n", (long)p->p_pid); -#endif PROC_LOCK(p); sigexit(td, SIGILL); } @@ -725,9 +719,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask (xfpusave != NULL && copyout(xfpusave, (void *)sf.sf_uc.uc_mcontext.mc_xfpustate, xfpusave_len) != 0)) { -#ifdef DEBUG - printf("process %ld has trashed its stack\n", (long)p->p_pid); -#endif PROC_LOCK(p); sigexit(td, SIGILL); } From owner-svn-src-all@freebsd.org Wed Nov 8 13:06:43 2017 Return-Path: Delivered-To: svn-src-all@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 660F4E53206; Wed, 8 Nov 2017 13:06:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FFC779E88; Wed, 8 Nov 2017 13:06:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8D6gBQ069775; Wed, 8 Nov 2017 13:06:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8D6g3g069774; Wed, 8 Nov 2017 13:06:42 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201711081306.vA8D6g3g069774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 Nov 2017 13:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325554 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 325554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 13:06:43 -0000 Author: manu Date: Wed Nov 8 13:06:41 2017 New Revision: 325554 URL: https://svnweb.freebsd.org/changeset/base/325554 Log: ctl(4): Insert a new line after a sentence-ending full stop. Reported by: bjk MFC after: 2 weeks Sponsored by: Gandi.net X-MFC-With: r325517 Modified: head/share/man/man4/ctl.4 Modified: head/share/man/man4/ctl.4 ============================================================================== --- head/share/man/man4/ctl.4 Wed Nov 8 13:05:14 2017 (r325553) +++ head/share/man/man4/ctl.4 Wed Nov 8 13:06:41 2017 (r325554) @@ -197,9 +197,11 @@ The following variables are available as tunables: .Bl -tag -width indent .It Va kern.cam.ctl.max_luns -Specifies the maximum number of LUNs we support, must be a power of 2. (Default 1024) +Specifies the maximum number of LUNs we support, must be a power of 2. +The default value is 1024. .It Va kern.cam.ctl.max_ports -Specifies the maximum number of ports we support, must be a power of 2. (Default 256) +Specifies the maximum number of ports we support, must be a power of 2. +The default value is 256. .Sh SEE ALSO .Xr cfiscsi 4 , .Xr cfumass 4 , From owner-svn-src-all@freebsd.org Wed Nov 8 14:21:54 2017 Return-Path: Delivered-To: svn-src-all@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 AA8A6E54D7C; Wed, 8 Nov 2017 14:21:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5B2197C9FB; Wed, 8 Nov 2017 14:21:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8ELrvi004332; Wed, 8 Nov 2017 14:21:53 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8ELqvg004304; Wed, 8 Nov 2017 14:21:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201711081421.vA8ELqvg004304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 8 Nov 2017 14:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325555 - in head/sys: compat/cloudabi32 compat/cloudabi64 contrib/cloudabi X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head/sys: compat/cloudabi32 compat/cloudabi64 contrib/cloudabi X-SVN-Commit-Revision: 325555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 14:21:54 -0000 Author: ed Date: Wed Nov 8 14:21:52 2017 New Revision: 325555 URL: https://svnweb.freebsd.org/changeset/base/325555 Log: Upgrade to CloudABI v0.17. Compared to the previous version, v0.16, there are a couple of minor changes: - CLOUDABI_AT_PID: Process identifiers for CloudABI processes. Initially, BSD process identifiers weren't exposed inside the runtime, due to them being pretty much useless inside of a cluster computing environment. When jobs are scheduled across systems, the BSD process number doesn't act as an identifier. Even on individual systems they may recycle relatively quickly. With this change, the kernel will now generate a UUIDv4 when executing a process. These UUIDs can be obtained within the process using program_getpid(). Right now, FreeBSD will not attempt to store this value. This should of course happen at some point in time, so that it may be printed by administration tools. - Removal of some unused structure members for polling. With the polling framework being simplified/redesigned, it turns out some of the structure fields were not used by the C library. We can remove these to keep things nice and tidy. Obtained from: https://github.com/NuxiNL/cloudabi Modified: head/sys/compat/cloudabi32/cloudabi32_module.c head/sys/compat/cloudabi32/cloudabi32_poll.c head/sys/compat/cloudabi32/cloudabi32_proto.h head/sys/compat/cloudabi32/cloudabi32_systrace_args.c head/sys/compat/cloudabi64/cloudabi64_module.c head/sys/compat/cloudabi64/cloudabi64_poll.c head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_systrace_args.c head/sys/contrib/cloudabi/cloudabi32_types.h head/sys/contrib/cloudabi/cloudabi64_types.h head/sys/contrib/cloudabi/cloudabi_types_common.h head/sys/contrib/cloudabi/syscalls32.master head/sys/contrib/cloudabi/syscalls64.master Modified: head/sys/compat/cloudabi32/cloudabi32_module.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_module.c Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/compat/cloudabi32/cloudabi32_module.c Wed Nov 8 14:21:52 2017 (r325555) @@ -63,10 +63,10 @@ cloudabi32_copyout_strings(struct image_params *imgp) int cloudabi32_fixup(register_t **stack_base, struct image_params *imgp) { - char canarybuf[64]; + char canarybuf[64], pidbuf[16]; Elf32_Auxargs *args; struct thread *td; - void *argdata, *canary; + void *argdata, *canary, *pid; size_t argdatalen; int error; @@ -79,8 +79,9 @@ cloudabi32_fixup(register_t **stack_base, struct image td = curthread; td->td_proc->p_osrel = __FreeBSD_version; - /* Store canary for stack smashing protection. */ argdata = *stack_base; + + /* Store canary for stack smashing protection. */ arc4rand(canarybuf, sizeof(canarybuf), 0); *stack_base -= howmany(sizeof(canarybuf), sizeof(register_t)); canary = *stack_base; @@ -89,6 +90,20 @@ cloudabi32_fixup(register_t **stack_base, struct image return (error); /* + * Generate a random UUID that identifies the process. Right now + * we don't store this UUID in the kernel. Ideally, it should be + * exposed through ps(1). + */ + arc4rand(pidbuf, sizeof(pidbuf), 0); + pidbuf[6] = (pidbuf[6] & 0x0f) | 0x40; + pidbuf[8] = (pidbuf[8] & 0x3f) | 0x80; + *stack_base -= howmany(sizeof(pidbuf), sizeof(register_t)); + pid = *stack_base; + error = copyout(pidbuf, pid, sizeof(pidbuf)); + if (error != 0) + return (error); + + /* * Compute length of program arguments. As the argument data is * binary safe, we had to add a trailing null byte in * exec_copyin_data_fds(). Undo this by reducing the length. @@ -111,9 +126,10 @@ cloudabi32_fixup(register_t **stack_base, struct image VAL(CLOUDABI_AT_PAGESZ, args->pagesz), PTR(CLOUDABI_AT_PHDR, args->phdr), VAL(CLOUDABI_AT_PHNUM, args->phnum), - VAL(CLOUDABI_AT_TID, td->td_tid), + PTR(CLOUDABI_AT_PID, pid), PTR(CLOUDABI_AT_SYSINFO_EHDR, imgp->proc->p_sysent->sv_shared_page_base), + VAL(CLOUDABI_AT_TID, td->td_tid), #undef VAL #undef PTR { .a_type = CLOUDABI_AT_NULL }, Modified: head/sys/compat/cloudabi32/cloudabi32_poll.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_poll.c Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/compat/cloudabi32/cloudabi32_poll.c Wed Nov 8 14:21:52 2017 (r325555) @@ -78,7 +78,7 @@ convert_signal(int sig) struct cloudabi32_kevent_args { const cloudabi32_subscription_t *in; - cloudabi32_event_t *out; + cloudabi_event_t *out; }; /* Converts CloudABI's subscription objects to FreeBSD's struct kevent. */ @@ -145,7 +145,7 @@ cloudabi32_kevent_copyin(void *arg, struct kevent *kev static int cloudabi32_kevent_copyout(void *arg, struct kevent *kevp, int count) { - cloudabi32_event_t ev; + cloudabi_event_t ev; struct cloudabi32_kevent_args *args; int error; @@ -157,19 +157,15 @@ cloudabi32_kevent_copyout(void *arg, struct kevent *ke switch (kevp->filter) { case EVFILT_TIMER: ev.type = CLOUDABI_EVENTTYPE_CLOCK; - ev.clock.identifier = kevp->ident; break; case EVFILT_READ: ev.type = CLOUDABI_EVENTTYPE_FD_READ; - ev.fd_readwrite.fd = kevp->ident; break; case EVFILT_WRITE: ev.type = CLOUDABI_EVENTTYPE_FD_WRITE; - ev.fd_readwrite.fd = kevp->ident; break; case EVFILT_PROCDESC: ev.type = CLOUDABI_EVENTTYPE_PROC_TERMINATE; - ev.proc_terminate.fd = kevp->ident; break; } @@ -231,7 +227,7 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi */ if (uap->nsubscriptions == 1) { cloudabi32_subscription_t sub; - cloudabi32_event_t ev = {}; + cloudabi_event_t ev = {}; int error; error = copyin(uap->in, &sub, sizeof(sub)); @@ -241,7 +237,6 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi ev.type = sub.type; if (sub.type == CLOUDABI_EVENTTYPE_CONDVAR) { /* Wait on a condition variable. */ - ev.condvar.condvar = sub.condvar.condvar; ev.error = cloudabi_convert_errno( cloudabi_futex_condvar_wait( td, TO_PTR(sub.condvar.condvar), @@ -253,7 +248,6 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi return (copyout(&ev, uap->out, sizeof(ev))); } else if (sub.type == CLOUDABI_EVENTTYPE_LOCK_RDLOCK) { /* Acquire a read lock. */ - ev.lock.lock = sub.lock.lock; ev.error = cloudabi_convert_errno( cloudabi_futex_lock_rdlock( td, TO_PTR(sub.lock.lock), @@ -263,7 +257,6 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi return (copyout(&ev, uap->out, sizeof(ev))); } else if (sub.type == CLOUDABI_EVENTTYPE_LOCK_WRLOCK) { /* Acquire a write lock. */ - ev.lock.lock = sub.lock.lock; ev.error = cloudabi_convert_errno( cloudabi_futex_lock_wrlock( td, TO_PTR(sub.lock.lock), @@ -274,7 +267,7 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi } } else if (uap->nsubscriptions == 2) { cloudabi32_subscription_t sub[2]; - cloudabi32_event_t ev[2] = {}; + cloudabi_event_t ev[2] = {}; int error; error = copyin(uap->in, &sub, sizeof(sub)); @@ -288,8 +281,6 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi sub[1].type == CLOUDABI_EVENTTYPE_CLOCK && sub[1].clock.flags == CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME) { /* Wait for a condition variable with timeout. */ - ev[0].condvar.condvar = sub[0].condvar.condvar; - ev[1].clock.identifier = sub[1].clock.identifier; error = cloudabi_futex_condvar_wait( td, TO_PTR(sub[0].condvar.condvar), sub[0].condvar.condvar_scope, @@ -309,8 +300,6 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi sub[1].type == CLOUDABI_EVENTTYPE_CLOCK && sub[1].clock.flags == CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME) { /* Acquire a read lock with a timeout. */ - ev[0].lock.lock = sub[0].lock.lock; - ev[1].clock.identifier = sub[1].clock.identifier; error = cloudabi_futex_lock_rdlock( td, TO_PTR(sub[0].lock.lock), sub[0].lock.lock_scope, sub[1].clock.clock_id, @@ -328,8 +317,6 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi sub[1].type == CLOUDABI_EVENTTYPE_CLOCK && sub[1].clock.flags == CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME) { /* Acquire a write lock with a timeout. */ - ev[0].lock.lock = sub[0].lock.lock; - ev[1].clock.identifier = sub[1].clock.identifier; error = cloudabi_futex_lock_wrlock( td, TO_PTR(sub[0].lock.lock), sub[0].lock.lock_scope, sub[1].clock.clock_id, Modified: head/sys/compat/cloudabi32/cloudabi32_proto.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_proto.h Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/compat/cloudabi32/cloudabi32_proto.h Wed Nov 8 14:21:52 2017 (r325555) @@ -224,7 +224,7 @@ struct cloudabi_sys_mem_unmap_args { }; struct cloudabi32_sys_poll_args { char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)]; - char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)]; + char out_l_[PADL_(cloudabi_event_t *)]; cloudabi_event_t * out; char out_r_[PADR_(cloudabi_event_t *)]; char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; }; struct cloudabi_sys_proc_exec_args { Modified: head/sys/compat/cloudabi32/cloudabi32_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Wed Nov 8 14:21:52 2017 (r325555) @@ -352,7 +352,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 37: { struct cloudabi32_sys_poll_args *p = params; uarg[0] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */ - uarg[1] = (intptr_t) p->out; /* cloudabi32_event_t * */ + uarg[1] = (intptr_t) p->out; /* cloudabi_event_t * */ uarg[2] = p->nsubscriptions; /* size_t */ *n_args = 3; break; @@ -1062,7 +1062,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland const cloudabi32_subscription_t *"; break; case 1: - p = "userland cloudabi32_event_t *"; + p = "userland cloudabi_event_t *"; break; case 2: p = "size_t"; Modified: head/sys/compat/cloudabi64/cloudabi64_module.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_module.c Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/compat/cloudabi64/cloudabi64_module.c Wed Nov 8 14:21:52 2017 (r325555) @@ -63,10 +63,10 @@ cloudabi64_copyout_strings(struct image_params *imgp) int cloudabi64_fixup(register_t **stack_base, struct image_params *imgp) { - char canarybuf[64]; + char canarybuf[64], pidbuf[16]; Elf64_Auxargs *args; struct thread *td; - void *argdata, *canary; + void *argdata, *canary, *pid; size_t argdatalen; int error; @@ -79,8 +79,9 @@ cloudabi64_fixup(register_t **stack_base, struct image td = curthread; td->td_proc->p_osrel = __FreeBSD_version; - /* Store canary for stack smashing protection. */ argdata = *stack_base; + + /* Store canary for stack smashing protection. */ arc4rand(canarybuf, sizeof(canarybuf), 0); *stack_base -= howmany(sizeof(canarybuf), sizeof(register_t)); canary = *stack_base; @@ -89,6 +90,20 @@ cloudabi64_fixup(register_t **stack_base, struct image return (error); /* + * Generate a random UUID that identifies the process. Right now + * we don't store this UUID in the kernel. Ideally, it should be + * exposed through ps(1). + */ + arc4rand(pidbuf, sizeof(pidbuf), 0); + pidbuf[6] = (pidbuf[6] & 0x0f) | 0x40; + pidbuf[8] = (pidbuf[8] & 0x3f) | 0x80; + *stack_base -= howmany(sizeof(pidbuf), sizeof(register_t)); + pid = *stack_base; + error = copyout(pidbuf, pid, sizeof(pidbuf)); + if (error != 0) + return (error); + + /* * Compute length of program arguments. As the argument data is * binary safe, we had to add a trailing null byte in * exec_copyin_data_fds(). Undo this by reducing the length. @@ -111,9 +126,10 @@ cloudabi64_fixup(register_t **stack_base, struct image VAL(CLOUDABI_AT_PAGESZ, args->pagesz), PTR(CLOUDABI_AT_PHDR, args->phdr), VAL(CLOUDABI_AT_PHNUM, args->phnum), - VAL(CLOUDABI_AT_TID, td->td_tid), + PTR(CLOUDABI_AT_PID, pid), PTR(CLOUDABI_AT_SYSINFO_EHDR, imgp->proc->p_sysent->sv_shared_page_base), + VAL(CLOUDABI_AT_TID, td->td_tid), #undef VAL #undef PTR { .a_type = CLOUDABI_AT_NULL }, Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_poll.c Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/compat/cloudabi64/cloudabi64_poll.c Wed Nov 8 14:21:52 2017 (r325555) @@ -78,7 +78,7 @@ convert_signal(int sig) struct cloudabi64_kevent_args { const cloudabi64_subscription_t *in; - cloudabi64_event_t *out; + cloudabi_event_t *out; }; /* Converts CloudABI's subscription objects to FreeBSD's struct kevent. */ @@ -145,7 +145,7 @@ cloudabi64_kevent_copyin(void *arg, struct kevent *kev static int cloudabi64_kevent_copyout(void *arg, struct kevent *kevp, int count) { - cloudabi64_event_t ev; + cloudabi_event_t ev; struct cloudabi64_kevent_args *args; int error; @@ -157,19 +157,15 @@ cloudabi64_kevent_copyout(void *arg, struct kevent *ke switch (kevp->filter) { case EVFILT_TIMER: ev.type = CLOUDABI_EVENTTYPE_CLOCK; - ev.clock.identifier = kevp->ident; break; case EVFILT_READ: ev.type = CLOUDABI_EVENTTYPE_FD_READ; - ev.fd_readwrite.fd = kevp->ident; break; case EVFILT_WRITE: ev.type = CLOUDABI_EVENTTYPE_FD_WRITE; - ev.fd_readwrite.fd = kevp->ident; break; case EVFILT_PROCDESC: ev.type = CLOUDABI_EVENTTYPE_PROC_TERMINATE; - ev.proc_terminate.fd = kevp->ident; break; } @@ -231,7 +227,7 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi */ if (uap->nsubscriptions == 1) { cloudabi64_subscription_t sub; - cloudabi64_event_t ev = {}; + cloudabi_event_t ev = {}; int error; error = copyin(uap->in, &sub, sizeof(sub)); @@ -241,7 +237,6 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi ev.type = sub.type; if (sub.type == CLOUDABI_EVENTTYPE_CONDVAR) { /* Wait on a condition variable. */ - ev.condvar.condvar = sub.condvar.condvar; ev.error = cloudabi_convert_errno( cloudabi_futex_condvar_wait( td, TO_PTR(sub.condvar.condvar), @@ -253,7 +248,6 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi return (copyout(&ev, uap->out, sizeof(ev))); } else if (sub.type == CLOUDABI_EVENTTYPE_LOCK_RDLOCK) { /* Acquire a read lock. */ - ev.lock.lock = sub.lock.lock; ev.error = cloudabi_convert_errno( cloudabi_futex_lock_rdlock( td, TO_PTR(sub.lock.lock), @@ -263,7 +257,6 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi return (copyout(&ev, uap->out, sizeof(ev))); } else if (sub.type == CLOUDABI_EVENTTYPE_LOCK_WRLOCK) { /* Acquire a write lock. */ - ev.lock.lock = sub.lock.lock; ev.error = cloudabi_convert_errno( cloudabi_futex_lock_wrlock( td, TO_PTR(sub.lock.lock), @@ -274,7 +267,7 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi } } else if (uap->nsubscriptions == 2) { cloudabi64_subscription_t sub[2]; - cloudabi64_event_t ev[2] = {}; + cloudabi_event_t ev[2] = {}; int error; error = copyin(uap->in, &sub, sizeof(sub)); @@ -288,8 +281,6 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi sub[1].type == CLOUDABI_EVENTTYPE_CLOCK && sub[1].clock.flags == CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME) { /* Wait for a condition variable with timeout. */ - ev[0].condvar.condvar = sub[0].condvar.condvar; - ev[1].clock.identifier = sub[1].clock.identifier; error = cloudabi_futex_condvar_wait( td, TO_PTR(sub[0].condvar.condvar), sub[0].condvar.condvar_scope, @@ -309,8 +300,6 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi sub[1].type == CLOUDABI_EVENTTYPE_CLOCK && sub[1].clock.flags == CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME) { /* Acquire a read lock with a timeout. */ - ev[0].lock.lock = sub[0].lock.lock; - ev[1].clock.identifier = sub[1].clock.identifier; error = cloudabi_futex_lock_rdlock( td, TO_PTR(sub[0].lock.lock), sub[0].lock.lock_scope, sub[1].clock.clock_id, @@ -328,8 +317,6 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi sub[1].type == CLOUDABI_EVENTTYPE_CLOCK && sub[1].clock.flags == CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME) { /* Acquire a write lock with a timeout. */ - ev[0].lock.lock = sub[0].lock.lock; - ev[1].clock.identifier = sub[1].clock.identifier; error = cloudabi_futex_lock_wrlock( td, TO_PTR(sub[0].lock.lock), sub[0].lock.lock_scope, sub[1].clock.clock_id, Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Wed Nov 8 14:21:52 2017 (r325555) @@ -224,7 +224,7 @@ struct cloudabi_sys_mem_unmap_args { }; struct cloudabi64_sys_poll_args { char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; - char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; + char out_l_[PADL_(cloudabi_event_t *)]; cloudabi_event_t * out; char out_r_[PADR_(cloudabi_event_t *)]; char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; }; struct cloudabi_sys_proc_exec_args { Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Wed Nov 8 14:21:52 2017 (r325555) @@ -352,7 +352,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg case 37: { struct cloudabi64_sys_poll_args *p = params; uarg[0] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ - uarg[1] = (intptr_t) p->out; /* cloudabi64_event_t * */ + uarg[1] = (intptr_t) p->out; /* cloudabi_event_t * */ uarg[2] = p->nsubscriptions; /* size_t */ *n_args = 3; break; @@ -1062,7 +1062,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d p = "userland const cloudabi64_subscription_t *"; break; case 1: - p = "userland cloudabi64_event_t *"; + p = "userland cloudabi_event_t *"; break; case 2: p = "size_t"; Modified: head/sys/contrib/cloudabi/cloudabi32_types.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi32_types.h Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/contrib/cloudabi/cloudabi32_types.h Wed Nov 8 14:21:52 2017 (r325555) @@ -53,47 +53,6 @@ _Static_assert(sizeof(cloudabi32_ciovec_t) == 8, "Inco _Static_assert(_Alignof(cloudabi32_ciovec_t) == 4, "Incorrect layout"); typedef struct { - _Alignas(8) cloudabi_userdata_t userdata; - _Alignas(2) cloudabi_errno_t error; - _Alignas(1) cloudabi_eventtype_t type; - union { - struct { - _Alignas(8) cloudabi_userdata_t identifier; - } clock; - struct { - _Alignas(4) uint32_t condvar; - } condvar; - struct { - _Alignas(8) cloudabi_filesize_t nbytes; - _Alignas(4) cloudabi_fd_t fd; - _Alignas(2) cloudabi_eventrwflags_t flags; - } fd_readwrite; - struct { - _Alignas(4) uint32_t lock; - } lock; - struct { - _Alignas(4) cloudabi_fd_t fd; - _Alignas(1) cloudabi_signal_t signal; - _Alignas(4) cloudabi_exitcode_t exitcode; - } proc_terminate; - }; -} cloudabi32_event_t; -_Static_assert(offsetof(cloudabi32_event_t, userdata) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, error) == 8, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, type) == 10, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, clock.identifier) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, condvar.condvar) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, fd_readwrite.fd) == 24, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, fd_readwrite.flags) == 28, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, lock.lock) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, proc_terminate.fd) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, proc_terminate.signal) == 20, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_event_t, proc_terminate.exitcode) == 24, "Incorrect layout"); -_Static_assert(sizeof(cloudabi32_event_t) == 32, "Incorrect layout"); -_Static_assert(_Alignof(cloudabi32_event_t) == 8, "Incorrect layout"); - -typedef struct { _Alignas(4) uint32_t buf; _Alignas(4) uint32_t buf_len; } cloudabi32_iovec_t; Modified: head/sys/contrib/cloudabi/cloudabi64_types.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi64_types.h Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/contrib/cloudabi/cloudabi64_types.h Wed Nov 8 14:21:52 2017 (r325555) @@ -53,47 +53,6 @@ _Static_assert(sizeof(cloudabi64_ciovec_t) == 16, "Inc _Static_assert(_Alignof(cloudabi64_ciovec_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) cloudabi_userdata_t userdata; - _Alignas(2) cloudabi_errno_t error; - _Alignas(1) cloudabi_eventtype_t type; - union { - struct { - _Alignas(8) cloudabi_userdata_t identifier; - } clock; - struct { - _Alignas(8) uint64_t condvar; - } condvar; - struct { - _Alignas(8) cloudabi_filesize_t nbytes; - _Alignas(4) cloudabi_fd_t fd; - _Alignas(2) cloudabi_eventrwflags_t flags; - } fd_readwrite; - struct { - _Alignas(8) uint64_t lock; - } lock; - struct { - _Alignas(4) cloudabi_fd_t fd; - _Alignas(1) cloudabi_signal_t signal; - _Alignas(4) cloudabi_exitcode_t exitcode; - } proc_terminate; - }; -} cloudabi64_event_t; -_Static_assert(offsetof(cloudabi64_event_t, userdata) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, error) == 8, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, type) == 10, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, "Incorrect layout"); -_Static_assert(sizeof(cloudabi64_event_t) == 32, "Incorrect layout"); -_Static_assert(_Alignof(cloudabi64_event_t) == 8, "Incorrect layout"); - -typedef struct { _Alignas(8) uint64_t buf; _Alignas(8) uint64_t buf_len; } cloudabi64_iovec_t; Modified: head/sys/contrib/cloudabi/cloudabi_types_common.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi_types_common.h Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/contrib/cloudabi/cloudabi_types_common.h Wed Nov 8 14:21:52 2017 (r325555) @@ -56,6 +56,7 @@ typedef uint32_t cloudabi_auxtype_t; #define CLOUDABI_AT_PAGESZ 6 #define CLOUDABI_AT_PHDR 3 #define CLOUDABI_AT_PHNUM 4 +#define CLOUDABI_AT_PID 263 #define CLOUDABI_AT_SYSINFO_EHDR 262 #define CLOUDABI_AT_TID 261 @@ -351,6 +352,35 @@ _Static_assert(offsetof(cloudabi_dirent_t, d_namlen) = _Static_assert(offsetof(cloudabi_dirent_t, d_type) == 20, "Incorrect layout"); _Static_assert(sizeof(cloudabi_dirent_t) == 24, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_dirent_t) == 8, "Incorrect layout"); + +typedef struct { + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_errno_t error; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { + _Alignas(8) cloudabi_filesize_t nbytes; + _Alignas(1) char unused[4]; + _Alignas(2) cloudabi_eventrwflags_t flags; + } fd_readwrite; + struct { + _Alignas(1) char unused[4]; + _Alignas(1) cloudabi_signal_t signal; + _Alignas(4) cloudabi_exitcode_t exitcode; + } proc_terminate; + }; +} cloudabi_event_t; +_Static_assert(offsetof(cloudabi_event_t, userdata) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, error) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, type) == 10, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.unused) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, fd_readwrite.flags) == 28, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, proc_terminate.unused) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, proc_terminate.signal) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_event_t, proc_terminate.exitcode) == 24, "Incorrect layout"); +_Static_assert(sizeof(cloudabi_event_t) == 32, "Incorrect layout"); +_Static_assert(_Alignof(cloudabi_event_t) == 8, "Incorrect layout"); typedef struct { _Alignas(1) cloudabi_filetype_t fs_filetype; Modified: head/sys/contrib/cloudabi/syscalls32.master ============================================================================== --- head/sys/contrib/cloudabi/syscalls32.master Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/contrib/cloudabi/syscalls32.master Wed Nov 8 14:21:52 2017 (r325555) @@ -228,7 +228,7 @@ 37 AUE_NULL STD { size_t cloudabi32_sys_poll( \ const cloudabi32_subscription_t *in, \ - cloudabi32_event_t *out, \ + cloudabi_event_t *out, \ size_t nsubscriptions); } 38 AUE_NULL STD { void cloudabi_sys_proc_exec( \ Modified: head/sys/contrib/cloudabi/syscalls64.master ============================================================================== --- head/sys/contrib/cloudabi/syscalls64.master Wed Nov 8 13:06:41 2017 (r325554) +++ head/sys/contrib/cloudabi/syscalls64.master Wed Nov 8 14:21:52 2017 (r325555) @@ -228,7 +228,7 @@ 37 AUE_NULL STD { size_t cloudabi64_sys_poll( \ const cloudabi64_subscription_t *in, \ - cloudabi64_event_t *out, \ + cloudabi_event_t *out, \ size_t nsubscriptions); } 38 AUE_NULL STD { void cloudabi_sys_proc_exec( \ From owner-svn-src-all@freebsd.org Wed Nov 8 14:44:48 2017 Return-Path: Delivered-To: svn-src-all@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 77ECDE55619; Wed, 8 Nov 2017 14:44:48 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2A78C7D6B3; Wed, 8 Nov 2017 14:44:48 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8Eil2U012988; Wed, 8 Nov 2017 14:44:47 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8Eikkf012975; Wed, 8 Nov 2017 14:44:46 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201711081444.vA8Eikkf012975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Wed, 8 Nov 2017 14:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325556 - in head/sys/boot: arm/uboot efi/loader i386/loader i386/zfsloader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: in head/sys/boot: arm/uboot efi/loader i386/loader i386/zfsloader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userboot/userboot X-SVN-Commit-Revision: 325556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 14:44:48 -0000 Author: royger Date: Wed Nov 8 14:44:45 2017 New Revision: 325556 URL: https://svnweb.freebsd.org/changeset/base/325556 Log: loader: set options before including bsd.init.mk bsd.init.mk ends up including defs.mk so the per-arch options must be set before including defs.mk, or else the global defaults will be used and the per-arch ones will be ignored. Although better, note that the usage of MK_FDT before the inclusion of bsd.init.mk is incorrect but doesn't lead to build errors. This circular dependency must be broken in order for this to work correctly. Reviewed by: imp Sponsored by: Citrix Systems R&D Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsloader/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/arm/uboot/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -1,5 +1,16 @@ # $FreeBSD$ +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_NET_SUPPORT?= yes +LOADER_NFS_SUPPORT?= yes +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no +LOADER_FDT_SUPPORT= ${MK_FDT} + .include FILES= ubldr ubldr.bin @@ -17,17 +28,6 @@ SRCS= start.S conf.c self_reloc.c vers.c .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif - -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= no -LOADER_MSDOS_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/efi/loader/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -2,6 +2,12 @@ MAN= +LOADER_NET_SUPPORT?= yes +LOADER_MSDOS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no + .include MK_SSP= no @@ -9,12 +15,6 @@ MK_SSP= no PROG= loader.sym INTERNALPROG= WARNS?= 3 -LOADER_NET_SUPPORT?= yes - -LOADER_MSDOS_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no # architecture-specific loader code SRCS= autoload.c \ Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/i386/loader/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -1,5 +1,15 @@ # $FreeBSD$ +LOADER_NET_SUPPORT?= yes +LOADER_NFS_SUPPORT?= yes +LOADER_TFTP_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no +LOADER_UFS_SUPPORT?= yes +LOADER_GZIP_SUPPORT?= yes +LOADER_BZIP2_SUPPORT?= yes + .include MK_SSP= no @@ -10,16 +20,6 @@ MAN= INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 VERSION_FILE= ${.CURDIR}/../loader/version -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= yes - -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -LOADER_MSDOS_SUPPORT?= no -LOADER_UFS_SUPPORT?= yes -LOADER_GZIP_SUPPORT?= yes -LOADER_BZIP2_SUPPORT?= yes # architecture-specific loader code SRCS= main.c conf.c vers.c chain.c Modified: head/sys/boot/i386/zfsloader/Makefile ============================================================================== --- head/sys/boot/i386/zfsloader/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/i386/zfsloader/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -1,12 +1,13 @@ # $FreeBSD$ +LOADER_ZFS_SUPPORT=yes + .include .PATH: ${BOOTSRC}/i386/loader LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 -LOADER_ZFS_SUPPORT=yes LOADER_ONLY= yes MAN= Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/mips/beri/loader/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -29,6 +29,13 @@ # # $FreeBSD$ +LOADER_MSDOS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_GZIP_SUPPORT?= yes +LOADER_BZIP2_SUPPORT?= yes + .include MK_SSP= no @@ -59,13 +66,6 @@ SRCS+= altera_jtag_uart.c \ # Since we don't have a backward compatibility issue, default to this on BERI. CFLAGS+= -DBOOT_PROMPT_123 - -LOADER_MSDOS_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -LOADER_GZIP_SUPPORT?= yes -LOADER_BZIP2_SUPPORT?= yes # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/mips/uboot/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -1,5 +1,16 @@ # $FreeBSD$ +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes +LOADER_NET_SUPPORT?= yes +LOADER_NFS_SUPPORT?= yes +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no +LOADER_FDT_SUPPORT= ${MK_FDT} + .include FILES= ubldr @@ -13,17 +24,6 @@ UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c - -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -LOADER_MSDOS_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/powerpc/kboot/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -1,5 +1,16 @@ # $FreeBSD$ +LOADER_CD9660_SUPPORT?= yes +LOADER_MSDOS_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes +LOADER_NET_SUPPORT?= yes +LOADER_NFS_SUPPORT?= yes +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= yes +LOADER_FDT_SUPPORT= yes +LOADER_BZIP2_SUPPORT?= no + .include MK_SSP= no MAN= @@ -12,17 +23,6 @@ INSTALLFLAGS= -b SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freebsd.c SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c - -LOADER_CD9660_SUPPORT?= yes -LOADER_MSDOS_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= yes -LOADER_FDT_SUPPORT= yes -LOADER_BZIP2_SUPPORT?= no .if ${LOADER_FDT_SUPPORT} == "yes" CFLAGS+= -I${FDTSRC} Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/powerpc/ofw/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -1,5 +1,16 @@ # $FreeBSD$ +LOADER_CD9660_SUPPORT?= yes +LOADER_EXT2FS_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no +LOADER_UFS_SUPPORT?= yes +LOADER_NET_SUPPORT?= yes +LOADER_NFS_SUPPORT?= yes +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= yes +LOADER_BZIP2_SUPPORT?= no +LOADER_FDT_SUPPORT?= yes + .include MK_SSP= no MAN= @@ -11,17 +22,6 @@ INSTALLFLAGS= -b # Architecture-specific loader code SRCS= conf.c metadata.c vers.c start.c SRCS+= ucmpdi2.c - -LOADER_CD9660_SUPPORT?= yes -LOADER_EXT2FS_SUPPORT?= no -LOADER_MSDOS_SUPPORT?= no -LOADER_UFS_SUPPORT?= yes -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= yes -LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT?= yes .if ${LOADER_FDT_SUPPORT} == "yes" SRCS+= ofwfdt.c Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/powerpc/ps3/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -1,5 +1,15 @@ # $FreeBSD$ +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= yes +LOADER_EXT2FS_SUPPORT?= yes +LOADER_NET_SUPPORT?= yes +LOADER_NFS_SUPPORT?= yes +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= yes +LOADER_FDT_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no + .include MK_SSP= no MAN= @@ -13,16 +23,6 @@ SRCS= start.S conf.c metadata.c vers.c main.c devicen SRCS+= lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c ps3repo.c \ ps3stor.c ps3disk.c ps3cdrom.c SRCS+= ucmpdi2.c - -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= yes -LOADER_EXT2FS_SUPPORT?= yes -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= yes -LOADER_FDT_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no .if ${LOADER_FDT_SUPPORT} == "yes" CFLAGS+= -I${FDTSRC} Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/powerpc/uboot/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -1,5 +1,15 @@ # $FreeBSD$ +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_NET_SUPPORT?= yes +LOADER_NFS_SUPPORT?= yes +LOADER_TFTP_SUPPORT?= no +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no +LOADER_FDT_SUPPORT= ${MK_FDT} + .include PROG= ubldr @@ -10,16 +20,6 @@ MAN= # Architecture-specific loader code SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c - -LOADER_UFS_SUPPORT?= yes -LOADER_CD9660_SUPPORT?= no -LOADER_EXT2FS_SUPPORT?= no -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= no -LOADER_GZIP_SUPPORT?= no -LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/sparc64/loader/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -1,17 +1,5 @@ # $FreeBSD$ -.include -MK_SSP= no -MAN= - -PROG?= loader -NEWVERSWHAT?= "bootstrap loader" sparc64 -VERSION_FILE= ${.CURDIR}/../loader/version -INSTALLFLAGS= -b - -# Architecture-specific loader code -SRCS= locore.S main.c metadata.c vers.c - LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes @@ -24,6 +12,18 @@ LOADER_TFTP_SUPPORT?= yes LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no LOADER_DEBUG?= no + +.include +MK_SSP= no +MAN= + +PROG?= loader +NEWVERSWHAT?= "bootstrap loader" sparc64 +VERSION_FILE= ${.CURDIR}/../loader/version +INSTALLFLAGS= -b + +# Architecture-specific loader code +SRCS= locore.S main.c metadata.c vers.c .if ${LOADER_DEBUG} == "yes" CFLAGS+= -DLOADER_DEBUG Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Wed Nov 8 14:21:52 2017 (r325555) +++ head/sys/boot/userboot/userboot/Makefile Wed Nov 8 14:44:45 2017 (r325556) @@ -2,14 +2,14 @@ MAN= -.include - -MK_SSP= no - LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no + +.include + +MK_SSP= no SHLIB_NAME= userboot.so MK_CTF= no From owner-svn-src-all@freebsd.org Wed Nov 8 15:25:35 2017 Return-Path: Delivered-To: svn-src-all@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 A963EE56816; Wed, 8 Nov 2017 15:25:35 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk0-x244.google.com (mail-qk0-x244.google.com [IPv6:2607:f8b0:400d:c09::244]) (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 6023F7EF21; Wed, 8 Nov 2017 15:25:35 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk0-x244.google.com with SMTP id n66so3746683qki.8; Wed, 08 Nov 2017 07:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Lqm41jAjY3B2QWVLC5IXlAKka5vNTUecWQawL1u065U=; b=Ah7AS85N9QyO14EBHbtlrSTDxaA1LDhoV7DP7nltAK837PeZvnsup6is0D0SX4gaox /vzNZDASSizmrWk6SGIFvUjN4WatraY4281RMbs3mv7c1V0GpH/ynTb73SmBvMc9tZFK FCkbWlyv/ZtQne0YiqJ1Ys5iB8mBmAJrEMHC+SYOKgrFaFuSWCxiSU6Z2jv9+M6sKnf3 XuPH+5ZMC0493AOd8Y4xOyC/N6tBsX65W32/kJbZRkrEmpp13NKYGZiptM3BIN44LE/5 D+crqvJ6GJBZE1v3ue3V22r7rGmhCvfU8X8NJ3eBo6ATNw1CS0eFM32AT86xq+EDhRN7 HKjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Lqm41jAjY3B2QWVLC5IXlAKka5vNTUecWQawL1u065U=; b=fKtk0i5SDyewlfYERl2GLfq2wPbjAV/18L90cqXx0SWIXv6IaFaoSMAr8P6a6pyQn6 4IfhtsnUbCLxeBmSVZMmmSeWcmYU4Jj333Zu6rLWfigmQXqohNjRtpasI1gr4Y4ilR8L 9VTv2iJit+6MOt/8TQc1BHDeGE5iRV3MT6kKZrkte8UnJt/BXHJ1cPkCnjspDCsdmFj7 4UKXx7KC5jM+qMcSm4C9JvH1HWcKnyj9Sz0Vsvlvp+P2MKdeqVCV9ZgCiryU+1Me2mC/ twwwtIjUDg3w95dx6j33xEtqI9XQRnuIuPvXl2hAjv/p6KIeB6LjuND9g7kFrwvmP1J8 1eqg== X-Gm-Message-State: AJaThX7InaIhIBM/B65VGJEWbcGQ5rE39sBKaHOeTQrf83EIZz/jrDXW HWFbsoZRs/Y1TFfKi/ImSli7QicM X-Google-Smtp-Source: AGs4zMabx86SKL4FnmkQd6l9lazddAY6+R8yEwX25tuhDHsQhowwVbdAhZNm6CwK3f/TiG5m0pjXAg== X-Received: by 10.55.69.84 with SMTP id s81mr1241272qka.77.1510154734365; Wed, 08 Nov 2017 07:25:34 -0800 (PST) Received: from mbp-eth.home (201-77-127-155.static.desktop.com.br. [201.77.127.155]) by smtp.gmail.com with ESMTPSA id v12sm2871653qkl.43.2017.11.08.07.25.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Nov 2017 07:25:33 -0800 (PST) Subject: Re: svn commit: r325520 - head/share/mk To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711071820.vA7IK835007755@repo.freebsd.org> From: Renato Botelho Message-ID: <9c4e54cb-26b5-00f5-d672-5cde8b15b187@gmail.com> Date: Wed, 8 Nov 2017 13:25:29 -0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201711071820.vA7IK835007755@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 15:25:35 -0000 On 07/11/17 16:20, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Nov 7 18:20:08 2017 > New Revision: 325520 > URL: https://svnweb.freebsd.org/changeset/base/325520 > > Log: > Reenable AUTO_OBJ by default. > > The problem with it was a bogus .OBJDIR in some cases where creation of > object directories were purposely not attempted, such as for 'make cleandir' > and in etc/ sub-directories. In these cases bmake would start with a > bogus .OBJDIR like etc/ due to MAKEOBJDIR being a dynamic value based on > .CURDIR, SRCTOP, and OBJTOP. OBJTOP would not yet be defined but is > during early src.sys.obj.mk. That file and auto.obj.mk both were not > modifying .OBJDIR unless they expected to create the objdir. Thus in > these cases the .OBJDIR was left as etc/* rather than fixed to the > proper .CURDIR. > > The issues were fixed in r325404 and r325416. An assertion to avoid the > bad .OBJDIR was added in r325405. > > Sponsored by: Dell EMC Isilon Bryan, Are these messages expected to show when make -s is used? [Creating objdir /usr/obj/usr/src/amd64.amd64/usr.bin/look...] Thanks -- Renato Botelho From owner-svn-src-all@freebsd.org Wed Nov 8 16:04:00 2017 Return-Path: Delivered-To: svn-src-all@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 29A26E57105; Wed, 8 Nov 2017 16:04:00 +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 DB73B7FDE2; Wed, 8 Nov 2017 16:03:59 +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 vA8G3wBF046820; Wed, 8 Nov 2017 16:03:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8G3w0m046818; Wed, 8 Nov 2017 16:03:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711081603.vA8G3w0m046818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Nov 2017 16:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325557 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 16:04:00 -0000 Author: bdrewery Date: Wed Nov 8 16:03:58 2017 New Revision: 325557 URL: https://svnweb.freebsd.org/changeset/base/325557 Log: AUTO_OBJ: Hide 'creating dirs' output with 'make -s'. Reported by: garga Sponsored by: Dell EMC Isilon Modified: head/share/mk/local.sys.env.mk Modified: head/share/mk/local.sys.env.mk ============================================================================== --- head/share/mk/local.sys.env.mk Wed Nov 8 14:44:45 2017 (r325556) +++ head/share/mk/local.sys.env.mk Wed Nov 8 16:03:58 2017 (r325557) @@ -44,4 +44,8 @@ TIME_STAMP_END?= ${TIME_STAMP_DATE} # error spam and show a proper error. Mkdirs= Mkdirs() { mkdir -p $$* || :; } +.if !empty(.MAKEFLAGS:M-s) +ECHO_TRACE?= true +.endif + .include "src.sys.env.mk" From owner-svn-src-all@freebsd.org Wed Nov 8 16:04:17 2017 Return-Path: Delivered-To: svn-src-all@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 D139AE57152; Wed, 8 Nov 2017 16:04:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F0A47FF40; Wed, 8 Nov 2017 16:04:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id C78E71CF5E; Wed, 8 Nov 2017 16:04:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id BC468274E; Wed, 8 Nov 2017 16:04:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id VxMWnRAYDioJ; Wed, 8 Nov 2017 16:04:10 +0000 (UTC) Subject: Re: svn commit: r325520 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 30DA62745 To: Renato Botelho , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711071820.vA7IK835007755@repo.freebsd.org> <9c4e54cb-26b5-00f5-d672-5cde8b15b187@gmail.com> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Wed, 8 Nov 2017 08:04:11 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <9c4e54cb-26b5-00f5-d672-5cde8b15b187@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="g3OSGBr2clmKAD9jgb8wbVfEiQO5KoFgd" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 16:04:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --g3OSGBr2clmKAD9jgb8wbVfEiQO5KoFgd Content-Type: multipart/mixed; boundary="qMKKMhtvFSeFXm1gltGjD0cBKHQ3ojsW5"; protected-headers="v1" From: Bryan Drewery To: Renato Botelho , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r325520 - head/share/mk References: <201711071820.vA7IK835007755@repo.freebsd.org> <9c4e54cb-26b5-00f5-d672-5cde8b15b187@gmail.com> In-Reply-To: <9c4e54cb-26b5-00f5-d672-5cde8b15b187@gmail.com> --qMKKMhtvFSeFXm1gltGjD0cBKHQ3ojsW5 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/8/2017 7:25 AM, Renato Botelho wrote: > On 07/11/17 16:20, Bryan Drewery wrote: >> Author: bdrewery >> Date: Tue Nov 7 18:20:08 2017 >> New Revision: 325520 >> URL: https://svnweb.freebsd.org/changeset/base/325520 >> >> Log: >> Reenable AUTO_OBJ by default. >> =20 >> The problem with it was a bogus .OBJDIR in some cases where creation= of >> object directories were purposely not attempted, such as for 'make c= leandir' >> and in etc/ sub-directories. In these cases bmake would start with = a >> bogus .OBJDIR like etc/ due to MAKEOBJDIR being a dynamic value base= d on >> .CURDIR, SRCTOP, and OBJTOP. OBJTOP would not yet be defined but is= >> during early src.sys.obj.mk. That file and auto.obj.mk both were no= t >> modifying .OBJDIR unless they expected to create the objdir. Thus i= n >> these cases the .OBJDIR was left as etc/* rather than fixed to the >> proper .CURDIR. >> =20 >> The issues were fixed in r325404 and r325416. An assertion to avoid= the >> bad .OBJDIR was added in r325405. >> =20 >> Sponsored by: Dell EMC Isilon >=20 > Bryan, >=20 > Are these messages expected to show when make -s is used? >=20 > [Creating objdir /usr/obj/usr/src/amd64.amd64/usr.bin/look...] >=20 > Thanks >=20 Thanks, fixed in r325557. --=20 Regards, Bryan Drewery --qMKKMhtvFSeFXm1gltGjD0cBKHQ3ojsW5-- --g3OSGBr2clmKAD9jgb8wbVfEiQO5KoFgd 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 iQEcBAEBAgAGBQJaAyr7AAoJEDXXcbtuRpfPjtMH/i5GYPBTNRQ3PmVIrNB3gsr9 /oy6Fn1d9H1KOqOX3k/SOSjznUGoRY+Bs7Q7aMe1HCPmQuofXZ/xDqGZO1p91C2D kw9xudahF+yiomLbiCrxqGhxW2o+lGQGHDjtQBKBS7cucExZte5XGl/DzgKCNXen +4fFnMelcb2U6axKt/ksP+uQ80Jhjkkjs2x3BSLDEXd6e1Tu3t7veCsBdumn0tSk +RFm4aB1j5K5hyNPeHO19qkl5HZfYvN4NZimHCGstTaTOjf2Pc8cj0mrXPNDL6uB IvHYUFBp9I8HwqGsOXnFPrmL8bGEOMIDVXMAk/B4vIM4oJJwztqiloI9X6u9/E8= =WcXo -----END PGP SIGNATURE----- --g3OSGBr2clmKAD9jgb8wbVfEiQO5KoFgd-- From owner-svn-src-all@freebsd.org Wed Nov 8 16:45:54 2017 Return-Path: Delivered-To: svn-src-all@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 CC422E57E35; Wed, 8 Nov 2017 16:45:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 967711240; Wed, 8 Nov 2017 16:45:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8Gjrls063860; Wed, 8 Nov 2017 16:45:53 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8Gjrlu063859; Wed, 8 Nov 2017 16:45:53 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201711081645.vA8Gjrlu063859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 8 Nov 2017 16:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325558 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 325558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 16:45:54 -0000 Author: glebius Date: Wed Nov 8 16:45:53 2017 New Revision: 325558 URL: https://svnweb.freebsd.org/changeset/base/325558 Log: When parsing UDP messages skip optional hostname as described by RFC 3164. PR: 200933 Submitted by: maxim Reported by: Konstantin Pavlov MFC after: 2 weeks Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Wed Nov 8 16:03:58 2017 (r325557) +++ head/usr.sbin/syslogd/syslogd.c Wed Nov 8 16:45:53 2017 (r325558) @@ -1034,7 +1034,7 @@ static void logmsg(int pri, const char *msg, const char *from, int flags) { struct filed *f; - int i, fac, msglen, prilev; + int i, j, fac, msglen, prilev; const char *timestamp; char prog[NAME_MAX+1]; char buf[MAXLINE+1]; @@ -1076,6 +1076,19 @@ logmsg(int pri, const char *msg, const char *from, int return; prilev = LOG_PRI(pri); + + /* skip hostname, see RFC 3164 */ + for (i = 0, j = 0; i < NAME_MAX; i++) { + if (isspace(msg[i])) { + j = i + 1; + } + if (msg[i] == ':') + break; + } + if (j <= msglen) { + msg += j; + msglen -= j; + } /* extract program name */ for (i = 0; i < NAME_MAX; i++) { From owner-svn-src-all@freebsd.org Wed Nov 8 16:53:13 2017 Return-Path: Delivered-To: svn-src-all@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 4DED0E5804F; Wed, 8 Nov 2017 16:53:13 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 118CD1760; Wed, 8 Nov 2017 16:53:12 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8GrC3s067780; Wed, 8 Nov 2017 16:53:12 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8GrCPH067778; Wed, 8 Nov 2017 16:53:12 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201711081653.vA8GrCPH067778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Wed, 8 Nov 2017 16:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325559 - in head: etc share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: in head: etc share/man/man5 X-SVN-Commit-Revision: 325559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 16:53:13 -0000 Author: eugen Date: Wed Nov 8 16:53:11 2017 New Revision: 325559 URL: https://svnweb.freebsd.org/changeset/base/325559 Log: Add suitable knob ifconfig__descr for static interface description. Document availability of interface descriptions within rc.conf(5). Approved by: avg (mentor), mav (mentor) MFC after: 3 days Modified: head/etc/network.subr head/share/man/man5/rc.conf.5 Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Wed Nov 8 16:45:53 2017 (r325558) +++ head/etc/network.subr Wed Nov 8 16:53:11 2017 (r325559) @@ -122,7 +122,7 @@ ifn_vnet0() # ifconfig_up() { - local _cfg _ipv6_opts ifconfig_args + local _cfg _ifconfig_descr _ipv6_opts ifconfig_args _cfg=1 # Make sure lo0 always comes up. @@ -213,6 +213,11 @@ ifconfig_up() ifalias $1 link alias ifalias $1 ether alias + + _ifconfig_descr=`get_if_var $1 ifconfig_IF_descr` + if [ -n "${_ifconfig_descr}" ]; then + ${IFCONFIG_CMD} $1 description "${_ifconfig_descr}" + fi if wpaif $1; then /etc/rc.d/wpa_supplicant start $1 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Nov 8 16:45:53 2017 (r325558) +++ head/share/man/man5/rc.conf.5 Wed Nov 8 16:53:11 2017 (r325559) @@ -1616,6 +1616,23 @@ is set to 1. .Pp Default is .Dq Li NO . +.It Va ifconfig_ Ns Ao Ar interface Ac Ns _descr +.Pq Vt str +This assigns arbitrary description to an interface. +The +.Xr sysctl 8 +variable +.Va net.ifdescr_maxlen +limits its length. +This static setting may be overridden by commands +started with dynamic interface configuration utilities +like +.Xr dhclient 8 +hooks. The description can be seen with +.Xr ifconfig 8 +command and it may be exported with +.Xr bsnmpd 1 +daemon using its MIB-2 module. .It Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 .Pq Vt str IPv6 functionality on an interface should be configured by From owner-svn-src-all@freebsd.org Wed Nov 8 18:02:02 2017 Return-Path: Delivered-To: svn-src-all@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 DBD30E5928B; Wed, 8 Nov 2017 18:02:02 +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 A2C8D36B5; Wed, 8 Nov 2017 18:02:02 +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 vA8I21Xd097385; Wed, 8 Nov 2017 18:02:01 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8I21CI097384; Wed, 8 Nov 2017 18:02:01 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711081802.vA8I21CI097384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Nov 2017 18:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325560 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 18:02:03 -0000 Author: bdrewery Date: Wed Nov 8 18:02:01 2017 New Revision: 325560 URL: https://svnweb.freebsd.org/changeset/base/325560 Log: META_MODE: Bmake 20171028 in r325340 simplifies the meta filename. Now if the meta file is in the objdir, the objdir is stripped away from the meta filename. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Wed Nov 8 16:53:11 2017 (r325559) +++ head/share/mk/bsd.dep.mk Wed Nov 8 18:02:01 2017 (r325560) @@ -233,10 +233,14 @@ afterdepend: beforedepend # mimicing what bmake's meta_name() does and adding in the full path # as well to ensure that the expected meta file is read. .if ${__obj:M*/*} +.if ${MAKE_VERSION} < 20171028 _meta_obj= ${.OBJDIR:C,/,_,g}_${__obj:C,/,_,g}.meta .else +_meta_obj= ${__obj:C,/,_,g}.meta +.endif # ${MAKE_VERSION} < 20171028 +.else _meta_obj= ${__obj}.meta -.endif +.endif # ${__obj:M*/*} _dep_obj= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} .if defined(_meta_filemon) _depfile= ${.OBJDIR}/${_meta_obj} From owner-svn-src-all@freebsd.org Wed Nov 8 19:55:18 2017 Return-Path: Delivered-To: svn-src-all@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 B3BD3E5ADC0; Wed, 8 Nov 2017 19:55:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B86D65827; Wed, 8 Nov 2017 19:55:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8JtHOY044212; Wed, 8 Nov 2017 19:55:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8JtHYV044211; Wed, 8 Nov 2017 19:55:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711081955.vA8JtHYV044211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 8 Nov 2017 19:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325561 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 325561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 19:55:18 -0000 Author: markj Date: Wed Nov 8 19:55:17 2017 New Revision: 325561 URL: https://svnweb.freebsd.org/changeset/base/325561 Log: Allow various page daemon parameters to be set from loader.conf. MFC after: 1 week Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Nov 8 18:02:01 2017 (r325560) +++ head/sys/vm/vm_pageout.c Wed Nov 8 19:55:17 2017 (r325561) @@ -171,44 +171,44 @@ SYSCTL_INT(_vm, OID_AUTO, panic_on_oom, "panic on out of memory instead of killing the largest process"); SYSCTL_INT(_vm, OID_AUTO, pageout_wakeup_thresh, - CTLFLAG_RW, &vm_pageout_wakeup_thresh, 0, + CTLFLAG_RWTUN, &vm_pageout_wakeup_thresh, 0, "free page threshold for waking up the pageout daemon"); SYSCTL_INT(_vm, OID_AUTO, pageout_update_period, - CTLFLAG_RW, &vm_pageout_update_period, 0, + CTLFLAG_RWTUN, &vm_pageout_update_period, 0, "Maximum active LRU update period"); -SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RW, &lowmem_period, 0, +SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RWTUN, &lowmem_period, 0, "Low memory callback period"); SYSCTL_INT(_vm, OID_AUTO, disable_swapspace_pageouts, - CTLFLAG_RW, &disable_swap_pageouts, 0, "Disallow swapout of dirty pages"); + CTLFLAG_RWTUN, &disable_swap_pageouts, 0, "Disallow swapout of dirty pages"); static int pageout_lock_miss; SYSCTL_INT(_vm, OID_AUTO, pageout_lock_miss, CTLFLAG_RD, &pageout_lock_miss, 0, "vget() lock misses during pageout"); SYSCTL_INT(_vm, OID_AUTO, pageout_oom_seq, - CTLFLAG_RW, &vm_pageout_oom_seq, 0, + CTLFLAG_RWTUN, &vm_pageout_oom_seq, 0, "back-to-back calls to oom detector to start OOM"); static int act_scan_laundry_weight = 3; -SYSCTL_INT(_vm, OID_AUTO, act_scan_laundry_weight, CTLFLAG_RW, +SYSCTL_INT(_vm, OID_AUTO, act_scan_laundry_weight, CTLFLAG_RWTUN, &act_scan_laundry_weight, 0, "weight given to clean vs. dirty pages in active queue scans"); static u_int vm_background_launder_target; -SYSCTL_UINT(_vm, OID_AUTO, background_launder_target, CTLFLAG_RW, +SYSCTL_UINT(_vm, OID_AUTO, background_launder_target, CTLFLAG_RWTUN, &vm_background_launder_target, 0, "background laundering target, in pages"); static u_int vm_background_launder_rate = 4096; -SYSCTL_UINT(_vm, OID_AUTO, background_launder_rate, CTLFLAG_RW, +SYSCTL_UINT(_vm, OID_AUTO, background_launder_rate, CTLFLAG_RWTUN, &vm_background_launder_rate, 0, "background laundering rate, in kilobytes per second"); static u_int vm_background_launder_max = 20 * 1024; -SYSCTL_UINT(_vm, OID_AUTO, background_launder_max, CTLFLAG_RW, +SYSCTL_UINT(_vm, OID_AUTO, background_launder_max, CTLFLAG_RWTUN, &vm_background_launder_max, 0, "background laundering cap, in kilobytes"); int vm_pageout_page_count = 32; From owner-svn-src-all@freebsd.org Wed Nov 8 21:13:01 2017 Return-Path: Delivered-To: svn-src-all@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 299FEE5C43B; Wed, 8 Nov 2017 21:13:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7E9F67CA4; Wed, 8 Nov 2017 21:13:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8LCxNb077575; Wed, 8 Nov 2017 21:12:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8LCxGZ077574; Wed, 8 Nov 2017 21:12:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201711082112.vA8LCxGZ077574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 Nov 2017 21:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325562 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 325562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 21:13:01 -0000 Author: manu Date: Wed Nov 8 21:12:59 2017 New Revision: 325562 URL: https://svnweb.freebsd.org/changeset/base/325562 Log: Allwinner: clk: Unlock the clknode after locking it. Pointy Hat: manu Modified: head/sys/arm/allwinner/clkng/aw_clk_nkmp.c Modified: head/sys/arm/allwinner/clkng/aw_clk_nkmp.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nkmp.c Wed Nov 8 19:55:17 2017 (r325561) +++ head/sys/arm/allwinner/clkng/aw_clk_nkmp.c Wed Nov 8 21:12:59 2017 (r325562) @@ -300,6 +300,7 @@ aw_clk_nkmp_set_freq(struct clknode *clk, uint64_t fpa val |= aw_clk_factor_get_value(&sc->p, best_p) << sc->p.shift; WRITE4(clk, sc->offset, val); DELAY(2000); + DEVICE_UNLOCK(clk); if ((sc->flags & AW_CLK_HAS_UPDATE) != 0) { DEVICE_LOCK(clk); @@ -307,6 +308,7 @@ aw_clk_nkmp_set_freq(struct clknode *clk, uint64_t fpa val |= 1 << sc->update_shift; WRITE4(clk, sc->offset, val); DELAY(2000); + DEVICE_UNLOCK(clk); } if ((sc->flags & AW_CLK_HAS_LOCK) != 0) { From owner-svn-src-all@freebsd.org Wed Nov 8 21:24:08 2017 Return-Path: Delivered-To: svn-src-all@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 89D64E5C745; Wed, 8 Nov 2017 21:24:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ABEF6823D; Wed, 8 Nov 2017 21:24:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8LO7oP081672; Wed, 8 Nov 2017 21:24:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8LO7FA081668; Wed, 8 Nov 2017 21:24:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201711082124.vA8LO7FA081668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 8 Nov 2017 21:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325563 - in head/sys/arm/allwinner: a13 clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm/allwinner: a13 clkng X-SVN-Commit-Revision: 325563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 21:24:08 -0000 Author: manu Date: Wed Nov 8 21:24:06 2017 New Revision: 325563 URL: https://svnweb.freebsd.org/changeset/base/325563 Log: Allwinner A13: Add clkng support DTS files switch from clocks under /clocks to a ccu (Clock Controller Unit) a while ago. Restore A13 functionality by adding a clock driver for it. Almost every clocks are handled, the missing ones are mostly video related clocks. Tested On: A13 Olinuxino Added: head/sys/arm/allwinner/clkng/ccu_a13.c (contents, props changed) head/sys/arm/allwinner/clkng/ccu_a13.h (contents, props changed) Modified: head/sys/arm/allwinner/a13/files.a13 head/sys/arm/allwinner/clkng/aw_ccung.c Modified: head/sys/arm/allwinner/a13/files.a13 ============================================================================== --- head/sys/arm/allwinner/a13/files.a13 Wed Nov 8 21:12:59 2017 (r325562) +++ head/sys/arm/allwinner/a13/files.a13 Wed Nov 8 21:24:06 2017 (r325563) @@ -1,3 +1,4 @@ # $FreeBSD$ arm/allwinner/a13/a13_padconf.c standard +arm/allwinner/clkng/ccu_a13.c standard Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Wed Nov 8 21:12:59 2017 (r325562) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Wed Nov 8 21:24:06 2017 (r325563) @@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$"); #include "opt_soc.h" #endif +#if defined(SOC_ALLWINNER_A13) +#include +#endif + #if defined(SOC_ALLWINNER_A31) #include #endif @@ -94,7 +98,14 @@ static struct resource_spec aw_ccung_spec[] = { #define A64_R_CCU 5 #endif +#if defined(SOC_ALLWINNER_A13) +#define A13_CCU 6 +#endif + static struct ofw_compat_data compat_data[] = { +#if defined(SOC_ALLWINNER_A31) + { "allwinner,sun5i-a13-ccu", A13_CCU}, +#endif #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) { "allwinner,sun8i-h3-ccu", H3_CCU }, { "allwinner,sun8i-h3-r-ccu", H3_R_CCU }, @@ -322,6 +333,11 @@ aw_ccung_attach(device_t dev) panic("Cannot create clkdom\n"); switch (sc->type) { +#if defined(SOC_ALLWINNER_A13) + case A13_CCU: + ccu_a13_register_clocks(sc); + break; +#endif #if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) case H3_CCU: ccu_h3_register_clocks(sc); Added: head/sys/arm/allwinner/clkng/ccu_a13.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/ccu_a13.c Wed Nov 8 21:24:06 2017 (r325563) @@ -0,0 +1,566 @@ +/*- + * Copyright (c) 2017 Emmanuel Vadot + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "ccu_a13.h" + +/* Non-exported clocks */ + +#define CLK_PLL_CORE 2 +#define CLK_PLL_AUDIO_BASE 3 +#define CLK_PLL_AUDIO 4 +#define CLK_PLL_AUDIO_2X 5 +#define CLK_PLL_AUDIO_4X 6 +#define CLK_PLL_AUDIO_8X 7 +#define CLK_PLL_VIDEO0 8 + +#define CLK_PLL_VE 10 +#define CLK_PLL_DDR_BASE 11 +#define CLK_PLL_DDR 12 +#define CLK_PLL_DDR_OTHER 13 +#define CLK_PLL_PERIPH 14 +#define CLK_PLL_VIDEO1 15 + +#define CLK_AXI 18 +#define CLK_AHB 19 +#define CLK_APB0 20 +#define CLK_APB1 21 +#define CLK_DRAM_AXI 22 + +#define CLK_TCON_CH1_SCLK 91 + +#define CLK_MBUS 99 + +static struct aw_ccung_reset a13_ccu_resets[] = { + CCU_RESET(RST_USB_PHY0, 0xcc, 0) + CCU_RESET(RST_USB_PHY1, 0xcc, 1) + + CCU_RESET(RST_GPS, 0xd0, 30) + + CCU_RESET(RST_DE_BE, 0x104, 30) + + CCU_RESET(RST_DE_FE, 0x10c, 30) + + CCU_RESET(RST_TVE, 0x118, 29) + CCU_RESET(RST_LCD, 0x118, 30) + + CCU_RESET(RST_CSI, 0x134, 30) + + CCU_RESET(RST_VE, 0x13c, 0) + CCU_RESET(RST_GPU, 0x154, 30) + CCU_RESET(RST_IEP, 0x160, 30) + +}; + +static struct aw_ccung_gate a13_ccu_gates[] = { + CCU_GATE(CLK_HOSC, "hosc", "osc24M", 0x50, 0) + + CCU_GATE(CLK_DRAM_AXI, "axi-dram", "axi", 0x5c, 0) + + CCU_GATE(CLK_AHB_OTG, "ahb-otg", "ahb", 0x60, 0) + CCU_GATE(CLK_AHB_EHCI, "ahb-ehci", "ahb", 0x60, 1) + CCU_GATE(CLK_AHB_OHCI, "ahb-ohci", "ahb", 0x60, 2) + CCU_GATE(CLK_AHB_SS, "ahb-ss", "ahb", 0x60, 5) + CCU_GATE(CLK_AHB_DMA, "ahb-dma", "ahb", 0x60, 6) + CCU_GATE(CLK_AHB_BIST, "ahb-bist", "ahb", 0x60, 7) + CCU_GATE(CLK_AHB_MMC0, "ahb-mmc0", "ahb", 0x60, 8) + CCU_GATE(CLK_AHB_MMC1, "ahb-mmc1", "ahb", 0x60, 9) + CCU_GATE(CLK_AHB_MMC2, "ahb-mmc2", "ahb", 0x60, 10) + CCU_GATE(CLK_AHB_NAND, "ahb-nand", "ahb", 0x60, 13) + CCU_GATE(CLK_AHB_SDRAM, "ahb-sdram", "ahb", 0x60, 14) + CCU_GATE(CLK_AHB_SPI0, "ahb-spi0", "ahb", 0x60, 20) + CCU_GATE(CLK_AHB_SPI1, "ahb-spi1", "ahb", 0x60, 21) + CCU_GATE(CLK_AHB_SPI2, "ahb-spi2", "ahb", 0x60, 22) + CCU_GATE(CLK_AHB_GPS, "ahb-gps", "ahb", 0x60, 26) + CCU_GATE(CLK_AHB_HSTIMER, "ahb-hstimer", "ahb", 0x60, 28) + + CCU_GATE(CLK_AHB_VE, "ahb-ve", "ahb", 0x64, 0) + CCU_GATE(CLK_AHB_LCD, "ahb-lcd", "ahb", 0x64, 4) + CCU_GATE(CLK_AHB_CSI, "ahb-csi", "ahb", 0x64, 8) + CCU_GATE(CLK_AHB_DE_BE, "ahb-de-be", "ahb", 0x64, 12) + CCU_GATE(CLK_AHB_DE_FE, "ahb-de-fe", "ahb", 0x64, 14) + CCU_GATE(CLK_AHB_IEP, "ahb-iep", "ahb", 0x64, 19) + CCU_GATE(CLK_AHB_GPU, "ahb-gpu", "ahb", 0x64, 20) + + CCU_GATE(CLK_APB0_CODEC, "apb0-codec", "apb0", 0x68, 0) + CCU_GATE(CLK_APB0_PIO, "apb0-pio", "apb0", 0x68, 5) + CCU_GATE(CLK_APB0_IR, "apb0-ir", "apb0", 0x68, 6) + + CCU_GATE(CLK_APB1_I2C0, "apb1-i2c0", "apb1", 0x6c, 0) + CCU_GATE(CLK_APB1_I2C1, "apb1-i2c1", "apb1", 0x6c, 1) + CCU_GATE(CLK_APB1_I2C2, "apb1-i2c2", "apb1", 0x6c, 2) + CCU_GATE(CLK_APB1_UART1, "apb1-uart1", "apb1", 0x6c, 17) + CCU_GATE(CLK_APB1_UART3, "apb1-uart3", "apb1", 0x6c, 19) + + CCU_GATE(CLK_DRAM_VE, "dram-ve", "pll-ddr", 0x100, 0) + CCU_GATE(CLK_DRAM_CSI, "dram-csi", "pll-ddr", 0x100, 1) + CCU_GATE(CLK_DRAM_DE_FE, "dram-de-fe", "pll-ddr", 0x100, 25) + CCU_GATE(CLK_DRAM_DE_BE, "dram-de-be", "pll-ddr", 0x100, 26) + CCU_GATE(CLK_DRAM_ACE, "dram-ace", "pll-ddr", 0x100, 29) + CCU_GATE(CLK_DRAM_IEP, "dram-iep", "pll-ddr", 0x100, 31) + + CCU_GATE(CLK_CODEC, "codec", "pll-audio", 0x140, 31) + + CCU_GATE(CLK_AVS, "avs", "hosc", 0x144, 31) +}; + +static const char *pll_parents[] = {"hosc"}; +static struct aw_clk_nkmp_def pll_core = { + .clkdef = { + .id = CLK_PLL_CORE, + .name = "pll-core", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .offset = 0x00, + .n = {.shift = 8, .width = 5}, + .k = {.shift = 4, .width = 2}, + .m = {.shift = 0, .width = 2}, + .p = {.shift = 16, .width = 2}, + .gate_shift = 31, + .flags = AW_CLK_HAS_GATE, +}; + +/* + * We only implement pll-audio for now + * For pll-audio-2/4/8 x we need a way to change the frequency + * of the parent clocks + */ +static struct aw_clk_nkmp_def pll_audio = { + .clkdef = { + .id = CLK_PLL_AUDIO, + .name = "pll-audio", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .offset = 0x08, + .n = {.shift = 8, .width = 7}, + .k = {.value = 1, .flags = AW_CLK_FACTOR_FIXED}, + .m = {.shift = 0, .width = 5}, + .p = {.shift = 26, .width = 4}, + .gate_shift = 31, + .flags = AW_CLK_HAS_GATE, +}; + +/* Missing PLL3-Video */ +/* Missing PLL4-VE */ + +static struct aw_clk_nkmp_def pll_ddr_base = { + .clkdef = { + .id = CLK_PLL_DDR_BASE, + .name = "pll-ddr-base", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .offset = 0x20, + .n = {.shift = 8, .width = 5}, + .k = {.shift = 4, .width = 2}, + .m = {.value = 1, .flags = AW_CLK_FACTOR_FIXED}, + .p = {.value = 1, .flags = AW_CLK_FACTOR_FIXED}, + .gate_shift = 31, + .flags = AW_CLK_HAS_GATE, +}; + +static const char *pll_ddr_parents[] = {"pll-ddr-base"}; +static struct clk_div_def pll_ddr = { + .clkdef = { + .id = CLK_PLL_DDR, + .name = "pll-ddr", + .parent_names = pll_ddr_parents, + .parent_cnt = nitems(pll_ddr_parents), + }, + .offset = 0x20, + .i_shift = 0, + .i_width = 2, +}; + +static const char *pll_ddr_other_parents[] = {"pll-ddr-base"}; +static struct clk_div_def pll_ddr_other = { + .clkdef = { + .id = CLK_PLL_DDR_OTHER, + .name = "pll-ddr-other", + .parent_names = pll_ddr_other_parents, + .parent_cnt = nitems(pll_ddr_other_parents), + }, + .offset = 0x20, + .i_shift = 16, + .i_width = 2, +}; + +static struct aw_clk_nkmp_def pll_periph = { + .clkdef = { + .id = CLK_PLL_PERIPH, + .name = "pll-periph", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .offset = 0x28, + .n = {.shift = 8, .width = 5}, + .k = {.shift = 4, .width = 2}, + .m = {.shift = 0, .width = 2}, + .p = {.value = 2, .flags = AW_CLK_FACTOR_FIXED}, + .gate_shift = 31, + .flags = AW_CLK_HAS_GATE, +}; + +/* Missing PLL7-VIDEO1 */ + +static const char *cpu_parents[] = {"osc32k", "hosc", "pll-core", "pll-periph"}; +static struct aw_clk_prediv_mux_def cpu_clk = { + .clkdef = { + .id = CLK_CPU, + .name = "cpu", + .parent_names = cpu_parents, + .parent_cnt = nitems(cpu_parents), + }, + .offset = 0x54, + .mux_shift = 16, .mux_width = 2, + .prediv = { + .value = 6, + .flags = AW_CLK_FACTOR_FIXED, + .cond_shift = 16, + .cond_width = 2, + .cond_value = 3, + }, +}; + +static const char *axi_parents[] = {"cpu"}; +static struct clk_div_def axi_clk = { + .clkdef = { + .id = CLK_AXI, + .name = "axi", + .parent_names = axi_parents, + .parent_cnt = nitems(axi_parents), + }, + .offset = 0x50, + .i_shift = 0, .i_width = 2, +}; + +static const char *ahb_parents[] = {"axi", "cpu", "pll-periph"}; +static struct aw_clk_prediv_mux_def ahb_clk = { + .clkdef = { + .id = CLK_AHB, + .name = "ahb", + .parent_names = ahb_parents, + .parent_cnt = nitems(ahb_parents), + }, + .offset = 0x54, + .mux_shift = 6, + .mux_width = 2, + .div = { + .shift = 4, + .width = 2, + .flags = AW_CLK_FACTOR_POWER_OF_TWO + }, + .prediv = { + .value = 2, + .flags = AW_CLK_FACTOR_FIXED, + .cond_shift = 6, + .cond_width = 2, + .cond_value = 2, + }, +}; + +static const char *apb0_parents[] = {"ahb"}; +static struct clk_div_table apb0_div_table[] = { + { .value = 0, .divider = 2, }, + { .value = 1, .divider = 2, }, + { .value = 2, .divider = 4, }, + { .value = 3, .divider = 8, }, + { }, +}; +static struct clk_div_def apb0_clk = { + .clkdef = { + .id = CLK_APB0, + .name = "apb0", + .parent_names = apb0_parents, + .parent_cnt = nitems(apb0_parents), + }, + .offset = 0x54, + .i_shift = 8, .i_width = 2, + .div_flags = CLK_DIV_WITH_TABLE, + .div_table = apb0_div_table, +}; + +static const char *apb1_parents[] = {"hosc", "pll-periph", "osc32k"}; +static struct aw_clk_nm_def apb1_clk = { + .clkdef = { + .id = CLK_APB1, + .name = "apb1", + .parent_names = apb1_parents, + .parent_cnt = nitems(apb1_parents), + }, + .offset = 0x58, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 5}, + .mux_shift = 24, + .mux_width = 2, + .flags = AW_CLK_HAS_MUX, +}; + +static const char *mod_parents[] = {"hosc", "pll-periph", "pll-ddr-other"}; + +static struct aw_clk_nm_def nand_clk = { + .clkdef = { + .id = CLK_NAND, + .name = "nand", + .parent_names = mod_parents, + .parent_cnt = nitems(mod_parents), + }, + .offset = 0x80, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 4}, + .mux_shift = 24, + .mux_width = 2, + .gate_shift = 31, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_REPARENT +}; + +static struct aw_clk_nm_def mmc0_clk = { + .clkdef = { + .id = CLK_MMC0, + .name = "mmc0", + .parent_names = mod_parents, + .parent_cnt = nitems(mod_parents), + }, + .offset = 0x88, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 4}, + .mux_shift = 24, + .mux_width = 2, + .gate_shift = 31, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_REPARENT +}; + +static struct aw_clk_nm_def mmc1_clk = { + .clkdef = { + .id = CLK_MMC1, + .name = "mmc1", + .parent_names = mod_parents, + .parent_cnt = nitems(mod_parents), + }, + .offset = 0x8C, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 4}, + .mux_shift = 24, + .mux_width = 2, + .gate_shift = 31, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_REPARENT +}; + +static struct aw_clk_nm_def mmc2_clk = { + .clkdef = { + .id = CLK_MMC2, + .name = "mmc2", + .parent_names = mod_parents, + .parent_cnt = nitems(mod_parents), + }, + .offset = 0x90, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 4}, + .mux_shift = 24, + .mux_width = 2, + .gate_shift = 31, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_REPARENT +}; + +static struct aw_clk_nm_def ss_clk = { + .clkdef = { + .id = CLK_SS, + .name = "ss", + .parent_names = mod_parents, + .parent_cnt = nitems(mod_parents), + }, + .offset = 0x9C, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 4}, + .mux_shift = 24, + .mux_width = 2, + .gate_shift = 31, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_REPARENT +}; + +static struct aw_clk_nm_def spi0_clk = { + .clkdef = { + .id = CLK_SPI0, + .name = "spi0", + .parent_names = mod_parents, + .parent_cnt = nitems(mod_parents), + }, + .offset = 0xA0, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 4}, + .mux_shift = 24, + .mux_width = 2, + .gate_shift = 31, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_REPARENT +}; + +static struct aw_clk_nm_def spi1_clk = { + .clkdef = { + .id = CLK_SPI1, + .name = "spi1", + .parent_names = mod_parents, + .parent_cnt = nitems(mod_parents), + }, + .offset = 0xA4, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 4}, + .mux_shift = 24, + .mux_width = 2, + .gate_shift = 31, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_REPARENT +}; + +static struct aw_clk_nm_def spi2_clk = { + .clkdef = { + .id = CLK_SPI2, + .name = "spi2", + .parent_names = mod_parents, + .parent_cnt = nitems(mod_parents), + }, + .offset = 0xA8, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 4}, + .mux_shift = 24, + .mux_width = 2, + .gate_shift = 31, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_REPARENT +}; + +static struct aw_clk_nm_def ir_clk = { + .clkdef = { + .id = CLK_IR, + .name = "ir", + .parent_names = mod_parents, + .parent_cnt = nitems(mod_parents), + }, + .offset = 0xB0, + .n = {.shift = 16, .width = 2, .flags = AW_CLK_FACTOR_POWER_OF_TWO, }, + .m = {.shift = 0, .width = 4}, + .mux_shift = 24, + .mux_width = 2, + .gate_shift = 31, + .flags = AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_REPARENT +}; + +/* Missing DE-BE clock */ +/* Missing DE-FE clock */ +/* Missing LCD CH1 clock */ +/* Missing CSI clock */ +/* Missing VE clock */ + + +/* Clocks list */ + +static struct aw_clk_nkmp_def *nkmp_clks[] = { + &pll_core, + &pll_audio, + &pll_ddr_base, + &pll_periph, +}; + +static struct aw_clk_nm_def *nm_clks[] = { + &apb1_clk, + &nand_clk, + &mmc0_clk, + &mmc1_clk, + &mmc2_clk, + &ss_clk, + &spi0_clk, + &spi1_clk, + &spi2_clk, + &ir_clk, +}; + +static struct aw_clk_prediv_mux_def *prediv_mux_clks[] = { + &cpu_clk, + &ahb_clk, +}; + +static struct clk_div_def *div_clks[] = { + &pll_ddr, + &pll_ddr_other, + &axi_clk, + &apb0_clk, +}; + +static struct clk_mux_def *mux_clks[] = { +}; + +static struct clk_fixed_def *fixed_factor_clks[] = { +}; + +static struct aw_clk_init init_clks[] = { +}; + +void +ccu_a13_register_clocks(struct aw_ccung_softc *sc) +{ + int i; + + sc->resets = a13_ccu_resets; + sc->nresets = nitems(a13_ccu_resets); + sc->gates = a13_ccu_gates; + sc->ngates = nitems(a13_ccu_gates); + sc->clk_init = init_clks; + sc->n_clk_init = nitems(init_clks); + + for (i = 0; i < nitems(nkmp_clks); i++) + aw_clk_nkmp_register(sc->clkdom, nkmp_clks[i]); + for (i = 0; i < nitems(nm_clks); i++) + aw_clk_nm_register(sc->clkdom, nm_clks[i]); + for (i = 0; i < nitems(prediv_mux_clks); i++) + aw_clk_prediv_mux_register(sc->clkdom, prediv_mux_clks[i]); + + for (i = 0; i < nitems(mux_clks); i++) + clknode_mux_register(sc->clkdom, mux_clks[i]); + for (i = 0; i < nitems(div_clks); i++) + clknode_div_register(sc->clkdom, div_clks[i]); + for (i = 0; i < nitems(fixed_factor_clks); i++) + clknode_fixed_register(sc->clkdom, fixed_factor_clks[i]); +} Added: head/sys/arm/allwinner/clkng/ccu_a13.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/ccu_a13.h Wed Nov 8 21:24:06 2017 (r325563) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2017 Emmanuel Vadot + * 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 ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __CCU_A13_H__ +#define __CCU_A13_H__ + +void ccu_a13_register_clocks(struct aw_ccung_softc *sc); + +#endif /* __CCU_a13 H__ */ From owner-svn-src-all@freebsd.org Wed Nov 8 22:41:25 2017 Return-Path: Delivered-To: svn-src-all@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 5803FE5D821; Wed, 8 Nov 2017 22:41:25 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5738B6A2CF; Wed, 8 Nov 2017 22:41:23 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id f7ec2f01; Wed, 8 Nov 2017 23:41:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=mAPEbtRg20IonoN1t+FRmAbKOmI=; b=C28LAOqBP8g9xQdOpA0ZVe8W/N7m FQ+74pRtjL1Fu99+F2Jz/yrXpoqcKt7jCVX3xL0iktEBSVlE45RTp6rKgDvyQPvv MLus7WV3q53zNeghS9d0XVt0ctbyD/C9kOcTgsgTwwRw3G2Zjmn63SEsXo2MLETk Xi2Io2NjOS5AUug= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=mvnufEUwXu3OCrj4mKrwGMEK/gttN1h0335Wq8/i2uHYtvDK9sIWeqLd FBMp/jxd39/P37VW/HCJFngljyDLWRYtXrkndDHvQM0G2pd3EUw1zv+2y7E1jICC Vz2uLL1faSp/xApFG1ep4T5hziNUuIlFPqxct4ClynzeB7g168Y= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 5e03aaed TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 8 Nov 2017 23:41:16 +0100 (CET) Date: Wed, 8 Nov 2017 23:41:15 +0100 From: Emmanuel Vadot To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325530 - in head/sys: amd64/amd64 arm64/arm64 fs/tmpfs kern mips/mips powerpc/aim powerpc/powerpc sparc64/sparc64 vm x86/iommu Message-Id: <20171108234115.421969741ee75d5bb3d905e5@bidouilliste.com> In-Reply-To: <201711080239.vA82dbJ6009161@repo.freebsd.org> References: <201711080239.vA82dbJ6009161@repo.freebsd.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 22:41:25 -0000 Hello Jeff, On Wed, 8 Nov 2017 02:39:37 +0000 (UTC) Jeff Roberson wrote: > Author: jeff > Date: Wed Nov 8 02:39:37 2017 > New Revision: 325530 > URL: https://svnweb.freebsd.org/changeset/base/325530 > > Log: > Replace manyinstances of VM_WAIT with blocking page allocation flags > similar to the kernel memory allocator. > > This simplifies NUMA allocation because the domain will be known at wait > time and races between failure and sleeping are eliminated. This also > reduces boilerplate code and simplifies callers. > > A wait primitive is supplied for uma zones for similar reasons. This > eliminates some non-specific VM_WAIT calls in favor of more explicit > sleeps that may be satisfied without new pages. > > Reviewed by: alc, kib, markj > Tested by: pho > Sponsored by: Netflix, Dell/EMC Isilon > This break armv7 (atleast) kernel : KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2017 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.0-CURRENT #51 3c355d849c9(HEAD): Wed Nov 8 23:24:16 CET 2017 elbarto@knuckles.blih.net:/usr/home/elbarto/Work/freebsd/obj/usr/home/elbarto/Work/freebsd/freebsd.git/arm.armv7/sys/GENERIC arm FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based on LLVM 5.0.0svn) WARNING: WITNESS option enabled, expect reduced performance. panic: inconsistent object(0)/req(8) cpuid = 0 time = 1 KDB: stack backtrace: (null)() at 0xc055f24c pc = 0xc055f24c lr = 0xc005ed40 (0xc005ed40) sp = 0xc0c13908 fp = 0xc0c13a20 (null)() at 0xc005ed40 pc = 0xc005ed40 lr = 0xc0269d58 (0xc0269d58) sp = 0xc0c13a28 fp = 0xc0c13a48 r4 = 0x00000100 r5 = 0x00000001 r6 = 0xc06e17cd r7 = 0xc092f530 (null)() at 0xc0269d58 pc = 0xc0269d58 lr = 0xc0269c00 (0xc0269c00) sp = 0xc0c13a50 fp = 0xc0c13a64 r4 = 0xc06e17cd r5 = 0xc0c13a6c r6 = 0x00000000 r7 = 0x00000008 r8 = 0xc0c13b0b r9 = 0x00000000 r10 = 0x00000008 (null)() at 0xc0269c00 pc = 0xc0269c00 lr = 0xc0544768 (0xc0544768) sp = 0xc0c13a6c fp = 0xc0c13aa8 r4 = 0xc0c13a64 r5 = 0xc0269c00 r6 = 0xc0c13a6c r7 = 0x00000000 r8 = 0x00000000 r9 = 0x00000000 r10 = 0x00000008 ... Thanks, -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Wed Nov 8 23:11:16 2017 Return-Path: Delivered-To: svn-src-all@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 F1B40E5E0AF; Wed, 8 Nov 2017 23:11:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF1336B1AB; Wed, 8 Nov 2017 23:11:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8NBFZL027170; Wed, 8 Nov 2017 23:11:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8NBF7E027169; Wed, 8 Nov 2017 23:11:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201711082311.vA8NBF7E027169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 8 Nov 2017 23:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325564 - head/usr.bin/patch X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/patch X-SVN-Commit-Revision: 325564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 23:11:17 -0000 Author: kevans Date: Wed Nov 8 23:11:15 2017 New Revision: 325564 URL: https://svnweb.freebsd.org/changeset/base/325564 Log: Revert r325365 r325365 caused several ports to fail to patch correctly. Revert it for the time being until an exp-run can be completed. Requested by: antoine Approved by: emaste (implicit) Modified: head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Wed Nov 8 21:24:06 2017 (r325563) +++ head/usr.bin/patch/patch.c Wed Nov 8 23:11:15 2017 (r325564) @@ -1026,9 +1026,6 @@ patch_match(LINENUM base, LINENUM offset, LINENUM fuzz const char *plineptr; unsigned short plinelen; - /* Patch does not match if we don't have anymore context to use */ - if (pline > pat_lines) - return false; for (iline = base + offset + fuzz; pline <= pat_lines; pline++, iline++) { ilineptr = ifetch(iline, offset >= 0); if (ilineptr == NULL) From owner-svn-src-all@freebsd.org Wed Nov 8 23:20:06 2017 Return-Path: Delivered-To: svn-src-all@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 AF9EFE5E304; Wed, 8 Nov 2017 23:20:06 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7C7C76B69B; Wed, 8 Nov 2017 23:20:06 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8NK5Wf028383; Wed, 8 Nov 2017 23:20:05 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8NK5g7028382; Wed, 8 Nov 2017 23:20:05 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201711082320.vA8NK5g7028382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Wed, 8 Nov 2017 23:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325565 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 325565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 23:20:06 -0000 Author: antoine Date: Wed Nov 8 23:20:05 2017 New Revision: 325565 URL: https://svnweb.freebsd.org/changeset/base/325565 Log: Do not leak control in raw_usend Modified: head/sys/net/raw_usrreq.c Modified: head/sys/net/raw_usrreq.c ============================================================================== --- head/sys/net/raw_usrreq.c Wed Nov 8 23:11:15 2017 (r325564) +++ head/sys/net/raw_usrreq.c Wed Nov 8 23:20:05 2017 (r325565) @@ -225,9 +225,10 @@ raw_usend(struct socket *so, int flags, struct mbuf *m KASSERT(sotorawcb(so) != NULL, ("raw_usend: rp == NULL")); if ((flags & PRUS_OOB) || (control && control->m_len)) { - /* XXXRW: Should control also be freed here? */ if (m != NULL) m_freem(m); + if (control != NULL) + m_freem(control); return (EOPNOTSUPP); } From owner-svn-src-all@freebsd.org Wed Nov 8 23:25:09 2017 Return-Path: Delivered-To: svn-src-all@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 69208E5E6D2; Wed, 8 Nov 2017 23:25:09 +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 4818F6BC43; Wed, 8 Nov 2017 23:25:07 +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 vA8NP53A032404; Wed, 8 Nov 2017 23:25:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8NP5TF032403; Wed, 8 Nov 2017 23:25:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711082325.vA8NP5TF032403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 23:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325566 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 325566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 23:25:09 -0000 Author: kib Date: Wed Nov 8 23:25:05 2017 New Revision: 325566 URL: https://svnweb.freebsd.org/changeset/base/325566 Log: Fix operator priority. Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Nov 8 23:20:05 2017 (r325565) +++ head/sys/vm/uma_core.c Wed Nov 8 23:25:05 2017 (r325566) @@ -1110,7 +1110,8 @@ noobj_alloc(uma_zone_t zone, vm_size_t bytes, uint8_t while (npages > 0) { p = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ | - (wait & M_WAITOK) ? VM_ALLOC_WAITOK : VM_ALLOC_NOWAIT); + ((wait & M_WAITOK) != 0 ? VM_ALLOC_WAITOK : + VM_ALLOC_NOWAIT)); if (p != NULL) { /* * Since the page does not belong to an object, its From owner-svn-src-all@freebsd.org Wed Nov 8 23:25:35 2017 Return-Path: Delivered-To: svn-src-all@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 0E4BBE5E75B; Wed, 8 Nov 2017 23:25:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 958956BE2A; Wed, 8 Nov 2017 23:25:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vA8NPSlg096973 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 9 Nov 2017 01:25:28 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vA8NPSlg096973 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vA8NPStN096971; Thu, 9 Nov 2017 01:25:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 9 Nov 2017 01:25:28 +0200 From: Konstantin Belousov To: Emmanuel Vadot Cc: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325530 - in head/sys: amd64/amd64 arm64/arm64 fs/tmpfs kern mips/mips powerpc/aim powerpc/powerpc sparc64/sparc64 vm x86/iommu Message-ID: <20171108232528.GX2566@kib.kiev.ua> References: <201711080239.vA82dbJ6009161@repo.freebsd.org> <20171108234115.421969741ee75d5bb3d905e5@bidouilliste.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171108234115.421969741ee75d5bb3d905e5@bidouilliste.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 23:25:35 -0000 On Wed, Nov 08, 2017 at 11:41:15PM +0100, Emmanuel Vadot wrote: > > Hello Jeff, > > On Wed, 8 Nov 2017 02:39:37 +0000 (UTC) > Jeff Roberson wrote: > > > Author: jeff > > Date: Wed Nov 8 02:39:37 2017 > > New Revision: 325530 > > URL: https://svnweb.freebsd.org/changeset/base/325530 > > > > Log: > > Replace manyinstances of VM_WAIT with blocking page allocation flags > > similar to the kernel memory allocator. > > > > This simplifies NUMA allocation because the domain will be known at wait > > time and races between failure and sleeping are eliminated. This also > > reduces boilerplate code and simplifies callers. > > > > A wait primitive is supplied for uma zones for similar reasons. This > > eliminates some non-specific VM_WAIT calls in favor of more explicit > > sleeps that may be satisfied without new pages. > > > > Reviewed by: alc, kib, markj > > Tested by: pho > > Sponsored by: Netflix, Dell/EMC Isilon > > > > This break armv7 (atleast) kernel : > > KDB: debugger backends: > ddb KDB: current backend: > ddb Copyright (c) 1992-2017 The FreeBSD > Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, > 1993, 1994 The Regents of the University of California. All rights > reserved. FreeBSD is a registered trademark of The FreeBSD > Foundation. FreeBSD 12.0-CURRENT #51 3c355d849c9(HEAD): Wed Nov 8 > 23:24:16 CET 2017 > elbarto@knuckles.blih.net:/usr/home/elbarto/Work/freebsd/obj/usr/home/elbarto/Work/freebsd/freebsd.git/arm.armv7/sys/GENERIC > arm FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based > on LLVM 5.0.0svn) WARNING: WITNESS option enabled, expect reduced > performance. panic: inconsistent object(0)/req(8) cpuid = > 0 time = Should be fixed by r325566. From owner-svn-src-all@freebsd.org Wed Nov 8 23:32:57 2017 Return-Path: Delivered-To: svn-src-all@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 A329DE5ECCA; Wed, 8 Nov 2017 23:32:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 701F46CEE0; Wed, 8 Nov 2017 23:32:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA8NWuG7038051; Wed, 8 Nov 2017 23:32:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8NWuur038050; Wed, 8 Nov 2017 23:32:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711082332.vA8NWuur038050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 8 Nov 2017 23:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325567 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 23:32:57 -0000 Author: kib Date: Wed Nov 8 23:32:56 2017 New Revision: 325567 URL: https://svnweb.freebsd.org/changeset/base/325567 Log: Zero whole struct ptrace_lwpinfo to not leak kernel stack data. Reported by: Ilja Van Sprundel Discussed with: secteam Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D12796 Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Wed Nov 8 23:25:05 2017 (r325566) +++ head/sys/kern/sys_process.c Wed Nov 8 23:32:56 2017 (r325567) @@ -504,6 +504,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl, struct ptrace_lwpinfo32 *pl32) { + bzero(pl32, sizeof(*pl32)); pl32->pl_lwpid = pl->pl_lwpid; pl32->pl_event = pl->pl_event; pl32->pl_flags = pl->pl_flags; @@ -1323,6 +1324,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi } else #endif pl = addr; + bzero(pl, sizeof(*pl)); pl->pl_lwpid = td2->td_tid; pl->pl_event = PL_EVENT_NONE; pl->pl_flags = 0; @@ -1343,8 +1345,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi pl->pl_siginfo = td2->td_si; } } - if ((pl->pl_flags & PL_FLAG_SI) == 0) - bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo)); if (td2->td_dbgflags & TDB_SCE) pl->pl_flags |= PL_FLAG_SCE; else if (td2->td_dbgflags & TDB_SCX) From owner-svn-src-all@freebsd.org Wed Nov 8 23:41:28 2017 Return-Path: Delivered-To: svn-src-all@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 62021E5EE13; Wed, 8 Nov 2017 23:41:28 +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 2F7D16D2FC; Wed, 8 Nov 2017 23:41:28 +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 vA8NfRbQ041331; Wed, 8 Nov 2017 23:41:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA8NfRUL041330; Wed, 8 Nov 2017 23:41:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711082341.vA8NfRUL041330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 8 Nov 2017 23:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325568 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Nov 2017 23:41:28 -0000 Author: bdrewery Date: Wed Nov 8 23:41:27 2017 New Revision: 325568 URL: https://svnweb.freebsd.org/changeset/base/325568 Log: universe: Fix creating LINT files with AUTO_OBJ. These are expected to be created in .CURDIR. Reported by: kib Sponsored by: Dell EMC Isilon Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Nov 8 23:32:56 2017 (r325567) +++ head/Makefile Wed Nov 8 23:41:27 2017 (r325568) @@ -553,7 +553,8 @@ universe_${target}_kernels: universe_${target}_worlds universe_${target}_kernels: universe_${target}_prologue .MAKE .PHONY .if exists(${KERNSRCDIR}/${target}/conf/NOTES) @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ - ${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ + ${SUB_MAKE} -DNO_OBJ LINT \ + > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) .endif From owner-svn-src-all@freebsd.org Thu Nov 9 01:41:01 2017 Return-Path: Delivered-To: svn-src-all@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 4D1D4E623A0; Thu, 9 Nov 2017 01:41:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1A7E570767; Thu, 9 Nov 2017 01:41:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA91f0m5088175; Thu, 9 Nov 2017 01:41:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA91f0II088174; Thu, 9 Nov 2017 01:41:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201711090141.vA91f0II088174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 9 Nov 2017 01:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325569 - head/tools/bsdbox X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/bsdbox X-SVN-Commit-Revision: 325569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 01:41:01 -0000 Author: adrian Date: Thu Nov 9 01:41:00 2017 New Revision: 325569 URL: https://svnweb.freebsd.org/changeset/base/325569 Log: [bsdbox] fix compilation due to library work. Modified: head/tools/bsdbox/Makefile Modified: head/tools/bsdbox/Makefile ============================================================================== --- head/tools/bsdbox/Makefile Wed Nov 8 23:41:27 2017 (r325568) +++ head/tools/bsdbox/Makefile Thu Nov 9 01:41:00 2017 (r325569) @@ -70,8 +70,9 @@ CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermcapw # CRUNCH_SRCDIRS+= sbin -CRUNCH_LIBS+= -lalias -lcam -lcursesw -ldevstat -lipsec +CRUNCH_LIBS+= -l80211 -lalias -lcam -lcursesw -ldevstat -lipsec # Don't forget this - ifconfig, etc -adrian +CRUNCH_LIBS+= -lprivateifconfig CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lsbuf -lufs ################################################################## From owner-svn-src-all@freebsd.org Thu Nov 9 02:37:50 2017 Return-Path: Delivered-To: svn-src-all@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 7B060E65A9E; Thu, 9 Nov 2017 02:37:50 +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 45B4C730DD; Thu, 9 Nov 2017 02:37:50 +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 vA92bnNh016035; Thu, 9 Nov 2017 02:37:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA92bn4K016034; Thu, 9 Nov 2017 02:37:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711090237.vA92bn4K016034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 9 Nov 2017 02:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325570 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 325570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 02:37:50 -0000 Author: bdrewery Date: Thu Nov 9 02:37:49 2017 New Revision: 325570 URL: https://svnweb.freebsd.org/changeset/base/325570 Log: AUTO_OBJ: Fix 'old style' kernel builds using wrong .OBJDIR. There's no way currently to automatically prevent the bad .OBJDIR from being created but it can at least be prevented from being used. Passing WITHOUT_AUTO_OBJ=yes or MK_AUTO_OBJ=no or -DNO_OBJ in will prevent it. Reported by: jeffr Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12989 Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Nov 9 01:41:00 2017 (r325569) +++ head/sys/conf/kern.pre.mk Thu Nov 9 02:37:49 2017 (r325570) @@ -24,6 +24,9 @@ _srcconf_included_: .MAKE.MODE+= curdirOk=yes .endif +# The kernel build always expects .OBJDIR=.CURDIR. +.OBJDIR: ${.CURDIR} + .if defined(NO_OBJWALK) || ${MK_AUTO_OBJ} == "yes" NO_OBJWALK= t NO_MODULES_OBJ= t From owner-svn-src-all@freebsd.org Thu Nov 9 07:36:40 2017 Return-Path: Delivered-To: svn-src-all@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 B00FAE6DABF; Thu, 9 Nov 2017 07:36:40 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C7CB47BDA8; Thu, 9 Nov 2017 07:36:38 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id e71d05c3; Thu, 9 Nov 2017 08:36:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=EVR1aP60fM//eCC4fPNTylOUolY=; b=P4HNu2jr8wQNXxNfchKk+m9os+tR oLgDH2Sm3J8V1ufdu/O2yiJRbXZEo1ii0q/0oExTkVyiNR/rJMZHah/gqj69WBN2 zhIZuySBxcU6RWmiypb23d7HnmK9kqTk98s3M8f/lgenxLJfyiHZCqPng8q/hLVi 1v/K91tuQUSrIBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=NT+TsTxgflAiZRpSgANDEZkrqseuQT0ej+hKBqhFsoK0PykFwZe/0tTb RyiE+1Or7N4dyvldNZ9UUyc4H/1p3N00gev0vHogid7bOfo4ATQwpPsRP1S8gKTR gcp+RD7BRtw4k4w0fzJ5YlfIK4atjS+frb0Q34f/2J62YfrjMJ0= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 2101a277 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 9 Nov 2017 08:36:35 +0100 (CET) Date: Thu, 9 Nov 2017 08:36:35 +0100 From: Emmanuel Vadot To: Konstantin Belousov Cc: Jeff Roberson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325530 - in head/sys: amd64/amd64 arm64/arm64 fs/tmpfs kern mips/mips powerpc/aim powerpc/powerpc sparc64/sparc64 vm x86/iommu Message-Id: <20171109083635.dd538d0fa285a0219faa8b95@bidouilliste.com> In-Reply-To: <20171108232528.GX2566@kib.kiev.ua> References: <201711080239.vA82dbJ6009161@repo.freebsd.org> <20171108234115.421969741ee75d5bb3d905e5@bidouilliste.com> <20171108232528.GX2566@kib.kiev.ua> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 07:36:40 -0000 On Thu, 9 Nov 2017 01:25:28 +0200 Konstantin Belousov wrote: > On Wed, Nov 08, 2017 at 11:41:15PM +0100, Emmanuel Vadot wrote: > > > > Hello Jeff, > > > > On Wed, 8 Nov 2017 02:39:37 +0000 (UTC) > > Jeff Roberson wrote: > > > > > Author: jeff > > > Date: Wed Nov 8 02:39:37 2017 > > > New Revision: 325530 > > > URL: https://svnweb.freebsd.org/changeset/base/325530 > > > > > > Log: > > > Replace manyinstances of VM_WAIT with blocking page allocation flags > > > similar to the kernel memory allocator. > > > > > > This simplifies NUMA allocation because the domain will be known at wait > > > time and races between failure and sleeping are eliminated. This also > > > reduces boilerplate code and simplifies callers. > > > > > > A wait primitive is supplied for uma zones for similar reasons. This > > > eliminates some non-specific VM_WAIT calls in favor of more explicit > > > sleeps that may be satisfied without new pages. > > > > > > Reviewed by: alc, kib, markj > > > Tested by: pho > > > Sponsored by: Netflix, Dell/EMC Isilon > > > > > > > This break armv7 (atleast) kernel : > > > > KDB: debugger backends: > > ddb KDB: current backend: > > ddb Copyright (c) 1992-2017 The FreeBSD > > Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, > > 1993, 1994 The Regents of the University of California. All rights > > reserved. FreeBSD is a registered trademark of The FreeBSD > > Foundation. FreeBSD 12.0-CURRENT #51 3c355d849c9(HEAD): Wed Nov 8 > > 23:24:16 CET 2017 > > elbarto@knuckles.blih.net:/usr/home/elbarto/Work/freebsd/obj/usr/home/elbarto/Work/freebsd/freebsd.git/arm.armv7/sys/GENERIC > > arm FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based > > on LLVM 5.0.0svn) WARNING: WITNESS option enabled, expect reduced > > performance. panic: inconsistent object(0)/req(8) cpuid = > > 0 time = > > Should be fixed by r325566. Confirmed, thank you. -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu Nov 9 10:15:59 2017 Return-Path: Delivered-To: svn-src-all@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 50BE7E70D71; Thu, 9 Nov 2017 10:15:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5A68032F; Thu, 9 Nov 2017 10:15:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9AFwRv008072; Thu, 9 Nov 2017 10:15:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9AFw82008071; Thu, 9 Nov 2017 10:15:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201711091015.vA9AFw82008071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 9 Nov 2017 10:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325571 - head/sys/dev/ahci X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ahci X-SVN-Commit-Revision: 325571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 10:15:59 -0000 Author: mav Date: Thu Nov 9 10:15:57 2017 New Revision: 325571 URL: https://svnweb.freebsd.org/changeset/base/325571 Log: Add some PCI IDs found on AMD Epyc system. MFC after: 2 weeks Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Thu Nov 9 02:37:49 2017 (r325570) +++ head/sys/dev/ahci/ahci_pci.c Thu Nov 9 10:15:57 2017 (r325571) @@ -73,6 +73,11 @@ static const struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, + {0x79001022, 0x00, "AMD KERNCZ", 0}, + {0x79011022, 0x00, "AMD KERNCZ", 0}, + {0x79021022, 0x00, "AMD KERNCZ", 0}, + {0x79031022, 0x00, "AMD KERNCZ", 0}, + {0x79041022, 0x00, "AMD KERNCZ", 0}, {0x06011b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, {0x06021b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, {0x06111b21, 0x00, "ASMedia ASM1061", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, From owner-svn-src-all@freebsd.org Thu Nov 9 11:37:21 2017 Return-Path: Delivered-To: svn-src-all@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 ABA6DE722CB; Thu, 9 Nov 2017 11:37:21 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 78D8E2705; Thu, 9 Nov 2017 11:37:21 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9BbK16041105; Thu, 9 Nov 2017 11:37:20 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9BbKXs041104; Thu, 9 Nov 2017 11:37:20 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091137.vA9BbKXs041104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 11:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r325572 - vendor-sys/ena-com/dist X-SVN-Group: vendor-sys X-SVN-Commit-Author: mw X-SVN-Commit-Paths: vendor-sys/ena-com/dist X-SVN-Commit-Revision: 325572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 11:37:21 -0000 Author: mw Date: Thu Nov 9 11:37:20 2017 New Revision: 325572 URL: https://svnweb.freebsd.org/changeset/base/325572 Log: Update ena-com HAL to newest version The newest ena-com HAL update adds dynamically controlled logging level functionality. Obtained from: Amazon, Inc. Modified: vendor-sys/ena-com/dist/ena_plat.h Modified: vendor-sys/ena-com/dist/ena_plat.h ============================================================================== --- vendor-sys/ena-com/dist/ena_plat.h Thu Nov 9 10:15:57 2017 (r325571) +++ vendor-sys/ena-com/dist/ena_plat.h Thu Nov 9 11:37:20 2017 (r325572) @@ -104,14 +104,11 @@ extern struct ena_bus_space ebs; #define ENA_IOQ (1 << 7) /* Detailed info about IO queues. */ #define ENA_ADMQ (1 << 8) /* Detailed info about admin queue. */ -#ifndef ENA_DEBUG_LEVEL -#define ENA_DEBUG_LEVEL (ENA_ALERT | ENA_WARNING) -#endif +extern int ena_log_level; -#ifdef ENA_TRACE #define ena_trace_raw(level, fmt, args...) \ do { \ - if (((level) & ENA_DEBUG_LEVEL) != (level)) \ + if (((level) & ena_log_level) != (level)) \ break; \ printf(fmt, ##args); \ } while (0) @@ -120,10 +117,6 @@ extern struct ena_bus_space ebs; ena_trace_raw(level, "%s() [TID:%d]: " \ fmt " \n", __func__, curthread->td_tid, ##args) -#else /* ENA_TRACE */ -#define ena_trace_raw(...) -#define ena_trace(...) -#endif /* ENA_TRACE */ #define ena_trc_dbg(format, arg...) ena_trace(ENA_DBG, format, ##arg) #define ena_trc_info(format, arg...) ena_trace(ENA_INFO, format, ##arg) From owner-svn-src-all@freebsd.org Thu Nov 9 11:39:09 2017 Return-Path: Delivered-To: svn-src-all@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 61D19E7232F; Thu, 9 Nov 2017 11:39:09 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2D3942883; Thu, 9 Nov 2017 11:39:09 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9Bd8vX041214; Thu, 9 Nov 2017 11:39:08 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9Bd88U041213; Thu, 9 Nov 2017 11:39:08 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091139.vA9Bd88U041213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 11:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r325573 - vendor-sys/ena-com/1.1.4.4 X-SVN-Group: vendor-sys X-SVN-Commit-Author: mw X-SVN-Commit-Paths: vendor-sys/ena-com/1.1.4.4 X-SVN-Commit-Revision: 325573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 11:39:09 -0000 Author: mw Date: Thu Nov 9 11:39:08 2017 New Revision: 325573 URL: https://svnweb.freebsd.org/changeset/base/325573 Log: Create 1.1.4.4 tag in ena-com Obtained from: Amazon.com, Inc. Added: vendor-sys/ena-com/1.1.4.4/ - copied from r325572, vendor-sys/ena-com/dist/ From owner-svn-src-all@freebsd.org Thu Nov 9 11:46:01 2017 Return-Path: Delivered-To: svn-src-all@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 30EAAE725F7; Thu, 9 Nov 2017 11:46:01 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0ACC52E14; Thu, 9 Nov 2017 11:46:00 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9Bk0ch045501; Thu, 9 Nov 2017 11:46:00 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9Bk0b1045494; Thu, 9 Nov 2017 11:46:00 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091146.vA9Bk0b1045494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 11:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325574 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 11:46:01 -0000 Author: mw Date: Thu Nov 9 11:45:59 2017 New Revision: 325574 URL: https://svnweb.freebsd.org/changeset/base/325574 Log: Add RX OOO completion feature The RX out of order completion feature, allows to complete RX descriptors out of order, by keeping trace of all free descriptors in the separate array. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12855 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 11:39:08 2017 (r325573) +++ head/sys/dev/ena/ena.c Thu Nov 9 11:45:59 2017 (r325574) @@ -102,6 +102,7 @@ static int ena_setup_tx_resources(struct ena_adapter * static void ena_free_tx_resources(struct ena_adapter *, int); static int ena_setup_all_tx_resources(struct ena_adapter *); static void ena_free_all_tx_resources(struct ena_adapter *); +static inline int validate_rx_req_id(struct ena_ring *, uint16_t); static int ena_setup_rx_resources(struct ena_adapter *, unsigned int); static void ena_free_rx_resources(struct ena_adapter *, unsigned int); static int ena_setup_all_rx_resources(struct ena_adapter *); @@ -765,6 +766,23 @@ ena_free_all_tx_resources(struct ena_adapter *adapter) return; } +static inline int +validate_rx_req_id(struct ena_ring *rx_ring, uint16_t req_id) +{ + if (likely(req_id < rx_ring->ring_size)) + return (0); + + device_printf(rx_ring->adapter->pdev, "Invalid rx req_id: %hu\n", + req_id); + counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); + + /* Trigger device reset */ + rx_ring->adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; + rx_ring->adapter->trigger_reset = true; + + return (EFAULT); +} + /** * ena_setup_rx_resources - allocate Rx resources (Descriptors) * @adapter: network interface device structure @@ -792,6 +810,12 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un rx_ring->rx_buffer_info = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO); + size = sizeof(uint16_t) * rx_ring->ring_size; + rx_ring->free_rx_ids = malloc(size, M_DEVBUF, M_WAITOK); + + for (i = 0; i < rx_ring->ring_size; i++) + rx_ring->free_rx_ids[i] = i; + /* Reset RX statistics. */ ena_reset_counters((counter_u64_t *)&rx_ring->rx_stats, sizeof(rx_ring->rx_stats)); @@ -831,6 +855,8 @@ err_rx_dma: rx_ring->rx_buffer_info[i].map); } + free(rx_ring->free_rx_ids, M_DEVBUF); + rx_ring->free_rx_ids = NULL; free(rx_ring->rx_buffer_info, M_DEVBUF); rx_ring->rx_buffer_info = NULL; ena_trace(ENA_ALERT, "RX resource allocation fail"); @@ -868,6 +894,9 @@ ena_free_rx_resources(struct ena_adapter *adapter, uns free(rx_ring->rx_buffer_info, M_DEVBUF); rx_ring->rx_buffer_info = NULL; + free(rx_ring->free_rx_ids, M_DEVBUF); + rx_ring->free_rx_ids = NULL; + return; } @@ -997,7 +1026,7 @@ static int ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t num) { struct ena_adapter *adapter = rx_ring->adapter; - uint16_t next_to_use; + uint16_t next_to_use, req_id; uint32_t i; int rc; @@ -1007,12 +1036,18 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t next_to_use = rx_ring->next_to_use; for (i = 0; i < num; i++) { + struct ena_rx_buffer *rx_info; + ena_trace(ENA_DBG | ENA_RXPTH | ENA_RSC, "RX buffer - next to use: %d", next_to_use); - struct ena_rx_buffer *rx_info = - &rx_ring->rx_buffer_info[next_to_use]; + req_id = rx_ring->free_rx_ids[next_to_use]; + rc = validate_rx_req_id(rx_ring, req_id); + if (unlikely(rc)) + break; + rx_info = &rx_ring->rx_buffer_info[req_id]; + rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); if (rc != 0) { device_printf(adapter->pdev, @@ -1020,7 +1055,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t break; } rc = ena_com_add_single_rx_desc(rx_ring->ena_com_io_sq, - &rx_info->ena_buf, next_to_use); + &rx_info->ena_buf, req_id); if (unlikely(rc)) { device_printf(adapter->pdev, "failed to add buffer for rx queue %d\n", @@ -1404,7 +1439,7 @@ ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_ * @rx_ring: ring for which we want to clean packets * @ena_bufs: buffer info * @ena_rx_ctx: metadata for this packet(s) - * @next_to_clean: ring pointer + * @next_to_clean: ring pointer, will be updated only upon success * **/ static struct mbuf* @@ -1414,15 +1449,22 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r struct mbuf *mbuf; struct ena_rx_buffer *rx_info; struct ena_adapter *adapter; - unsigned int len, buf = 0; unsigned int descs = ena_rx_ctx->descs; + uint16_t ntc, len, req_id, buf = 0; + ntc = *next_to_clean; adapter = rx_ring->adapter; - rx_info = &rx_ring->rx_buffer_info[*next_to_clean]; + rx_info = &rx_ring->rx_buffer_info[ntc]; - ENA_ASSERT(rx_info->mbuf, "Invalid alloc frag buffer\n"); + if (unlikely(rx_info->mbuf == NULL)) { + device_printf(adapter->pdev, "NULL mbuf in rx_info"); + return (NULL); + } - len = ena_bufs[0].len; + len = ena_bufs[buf].len; + req_id = ena_bufs[buf].req_id; + rx_info = &rx_ring->rx_buffer_info[req_id]; + ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx", rx_info, rx_info->mbuf, (uintmax_t)rx_info->ena_buf.paddr); @@ -1442,18 +1484,36 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); rx_info->mbuf = NULL; - *next_to_clean = ENA_RX_RING_IDX_NEXT(*next_to_clean, - rx_ring->ring_size); + rx_ring->free_rx_ids[ntc] = req_id; + ntc = ENA_RX_RING_IDX_NEXT(ntc, rx_ring->ring_size); /* * While we have more than 1 descriptors for one rcvd packet, append * other mbufs to the main one */ while (--descs) { - rx_info = &rx_ring->rx_buffer_info[*next_to_clean]; - len = ena_bufs[++buf].len; + ++buf; + len = ena_bufs[buf].len; + req_id = ena_bufs[buf].req_id; + rx_info = &rx_ring->rx_buffer_info[req_id]; - if (!m_append(mbuf, len, rx_info->mbuf->m_data)) { + if (unlikely(rx_info->mbuf == NULL)) { + device_printf(adapter->pdev, "NULL mbuf in rx_info"); + /* + * If one of the required mbufs was not allocated yet, + * we can break there. + * All earlier used descriptors will be reallocated + * later and not used mbufs can be reused. + * The next_to_clean pointer will not be updated in case + * of an error, so caller should advance it manually + * in error handling routine to keep it up to date + * with hw ring. + */ + m_freem(mbuf); + return (NULL); + } + + if (m_append(mbuf, len, rx_info->mbuf->m_data) == 0) { counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p", mbuf); @@ -1463,10 +1523,12 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r m_freem(rx_info->mbuf); rx_info->mbuf = NULL; - *next_to_clean = ENA_RX_RING_IDX_NEXT(*next_to_clean, - rx_ring->ring_size); + rx_ring->free_rx_ids[ntc] = req_id; + ntc = ENA_RX_RING_IDX_NEXT(ntc, rx_ring->ring_size); } + *next_to_clean = ntc; + return (mbuf); } @@ -1523,7 +1585,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) uint32_t refill_threshold; uint32_t do_if_input = 0; unsigned int qid; - int rc; + int rc, i; int budget = RX_BUDGET; adapter = rx_ring->que->adapter; @@ -1552,8 +1614,14 @@ ena_rx_cleanup(struct ena_ring *rx_ring) /* Exit if we failed to retrieve a buffer */ if (unlikely(!mbuf)) { - next_to_clean = ENA_RX_RING_IDX_ADD(next_to_clean, - ena_rx_ctx.descs, rx_ring->ring_size); + for (i = 0; i < ena_rx_ctx.descs; ++i) { + rx_ring->free_rx_ids[next_to_clean] = + rx_ring->ena_bufs[i].req_id; + next_to_clean = + ENA_RX_RING_IDX_NEXT(next_to_clean, + rx_ring->ring_size); + + } break; } ena_trace(ENA_DBG | ENA_RXPTH, "Rx: %d bytes", Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Nov 9 11:39:08 2017 (r325573) +++ head/sys/dev/ena/ena.h Thu Nov 9 11:45:59 2017 (r325574) @@ -242,12 +242,17 @@ struct ena_stats_rx { counter_u64_t bad_desc_num; /* Not counted */ counter_u64_t small_copy_len_pkt; + counter_u64_t bad_req_id; + counter_u64_t empty_rx_ring; }; struct ena_ring { - /* Holds the empty requests for TX out of order completions */ - uint16_t *free_tx_ids; + /* Holds the empty requests for TX/RX out of order completions */ + union { + uint16_t *free_tx_ids; + uint16_t *free_rx_ids; + }; struct ena_com_dev *ena_dev; struct ena_adapter *adapter; struct ena_com_io_cq *ena_com_io_cq; Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu Nov 9 11:39:08 2017 (r325573) +++ head/sys/dev/ena/ena_sysctl.c Thu Nov 9 11:45:59 2017 (r325574) @@ -197,6 +197,9 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, "small_copy_len_pkt", CTLFLAG_RD, &rx_stats->small_copy_len_pkt, "Small copy packet count"); + SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, + "bad_req_id", CTLFLAG_RD, + &rx_stats->bad_req_id, "Bad request id count"); } /* Stats read from device */ From owner-svn-src-all@freebsd.org Thu Nov 9 11:48:23 2017 Return-Path: Delivered-To: svn-src-all@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 9F476E726C0; Thu, 9 Nov 2017 11:48:23 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 611D73068; Thu, 9 Nov 2017 11:48:23 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9BmMUg045666; Thu, 9 Nov 2017 11:48:22 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9BmMCl045663; Thu, 9 Nov 2017 11:48:22 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091148.vA9BmMCl045663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 11:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325576 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 11:48:23 -0000 Author: mw Date: Thu Nov 9 11:48:22 2017 New Revision: 325576 URL: https://svnweb.freebsd.org/changeset/base/325576 Log: Check for Rx ring state to prevent from stall in the ENA driver In case when Rx ring is full and driver will fail to allocate Rx mbufs, the ring could be stalled. Keep alive is checking every second for Rx ring state, and if it is full for two cycles, then trigger rx_cleanup routine in another thread. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12856 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 11:47:47 2017 (r325575) +++ head/sys/dev/ena/ena.c Thu Nov 9 11:48:22 2017 (r325576) @@ -122,6 +122,7 @@ static void ena_destroy_all_rx_queues(struct ena_adapt static void ena_destroy_all_io_queues(struct ena_adapter *); static int ena_create_io_queues(struct ena_adapter *); static int ena_tx_cleanup(struct ena_ring *); +static void ena_deferred_rx_cleanup(void *, int); static int ena_rx_cleanup(struct ena_ring *); static inline int validate_tx_req_id(struct ena_ring *, uint16_t); static void ena_rx_hash_mbuf(struct ena_ring *, struct ena_com_rx_ctx *, @@ -471,6 +472,7 @@ ena_init_io_rings(struct ena_adapter *adapter) device_get_nameunit(adapter->pdev), i); mtx_init(&txr->ring_mtx, txr->mtx_name, NULL, MTX_DEF); + mtx_init(&rxr->ring_mtx, rxr->mtx_name, NULL, MTX_DEF); que = &adapter->que[i]; que->adapter = adapter; @@ -480,6 +482,8 @@ ena_init_io_rings(struct ena_adapter *adapter) txr->que = que; rxr->que = que; + + rxr->empty_rx_queue = 0; } } @@ -495,6 +499,7 @@ ena_free_io_ring_resources(struct ena_adapter *adapter sizeof(rxr->rx_stats)); mtx_destroy(&txr->ring_mtx); + mtx_destroy(&rxr->ring_mtx); drbr_free(txr->br, M_DEVBUF); @@ -847,6 +852,22 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un } } + /* Allocate taskqueues */ + TASK_INIT(&rx_ring->cmpl_task, 0, ena_deferred_rx_cleanup, rx_ring); + rx_ring->cmpl_tq = taskqueue_create_fast("ena RX completion", M_WAITOK, + taskqueue_thread_enqueue, &rx_ring->cmpl_tq); + + /* RSS set cpu for thread */ +#ifdef RSS + CPU_SETOF(que->cpu, &cpu_mask); + taskqueue_start_threads_cpuset(&rx_ring->cmpl_tq, 1, PI_NET, &cpu_mask, + "%s rx_ring cmpl (bucket %d)", + device_get_nameunit(adapter->pdev), que->cpu); +#else + taskqueue_start_threads(&rx_ring->cmpl_tq, 1, PI_NET, + "%s rx_ring cmpl %d", device_get_nameunit(adapter->pdev), que->cpu); +#endif + return (0); err_rx_dma: @@ -877,6 +898,11 @@ ena_free_rx_resources(struct ena_adapter *adapter, uns ena_trace(ENA_INFO, "%s qid %d\n", __func__, qid); + while (taskqueue_cancel(rx_ring->cmpl_tq, &rx_ring->cmpl_task, NULL) != 0) + taskqueue_drain(rx_ring->cmpl_tq, &rx_ring->cmpl_task); + + taskqueue_free(rx_ring->cmpl_tq); + /* Free buffer DMA maps, */ for (int i = 0; i < rx_ring->ring_size; i++) { m_freem(rx_ring->rx_buffer_info[i].mbuf); @@ -1565,6 +1591,24 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c return; } +static void +ena_deferred_rx_cleanup(void *arg, int pending) +{ + struct ena_ring *rx_ring = arg; + int budget = CLEAN_BUDGET; + + ENA_RING_MTX_LOCK(rx_ring); + /* + * If deferred task was executed, perform cleanup of all awaiting + * descs (or until given budget is depleted to avoid infinite loop). + */ + while (budget--) { + if (ena_rx_cleanup(rx_ring) == 0) + break; + } + ENA_RING_MTX_UNLOCK(rx_ring); +} + /** * ena_rx_cleanup - handle rx irq * @arg: ring for which irq is being handled @@ -1736,7 +1780,17 @@ ena_handle_msix(void *arg) io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; for (i = 0; i < CLEAN_BUDGET; ++i) { - rxc = ena_rx_cleanup(rx_ring); + /* + * If lock cannot be acquired, then deferred cleanup task was + * being executed and rx ring is being cleaned up in + * another thread. + */ + if (ENA_RING_MTX_TRYLOCK(rx_ring)) { + rxc = ena_rx_cleanup(rx_ring); + ENA_RING_MTX_UNLOCK(rx_ring); + } else { + rxc = 0; + } /* Protection from calling ena_tx_cleanup from ena_start_xmit */ ENA_RING_MTX_LOCK(tx_ring); @@ -3374,7 +3428,54 @@ static void check_for_missing_tx_completions(struct en adapter->next_monitored_tx_qid = i % adapter->num_queues; } +/* trigger deferred rx cleanup after 2 consecutive detections */ +#define EMPTY_RX_REFILL 2 +/* For the rare case where the device runs out of Rx descriptors and the + * msix handler failed to refill new Rx descriptors (due to a lack of memory + * for example). + * This case will lead to a deadlock: + * The device won't send interrupts since all the new Rx packets will be dropped + * The msix handler won't allocate new Rx descriptors so the device won't be + * able to send new packets. + * + * When such a situation is detected - execute rx cleanup task in another thread + */ +static void +check_for_empty_rx_ring(struct ena_adapter *adapter) +{ + struct ena_ring *rx_ring; + int i, refill_required; + if (!adapter->up) + return; + + if (adapter->trigger_reset) + return; + + for (i = 0; i < adapter->num_queues; i++) { + rx_ring = &adapter->rx_ring[i]; + + refill_required = ena_com_free_desc(rx_ring->ena_com_io_sq); + if (unlikely(refill_required == (rx_ring->ring_size - 1))) { + rx_ring->empty_rx_queue++; + + if (rx_ring->empty_rx_queue >= EMPTY_RX_REFILL) { + counter_u64_add(rx_ring->rx_stats.empty_rx_ring, + 1); + + device_printf(adapter->pdev, + "trigger refill for ring %d\n", i); + + taskqueue_enqueue(rx_ring->cmpl_tq, + &rx_ring->cmpl_task); + rx_ring->empty_rx_queue = 0; + } + } else { + rx_ring->empty_rx_queue = 0; + } + } +} + static void ena_timer_service(void *data) { @@ -3387,6 +3488,8 @@ ena_timer_service(void *data) check_for_admin_com_state(adapter); check_for_missing_tx_completions(adapter); + + check_for_empty_rx_ring(adapter); if (host_info) ena_update_host_info(host_info, adapter->ifp); Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Nov 9 11:47:47 2017 (r325575) +++ head/sys/dev/ena/ena.h Thu Nov 9 11:48:22 2017 (r325576) @@ -284,15 +284,23 @@ struct ena_ring { struct buf_ring *br; /* only for TX */ struct mtx ring_mtx; char mtx_name[16]; - struct task enqueue_task; - struct taskqueue *enqueue_tq; - struct task cmpl_task; - struct taskqueue *cmpl_tq; + union { + struct { + struct task enqueue_task; + struct taskqueue *enqueue_tq; + }; + struct { + struct task cmpl_task; + struct taskqueue *cmpl_tq; + }; + }; union { struct ena_stats_tx tx_stats; struct ena_stats_rx rx_stats; }; + + int empty_rx_queue; } __aligned(CACHE_LINE_SIZE); Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu Nov 9 11:47:47 2017 (r325575) +++ head/sys/dev/ena/ena_sysctl.c Thu Nov 9 11:48:22 2017 (r325576) @@ -200,6 +200,9 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, "bad_req_id", CTLFLAG_RD, &rx_stats->bad_req_id, "Bad request id count"); + SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, + "empty_rx_ring", CTLFLAG_RD, + &rx_stats->empty_rx_ring, "RX descriptors depletion count"); } /* Stats read from device */ From owner-svn-src-all@freebsd.org Thu Nov 9 11:50:54 2017 Return-Path: Delivered-To: svn-src-all@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 06DA8E7275E; Thu, 9 Nov 2017 11:50:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D3E6B3253; Thu, 9 Nov 2017 11:50:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9Boq9A045807; Thu, 9 Nov 2017 11:50:52 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9BoqZR045806; Thu, 9 Nov 2017 11:50:52 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091150.vA9BoqZR045806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 11:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325577 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 11:50:54 -0000 Author: mw Date: Thu Nov 9 11:50:52 2017 New Revision: 325577 URL: https://svnweb.freebsd.org/changeset/base/325577 Log: Split function checking for missing TX completion in ENA driver Pure cosmetic change for better readability of the driver. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12857 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 11:48:22 2017 (r325576) +++ head/sys/dev/ena/ena.c Thu Nov 9 11:50:52 2017 (r325577) @@ -3349,6 +3349,56 @@ static void check_for_admin_com_state(struct ena_adapt } } +static int +check_missing_comp_in_queue(struct ena_adapter *adapter, + struct ena_ring *tx_ring) +{ + struct bintime curtime, time; + struct ena_tx_buffer *tx_buf; + uint32_t missed_tx = 0; + int i; + + getbinuptime(&curtime); + + for (i = 0; i < tx_ring->ring_size; i++) { + tx_buf = &tx_ring->tx_buffer_info[i]; + + if (!bintime_isset(&tx_buf->timestamp)) + continue; + + time = curtime; + bintime_sub(&time, &tx_buf->timestamp); + + /* Check again if packet is still waiting */ + if (unlikely(bttosbt(time) > adapter->missing_tx_timeout)) { + + if (!tx_buf->print_once) + ena_trace(ENA_WARNING, "Found a Tx that wasn't " + "completed on time, qid %d, index %d.\n", + tx_ring->qid, i); + + tx_buf->print_once = true; + missed_tx++; + + if (unlikely(missed_tx > + adapter->missing_tx_threshold)) { + device_printf(adapter->pdev, + "The number of lost tx completion " + "is above the threshold (%d > %d). " + "Reset the device\n", + missed_tx, + adapter->missing_tx_threshold); + adapter->reset_reason = + ENA_REGS_RESET_MISS_TX_CMPL; + adapter->trigger_reset = true; + return (EIO); + } + } + } + + return (0); +} + /* * Check for TX which were not completed on time. * Timeout is defined by "missing_tx_timeout". @@ -3358,9 +3408,7 @@ static void check_for_admin_com_state(struct ena_adapt static void check_for_missing_tx_completions(struct ena_adapter *adapter) { struct ena_ring *tx_ring; - struct ena_tx_buffer *tx_info; - struct bintime curtime, time; - int i, j, budget, missed_tx; + int i, budget, rc; /* Make sure the driver doesn't turn the device in other process */ rmb(); @@ -3375,48 +3423,13 @@ static void check_for_missing_tx_completions(struct en return; budget = adapter->missing_tx_max_queues; - getbinuptime(&curtime); for (i = adapter->next_monitored_tx_qid; i < adapter->num_queues; i++) { tx_ring = &adapter->tx_ring[i]; - missed_tx = 0; - - for (j = 0; j < tx_ring->ring_size; j++) { - tx_info = &tx_ring->tx_buffer_info[j]; - - if (!bintime_isset(&tx_info->timestamp)) - continue; - - time = curtime; - bintime_sub(&time, &tx_info->timestamp); - - /* Check again if packet is still waiting */ - if (bintime_isset(&tx_info->timestamp) && unlikely( - bttosbt(time) > adapter->missing_tx_timeout)) { - if (tx_info->print_once) - device_printf(adapter->pdev, - "Found a Tx that wasn't completed " - "on time, qid %d, index %d.\n", - tx_ring->qid, j); - - tx_info->print_once = false; - missed_tx++; - - if (unlikely(missed_tx > - adapter->missing_tx_threshold)) { - device_printf(adapter->pdev, - "The number of lost tx completion " - "is above the threshold (%d > %d). " - "Reset the device\n", missed_tx, - adapter->missing_tx_threshold); - adapter->reset_reason = - ENA_REGS_RESET_MISS_TX_CMPL; - adapter->trigger_reset = true; - return; - } - } - } + rc = check_missing_comp_in_queue(adapter, tx_ring); + if (unlikely(rc)) + return; budget--; if (budget == 0) { From owner-svn-src-all@freebsd.org Thu Nov 9 11:52:54 2017 Return-Path: Delivered-To: svn-src-all@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 49D6BE72903; Thu, 9 Nov 2017 11:52:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 169B635F5; Thu, 9 Nov 2017 11:52:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9BqrmQ049818; Thu, 9 Nov 2017 11:52:53 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9BqrZm049817; Thu, 9 Nov 2017 11:52:53 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091152.vA9BqrZm049817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 11:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325578 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 11:52:54 -0000 Author: mw Date: Thu Nov 9 11:52:52 2017 New Revision: 325578 URL: https://svnweb.freebsd.org/changeset/base/325578 Log: Destroy admin queue after freeing interrupts in ENA driver On heavy load, when interrupt handling routine was slowed down, there could appear memory corruption, because resources were destroyed and interrupt was still being handled. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12858 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 11:50:52 2017 (r325577) +++ head/sys/dev/ena/ena.c Thu Nov 9 11:52:52 2017 (r325578) @@ -3862,9 +3862,13 @@ ena_detach(device_t pdev) ena_com_delete_host_info(ena_dev); - ena_com_admin_destroy(ena_dev); - ena_free_irqs(adapter); + + ena_com_abort_admin_commands(ena_dev); + + ena_com_wait_for_abort_completion(ena_dev); + + ena_com_admin_destroy(ena_dev); ena_com_mmio_reg_read_request_destroy(ena_dev); From owner-svn-src-all@freebsd.org Thu Nov 9 11:54:33 2017 Return-Path: Delivered-To: svn-src-all@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 46650E72983; Thu, 9 Nov 2017 11:54:33 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 20A0C3784; Thu, 9 Nov 2017 11:54:33 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9BsWWh049918; Thu, 9 Nov 2017 11:54:32 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9BsWkB049917; Thu, 9 Nov 2017 11:54:32 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091154.vA9BsWkB049917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 11:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325579 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 11:54:33 -0000 Author: mw Date: Thu Nov 9 11:54:32 2017 New Revision: 325579 URL: https://svnweb.freebsd.org/changeset/base/325579 Log: Fix error handling in the ENA driver and lock drbr_free() call Some goto tags were renamed for consistency, and few error handling routines were reworked. The drbr_free() must be locked just in case code will change in the future - for now, it should never be an issue, because drbr is being flushed in the ena_down() call, and the lock is required only when there are some mbufs inside. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12859 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 11:52:52 2017 (r325578) +++ head/sys/dev/ena/ena.c Thu Nov 9 11:54:32 2017 (r325579) @@ -269,9 +269,8 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, return (0); fail_map_load: - bus_dmamap_unload(dma->tag, dma->map); -fail_map_create: bus_dmamem_free(dma->tag, dma->vaddr, dma->map); +fail_map_create: bus_dma_tag_destroy(dma->tag); fail_tag: dma->tag = NULL; @@ -498,11 +497,12 @@ ena_free_io_ring_resources(struct ena_adapter *adapter ena_free_counters((counter_u64_t *)&rxr->rx_stats, sizeof(rxr->rx_stats)); - mtx_destroy(&txr->ring_mtx); - mtx_destroy(&rxr->ring_mtx); - + ENA_RING_MTX_LOCK(txr); drbr_free(txr->br, M_DEVBUF); + ENA_RING_MTX_UNLOCK(txr); + mtx_destroy(&txr->ring_mtx); + mtx_destroy(&rxr->ring_mtx); } static void @@ -613,12 +613,12 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in tx_ring->tx_buffer_info = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); if (tx_ring->tx_buffer_info == NULL) - goto err_tx_buffer_info; + return (ENOMEM); size = sizeof(uint16_t) * tx_ring->ring_size; tx_ring->free_tx_ids = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); if (tx_ring->free_tx_ids == NULL) - goto err_tx_reqs; + goto err_buf_info_free; /* Req id stack for TX OOO completions */ for (i = 0; i < tx_ring->ring_size; i++) @@ -643,7 +643,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in if (err != 0) { device_printf(adapter->pdev, "Unable to create Tx DMA map for buffer %d\n", i); - goto err_tx_map; + goto err_buf_info_unmap; } } @@ -655,7 +655,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in device_printf(adapter->pdev, "Unable to create taskqueue for enqueue task\n"); i = tx_ring->ring_size; - goto err_tx_map; + goto err_buf_info_unmap; } /* RSS set cpu for thread */ @@ -671,15 +671,17 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in return (0); -err_tx_map: +err_buf_info_unmap: while (i--) { bus_dmamap_destroy(adapter->tx_buf_tag, tx_ring->tx_buffer_info[i].map); } free(tx_ring->free_tx_ids, M_DEVBUF); -err_tx_reqs: + tx_ring->free_tx_ids = NULL; +err_buf_info_free: free(tx_ring->tx_buffer_info, M_DEVBUF); -err_tx_buffer_info: + tx_ring->tx_buffer_info = NULL; + return (ENOMEM); } @@ -737,12 +739,11 @@ ena_setup_all_tx_resources(struct ena_adapter *adapter for (i = 0; i < adapter->num_queues; i++) { rc = ena_setup_tx_resources(adapter, i); - if (rc == 0) - continue; - - device_printf(adapter->pdev, - "Allocation for Tx Queue %u failed\n", i); - goto err_setup_tx; + if (rc) { + device_printf(adapter->pdev, + "Allocation for Tx Queue %u failed\n", i); + goto err_setup_tx; + } } return (0); @@ -835,7 +836,7 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un if (err != 0) { device_printf(adapter->pdev, "Unable to create Rx DMA map for buffer %d\n", i); - goto err_rx_dma; + goto err_buf_info_unmap; } } @@ -870,7 +871,7 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un return (0); -err_rx_dma: +err_buf_info_unmap: while (i--) { bus_dmamap_destroy(adapter->rx_buf_tag, rx_ring->rx_buffer_info[i].map); @@ -939,12 +940,11 @@ ena_setup_all_rx_resources(struct ena_adapter *adapter for (i = 0; i < adapter->num_queues; i++) { rc = ena_setup_rx_resources(adapter, i); - if (rc == 0) - continue; - - device_printf(adapter->pdev, - "Allocation for Rx Queue %u failed\n", i); - goto err_setup_rx; + if (rc) { + device_printf(adapter->pdev, + "Allocation for Rx Queue %u failed\n", i); + goto err_setup_rx; + } } return (0); @@ -1837,16 +1837,20 @@ ena_enable_msix(struct ena_adapter *adapter) if (rc != 0) { device_printf(dev, "Failed to enable MSIX, vectors %d rc %d\n", msix_vecs, rc); - free(adapter->msix_entries, M_DEVBUF); - adapter->msix_entries = NULL; + rc = ENOSPC; - goto error; + goto err_msix_free; } adapter->msix_vecs = msix_vecs; adapter->msix_enabled = true; -error: + return (0); + +err_msix_free: + free(adapter->msix_entries, M_DEVBUF); + adapter->msix_entries = NULL; + return (rc); } @@ -1922,15 +1926,14 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) if (irq->res == NULL) { device_printf(adapter->pdev, "could not allocate " "irq vector: %d\n", irq->vector); - rc = ENXIO; - goto exit_res; + return (ENXIO); } if ((rc = bus_activate_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res)) != 0) { device_printf(adapter->pdev, "could not activate " "irq vector: %d\n", irq->vector); - goto exit_intr; + goto err_res_free; } if ((rc = bus_setup_intr(adapter->pdev, irq->res, @@ -1939,15 +1942,15 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) device_printf(adapter->pdev, "failed to register " "interrupt handler for irq %ju: %d\n", rman_get_start(irq->res), rc); - goto exit_intr; + goto err_res_free; } irq->requested = true; return (rc); -exit_intr: - device_printf(adapter->pdev, "exit_intr: releasing resource" - " for irq %d\n", irq->vector); +err_res_free: + device_printf(adapter->pdev, "releasing resource for irq %d\n", + irq->vector); rcc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); if (rcc) @@ -1955,7 +1958,6 @@ exit_intr: "releasing res for irq: %d\n", irq->vector); irq->res = NULL; -exit_res: return (rc); } @@ -2181,7 +2183,10 @@ ena_up_complete(struct ena_adapter *adapter) return (rc); } - ena_change_mtu(adapter->ifp, adapter->ifp->if_mtu); + rc = ena_change_mtu(adapter->ifp, adapter->ifp->if_mtu); + if (rc != 0) + return (rc); + ena_refill_all_rx_bufs(adapter); ena_reset_counters((counter_u64_t *)&adapter->hw_stats, sizeof(adapter->hw_stats)); @@ -3057,7 +3062,7 @@ static int ena_rss_init_default(struct ena_adapter *ad rc = ena_com_rss_init(ena_dev, ENA_RX_RSS_TABLE_LOG_SIZE); if (unlikely(rc)) { device_printf(dev, "Cannot init RSS\n"); - goto err_rss_init; + return (rc); } for (i = 0; i < ENA_RX_RSS_TABLE_SIZE; i++) { @@ -3071,7 +3076,7 @@ static int ena_rss_init_default(struct ena_adapter *ad ENA_IO_RXQ_IDX(qid)); if (unlikely(rc && (rc != EOPNOTSUPP))) { device_printf(dev, "Cannot fill indirect table\n"); - goto err_fill_indir; + goto err_rss_destroy; } } @@ -3079,20 +3084,19 @@ static int ena_rss_init_default(struct ena_adapter *ad ENA_HASH_KEY_SIZE, 0xFFFFFFFF); if (unlikely(rc && (rc != EOPNOTSUPP))) { device_printf(dev, "Cannot fill hash function\n"); - goto err_fill_indir; + goto err_rss_destroy; } rc = ena_com_set_default_hash_ctrl(ena_dev); if (unlikely(rc && (rc != EOPNOTSUPP))) { device_printf(dev, "Cannot fill hash control\n"); - goto err_fill_indir; + goto err_rss_destroy; } return (0); -err_fill_indir: +err_rss_destroy: ena_com_rss_destroy(ena_dev); -err_rss_init: return (rc); } From owner-svn-src-all@freebsd.org Thu Nov 9 11:57:03 2017 Return-Path: Delivered-To: svn-src-all@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 5BC4EE72A14; Thu, 9 Nov 2017 11:57:03 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 111AB3929; Thu, 9 Nov 2017 11:57:02 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9Bv22G050066; Thu, 9 Nov 2017 11:57:02 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9Bv24F050064; Thu, 9 Nov 2017 11:57:02 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091157.vA9Bv24F050064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 11:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325580 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 11:57:03 -0000 Author: mw Date: Thu Nov 9 11:57:02 2017 New Revision: 325580 URL: https://svnweb.freebsd.org/changeset/base/325580 Log: Refactor style of the ENA driver * Change all conditional checks in "if" statement to boolean expressions * Initialize variables with too complex values outside the declaration * Fix indentations * Move code associated with sysctls to ena_sysctl.c file * For consistency, remove unnecesary "return" from void functions * Use if_getdrvflags() function instead of accesing variable directly Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12860 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 11:54:32 2017 (r325579) +++ head/sys/dev/ena/ena.c Thu Nov 9 11:57:02 2017 (r325580) @@ -193,7 +193,6 @@ static int ena_buf_ring_size = 4096; SYSCTL_INT(_hw_ena, OID_AUTO, buf_ring_size, CTLFLAG_RWTUN, &ena_buf_ring_size, 0, "Size of the bufring"); - static ena_vendor_info_t ena_vendor_info_array[] = { { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_PF, 0}, { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_LLQ_PF, 0}, @@ -211,10 +210,9 @@ static struct ena_aenq_handlers aenq_handlers; void ena_dmamap_callback(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - if (error) + if (error != 0) return; *(bus_addr_t *) arg = segs[0].ds_addr; - return; } int @@ -222,12 +220,16 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, ena_mem_handle_t *dma , int mapflags) { struct ena_adapter* adapter = device_get_softc(dmadev); - uint32_t maxsize = ((size - 1)/PAGE_SIZE + 1) * PAGE_SIZE; - uint64_t dma_space_addr = ENA_DMA_BIT_MASK(adapter->dma_width); + uint32_t maxsize; + uint64_t dma_space_addr; int error; + maxsize = ((size - 1) / PAGE_SIZE + 1) * PAGE_SIZE; + + dma_space_addr = ENA_DMA_BIT_MASK(adapter->dma_width); if (dma_space_addr == 0) dma_space_addr = BUS_SPACE_MAXADDR; + error = bus_dma_tag_create(bus_get_dma_tag(dmadev), /* parent */ 8, 0, /* alignment, bounds */ dma_space_addr, /* lowaddr of exclusion window */ @@ -240,29 +242,26 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, NULL, /* lockfunc */ NULL, /* lockarg */ &dma->tag); - if (error) { - device_printf(dmadev, - "%s: bus_dma_tag_create failed: %d\n", - __func__, error); + if (error != 0) { + device_printf(dmadev, "%s: bus_dma_tag_create failed: %d\n", + __func__, error); goto fail_tag; } error = bus_dmamem_alloc(dma->tag, (void**) &dma->vaddr, BUS_DMA_COHERENT | BUS_DMA_ZERO, &dma->map); - if (error) { - device_printf(dmadev, - "%s: bus_dmamem_alloc(%ju) failed: %d\n", - __func__, (uintmax_t)size, error); + if (error != 0) { + device_printf(dmadev, "%s: bus_dmamem_alloc(%ju) failed: %d\n", + __func__, (uintmax_t)size, error); goto fail_map_create; } dma->paddr = 0; error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size, ena_dmamap_callback, &dma->paddr, mapflags); - if (error || dma->paddr == 0) { - device_printf(dmadev, - "%s: bus_dmamap_load failed: %d\n", - __func__, error); + if ((error != 0) || (dma->paddr == 0)) { + device_printf(dmadev, "%s: bus_dmamap_load failed: %d\n", + __func__, error); goto fail_map_load; } @@ -311,8 +310,6 @@ ena_free_pci_resources(struct ena_adapter *adapter) bus_release_resource(pdev, SYS_RES_MEMORY, PCIR_BAR(ENA_REG_BAR), adapter->registers); } - - return; } static int @@ -353,7 +350,7 @@ ena_change_mtu(if_t ifp, int new_mtu) int rc, old_mtu, max_frame; rc = ena_com_get_dev_attr_feat(adapter->ena_dev, &get_feat_ctx); - if (rc) { + if (rc != 0) { device_printf(adapter->pdev, "Cannot get attribute for ena device\n"); return (ENXIO); @@ -591,7 +588,6 @@ ena_free_rx_dma_tag(struct ena_adapter *adapter) return (ret); } - /** * ena_setup_tx_resources - allocate Tx resources (Descriptors) * @adapter: network interface device structure @@ -739,7 +735,7 @@ ena_setup_all_tx_resources(struct ena_adapter *adapter for (i = 0; i < adapter->num_queues; i++) { rc = ena_setup_tx_resources(adapter, i); - if (rc) { + if (rc != 0) { device_printf(adapter->pdev, "Allocation for Tx Queue %u failed\n", i); goto err_setup_tx; @@ -768,8 +764,6 @@ ena_free_all_tx_resources(struct ena_adapter *adapter) for (i = 0; i < adapter->num_queues; i++) ena_free_tx_resources(adapter, i); - - return; } static inline int @@ -841,9 +835,9 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un } /* Create LRO for the ring */ - if (adapter->ifp->if_capenable & IFCAP_LRO) { + if ((adapter->ifp->if_capenable & IFCAP_LRO) != 0) { int err = tcp_lro_init(&rx_ring->lro); - if (err) { + if (err != 0) { device_printf(adapter->pdev, "LRO[%d] Initialization failed!\n", qid); } else { @@ -923,8 +917,6 @@ ena_free_rx_resources(struct ena_adapter *adapter, uns free(rx_ring->free_rx_ids, M_DEVBUF); rx_ring->free_rx_ids = NULL; - - return; } /** @@ -940,7 +932,7 @@ ena_setup_all_rx_resources(struct ena_adapter *adapter for (i = 0; i < adapter->num_queues; i++) { rc = ena_setup_rx_resources(adapter, i); - if (rc) { + if (rc != 0) { device_printf(adapter->pdev, "Allocation for Rx Queue %u failed\n", i); goto err_setup_rx; @@ -968,8 +960,6 @@ ena_free_all_rx_resources(struct ena_adapter *adapter) for (i = 0; i < adapter->num_queues; i++) ena_free_rx_resources(adapter, i); - - return; } static inline int @@ -1000,7 +990,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, adapter->rx_buf_tag,rx_info->mbuf, rx_info->mbuf->m_len); error = bus_dmamap_load_mbuf_sg(adapter->rx_buf_tag, rx_info->map, rx_info->mbuf, segs, &nsegs, BUS_DMA_NOWAIT); - if (error || (nsegs != 1)) { + if ((error != 0) || (nsegs != 1)) { device_printf(adapter->pdev, "failed to map mbuf, error: %d, " "nsegs: %d\n", error, nsegs); counter_u64_add(rx_ring->rx_stats.dma_mapping_err, 1); @@ -1037,11 +1027,8 @@ ena_free_rx_mbuf(struct ena_adapter *adapter, struct e bus_dmamap_unload(adapter->rx_buf_tag, rx_info->map); m_freem(rx_info->mbuf); rx_info->mbuf = NULL; - - return; } - /** * ena_refill_rx_bufs - Refills ring with descriptors * @rx_ring: the ring which we want to feed with free descriptors @@ -1069,7 +1056,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t req_id = rx_ring->free_rx_ids[next_to_use]; rc = validate_rx_req_id(rx_ring, req_id); - if (unlikely(rc)) + if (unlikely(rc != 0)) break; rx_info = &rx_ring->rx_buffer_info[req_id]; @@ -1082,7 +1069,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t } rc = ena_com_add_single_rx_desc(rx_ring->ena_com_io_sq, &rx_info->ena_buf, req_id); - if (unlikely(rc)) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "failed to add buffer for rx queue %d\n", rx_ring->qid); @@ -1116,11 +1103,9 @@ ena_free_rx_bufs(struct ena_adapter *adapter, unsigned for (i = 0; i < rx_ring->ring_size; i++) { struct ena_rx_buffer *rx_info = &rx_ring->rx_buffer_info[i]; - if (rx_info->mbuf) + if (rx_info->mbuf != NULL) ena_free_rx_mbuf(adapter, rx_ring, rx_info); } - - return; } /** @@ -1153,7 +1138,6 @@ ena_free_all_rx_bufs(struct ena_adapter *adapter) for (i = 0; i < adapter->num_queues; i++) ena_free_rx_bufs(adapter, i); - return; } /** @@ -1181,8 +1165,6 @@ ena_free_tx_bufs(struct ena_adapter *adapter, unsigned tx_info->mbuf = NULL; } ENA_RING_MTX_UNLOCK(tx_ring); - - return; } static void @@ -1191,8 +1173,6 @@ ena_free_all_tx_bufs(struct ena_adapter *adapter) for (int i = 0; i < adapter->num_queues; i++) ena_free_tx_bufs(adapter, i); - - return; } static void @@ -1233,8 +1213,8 @@ validate_tx_req_id(struct ena_ring *tx_ring, uint16_t if (likely(req_id < tx_ring->ring_size)) { tx_info = &tx_ring->tx_buffer_info[req_id]; - if (tx_info->mbuf) - return 0; + if (tx_info->mbuf != NULL) + return (0); } counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); @@ -1262,7 +1242,7 @@ ena_create_io_queues(struct ena_adapter *adapter) ctx.msix_vector = msix_vector; ctx.qid = ena_qid; rc = ena_com_create_io_queue(ena_dev, &ctx); - if (rc) { + if (rc != 0) { device_printf(adapter->pdev, "Failed to create io TX queue #%d rc: %d\n", i, rc); goto err_tx; @@ -1271,7 +1251,7 @@ ena_create_io_queues(struct ena_adapter *adapter) rc = ena_com_get_io_handlers(ena_dev, ena_qid, &ring->ena_com_io_sq, &ring->ena_com_io_cq); - if (rc) { + if (rc != 0) { device_printf(adapter->pdev, "Failed to get TX queue handlers. TX queue num" " %d rc: %d\n", i, rc); @@ -1290,7 +1270,7 @@ ena_create_io_queues(struct ena_adapter *adapter) ctx.msix_vector = msix_vector; ctx.qid = ena_qid; rc = ena_com_create_io_queue(ena_dev, &ctx); - if (rc) { + if (rc != 0) { device_printf(adapter->pdev, "Failed to create io RX queue[%d] rc: %d\n", i, rc); goto err_rx; @@ -1300,7 +1280,7 @@ ena_create_io_queues(struct ena_adapter *adapter) rc = ena_com_get_io_handlers(ena_dev, ena_qid, &ring->ena_com_io_sq, &ring->ena_com_io_cq); - if (rc) { + if (rc != 0) { device_printf(adapter->pdev, "Failed to get RX queue handlers. RX queue num" " %d rc: %d\n", i, rc); @@ -1361,7 +1341,7 @@ ena_tx_cleanup(struct ena_ring *tx_ring) break; rc = validate_tx_req_id(tx_ring, req_id); - if (rc) + if (rc != 0) break; tx_info = &tx_ring->tx_buffer_info[req_id]; @@ -1388,7 +1368,9 @@ ena_tx_cleanup(struct ena_ring *tx_ring) commit = TX_COMMIT; /* update ring state every TX_COMMIT descriptor */ tx_ring->next_to_clean = next_to_clean; - ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], total_done); + ena_com_comp_ack( + &adapter->ena_dev->io_sq_queues[ena_qid], + total_done); ena_com_update_dev_comp_head(io_cq); total_done = 0; } @@ -1399,7 +1381,8 @@ ena_tx_cleanup(struct ena_ring *tx_ring) /* If there is still something to commit update ring state */ if (commit != TX_COMMIT) { tx_ring->next_to_clean = next_to_clean; - ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], total_done); + ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], + total_done); ena_com_update_dev_comp_head(io_cq); } @@ -1418,7 +1401,7 @@ ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_ mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; if (ena_rx_ctx->frag && - ena_rx_ctx->l3_proto != ENA_ETH_IO_L4_PROTO_UNKNOWN) { + (ena_rx_ctx->l3_proto != ENA_ETH_IO_L4_PROTO_UNKNOWN)) { M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); return; } @@ -1568,7 +1551,7 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c /* if IP and error */ if ((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) && - (ena_rx_ctx->l3_csum_err)) { + ena_rx_ctx->l3_csum_err) { /* ipv4 checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); @@ -1587,8 +1570,6 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; } } - - return; } static void @@ -1621,7 +1602,6 @@ ena_rx_cleanup(struct ena_ring *rx_ring) struct ena_com_rx_ctx ena_rx_ctx; struct ena_com_io_cq* io_cq; struct ena_com_io_sq* io_sq; - /* struct ena_eth_io_intr_reg intr_reg; */ if_t ifp; uint16_t ena_qid; uint16_t next_to_clean; @@ -1646,7 +1626,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) ena_rx_ctx.descs = 0; rc = ena_com_rx_pkt(io_cq, io_sq, &ena_rx_ctx); - if (unlikely(rc)) + if (unlikely(rc != 0)) goto error; if (unlikely(ena_rx_ctx.descs == 0)) @@ -1657,7 +1637,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) &ena_rx_ctx, &next_to_clean); /* Exit if we failed to retrieve a buffer */ - if (unlikely(!mbuf)) { + if (unlikely(mbuf == NULL)) { for (i = 0; i < ena_rx_ctx.descs; ++i) { rx_ring->free_rx_ids[next_to_clean] = rx_ring->ena_bufs[i].req_id; @@ -1671,8 +1651,8 @@ ena_rx_cleanup(struct ena_ring *rx_ring) ena_trace(ENA_DBG | ENA_RXPTH, "Rx: %d bytes", mbuf->m_pkthdr.len); - if ((ifp->if_capenable & IFCAP_RXCSUM) || - (ifp->if_capenable & IFCAP_RXCSUM_IPV6)) { + if (((ifp->if_capenable & IFCAP_RXCSUM) != 0) || + ((ifp->if_capenable & IFCAP_RXCSUM_IPV6) != 0)) { ena_rx_checksum(rx_ring, &ena_rx_ctx, mbuf); } @@ -1687,22 +1667,22 @@ ena_rx_cleanup(struct ena_ring *rx_ring) * should be computed by hardware. */ do_if_input = 1; - if ((ifp->if_capenable & IFCAP_LRO) && - (mbuf->m_pkthdr.csum_flags & CSUM_IP_VALID) && - ena_rx_ctx.l4_proto == ENA_ETH_IO_L4_PROTO_TCP) { + if (((ifp->if_capenable & IFCAP_LRO) != 0) && + ((mbuf->m_pkthdr.csum_flags & CSUM_IP_VALID) != 0) && + (ena_rx_ctx.l4_proto == ENA_ETH_IO_L4_PROTO_TCP)) { /* * Send to the stack if: * - LRO not enabled, or * - no LRO resources, or * - lro enqueue fails */ - if (rx_ring->lro.lro_cnt != 0 && - tcp_lro_rx(&rx_ring->lro, mbuf, 0) == 0) + if ((rx_ring->lro.lro_cnt != 0) && + (tcp_lro_rx(&rx_ring->lro, mbuf, 0) == 0)) do_if_input = 0; } - if (do_if_input) { - ena_trace(ENA_DBG | ENA_RXPTH, "calling if_input() with mbuf %p", - mbuf); + if (do_if_input != 0) { + ena_trace(ENA_DBG | ENA_RXPTH, + "calling if_input() with mbuf %p", mbuf); (*ifp->if_input)(ifp, mbuf); } @@ -1768,7 +1748,7 @@ ena_handle_msix(void *arg) int qid, ena_qid; int txc, rxc, i; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) return; ena_trace(ENA_DBG, "MSI-X TX/RX routine"); @@ -1785,7 +1765,7 @@ ena_handle_msix(void *arg) * being executed and rx ring is being cleaned up in * another thread. */ - if (ENA_RING_MTX_TRYLOCK(rx_ring)) { + if (ENA_RING_MTX_TRYLOCK(rx_ring) != 0) { rxc = ena_rx_cleanup(rx_ring); ENA_RING_MTX_UNLOCK(rx_ring); } else { @@ -1797,10 +1777,10 @@ ena_handle_msix(void *arg) txc = ena_tx_cleanup(tx_ring); ENA_RING_MTX_UNLOCK(tx_ring); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) return; - if (txc != TX_BUDGET && rxc != RX_BUDGET) + if ((txc != TX_BUDGET) && (rxc != RX_BUDGET)) break; } @@ -1869,8 +1849,6 @@ ena_setup_mgmnt_intr(struct ena_adapter *adapter) adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].data = adapter; adapter->irq_tbl[ENA_MGMNT_IRQ_IDX].vector = adapter->msix_entries[ENA_MGMNT_IRQ_IDX].vector; - - return; } static void @@ -1906,8 +1884,6 @@ ena_setup_io_intr(struct ena_adapter *adapter) last_bind_cpu = CPU_NEXT(last_bind_cpu); #endif } - - return; } static int @@ -1929,16 +1905,18 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) return (ENXIO); } - if ((rc = bus_activate_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, - irq->res)) != 0) { + rc = bus_activate_resource(adapter->pdev, SYS_RES_IRQ, + irq->vector, irq->res); + if (rc != 0) { device_printf(adapter->pdev, "could not activate " "irq vector: %d\n", irq->vector); goto err_res_free; } - if ((rc = bus_setup_intr(adapter->pdev, irq->res, - INTR_TYPE_NET | INTR_MPSAFE, NULL, - ena_intr_msix_mgmnt, irq->data, &irq->cookie)) != 0) { + rc = bus_setup_intr(adapter->pdev, irq->res, + INTR_TYPE_NET | INTR_MPSAFE, NULL, ena_intr_msix_mgmnt, + irq->data, &irq->cookie); + if (rc != 0) { device_printf(adapter->pdev, "failed to register " "interrupt handler for irq %ju: %d\n", rman_get_start(irq->res), rc); @@ -1953,7 +1931,7 @@ err_res_free: irq->vector); rcc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); - if (rcc) + if (rcc != 0) device_printf(adapter->pdev, "dev has no parent while " "releasing res for irq: %d\n", irq->vector); irq->res = NULL; @@ -1968,7 +1946,7 @@ ena_request_io_irq(struct ena_adapter *adapter) unsigned long flags = 0; int rc = 0, i, rcc; - if (!adapter->msix_enabled) { + if (adapter->msix_enabled == 0) { device_printf(adapter->pdev, "failed to request irq\n"); return (EINVAL); } else { @@ -1989,9 +1967,10 @@ ena_request_io_irq(struct ena_adapter *adapter) goto err; } - if ((rc = bus_setup_intr(adapter->pdev, irq->res, - INTR_TYPE_NET | INTR_MPSAFE, NULL, irq->handler, - irq->data, &irq->cookie)) != 0) { + rc = bus_setup_intr(adapter->pdev, irq->res, + INTR_TYPE_NET | INTR_MPSAFE, NULL, + irq->handler, irq->data, &irq->cookie); + if (rc != 0) { device_printf(adapter->pdev, "failed to register " "interrupt handler for irq %ju: %d\n", rman_get_start(irq->res), rc); @@ -2018,9 +1997,9 @@ err: /* Once we entered err: section and irq->requested is true we free both intr and resources */ - if (irq->requested == true) + if (irq->requested) rcc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (rcc) + if (rcc != 0) device_printf(adapter->pdev, "could not release" " irq: %d, error: %d\n", irq->vector, rcc); @@ -2033,7 +2012,7 @@ err: rcc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); } - if (rcc) + if (rcc != 0) device_printf(adapter->pdev, "dev has no parent while " "releasing res for irq: %d\n", irq->vector); irq->requested = false; @@ -2054,7 +2033,7 @@ ena_free_mgmnt_irq(struct ena_adapter *adapter) ena_trace(ENA_INFO | ENA_ADMQ, "tear down irq: %d\n", irq->vector); rc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (rc) + if (rc != 0) device_printf(adapter->pdev, "failed to tear " "down irq: %d\n", irq->vector); irq->requested = 0; @@ -2066,12 +2045,10 @@ ena_free_mgmnt_irq(struct ena_adapter *adapter) rc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); irq->res = NULL; - if (rc) + if (rc != 0) device_printf(adapter->pdev, "dev has no parent while " "releasing res for irq: %d\n", irq->vector); } - - return; } static void @@ -2087,7 +2064,7 @@ ena_free_io_irq(struct ena_adapter *adapter) irq->vector); rc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (rc) { + if (rc != 0) { device_printf(adapter->pdev, "failed to tear " "down irq: %d\n", irq->vector); } @@ -2100,15 +2077,13 @@ ena_free_io_irq(struct ena_adapter *adapter) rc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); irq->res = NULL; - if (rc) { + if (rc != 0) { device_printf(adapter->pdev, "dev has no parent" " while releasing res for irq: %d\n", irq->vector); } } } - - return; } static void @@ -2149,27 +2124,28 @@ ena_unmask_all_io_irqs(struct ena_adapter *adapter) } /* Configure the Rx forwarding */ -static int ena_rss_configure(struct ena_adapter *adapter) +static int +ena_rss_configure(struct ena_adapter *adapter) { struct ena_com_dev *ena_dev = adapter->ena_dev; int rc; /* Set indirect table */ rc = ena_com_indirect_table_set(ena_dev); - if (unlikely(rc && rc != EOPNOTSUPP)) - return rc; + if (unlikely((rc != 0) && (rc != EOPNOTSUPP))) + return (rc); /* Configure hash function (if supported) */ rc = ena_com_set_hash_function(ena_dev); - if (unlikely(rc && (rc != EOPNOTSUPP))) - return rc; + if (unlikely((rc != 0) && (rc != EOPNOTSUPP))) + return (rc); /* Configure hash inputs (if supported) */ rc = ena_com_set_hash_ctrl(ena_dev); - if (unlikely(rc && (rc != EOPNOTSUPP))) - return rc; + if (unlikely((rc != 0) && (rc != EOPNOTSUPP))) + return (rc); - return 0; + return (0); } static int @@ -2179,7 +2155,7 @@ ena_up_complete(struct ena_adapter *adapter) if (adapter->rss_support) { rc = ena_rss_configure(adapter); - if (rc) + if (rc != 0) return (rc); } @@ -2199,12 +2175,12 @@ ena_up(struct ena_adapter *adapter) { int rc = 0; - if (!device_is_attached(adapter->pdev)) { + if (device_is_attached(adapter->pdev) == 0) { device_printf(adapter->pdev, "device is not attached!\n"); return (ENXIO); } - if (!adapter->running) { + if (!adapter->running == false) { device_printf(adapter->pdev, "device is not running!\n"); return (ENXIO); } @@ -2215,28 +2191,28 @@ ena_up(struct ena_adapter *adapter) /* setup interrupts for IO queues */ ena_setup_io_intr(adapter); rc = ena_request_io_irq(adapter); - if (rc) { + if (rc != 0) { ena_trace(ENA_ALERT, "err_req_irq"); goto err_req_irq; } /* allocate transmit descriptors */ rc = ena_setup_all_tx_resources(adapter); - if (rc) { + if (rc != 0) { ena_trace(ENA_ALERT, "err_setup_tx"); goto err_setup_tx; } /* allocate receive descriptors */ rc = ena_setup_all_rx_resources(adapter); - if (rc) { + if (rc != 0) { ena_trace(ENA_ALERT, "err_setup_rx"); goto err_setup_rx; } /* create IO queues for Rx & Tx */ rc = ena_create_io_queues(adapter); - if (rc) { + if (rc != 0) { ena_trace(ENA_ALERT, "create IO queues failed"); goto err_io_que; @@ -2246,7 +2222,7 @@ ena_up(struct ena_adapter *adapter) if_link_state_change(adapter->ifp, LINK_STATE_UP); rc = ena_up_complete(adapter); - if (rc) + if (rc != 0) goto err_up_complete; counter_u64_add(adapter->dev_stats.interface_up, 1); @@ -2331,8 +2307,6 @@ ena_media_status(if_t ifp, struct ifmediareq *ifmr) ifmr->ifm_active |= IFM_10G_T | IFM_FDX; ENA_DEV_UNLOCK; - - return; } static void @@ -2340,13 +2314,11 @@ ena_init(void *arg) { struct ena_adapter *adapter = (struct ena_adapter *)arg; - if (adapter->up == false) { + if (!adapter->up) { sx_xlock(&adapter->ioctl_sx); ena_up(adapter); sx_unlock(&adapter->ioctl_sx); } - - return; } static int @@ -2375,10 +2347,10 @@ ena_ioctl(if_t ifp, u_long command, caddr_t data) break; case SIOCSIFFLAGS: - if (ifp->if_flags & IFF_UP) { - if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { - if (ifp->if_flags & (IFF_PROMISC | - IFF_ALLMULTI)) { + if ((ifp->if_flags & IFF_UP) != 0) { + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { + if ((ifp->if_flags & (IFF_PROMISC | + IFF_ALLMULTI)) != 0) { device_printf(adapter->pdev, "ioctl promisc/allmulti\n"); } @@ -2388,7 +2360,7 @@ ena_ioctl(if_t ifp, u_long command, caddr_t data) sx_unlock(&adapter->ioctl_sx); } } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { sx_xlock(&adapter->ioctl_sx); ena_down(adapter); sx_unlock(&adapter->ioctl_sx); @@ -2414,7 +2386,8 @@ ena_ioctl(if_t ifp, u_long command, caddr_t data) reinit = 1; } - if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) { + if ((reinit != 0) && + ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0)) { sx_xlock(&adapter->ioctl_sx); ena_down(adapter); rc = ena_up(adapter); @@ -2436,30 +2409,32 @@ ena_get_dev_offloads(struct ena_com_dev_get_features_c { int caps = 0; - if (feat->offload.tx & + if ((feat->offload.tx & (ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_FULL_MASK | ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_PART_MASK | - ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L3_CSUM_IPV4_MASK)) + ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L3_CSUM_IPV4_MASK)) != 0) caps |= IFCAP_TXCSUM; - if (feat->offload.tx & + if ((feat->offload.tx & (ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV6_CSUM_FULL_MASK | - ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV6_CSUM_PART_MASK)) + ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV6_CSUM_PART_MASK)) != 0) caps |= IFCAP_TXCSUM_IPV6; - if (feat->offload.tx & ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV4_MASK) + if ((feat->offload.tx & + ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV4_MASK) != 0) caps |= IFCAP_TSO4; - if (feat->offload.tx & ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV6_MASK) + if ((feat->offload.tx & + ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV6_MASK) != 0) caps |= IFCAP_TSO6; - if (feat->offload.rx_supported & + if ((feat->offload.rx_supported & (ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV4_CSUM_MASK | - ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L3_CSUM_IPV4_MASK)) + ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L3_CSUM_IPV4_MASK)) != 0) caps |= IFCAP_RXCSUM; - if (feat->offload.rx_supported & - ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV6_CSUM_MASK) + if ((feat->offload.rx_supported & + ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV6_CSUM_MASK) != 0) caps |= IFCAP_RXCSUM_IPV6; caps |= IFCAP_LRO | IFCAP_JUMBO_MTU; @@ -2485,22 +2460,23 @@ ena_update_hwassist(struct ena_adapter *adapter) if_clearhwassist(ifp); - if (cap & IFCAP_TXCSUM) { - if (feat & ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L3_CSUM_IPV4_MASK) + if ((cap & IFCAP_TXCSUM) != 0) { + if ((feat & + ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L3_CSUM_IPV4_MASK) != 0) flags |= CSUM_IP; - if (feat & + if ((feat & (ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_FULL_MASK | - ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_PART_MASK)) + ENA_ADMIN_FEATURE_OFFLOAD_DESC_TX_L4_IPV4_CSUM_PART_MASK)) != 0) flags |= CSUM_IP_UDP | CSUM_IP_TCP; } - if (cap & IFCAP_TXCSUM_IPV6) + if ((cap & IFCAP_TXCSUM_IPV6) != 0) flags |= CSUM_IP6_UDP | CSUM_IP6_TCP; - if (cap & IFCAP_TSO4) + if ((cap & IFCAP_TSO4) != 0) flags |= CSUM_IP_TSO; - if (cap & IFCAP_TSO6) + if ((cap & IFCAP_TSO6) != 0) flags |= CSUM_IP6_TSO; if_sethwassistbits(ifp, flags, 0); @@ -2516,7 +2492,7 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *ada ena_trace(ENA_DBG, "enter"); ifp = adapter->ifp = if_gethandle(IFT_ETHER); - if (ifp == 0) { + if (ifp == NULL) { device_printf(pdev, "can not allocate ifnet structure\n"); return (ENXIO); } @@ -2585,7 +2561,7 @@ ena_down(struct ena_adapter *adapter) if (adapter->trigger_reset) { rc = ena_com_dev_reset(adapter->ena_dev, adapter->reset_reason); - if (rc) + if (rc != 0) device_printf(adapter->pdev, "Device reset failed\n"); } @@ -2599,8 +2575,6 @@ ena_down(struct ena_adapter *adapter) counter_u64_add(adapter->dev_stats.interface_down, 1); } - - return; } static void @@ -2629,7 +2603,7 @@ ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct if ((mbuf->m_pkthdr.csum_flags & CSUM_OFFLOAD) != 0) offload = true; - if (offload == false) { + if (!offload) { ena_tx_ctx->meta_valid = 0; return; } @@ -2671,16 +2645,18 @@ ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct if (ip->ip_p == IPPROTO_TCP) { ena_tx_ctx->l4_proto = ENA_ETH_IO_L4_PROTO_TCP; - if (mbuf->m_pkthdr.csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP)) - ena_tx_ctx->l4_csum_enable = 1; + if ((mbuf->m_pkthdr.csum_flags & + (CSUM_IP_TCP | CSUM_IP6_TCP)) != 0) + ena_tx_ctx->l4_csum_enable = 1; else - ena_tx_ctx->l4_csum_enable = 0; + ena_tx_ctx->l4_csum_enable = 0; } else if (ip->ip_p == IPPROTO_UDP) { ena_tx_ctx->l4_proto = ENA_ETH_IO_L4_PROTO_UDP; - if (mbuf->m_pkthdr.csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) - ena_tx_ctx->l4_csum_enable = 1; + if ((mbuf->m_pkthdr.csum_flags & + (CSUM_IP_UDP | CSUM_IP6_UDP)) != 0) + ena_tx_ctx->l4_csum_enable = 1; else - ena_tx_ctx->l4_csum_enable = 0; + ena_tx_ctx->l4_csum_enable = 0; } else { ena_tx_ctx->l4_proto = ENA_ETH_IO_L4_PROTO_UNKNOWN; ena_tx_ctx->l4_csum_enable = 0; @@ -2744,10 +2720,8 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** ena_dev = adapter->ena_dev; io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; - ENA_ASSERT(*mbuf, "mbuf is NULL\n"); - rc = ena_check_and_collapse_mbuf(tx_ring, mbuf); - if (rc) { + if (rc != 0) { ena_trace(ENA_WARNING, "Failed to collapse mbuf! err: %d", rc); return (rc); @@ -2772,7 +2746,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** rc = bus_dmamap_load_mbuf_sg(adapter->tx_buf_tag, tx_info->map, *mbuf, segs, &nsegs, BUS_DMA_NOWAIT); - if (rc || (nsegs == 0)) { + if ((rc != 0) || (nsegs == 0)) { ena_trace(ENA_WARNING, "dmamap load failed! err: %d nsegs: %d", rc, nsegs); counter_u64_add(tx_ring->tx_stats.dma_mapping_err, 1); @@ -2812,7 +2786,8 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** counter_enter(); counter_u64_add_protected(tx_ring->tx_stats.cnt, 1); - counter_u64_add_protected(tx_ring->tx_stats.bytes, (*mbuf)->m_pkthdr.len); + counter_u64_add_protected(tx_ring->tx_stats.bytes, + (*mbuf)->m_pkthdr.len); counter_u64_add_protected(adapter->hw_stats.tx_packets, 1); counter_u64_add_protected(adapter->hw_stats.tx_bytes, @@ -2826,7 +2801,8 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** tx_ring->next_to_use = ENA_TX_RING_IDX_NEXT(next_to_use, tx_ring->ring_size); - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map, + BUS_DMASYNC_PREWRITE); return (0); @@ -2847,7 +2823,7 @@ ena_start_xmit(struct ena_ring *tx_ring) int acum_pkts = 0; int ret = 0; - if ((adapter->ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0) return; if (!adapter->link_status) @@ -2880,7 +2856,7 @@ ena_start_xmit(struct ena_ring *tx_ring) drbr_advance(adapter->ifp, tx_ring->br); - if ((adapter->ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0) return; acum_pkts++; @@ -2897,15 +2873,14 @@ ena_start_xmit(struct ena_ring *tx_ring) } - if (acum_pkts) { + if (acum_pkts != 0) { wmb(); /* Trigger the dma engine */ ena_com_write_sq_doorbell(io_sq); counter_u64_add(tx_ring->tx_stats.doorbells, 1); } - if (!ena_com_sq_have_enough_space(io_sq, - ENA_TX_CLEANUP_THRESHOLD)) + if (!ena_com_sq_have_enough_space(io_sq, ENA_TX_CLEANUP_THRESHOLD)) ena_tx_cleanup(tx_ring); } @@ -2915,8 +2890,8 @@ ena_deferred_mq_start(void *arg, int pending) struct ena_ring *tx_ring = (struct ena_ring *)arg; struct ifnet *ifp = tx_ring->adapter->ifp; - while (drbr_empty(ifp, tx_ring->br) == FALSE && - (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + while (!drbr_empty(ifp, tx_ring->br) && + (if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { ENA_RING_MTX_LOCK(tx_ring); ena_start_xmit(tx_ring); ENA_RING_MTX_UNLOCK(tx_ring); @@ -2931,7 +2906,7 @@ ena_mq_start(if_t ifp, struct mbuf *m) int ret, is_drbr_empty; uint32_t i; - if ((adapter->ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0) return (ENODEV); /* Which queue to use */ @@ -2959,12 +2934,12 @@ ena_mq_start(if_t ifp, struct mbuf *m) /* Check if drbr is empty before putting packet */ is_drbr_empty = drbr_empty(ifp, tx_ring->br); ret = drbr_enqueue(ifp, tx_ring->br, m); - if (ret) { + if (ret != 0) { taskqueue_enqueue(tx_ring->enqueue_tq, &tx_ring->enqueue_task); return (ret); } - if (is_drbr_empty && ENA_RING_MTX_TRYLOCK(tx_ring)) { + if ((is_drbr_empty != 0) && (ENA_RING_MTX_TRYLOCK(tx_ring) != 0)) { ena_start_xmit(tx_ring); ENA_RING_MTX_UNLOCK(tx_ring); } else { @@ -2982,18 +2957,17 @@ ena_qflush(if_t ifp) int i; for(i = 0; i < adapter->num_queues; ++i, ++tx_ring) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 9 11:59:23 2017 Return-Path: Delivered-To: svn-src-all@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 3741CE72B04; Thu, 9 Nov 2017 11:59:23 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E13763B26; Thu, 9 Nov 2017 11:59:22 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9BxMID050181; Thu, 9 Nov 2017 11:59:22 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9BxM6C050180; Thu, 9 Nov 2017 11:59:22 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091159.vA9BxM6C050180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 11:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325581 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 11:59:23 -0000 Author: mw Date: Thu Nov 9 11:59:21 2017 New Revision: 325581 URL: https://svnweb.freebsd.org/changeset/base/325581 Log: Cover ENA driver code with branch predictioning statements The driver was using it in only few places, so the rest of the code was covered with those statement. Submitted by: Michal Krawczyk Reviewed by: rlibby Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12861 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 11:57:02 2017 (r325580) +++ head/sys/dev/ena/ena.c Thu Nov 9 11:59:21 2017 (r325581) @@ -227,7 +227,7 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, maxsize = ((size - 1) / PAGE_SIZE + 1) * PAGE_SIZE; dma_space_addr = ENA_DMA_BIT_MASK(adapter->dma_width); - if (dma_space_addr == 0) + if (unlikely(dma_space_addr == 0)) dma_space_addr = BUS_SPACE_MAXADDR; error = bus_dma_tag_create(bus_get_dma_tag(dmadev), /* parent */ @@ -242,7 +242,7 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, NULL, /* lockfunc */ NULL, /* lockarg */ &dma->tag); - if (error != 0) { + if (unlikely(error != 0)) { device_printf(dmadev, "%s: bus_dma_tag_create failed: %d\n", __func__, error); goto fail_tag; @@ -250,7 +250,7 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, error = bus_dmamem_alloc(dma->tag, (void**) &dma->vaddr, BUS_DMA_COHERENT | BUS_DMA_ZERO, &dma->map); - if (error != 0) { + if (unlikely(error != 0)) { device_printf(dmadev, "%s: bus_dmamem_alloc(%ju) failed: %d\n", __func__, (uintmax_t)size, error); goto fail_map_create; @@ -259,7 +259,7 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, dma->paddr = 0; error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size, ena_dmamap_callback, &dma->paddr, mapflags); - if ((error != 0) || (dma->paddr == 0)) { + if (unlikely((error != 0) || (dma->paddr == 0))) { device_printf(dmadev, "%s: bus_dmamap_load failed: %d\n", __func__, error); goto fail_map_load; @@ -287,7 +287,7 @@ ena_allocate_pci_resources(struct ena_adapter* adapter adapter->memory = NULL; adapter->registers = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (adapter->registers == NULL) { + if (unlikely(adapter->registers == NULL)) { device_printf(pdev, "Unable to allocate bus resource: " "registers\n"); return (ENXIO); @@ -350,7 +350,7 @@ ena_change_mtu(if_t ifp, int new_mtu) int rc, old_mtu, max_frame; rc = ena_com_get_dev_attr_feat(adapter->ena_dev, &get_feat_ctx); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "Cannot get attribute for ena device\n"); return (ENXIO); @@ -363,9 +363,9 @@ ena_change_mtu(if_t ifp, int new_mtu) if_setmtu(ifp, new_mtu); max_frame = ETHER_MAX_FRAME(ifp, ETHERTYPE_VLAN, 1); - if ((new_mtu < ENA_MIN_FRAME_LEN) || + if (unlikely((new_mtu < ENA_MIN_FRAME_LEN) || (new_mtu > get_feat_ctx.dev_attr.max_mtu) || - (max_frame > ENA_MAX_FRAME_LEN)) { + (max_frame > ENA_MAX_FRAME_LEN))) { device_printf(adapter->pdev, "Invalid MTU setting. " "new_mtu: %d\n", new_mtu); goto error; @@ -531,7 +531,7 @@ ena_setup_tx_dma_tag(struct ena_adapter *adapter) NULL, /* lockfuncarg */ &adapter->tx_buf_tag); - if (ret != 0) + if (unlikely(ret != 0)) device_printf(adapter->pdev, "Unable to create Tx DMA tag\n"); return (ret); @@ -544,7 +544,7 @@ ena_free_tx_dma_tag(struct ena_adapter *adapter) ret = bus_dma_tag_destroy(adapter->tx_buf_tag); - if (ret == 0) + if (likely(ret == 0)) adapter->tx_buf_tag = NULL; return (ret); @@ -569,7 +569,7 @@ ena_setup_rx_dma_tag(struct ena_adapter *adapter) NULL, /* lockarg */ &adapter->rx_buf_tag); - if (ret != 0) + if (unlikely(ret != 0)) device_printf(adapter->pdev, "Unable to create Rx DMA tag\n"); return (ret); @@ -582,7 +582,7 @@ ena_free_rx_dma_tag(struct ena_adapter *adapter) ret = bus_dma_tag_destroy(adapter->rx_buf_tag); - if (ret == 0) + if (likely(ret == 0)) adapter->rx_buf_tag = NULL; return (ret); @@ -608,12 +608,12 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size; tx_ring->tx_buffer_info = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); - if (tx_ring->tx_buffer_info == NULL) + if (unlikely(tx_ring->tx_buffer_info == NULL)) return (ENOMEM); size = sizeof(uint16_t) * tx_ring->ring_size; tx_ring->free_tx_ids = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); - if (tx_ring->free_tx_ids == NULL) + if (unlikely(tx_ring->free_tx_ids == NULL)) goto err_buf_info_free; /* Req id stack for TX OOO completions */ @@ -636,7 +636,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in for (i = 0; i < tx_ring->ring_size; i++) { err = bus_dmamap_create(adapter->tx_buf_tag, 0, &tx_ring->tx_buffer_info[i].map); - if (err != 0) { + if (unlikely(err != 0)) { device_printf(adapter->pdev, "Unable to create Tx DMA map for buffer %d\n", i); goto err_buf_info_unmap; @@ -647,7 +647,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in TASK_INIT(&tx_ring->enqueue_task, 0, ena_deferred_mq_start, tx_ring); tx_ring->enqueue_tq = taskqueue_create_fast("ena_tx_enque", M_NOWAIT, taskqueue_thread_enqueue, &tx_ring->enqueue_tq); - if (tx_ring->enqueue_tq == NULL) { + if (unlikely(tx_ring->enqueue_tq == NULL)) { device_printf(adapter->pdev, "Unable to create taskqueue for enqueue task\n"); i = tx_ring->ring_size; @@ -971,13 +971,13 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, int nsegs, error; /* if previous allocated frag is not used */ - if (rx_info->mbuf != NULL) + if (unlikely(rx_info->mbuf != NULL)) return (0); /* Get mbuf using UMA allocator */ rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); - if (rx_info->mbuf == NULL) { + if (unlikely(rx_info->mbuf == NULL)) { counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); return (ENOMEM); } @@ -990,7 +990,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, adapter->rx_buf_tag,rx_info->mbuf, rx_info->mbuf->m_len); error = bus_dmamap_load_mbuf_sg(adapter->rx_buf_tag, rx_info->map, rx_info->mbuf, segs, &nsegs, BUS_DMA_NOWAIT); - if ((error != 0) || (nsegs != 1)) { + if (unlikely((error != 0) || (nsegs != 1))) { device_printf(adapter->pdev, "failed to map mbuf, error: %d, " "nsegs: %d\n", error, nsegs); counter_u64_add(rx_ring->rx_stats.dma_mapping_err, 1); @@ -1062,7 +1062,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t rx_info = &rx_ring->rx_buffer_info[req_id]; rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "failed to alloc buffer for rx queue\n"); break; @@ -1079,14 +1079,14 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t rx_ring->ring_size); } - if (i < num) { + if (unlikely(i < num)) { counter_u64_add(rx_ring->rx_stats.refil_partial, 1); device_printf(adapter->pdev, "refilled rx queue %d with %d pages only\n", rx_ring->qid, i); } - if (i != 0) { + if (likely(i != 0)) { wmb(); ena_com_write_sq_doorbell(rx_ring->ena_com_io_sq); } @@ -1270,7 +1270,7 @@ ena_create_io_queues(struct ena_adapter *adapter) ctx.msix_vector = msix_vector; ctx.qid = ena_qid; rc = ena_com_create_io_queue(ena_dev, &ctx); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "Failed to create io RX queue[%d] rc: %d\n", i, rc); goto err_rx; @@ -1280,7 +1280,7 @@ ena_create_io_queues(struct ena_adapter *adapter) rc = ena_com_get_io_handlers(ena_dev, ena_qid, &ring->ena_com_io_sq, &ring->ena_com_io_cq); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "Failed to get RX queue handlers. RX queue num" " %d rc: %d\n", i, rc); @@ -1337,11 +1337,11 @@ ena_tx_cleanup(struct ena_ring *tx_ring) struct mbuf *mbuf; rc = ena_com_tx_comp_req_id_get(io_cq, &req_id); - if (rc != 0) + if (unlikely(rc != 0)) break; rc = validate_tx_req_id(tx_ring, req_id); - if (rc != 0) + if (unlikely(rc != 0)) break; tx_info = &tx_ring->tx_buffer_info[req_id]; @@ -1351,7 +1351,7 @@ ena_tx_cleanup(struct ena_ring *tx_ring) tx_info->mbuf = NULL; bintime_clear(&tx_info->timestamp); - if (tx_info->num_of_bufs != 0) { + if (likely(tx_info->num_of_bufs != 0)) { /* Map is no longer required */ bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); } @@ -1364,7 +1364,7 @@ ena_tx_cleanup(struct ena_ring *tx_ring) next_to_clean = ENA_TX_RING_IDX_NEXT(next_to_clean, tx_ring->ring_size); - if (--commit == 0) { + if (unlikely(--commit == 0)) { commit = TX_COMMIT; /* update ring state every TX_COMMIT descriptor */ tx_ring->next_to_clean = next_to_clean; @@ -1374,12 +1374,12 @@ ena_tx_cleanup(struct ena_ring *tx_ring) ena_com_update_dev_comp_head(io_cq); total_done = 0; } - } while (--budget); + } while (likely(--budget)); work_done = TX_BUDGET - budget; /* If there is still something to commit update ring state */ - if (commit != TX_COMMIT) { + if (likely(commit != TX_COMMIT)) { tx_ring->next_to_clean = next_to_clean; ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], total_done); @@ -1397,7 +1397,7 @@ ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_ { struct ena_adapter *adapter = rx_ring->adapter; - if (adapter->rss_support) { + if (likely(adapter->rss_support)) { mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; if (ena_rx_ctx->frag && @@ -1522,7 +1522,7 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r return (NULL); } - if (m_append(mbuf, len, rx_info->mbuf->m_data) == 0) { + if (unlikely(m_append(mbuf, len, rx_info->mbuf->m_data) == 0)) { counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p", mbuf); @@ -1550,8 +1550,8 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c { /* if IP and error */ - if ((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) && - ena_rx_ctx->l3_csum_err) { + if (unlikely((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) && + ena_rx_ctx->l3_csum_err)) { /* ipv4 checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); @@ -1583,7 +1583,7 @@ ena_deferred_rx_cleanup(void *arg, int pending) * If deferred task was executed, perform cleanup of all awaiting * descs (or until given budget is depleted to avoid infinite loop). */ - while (budget--) { + while (likely(budget--)) { if (ena_rx_cleanup(rx_ring) == 0) break; } @@ -1748,7 +1748,7 @@ ena_handle_msix(void *arg) int qid, ena_qid; int txc, rxc, i; - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) return; ena_trace(ENA_DBG, "MSI-X TX/RX routine"); @@ -1765,7 +1765,7 @@ ena_handle_msix(void *arg) * being executed and rx ring is being cleaned up in * another thread. */ - if (ENA_RING_MTX_TRYLOCK(rx_ring) != 0) { + if (likely(ENA_RING_MTX_TRYLOCK(rx_ring) != 0)) { rxc = ena_rx_cleanup(rx_ring); ENA_RING_MTX_UNLOCK(rx_ring); } else { @@ -1777,7 +1777,7 @@ ena_handle_msix(void *arg) txc = ena_tx_cleanup(tx_ring); ENA_RING_MTX_UNLOCK(tx_ring); - if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0) + if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) return; if ((txc != TX_BUDGET) && (rxc != RX_BUDGET)) @@ -1814,7 +1814,7 @@ ena_enable_msix(struct ena_adapter *adapter) } rc = pci_alloc_msix(dev, &msix_vecs); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(dev, "Failed to enable MSIX, vectors %d rc %d\n", msix_vecs, rc); @@ -1877,7 +1877,7 @@ ena_setup_io_intr(struct ena_adapter *adapter) * We still want to bind rings to the corresponding cpu * using something similar to the RSS round-robin technique. */ - if (last_bind_cpu < 0) + if (unlikely(last_bind_cpu < 0)) last_bind_cpu = CPU_FIRST(); adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = last_bind_cpu; @@ -1899,7 +1899,7 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) irq->res = bus_alloc_resource_any(adapter->pdev, SYS_RES_IRQ, &irq->vector, flags); - if (irq->res == NULL) { + if (unlikely(irq->res == NULL)) { device_printf(adapter->pdev, "could not allocate " "irq vector: %d\n", irq->vector); return (ENXIO); @@ -1907,7 +1907,7 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) rc = bus_activate_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "could not activate " "irq vector: %d\n", irq->vector); goto err_res_free; @@ -1916,7 +1916,7 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) rc = bus_setup_intr(adapter->pdev, irq->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, ena_intr_msix_mgmnt, irq->data, &irq->cookie); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "failed to register " "interrupt handler for irq %ju: %d\n", rman_get_start(irq->res), rc); @@ -1931,7 +1931,7 @@ err_res_free: irq->vector); rcc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); - if (rcc != 0) + if (unlikely(rcc != 0)) device_printf(adapter->pdev, "dev has no parent while " "releasing res for irq: %d\n", irq->vector); irq->res = NULL; @@ -1946,7 +1946,7 @@ ena_request_io_irq(struct ena_adapter *adapter) unsigned long flags = 0; int rc = 0, i, rcc; - if (adapter->msix_enabled == 0) { + if (unlikely(adapter->msix_enabled == 0)) { device_printf(adapter->pdev, "failed to request irq\n"); return (EINVAL); } else { @@ -1956,12 +1956,12 @@ ena_request_io_irq(struct ena_adapter *adapter) for (i = ENA_IO_IRQ_FIRST_IDX; i < adapter->msix_vecs; i++) { irq = &adapter->irq_tbl[i]; - if (irq->requested) + if (unlikely(irq->requested)) continue; irq->res = bus_alloc_resource_any(adapter->pdev, SYS_RES_IRQ, &irq->vector, flags); - if (irq->res == NULL) { + if (unlikely(irq->res == NULL)) { device_printf(adapter->pdev, "could not allocate " "irq vector: %d\n", irq->vector); goto err; @@ -1970,7 +1970,7 @@ ena_request_io_irq(struct ena_adapter *adapter) rc = bus_setup_intr(adapter->pdev, irq->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, irq->handler, irq->data, &irq->cookie); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "failed to register " "interrupt handler for irq %ju: %d\n", rman_get_start(irq->res), rc); @@ -1999,7 +1999,7 @@ err: free both intr and resources */ if (irq->requested) rcc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (rcc != 0) + if (unlikely(rcc != 0)) device_printf(adapter->pdev, "could not release" " irq: %d, error: %d\n", irq->vector, rcc); @@ -2012,7 +2012,7 @@ err: rcc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); } - if (rcc != 0) + if (unlikely(rcc != 0)) device_printf(adapter->pdev, "dev has no parent while " "releasing res for irq: %d\n", irq->vector); irq->requested = false; @@ -2033,7 +2033,7 @@ ena_free_mgmnt_irq(struct ena_adapter *adapter) ena_trace(ENA_INFO | ENA_ADMQ, "tear down irq: %d\n", irq->vector); rc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (rc != 0) + if (unlikely(rc != 0)) device_printf(adapter->pdev, "failed to tear " "down irq: %d\n", irq->vector); irq->requested = 0; @@ -2045,7 +2045,7 @@ ena_free_mgmnt_irq(struct ena_adapter *adapter) rc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); irq->res = NULL; - if (rc != 0) + if (unlikely(rc != 0)) device_printf(adapter->pdev, "dev has no parent while " "releasing res for irq: %d\n", irq->vector); } @@ -2064,7 +2064,7 @@ ena_free_io_irq(struct ena_adapter *adapter) irq->vector); rc = bus_teardown_intr(adapter->pdev, irq->res, irq->cookie); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "failed to tear " "down irq: %d\n", irq->vector); } @@ -2077,7 +2077,7 @@ ena_free_io_irq(struct ena_adapter *adapter) rc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); irq->res = NULL; - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "dev has no parent" " while releasing res for irq: %d\n", irq->vector); @@ -2153,14 +2153,14 @@ ena_up_complete(struct ena_adapter *adapter) { int rc; - if (adapter->rss_support) { + if (likely(adapter->rss_support)) { rc = ena_rss_configure(adapter); if (rc != 0) return (rc); } rc = ena_change_mtu(adapter->ifp, adapter->ifp->if_mtu); - if (rc != 0) + if (unlikely(rc != 0)) return (rc); ena_refill_all_rx_bufs(adapter); @@ -2175,12 +2175,12 @@ ena_up(struct ena_adapter *adapter) { int rc = 0; - if (device_is_attached(adapter->pdev) == 0) { + if (unlikely(device_is_attached(adapter->pdev) == 0)) { device_printf(adapter->pdev, "device is not attached!\n"); return (ENXIO); } - if (!adapter->running == false) { + if (unlikely(!adapter->running)) { device_printf(adapter->pdev, "device is not running!\n"); return (ENXIO); } @@ -2191,38 +2191,38 @@ ena_up(struct ena_adapter *adapter) /* setup interrupts for IO queues */ ena_setup_io_intr(adapter); rc = ena_request_io_irq(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "err_req_irq"); goto err_req_irq; } /* allocate transmit descriptors */ rc = ena_setup_all_tx_resources(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "err_setup_tx"); goto err_setup_tx; } /* allocate receive descriptors */ rc = ena_setup_all_rx_resources(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "err_setup_rx"); goto err_setup_rx; } /* create IO queues for Rx & Tx */ rc = ena_create_io_queues(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "create IO queues failed"); goto err_io_que; } - if (adapter->link_status) + if (unlikely(adapter->link_status)) if_link_state_change(adapter->ifp, LINK_STATE_UP); rc = ena_up_complete(adapter); - if (rc != 0) + if (unlikely(rc != 0)) goto err_up_complete; counter_u64_add(adapter->dev_stats.interface_up, 1); @@ -2492,7 +2492,7 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *ada ena_trace(ENA_DBG, "enter"); ifp = adapter->ifp = if_gethandle(IFT_ETHER); - if (ifp == NULL) { + if (unlikely(ifp == NULL)) { device_printf(pdev, "can not allocate ifnet structure\n"); return (ENXIO); } @@ -2561,7 +2561,7 @@ ena_down(struct ena_adapter *adapter) if (adapter->trigger_reset) { rc = ena_com_dev_reset(adapter->ena_dev, adapter->reset_reason); - if (rc != 0) + if (unlikely(rc != 0)) device_printf(adapter->pdev, "Device reset failed\n"); } @@ -2685,7 +2685,7 @@ ena_check_and_collapse_mbuf(struct ena_ring *tx_ring, collapsed_mbuf = m_collapse(*mbuf, M_NOWAIT, adapter->max_tx_sgl_size - 1); - if (collapsed_mbuf == NULL) { + if (unlikely(collapsed_mbuf == NULL)) { counter_u64_add(tx_ring->tx_stats.collapse_err, 1); return (ENOMEM); } @@ -2721,7 +2721,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; rc = ena_check_and_collapse_mbuf(tx_ring, mbuf); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_WARNING, "Failed to collapse mbuf! err: %d", rc); return (rc); @@ -2746,7 +2746,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** rc = bus_dmamap_load_mbuf_sg(adapter->tx_buf_tag, tx_info->map, *mbuf, segs, &nsegs, BUS_DMA_NOWAIT); - if ((rc != 0) || (nsegs == 0)) { + if (unlikely((rc != 0) || (nsegs == 0))) { ena_trace(ENA_WARNING, "dmamap load failed! err: %d nsegs: %d", rc, nsegs); counter_u64_add(tx_ring->tx_stats.dma_mapping_err, 1); @@ -2775,7 +2775,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** ena_tx_csum(&ena_tx_ctx, *mbuf); /* Prepare the packet's descriptors and send them to device */ rc = ena_com_prepare_tx(io_sq, &ena_tx_ctx, &nb_hw_desc); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_WARNING, "failed to prepare tx bufs\n"); counter_enter(); counter_u64_add_protected(tx_ring->tx_stats.queue_stop, 1); @@ -2823,10 +2823,10 @@ ena_start_xmit(struct ena_ring *tx_ring) int acum_pkts = 0; int ret = 0; - if ((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0) + if (unlikely((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0)) return; - if (!adapter->link_status) + if (unlikely(!adapter->link_status)) return; ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); @@ -2837,11 +2837,11 @@ ena_start_xmit(struct ena_ring *tx_ring) " header csum flags %#jx", mbuf, mbuf->m_flags, mbuf->m_pkthdr.csum_flags); - if (!ena_com_sq_have_enough_space(io_sq, - ENA_TX_CLEANUP_THRESHOLD)) + if (unlikely(!ena_com_sq_have_enough_space(io_sq, + ENA_TX_CLEANUP_THRESHOLD))) ena_tx_cleanup(tx_ring); - if ((ret = ena_xmit_mbuf(tx_ring, &mbuf)) != 0) { + if (unlikely((ret = ena_xmit_mbuf(tx_ring, &mbuf)) != 0)) { if (ret == ENA_COM_NO_MEM) { drbr_putback(adapter->ifp, tx_ring->br, mbuf); } else if (ret == ENA_COM_NO_SPACE) { @@ -2856,14 +2856,15 @@ ena_start_xmit(struct ena_ring *tx_ring) drbr_advance(adapter->ifp, tx_ring->br); - if ((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0) + if (unlikely((if_getdrvflags(adapter->ifp) & + IFF_DRV_RUNNING) == 0)) return; acum_pkts++; BPF_MTAP(adapter->ifp, mbuf); - if (acum_pkts == DB_THRESHOLD) { + if (unlikely(acum_pkts == DB_THRESHOLD)) { acum_pkts = 0; wmb(); /* Trigger the dma engine */ @@ -2873,7 +2874,7 @@ ena_start_xmit(struct ena_ring *tx_ring) } - if (acum_pkts != 0) { + if (likely(acum_pkts != 0)) { wmb(); /* Trigger the dma engine */ ena_com_write_sq_doorbell(io_sq); @@ -2906,7 +2907,7 @@ ena_mq_start(if_t ifp, struct mbuf *m) int ret, is_drbr_empty; uint32_t i; - if ((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0) + if (unlikely((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0)) return (ENODEV); /* Which queue to use */ @@ -2934,7 +2935,7 @@ ena_mq_start(if_t ifp, struct mbuf *m) /* Check if drbr is empty before putting packet */ is_drbr_empty = drbr_empty(ifp, tx_ring->br); ret = drbr_enqueue(ifp, tx_ring->br, m); - if (ret != 0) { + if (unlikely(ret != 0)) { taskqueue_enqueue(tx_ring->enqueue_tq, &tx_ring->enqueue_task); return (ret); } @@ -3084,7 +3085,7 @@ ena_rss_init_default_deferred(void *arg) int rc; dc = devclass_find("ena"); - if (dc == NULL) { + if (unlikely(dc == NULL)) { ena_trace(ENA_DBG, "No devclass ena\n"); return; } @@ -3095,7 +3096,7 @@ ena_rss_init_default_deferred(void *arg) if (adapter != NULL) { rc = ena_rss_init_default(adapter); adapter->rss_support = true; - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "WARNING: RSS was not properly initialized," " it will affect bandwidth\n"); @@ -3114,7 +3115,7 @@ ena_config_host_info(struct ena_com_dev *ena_dev) /* Allocate only the host info */ rc = ena_com_allocate_host_info(ena_dev); - if (rc != 0) { + if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "Cannot allocate host info\n"); return; } @@ -3135,7 +3136,7 @@ ena_config_host_info(struct ena_com_dev *ena_dev) (DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT); rc = ena_com_set_host_attributes(ena_dev); - if (rc != 0) { + if (unlikely(rc != 0)) { if (rc == EOPNOTSUPP) ena_trace(ENA_WARNING, "Cannot set host attributes\n"); else @@ -3161,7 +3162,7 @@ ena_device_init(struct ena_adapter *adapter, device_t int rc; rc = ena_com_mmio_reg_read_request_init(ena_dev); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev, "failed to init mmio read less\n"); return (rc); } @@ -3174,19 +3175,19 @@ ena_device_init(struct ena_adapter *adapter, device_t ena_com_set_mmio_read_mode(ena_dev, readless_supported); rc = ena_com_dev_reset(ena_dev, ENA_REGS_RESET_NORMAL); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev, "Can not reset device\n"); goto err_mmio_read_less; } rc = ena_com_validate_version(ena_dev); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev, "device version is too low\n"); goto err_mmio_read_less; } dma_width = ena_com_get_dma_width(ena_dev); - if (dma_width < 0) { + if (unlikely(dma_width < 0)) { device_printf(pdev, "Invalid dma width value %d", dma_width); rc = dma_width; goto err_mmio_read_less; @@ -3195,7 +3196,7 @@ ena_device_init(struct ena_adapter *adapter, device_t /* ENA admin level init */ rc = ena_com_admin_init(ena_dev, &aenq_handlers, true); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev, "Can not initialize ena admin queue with device\n"); goto err_mmio_read_less; @@ -3212,7 +3213,7 @@ ena_device_init(struct ena_adapter *adapter, device_t /* Get Device Attributes */ rc = ena_com_get_dev_attr_feat(ena_dev, get_feat_ctx); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev, "Cannot get attribute for ena device rc: %d\n", rc); goto err_admin_init; @@ -3226,7 +3227,7 @@ ena_device_init(struct ena_adapter *adapter, device_t aenq_groups &= get_feat_ctx->aenq.supported_groups; rc = ena_com_set_aenq_config(ena_dev, aenq_groups); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev, "Cannot configure aenq groups rc: %d\n", rc); goto err_admin_init; } @@ -3251,7 +3252,7 @@ static int ena_enable_msix_and_set_admin_interrupts(st int rc; rc = ena_enable_msix(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "Error with MSI-X enablement\n"); return (rc); } @@ -3259,7 +3260,7 @@ static int ena_enable_msix_and_set_admin_interrupts(st ena_setup_mgmnt_intr(adapter); rc = ena_request_mgmnt_irq(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "Cannot setup mgmnt queue intr\n"); goto err_disable_msix; } @@ -3303,7 +3304,7 @@ static void check_for_missing_keep_alive(struct ena_ad if (adapter->wd_active == 0) return; - if (adapter->keep_alive_timeout == 0) + if (likely(adapter->keep_alive_timeout == 0)) return; timestamp = atomic_load_acq_64(&adapter->keep_alive_timestamp); @@ -3537,7 +3538,7 @@ ena_reset_task(void *arg, int pending) /* Finished destroy part. Restart the device */ rc = ena_device_init(adapter, adapter->pdev, &get_feat_ctx, &adapter->wd_active); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "ENA device init failed! (err: %d)\n", rc); goto err_dev_free; @@ -3545,7 +3546,7 @@ ena_reset_task(void *arg, int pending) rc = ena_enable_msix_and_set_admin_interrupts(adapter, adapter->num_queues); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "Enable MSI-X failed\n"); goto err_com_free; } @@ -3553,7 +3554,7 @@ ena_reset_task(void *arg, int pending) /* If the interface was up before the reset bring it up */ if (dev_up) { rc = ena_up(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(adapter->pdev, "Failed to create I/O queues\n"); goto err_msix_free; @@ -3617,7 +3618,7 @@ ena_attach(device_t pdev) device_printf(pdev, "%s\n", ena_version); rc = ena_allocate_pci_resources(adapter); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev, "PCI resource allocation failed!\n"); ena_free_pci_resources(adapter); return (rc); @@ -3638,7 +3639,7 @@ ena_attach(device_t pdev) ((struct ena_bus*)(ena_dev->bus))->reg_bar_h = rman_get_bushandle(adapter->registers); - if (((struct ena_bus*)(ena_dev->bus))->reg_bar_h == 0) { + if (unlikely(((struct ena_bus*)(ena_dev->bus))->reg_bar_h == 0)) { device_printf(pdev, "failed to pmap registers bar\n"); rc = ENXIO; goto err_bus_free; @@ -3648,7 +3649,7 @@ ena_attach(device_t pdev) /* Device initialization */ rc = ena_device_init(adapter, pdev, &get_feat_ctx, &adapter->wd_active); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev, "ENA device init failed! (err: %d)\n", rc); rc = ENXIO; goto err_bus_free; @@ -3677,7 +3678,7 @@ ena_attach(device_t pdev) /* calculatre ring sizes */ queue_size = ena_calc_queue_size(adapter,&tx_sgl_size, &rx_sgl_size, &get_feat_ctx); - if ((queue_size <= 0) || (io_queue_num <= 0)) { + if (unlikely((queue_size <= 0) || (io_queue_num <= 0))) { rc = ENA_COM_FAULT; goto err_com_free; } @@ -3692,11 +3693,11 @@ ena_attach(device_t pdev) /* set up dma tags for rx and tx buffers */ rc = ena_setup_tx_dma_tag(adapter); - if (rc != 0) + if (unlikely(rc != 0)) goto err_com_free; rc = ena_setup_rx_dma_tag(adapter); - if (rc != 0) + if (unlikely(rc != 0)) goto err_tx_tag_free; /* initialize rings basic information */ @@ -3705,13 +3706,13 @@ ena_attach(device_t pdev) /* setup network interface */ rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev,"Error with network interface setup\n"); goto err_io_free; } rc = ena_enable_msix_and_set_admin_interrupts(adapter, io_queue_num); - if (rc != 0) { + if (unlikely(rc != 0)) { device_printf(pdev, "Failed to enable and set the admin interrupts\n"); goto err_ifp_free; @@ -3799,16 +3800,16 @@ ena_detach(device_t pdev) ena_free_counters((counter_u64_t *)&adapter->dev_stats, sizeof(struct ena_stats_dev)); - if (adapter->rss_support) + if (likely(adapter->rss_support)) ena_com_rss_destroy(ena_dev); rc = ena_free_rx_dma_tag(adapter); - if (rc != 0) + if (unlikely(rc != 0)) device_printf(adapter->pdev, "Unmapped RX DMA tag associations\n"); rc = ena_free_tx_dma_tag(adapter); - if (rc != 0) + if (unlikely(rc != 0)) device_printf(adapter->pdev, "Unmapped TX DMA tag associations\n"); From owner-svn-src-all@freebsd.org Thu Nov 9 12:01:47 2017 Return-Path: Delivered-To: svn-src-all@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 DE7FDE4E478; Thu, 9 Nov 2017 12:01:47 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B881F63420; Thu, 9 Nov 2017 12:01:47 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9C1k6a053956; Thu, 9 Nov 2017 12:01:46 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9C1kmr053953; Thu, 9 Nov 2017 12:01:46 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091201.vA9C1kmr053953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 12:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325582 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 12:01:48 -0000 Author: mw Date: Thu Nov 9 12:01:46 2017 New Revision: 325582 URL: https://svnweb.freebsd.org/changeset/base/325582 Log: Remove deprecated and unused counters in ENA driver Few counters were imported from the Linux driver and never used, because of differences between the Linux and FreeBSD APIs. Queue stops and resumes are no longer supported by the driver and counters were incremented indicating false events. Submitted by: Michal Krawczyk Reviewed by: rlibby Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12862 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 11:59:21 2017 (r325581) +++ head/sys/dev/ena/ena.c Thu Nov 9 12:01:46 2017 (r325582) @@ -2777,10 +2777,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** rc = ena_com_prepare_tx(io_sq, &ena_tx_ctx, &nb_hw_desc); if (unlikely(rc != 0)) { ena_trace(ENA_WARNING, "failed to prepare tx bufs\n"); - counter_enter(); - counter_u64_add_protected(tx_ring->tx_stats.queue_stop, 1); - counter_u64_add_protected(tx_ring->tx_stats.prepare_ctx_err, 1); - counter_exit(); + counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1); goto dma_error; } Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Nov 9 11:59:21 2017 (r325581) +++ head/sys/dev/ena/ena.h Thu Nov 9 12:01:46 2017 (r325582) @@ -213,16 +213,8 @@ struct ena_rx_buffer { struct ena_stats_tx { counter_u64_t cnt; counter_u64_t bytes; - counter_u64_t queue_stop; counter_u64_t prepare_ctx_err; - counter_u64_t queue_wakeup; counter_u64_t dma_mapping_err; - /* Not counted */ - counter_u64_t unsupported_desc_num; - /* Not counted */ - counter_u64_t napi_comp; - /* Not counted */ - counter_u64_t tx_poll; counter_u64_t doorbells; counter_u64_t missing_tx_comp; counter_u64_t bad_req_id; @@ -235,13 +227,9 @@ struct ena_stats_rx { counter_u64_t bytes; counter_u64_t refil_partial; counter_u64_t bad_csum; - /* Not counted */ - counter_u64_t page_alloc_fail; counter_u64_t mbuf_alloc_fail; counter_u64_t dma_mapping_err; counter_u64_t bad_desc_num; - /* Not counted */ - counter_u64_t small_copy_len_pkt; counter_u64_t bad_req_id; counter_u64_t empty_rx_ring; }; @@ -304,17 +292,9 @@ struct ena_ring { } __aligned(CACHE_LINE_SIZE); struct ena_stats_dev { - /* Not counted */ - counter_u64_t tx_timeout; - /* Not counted */ - counter_u64_t io_suspend; - /* Not counted */ - counter_u64_t io_resume; - /* Not counted */ counter_u64_t wd_expired; counter_u64_t interface_up; counter_u64_t interface_down; - /* Not counted */ counter_u64_t admin_q_pause; }; Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu Nov 9 11:59:21 2017 (r325581) +++ head/sys/dev/ena/ena_sysctl.c Thu Nov 9 12:01:46 2017 (r325582) @@ -119,15 +119,6 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) dev_stats = &adapter->dev_stats; admin_stats = &adapter->ena_dev->admin_queue.stats; - SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "tx_timeout", - CTLFLAG_RD, &dev_stats->tx_timeout, - "Driver TX timeouts"); - SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "io_suspend", - CTLFLAG_RD, &dev_stats->io_suspend, - "IO queue suspends"); - SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "io_resume", - CTLFLAG_RD, &dev_stats->io_resume, - "IO queue resumes"); SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "wd_expired", CTLFLAG_RD, &dev_stats->wd_expired, "Watchdog expiry count"); @@ -166,22 +157,9 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &tx_stats->prepare_ctx_err, "TX buffer preparation failures"); SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, - "queue_wakeup", CTLFLAG_RD, - &tx_stats->queue_wakeup, "Queue wakeups"); - SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, "dma_mapping_err", CTLFLAG_RD, &tx_stats->dma_mapping_err, "DMA mapping failures"); SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, - "unsupported_desc_num", CTLFLAG_RD, - &tx_stats->unsupported_desc_num, - "Excessive descriptor packet discards"); - SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, - "napi_comp", CTLFLAG_RD, - &tx_stats->napi_comp, "Napi completions"); - SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, - "tx_poll", CTLFLAG_RD, - &tx_stats->tx_poll, "TX poll count"); - SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, "doorbells", CTLFLAG_RD, &tx_stats->doorbells, "Queue doorbells"); SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, @@ -191,9 +169,6 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) "bad_req_id", CTLFLAG_RD, &tx_stats->bad_req_id, "Bad request id count"); SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, - "stops", CTLFLAG_RD, - &tx_stats->queue_stop, "Queue stops"); - SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, "mbuf_collapses", CTLFLAG_RD, &tx_stats->collapse, "Mbuf collapse count"); @@ -222,9 +197,6 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) "bad_csum", CTLFLAG_RD, &rx_stats->bad_csum, "Bad RX checksum"); SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, - "page_alloc_fail", CTLFLAG_RD, - &rx_stats->page_alloc_fail, "Failed page allocs"); - SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, "mbuf_alloc_fail", CTLFLAG_RD, &rx_stats->mbuf_alloc_fail, "Failed mbuf allocs"); SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, @@ -233,9 +205,6 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, "bad_desc_num", CTLFLAG_RD, &rx_stats->bad_desc_num, "Bad descriptor count"); - SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, - "small_copy_len_pkt", CTLFLAG_RD, - &rx_stats->small_copy_len_pkt, "Small copy packet count"); SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, "bad_req_id", CTLFLAG_RD, &rx_stats->bad_req_id, "Bad request id count"); From owner-svn-src-all@freebsd.org Thu Nov 9 12:03:07 2017 Return-Path: Delivered-To: svn-src-all@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 DE4A7E4E53D; Thu, 9 Nov 2017 12:03:07 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A91AD63600; Thu, 9 Nov 2017 12:03:07 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9C36sA054047; Thu, 9 Nov 2017 12:03:06 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9C36H5054045; Thu, 9 Nov 2017 12:03:06 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091203.vA9C36H5054045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 12:03:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325583 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 12:03:08 -0000 Author: mw Date: Thu Nov 9 12:03:06 2017 New Revision: 325583 URL: https://svnweb.freebsd.org/changeset/base/325583 Log: Allow partial MSI-x allocation in ENA driver The situation, where part of the MSI-x was not configured properly, was not properly handled. Now, the driver reduces number of queues to reflect number of existing and properly configured MSI-x vectors. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12863 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 12:01:46 2017 (r325582) +++ head/sys/dev/ena/ena.c Thu Nov 9 12:03:06 2017 (r325583) @@ -1796,7 +1796,8 @@ static int ena_enable_msix(struct ena_adapter *adapter) { device_t dev = adapter->pdev; - int i, msix_vecs, rc = 0; + int msix_vecs, msix_req; + int i, rc = 0; /* Reserved the max msix vectors we might need */ msix_vecs = ENA_MAX_MSIX_VEC(adapter->num_queues); @@ -1813,6 +1814,7 @@ ena_enable_msix(struct ena_adapter *adapter) adapter->msix_entries[i].vector = i + 1; } + msix_req = msix_vecs; rc = pci_alloc_msix(dev, &msix_vecs); if (unlikely(rc != 0)) { device_printf(dev, @@ -1820,6 +1822,12 @@ ena_enable_msix(struct ena_adapter *adapter) rc = ENOSPC; goto err_msix_free; + } + + if (msix_vecs != msix_req) { + device_printf(dev, "Enable only %d MSI-x (out of %d), reduce " + "the number of queues\n", msix_vecs, msix_req); + adapter->num_queues = msix_vecs - ENA_ADMIN_MSIX_VEC; } adapter->msix_vecs = msix_vecs; Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Nov 9 12:01:46 2017 (r325582) +++ head/sys/dev/ena/ena.h Thu Nov 9 12:03:06 2017 (r325583) @@ -58,7 +58,8 @@ #define ENA_DMA_BIT_MASK(x) ((1ULL << (x)) - 1ULL) /* 1 for AENQ + ADMIN */ -#define ENA_MAX_MSIX_VEC(io_queues) (1 + (io_queues)) +#define ENA_ADMIN_MSIX_VEC 1 +#define ENA_MAX_MSIX_VEC(io_queues) (ENA_ADMIN_MSIX_VEC + (io_queues)) #define ENA_REG_BAR 0 #define ENA_MEM_BAR 2 From owner-svn-src-all@freebsd.org Thu Nov 9 12:07:03 2017 Return-Path: Delivered-To: svn-src-all@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 980BCE4E617; Thu, 9 Nov 2017 12:07:03 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 71F0F6379A; Thu, 9 Nov 2017 12:07:03 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9C72SY054215; Thu, 9 Nov 2017 12:07:02 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9C72pq054213; Thu, 9 Nov 2017 12:07:02 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091207.vA9C72pq054213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 12:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325584 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 12:07:03 -0000 Author: mw Date: Thu Nov 9 12:07:02 2017 New Revision: 325584 URL: https://svnweb.freebsd.org/changeset/base/325584 Log: Cleanup of the ENA driver header file Remove unused macros and fields - some of them were only initialized, without further usage. Implement minor style fixes and add required comments. On the occasion add missing TX completion counter, which was existing, but mistakenly remained unused. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12864 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 12:03:06 2017 (r325583) +++ head/sys/dev/ena/ena.c Thu Nov 9 12:07:02 2017 (r325584) @@ -453,7 +453,6 @@ ena_init_io_rings(struct ena_adapter *adapter) /* RX specific ring state */ rxr->ring_size = adapter->rx_ring_size; - rxr->rx_small_copy_len = adapter->small_copy_len; rxr->smoothed_interval = ena_com_get_nonadaptive_moderation_interval_rx(ena_dev); @@ -1695,7 +1694,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) rx_ring->next_to_clean = next_to_clean; refill_required = ena_com_free_desc(io_sq); - refill_threshold = rx_ring->ring_size / ENA_RX_REFILL_THRESH_DEVIDER; + refill_threshold = rx_ring->ring_size / ENA_RX_REFILL_THRESH_DIVIDER; if (refill_required > refill_threshold) { ena_com_update_dev_comp_head(rx_ring->ena_com_io_cq); @@ -2300,13 +2299,13 @@ ena_media_status(if_t ifp, struct ifmediareq *ifmr) struct ena_adapter *adapter = if_getsoftc(ifp); ena_trace(ENA_DBG, "enter"); - ENA_DEV_LOCK; + mtx_lock(&adapter->global_mtx); ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; if (!adapter->link_status) { - ENA_DEV_UNLOCK; + mtx_unlock(&adapter->global_mtx); ena_trace(ENA_WARNING, "link_status = false"); return; } @@ -2314,7 +2313,7 @@ ena_media_status(if_t ifp, struct ifmediareq *ifmr) ifmr->ifm_status |= IFM_ACTIVE; ifmr->ifm_active |= IFM_10G_T | IFM_FDX; - ENA_DEV_UNLOCK; + mtx_unlock(&adapter->global_mtx); } static void @@ -3366,6 +3365,7 @@ check_missing_comp_in_queue(struct ena_adapter *adapte tx_buf->print_once = true; missed_tx++; + counter_u64_add(tx_ring->tx_stats.missing_tx_comp, 1); if (unlikely(missed_tx > adapter->missing_tx_threshold)) { @@ -3669,9 +3669,6 @@ ena_attach(device_t pdev) memcpy(adapter->mac_addr, get_feat_ctx.dev_attr.mac_addr, ETHER_ADDR_LEN); - - adapter->small_copy_len = - ENA_DEFAULT_SMALL_PACKET_LEN; /* calculate IO queue number to create */ io_queue_num = ena_calc_io_queue_num(adapter, &get_feat_ctx); Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Nov 9 12:03:06 2017 (r325583) +++ head/sys/dev/ena/ena.h Thu Nov 9 12:07:02 2017 (r325584) @@ -67,29 +67,20 @@ #define ENA_BUS_DMA_SEGS 32 #define ENA_DEFAULT_RING_SIZE 1024 -#define ENA_DEFAULT_SMALL_PACKET_LEN 128 -#define ENA_DEFAULT_MAX_RX_BUFF_ALLOC_SIZE 1536 -#define ENA_RX_REFILL_THRESH_DEVIDER 8 +#define ENA_RX_REFILL_THRESH_DIVIDER 8 -#define ENA_MAX_PUSH_PKT_SIZE 128 - -#define ENA_NAME_MAX_LEN 20 #define ENA_IRQNAME_SIZE 40 #define ENA_PKT_MAX_BUFS 19 -#define ENA_STALL_TIMEOUT 100 #define ENA_RX_RSS_TABLE_LOG_SIZE 7 #define ENA_RX_RSS_TABLE_SIZE (1 << ENA_RX_RSS_TABLE_LOG_SIZE) #define ENA_HASH_KEY_SIZE 40 -#define ENA_DMA_BITS_MASK 40 #define ENA_MAX_FRAME_LEN 10000 #define ENA_MIN_FRAME_LEN 60 -#define ENA_RX_HASH_KEY_NUM 10 -#define ENA_RX_THASH_TABLE_SIZE (1 << 8) #define ENA_TX_CLEANUP_THRESHOLD 128 @@ -112,18 +103,13 @@ #define RX_IRQ_INTERVAL 20 #define TX_IRQ_INTERVAL 50 -#define ENA_MAX_MTU 9216 #define ENA_TSO_MAXSIZE 65536 -#define ENA_TSO_NSEGS ENA_PKT_MAX_BUFS -#define ENA_RX_OFFSET NET_SKB_PAD + NET_IP_ALIGN #define ENA_MMIO_DISABLE_REG_READ BIT(0) #define ENA_TX_RING_IDX_NEXT(idx, ring_size) (((idx) + 1) & ((ring_size) - 1)) #define ENA_RX_RING_IDX_NEXT(idx, ring_size) (((idx) + 1) & ((ring_size) - 1)) -#define ENA_RX_RING_IDX_ADD(idx, n, ring_size) \ - (((idx) + (n)) & ((ring_size) - 1)) #define ENA_IO_TXQ_IDX(q) (2 * (q)) #define ENA_IO_RXQ_IDX(q) (2 * (q) + 1) @@ -210,7 +196,6 @@ struct ena_rx_buffer { struct ena_com_buf ena_buf; } __aligned(CACHE_LINE_SIZE); - struct ena_stats_tx { counter_u64_t cnt; counter_u64_t bytes; @@ -246,14 +231,19 @@ struct ena_ring { struct ena_com_io_cq *ena_com_io_cq; struct ena_com_io_sq *ena_com_io_sq; - /* The maximum length the driver can push to the device (For LLQ) */ - enum ena_admin_placement_policy_type tx_mem_queue_type; - uint16_t rx_small_copy_len; uint16_t qid; - uint16_t mtu; + + /* Determines if device will use LLQ or normal mode for TX */ + enum ena_admin_placement_policy_type tx_mem_queue_type; + /* The maximum length the driver can push to the device (For LLQ) */ uint8_t tx_max_header_size; struct ena_com_rx_buf_info ena_bufs[ENA_PKT_MAX_BUFS]; + + /* + * Fields used for Adaptive Interrupt Modulation - to be implemented in + * the future releases + */ uint32_t smoothed_interval; enum ena_intr_moder_level moder_tbl_idx; @@ -270,8 +260,10 @@ struct ena_ring { int ring_size; /* number of tx/rx_buffer_info's entries */ struct buf_ring *br; /* only for TX */ + struct mtx ring_mtx; char mtx_name[16]; + union { struct { struct task enqueue_task; @@ -289,7 +281,6 @@ struct ena_ring { }; int empty_rx_queue; - } __aligned(CACHE_LINE_SIZE); struct ena_stats_dev { @@ -319,8 +310,8 @@ struct ena_adapter { struct ifmedia media; /* OS resources */ - struct resource * memory; - struct resource * registers; + struct resource *memory; + struct resource *registers; struct mtx global_mtx; struct sx ioctl_sx; @@ -334,11 +325,6 @@ struct ena_adapter { bus_dma_tag_t tx_buf_tag; bus_dma_tag_t rx_buf_tag; int dma_width; - /* - * RX packets that shorter that this len will be copied to the skb - * header - */ - unsigned int small_copy_len; uint16_t max_tx_sgl_size; uint16_t max_rx_sgl_size; @@ -348,28 +334,21 @@ struct ena_adapter { /* Tx fast path data */ int num_queues; - unsigned int tx_usecs, rx_usecs; /* Interrupt coalescing */ - unsigned int tx_ring_size; unsigned int rx_ring_size; /* RSS*/ - uint8_t rss_ind_tbl[ENA_RX_RSS_TABLE_SIZE]; + uint8_t rss_ind_tbl[ENA_RX_RSS_TABLE_SIZE]; bool rss_support; - uint32_t msg_enable; - uint8_t mac_addr[ETHER_ADDR_LEN]; /* mdio and phy*/ - char name[ENA_NAME_MAX_LEN]; bool link_status; bool trigger_reset; bool up; bool running; - uint32_t wol; - /* Queue will represent one TX and one RX ring */ struct ena_que que[ENA_MAX_NUM_IO_QUEUES] __aligned(CACHE_LINE_SIZE); @@ -403,17 +382,9 @@ struct ena_adapter { enum ena_regs_reset_reason_types reset_reason; }; -#define ENA_DEV_LOCK mtx_lock(&adapter->global_mtx) -#define ENA_DEV_UNLOCK mtx_unlock(&adapter->global_mtx) - #define ENA_RING_MTX_LOCK(_ring) mtx_lock(&(_ring)->ring_mtx) #define ENA_RING_MTX_TRYLOCK(_ring) mtx_trylock(&(_ring)->ring_mtx) #define ENA_RING_MTX_UNLOCK(_ring) mtx_unlock(&(_ring)->ring_mtx) - -struct ena_dev *ena_efa_enadev_get(device_t pdev); - -int ena_register_adapter(struct ena_adapter *adapter); -void ena_unregister_adapter(struct ena_adapter *adapter); static inline int ena_mbuf_count(struct mbuf *mbuf) { From owner-svn-src-all@freebsd.org Thu Nov 9 12:32:12 2017 Return-Path: Delivered-To: svn-src-all@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 0219EE4F064; Thu, 9 Nov 2017 12:32:12 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C372164314; Thu, 9 Nov 2017 12:32:11 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9CWA4h066939; Thu, 9 Nov 2017 12:32:10 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9CWAer066938; Thu, 9 Nov 2017 12:32:10 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091232.vA9CWAer066938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 12:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325585 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 12:32:12 -0000 Author: mw Date: Thu Nov 9 12:32:10 2017 New Revision: 325585 URL: https://svnweb.freebsd.org/changeset/base/325585 Log: Fix checking if the DF flag was set in ENA driver The previous way of checking for DF was not valid. When DF is enabled, the DF bit should be 1. The original way of checking it was wrong in 2 ways: first of all, it was not checking for single bit, secondly, it was checking for 0. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12865 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 12:07:02 2017 (r325584) +++ head/sys/dev/ena/ena.c Thu Nov 9 12:32:10 2017 (r325585) @@ -2640,7 +2640,7 @@ ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct switch (etype) { case ETHERTYPE_IP: ena_tx_ctx->l3_proto = ENA_ETH_IO_L3_PROTO_IPV4; - if (ip->ip_off == 0) + if ((ip->ip_off & htons(IP_DF)) != 0) ena_tx_ctx->df = 1; break; case ETHERTYPE_IPV6: From owner-svn-src-all@freebsd.org Thu Nov 9 12:37:20 2017 Return-Path: Delivered-To: svn-src-all@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 562FAE4F1C0; Thu, 9 Nov 2017 12:37:20 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 23A6F645B6; Thu, 9 Nov 2017 12:37:20 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9CbJpX067687; Thu, 9 Nov 2017 12:37:19 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9CbJPj067686; Thu, 9 Nov 2017 12:37:19 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091237.vA9CbJPj067686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 12:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325586 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 12:37:20 -0000 Author: mw Date: Thu Nov 9 12:37:19 2017 New Revision: 325586 URL: https://svnweb.freebsd.org/changeset/base/325586 Log: Fix compilation warnings when building ENA driver with gcc compiler The gcc compiler is more sensitive when variable is having an value assigned, but it is not used anywhere further. Submitted by: Michal Krawczyk Reviewed by: rlibby Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12866 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 12:32:10 2017 (r325585) +++ head/sys/dev/ena/ena.c Thu Nov 9 12:37:19 2017 (r325586) @@ -2725,7 +2725,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); adapter = tx_ring->que->adapter; ena_dev = adapter->ena_dev; - io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; + io_sq = &ena_dev->io_sq_queues[ena_qid]; rc = ena_check_and_collapse_mbuf(tx_ring, mbuf); if (unlikely(rc != 0)) { From owner-svn-src-all@freebsd.org Thu Nov 9 12:39:27 2017 Return-Path: Delivered-To: svn-src-all@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 99E15E4F258; Thu, 9 Nov 2017 12:39:27 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 672D164720; Thu, 9 Nov 2017 12:39:27 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9CdQnh067799; Thu, 9 Nov 2017 12:39:26 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9CdQJ1067798; Thu, 9 Nov 2017 12:39:26 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091239.vA9CdQJ1067798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 12:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325587 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 12:39:27 -0000 Author: mw Date: Thu Nov 9 12:39:26 2017 New Revision: 325587 URL: https://svnweb.freebsd.org/changeset/base/325587 Log: Fix comparing L3 type with L4 enum on RX hash in ENA driver This bug wasn't impacting anything, because both enums are indicating the same value, but it could cause a problem on API change. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12867 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 12:37:19 2017 (r325586) +++ head/sys/dev/ena/ena.c Thu Nov 9 12:39:26 2017 (r325587) @@ -1400,7 +1400,7 @@ ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_ mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; if (ena_rx_ctx->frag && - (ena_rx_ctx->l3_proto != ENA_ETH_IO_L4_PROTO_UNKNOWN)) { + (ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN)) { M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); return; } From owner-svn-src-all@freebsd.org Thu Nov 9 13:09:08 2017 Return-Path: Delivered-To: svn-src-all@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 DED67E4FAAE; Thu, 9 Nov 2017 13:09:08 +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 AC04365302; Thu, 9 Nov 2017 13:09:08 +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 vA9D97Hh080410; Thu, 9 Nov 2017 13:09:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9D977J080409; Thu, 9 Nov 2017 13:09:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711091309.vA9D977J080409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 9 Nov 2017 13:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325588 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 325588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 13:09:09 -0000 Author: kib Date: Thu Nov 9 13:09:07 2017 New Revision: 325588 URL: https://svnweb.freebsd.org/changeset/base/325588 Log: Correct operators precedence. Also keep the calculated vm_page_alloc_contig() flags in the variable to not re-evaluate it on the loop iteration. Noted by: alc Sponsored by: The FreeBSD Foundation Modified: head/sys/x86/iommu/intel_utils.c Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Thu Nov 9 12:39:26 2017 (r325587) +++ head/sys/x86/iommu/intel_utils.c Thu Nov 9 13:09:07 2017 (r325588) @@ -257,9 +257,12 @@ vm_page_t dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int flags) { vm_page_t m; - int zeroed; + int zeroed, aflags; zeroed = (flags & DMAR_PGF_ZERO) != 0 ? VM_ALLOC_ZERO : 0; + aflags = zeroed | VM_ALLOC_NOBUSY | VM_ALLOC_SYSTEM | VM_ALLOC_NODUMP | + ((flags & DMAR_PGF_WAITOK) != 0 ? VM_ALLOC_WAITFAIL : + VM_ALLOC_NOWAIT); for (;;) { if ((flags & DMAR_PGF_OBJL) == 0) VM_OBJECT_WLOCK(obj); @@ -269,10 +272,7 @@ dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int fla VM_OBJECT_WUNLOCK(obj); break; } - m = vm_page_alloc_contig(obj, idx, VM_ALLOC_NOBUSY | - VM_ALLOC_SYSTEM | VM_ALLOC_NODUMP | zeroed | - (flags & DMAR_PGF_WAITOK) ? - VM_ALLOC_WAITFAIL : VM_ALLOC_NOWAIT, 1, 0, + m = vm_page_alloc_contig(obj, idx, aflags, 1, 0, dmar_high, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); if ((flags & DMAR_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); From owner-svn-src-all@freebsd.org Thu Nov 9 13:30:40 2017 Return-Path: Delivered-To: svn-src-all@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 D0179E5037B; Thu, 9 Nov 2017 13:30:40 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 97B1365DC3; Thu, 9 Nov 2017 13:30:40 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9DUdIn089954; Thu, 9 Nov 2017 13:30:39 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9DUdvS089952; Thu, 9 Nov 2017 13:30:39 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091330.vA9DUdvS089952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 13:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325589 - in head/sys: contrib/ena-com dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: contrib/ena-com dev/ena X-SVN-Commit-Revision: 325589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 13:30:40 -0000 Author: mw Date: Thu Nov 9 13:30:39 2017 New Revision: 325589 URL: https://svnweb.freebsd.org/changeset/base/325589 Log: Rework printouts and logging level in ENA driver The driver was printing out a lot of information upon failure, which does not have to be interested for the user. Changing logging level required to rebuild driver with proper flags. The proper sysctl was added, so the level now can be changed dynamically using bitmask. Levels of printouts were adjusted to keep on mind end user instead of debugging purposes. More verbose messages were added to align the driver with the Linux. Fix building error introduced by the r325506 by casting csum_flags to uint64_t. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12868 Modified: head/sys/contrib/ena-com/ena_plat.h head/sys/dev/ena/ena.c Directory Properties: head/sys/contrib/ena-com/ (props changed) Modified: head/sys/contrib/ena-com/ena_plat.h ============================================================================== --- head/sys/contrib/ena-com/ena_plat.h Thu Nov 9 13:09:07 2017 (r325588) +++ head/sys/contrib/ena-com/ena_plat.h Thu Nov 9 13:30:39 2017 (r325589) @@ -104,14 +104,11 @@ extern struct ena_bus_space ebs; #define ENA_IOQ (1 << 7) /* Detailed info about IO queues. */ #define ENA_ADMQ (1 << 8) /* Detailed info about admin queue. */ -#ifndef ENA_DEBUG_LEVEL -#define ENA_DEBUG_LEVEL (ENA_ALERT | ENA_WARNING) -#endif +extern int ena_log_level; -#ifdef ENA_TRACE #define ena_trace_raw(level, fmt, args...) \ do { \ - if (((level) & ENA_DEBUG_LEVEL) != (level)) \ + if (((level) & ena_log_level) != (level)) \ break; \ printf(fmt, ##args); \ } while (0) @@ -120,10 +117,6 @@ extern struct ena_bus_space ebs; ena_trace_raw(level, "%s() [TID:%d]: " \ fmt " \n", __func__, curthread->td_tid, ##args) -#else /* ENA_TRACE */ -#define ena_trace_raw(...) -#define ena_trace(...) -#endif /* ENA_TRACE */ #define ena_trc_dbg(format, arg...) ena_trace(ENA_DBG, format, ##arg) #define ena_trc_info(format, arg...) ena_trace(ENA_INFO, format, ##arg) Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 13:09:07 2017 (r325588) +++ head/sys/dev/ena/ena.c Thu Nov 9 13:30:39 2017 (r325589) @@ -193,6 +193,13 @@ static int ena_buf_ring_size = 4096; SYSCTL_INT(_hw_ena, OID_AUTO, buf_ring_size, CTLFLAG_RWTUN, &ena_buf_ring_size, 0, "Size of the bufring"); +/* + * Logging level for changing verbosity of the output + */ +int ena_log_level = ENA_ALERT | ENA_WARNING; +SYSCTL_INT(_hw_ena, OID_AUTO, log_level, CTLFLAG_RWTUN, + &ena_log_level, 0, "Logging level indicating verbosity of the logs"); + static ena_vendor_info_t ena_vendor_info_array[] = { { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_PF, 0}, { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_LLQ_PF, 0}, @@ -243,16 +250,15 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, NULL, /* lockarg */ &dma->tag); if (unlikely(error != 0)) { - device_printf(dmadev, "%s: bus_dma_tag_create failed: %d\n", - __func__, error); + ena_trace(ENA_ALERT, "bus_dma_tag_create failed: %d\n", error); goto fail_tag; } error = bus_dmamem_alloc(dma->tag, (void**) &dma->vaddr, BUS_DMA_COHERENT | BUS_DMA_ZERO, &dma->map); if (unlikely(error != 0)) { - device_printf(dmadev, "%s: bus_dmamem_alloc(%ju) failed: %d\n", - __func__, (uintmax_t)size, error); + ena_trace(ENA_ALERT, "bus_dmamem_alloc(%ju) failed: %d\n", + (uintmax_t)size, error); goto fail_map_create; } @@ -260,8 +266,7 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size, ena_dmamap_callback, &dma->paddr, mapflags); if (unlikely((error != 0) || (dma->paddr == 0))) { - device_printf(dmadev, "%s: bus_dmamap_load failed: %d\n", - __func__, error); + ena_trace(ENA_ALERT, ": bus_dmamap_load failed: %d\n", error); goto fail_map_load; } @@ -530,9 +535,6 @@ ena_setup_tx_dma_tag(struct ena_adapter *adapter) NULL, /* lockfuncarg */ &adapter->tx_buf_tag); - if (unlikely(ret != 0)) - device_printf(adapter->pdev, "Unable to create Tx DMA tag\n"); - return (ret); } @@ -568,9 +570,6 @@ ena_setup_rx_dma_tag(struct ena_adapter *adapter) NULL, /* lockarg */ &adapter->rx_buf_tag); - if (unlikely(ret != 0)) - device_printf(adapter->pdev, "Unable to create Rx DMA tag\n"); - return (ret); } @@ -636,8 +635,8 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in err = bus_dmamap_create(adapter->tx_buf_tag, 0, &tx_ring->tx_buffer_info[i].map); if (unlikely(err != 0)) { - device_printf(adapter->pdev, - "Unable to create Tx DMA map for buffer %d\n", i); + ena_trace(ENA_ALERT, + "Unable to create Tx DMA map for buffer %d\n", i); goto err_buf_info_unmap; } } @@ -647,7 +646,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in tx_ring->enqueue_tq = taskqueue_create_fast("ena_tx_enque", M_NOWAIT, taskqueue_thread_enqueue, &tx_ring->enqueue_tq); if (unlikely(tx_ring->enqueue_tq == NULL)) { - device_printf(adapter->pdev, + ena_trace(ENA_ALERT, "Unable to create taskqueue for enqueue task\n"); i = tx_ring->ring_size; goto err_buf_info_unmap; @@ -827,7 +826,7 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un err = bus_dmamap_create(adapter->rx_buf_tag, 0, &(rx_ring->rx_buffer_info[i].map)); if (err != 0) { - device_printf(adapter->pdev, + ena_trace(ENA_ALERT, "Unable to create Rx DMA map for buffer %d\n", i); goto err_buf_info_unmap; } @@ -874,7 +873,6 @@ err_buf_info_unmap: rx_ring->free_rx_ids = NULL; free(rx_ring->rx_buffer_info, M_DEVBUF); rx_ring->rx_buffer_info = NULL; - ena_trace(ENA_ALERT, "RX resource allocation fail"); return (ENOMEM); } @@ -890,8 +888,6 @@ ena_free_rx_resources(struct ena_adapter *adapter, uns { struct ena_ring *rx_ring = &adapter->rx_ring[qid]; - ena_trace(ENA_INFO, "%s qid %d\n", __func__, qid); - while (taskqueue_cancel(rx_ring->cmpl_tq, &rx_ring->cmpl_task, NULL) != 0) taskqueue_drain(rx_ring->cmpl_tq, &rx_ring->cmpl_task); @@ -990,7 +986,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, error = bus_dmamap_load_mbuf_sg(adapter->rx_buf_tag, rx_info->map, rx_info->mbuf, segs, &nsegs, BUS_DMA_NOWAIT); if (unlikely((error != 0) || (nsegs != 1))) { - device_printf(adapter->pdev, "failed to map mbuf, error: %d, " + ena_trace(ENA_WARNING, "failed to map mbuf, error: %d, " "nsegs: %d\n", error, nsegs); counter_u64_add(rx_ring->rx_stats.dma_mapping_err, 1); goto exit; @@ -1020,8 +1016,10 @@ ena_free_rx_mbuf(struct ena_adapter *adapter, struct e struct ena_rx_buffer *rx_info) { - if (rx_info->mbuf == NULL) + if (rx_info->mbuf == NULL) { + ena_trace(ENA_WARNING, "Trying to free unallocated buffer\n"); return; + } bus_dmamap_unload(adapter->rx_buf_tag, rx_info->map); m_freem(rx_info->mbuf); @@ -1062,14 +1060,15 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); if (unlikely(rc != 0)) { - device_printf(adapter->pdev, - "failed to alloc buffer for rx queue\n"); + ena_trace(ENA_WARNING, + "failed to alloc buffer for rx queue %d\n", + rx_ring->qid); break; } rc = ena_com_add_single_rx_desc(rx_ring->ena_com_io_sq, &rx_info->ena_buf, req_id); if (unlikely(rc != 0)) { - device_printf(adapter->pdev, + ena_trace(ENA_WARNING, "failed to add buffer for rx queue %d\n", rx_ring->qid); break; @@ -1080,9 +1079,9 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t if (unlikely(i < num)) { counter_u64_add(rx_ring->rx_stats.refil_partial, 1); - device_printf(adapter->pdev, - "refilled rx queue %d with %d pages only\n", - rx_ring->qid, i); + ena_trace(ENA_WARNING, + "refilled rx qid %d with only %d mbufs (from %d)\n", + rx_ring->qid, i, num); } if (likely(i != 0)) { @@ -1124,9 +1123,8 @@ ena_refill_all_rx_bufs(struct ena_adapter *adapter) rc = ena_refill_rx_bufs(rx_ring, bufs_num); if (unlikely(rc != bufs_num)) - device_printf(adapter->pdev, - "refilling Queue %d failed. allocated %d buffers" - " from: %d\n", i, rc, bufs_num); + ena_trace(ENA_WARNING, "refilling Queue %d failed. " + "Allocated %d buffers from: %d\n", i, rc, bufs_num); } } @@ -1147,6 +1145,7 @@ ena_free_all_rx_bufs(struct ena_adapter *adapter) static void ena_free_tx_bufs(struct ena_adapter *adapter, unsigned int qid) { + bool print_once = true; struct ena_ring *tx_ring = &adapter->tx_ring[qid]; ENA_RING_MTX_LOCK(tx_ring); @@ -1156,8 +1155,16 @@ ena_free_tx_bufs(struct ena_adapter *adapter, unsigned if (tx_info->mbuf == NULL) continue; - ena_trace(ENA_DBG | ENA_TXPTH | ENA_RSC, - "free uncompleted Tx mbufs qid[%d] idx: 0x%x", qid, i); + if (print_once) { + device_printf(adapter->pdev, + "free uncompleted tx mbuf qid %d idx 0x%x", + qid, i); + print_once = false; + } else { + ena_trace(ENA_DBG, + "free uncompleted tx mbuf qid %d idx 0x%x", + qid, i); + } bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); m_free(tx_info->mbuf); @@ -1208,6 +1215,7 @@ ena_destroy_all_io_queues(struct ena_adapter *adapter) static inline int validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id) { + struct ena_adapter *adapter = tx_ring->adapter; struct ena_tx_buffer *tx_info = NULL; if (likely(req_id < tx_ring->ring_size)) { @@ -1216,6 +1224,12 @@ validate_tx_req_id(struct ena_ring *tx_ring, uint16_t return (0); } + if (tx_info->mbuf == NULL) + device_printf(adapter->pdev, + "tx_info doesn't have valid mbuf\n"); + else + device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id); + counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); return (EFAULT); @@ -1355,6 +1369,9 @@ ena_tx_cleanup(struct ena_ring *tx_ring) bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); } + ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed", + tx_ring->qid, mbuf); + m_freem(mbuf); total_done += tx_info->tx_descs; @@ -1377,6 +1394,9 @@ ena_tx_cleanup(struct ena_ring *tx_ring) work_done = TX_BUDGET - budget; + ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d done. total pkts: %d", + tx_ring->qid, work_done); + /* If there is still something to commit update ring state */ if (likely(commit != TX_COMMIT)) { tx_ring->next_to_clean = next_to_clean; @@ -1526,6 +1546,10 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p", mbuf); } + + ena_trace(ENA_DBG | ENA_RXPTH, + "rx mbuf updated. len %d", mbuf->m_pkthdr.len); + /* Free already appended mbuf, it won't be useful anymore */ bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); m_freem(rx_info->mbuf); @@ -1554,6 +1578,7 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c /* ipv4 checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); + ena_trace(ENA_DBG, "RX IPv4 header checksum error"); return; } @@ -1564,6 +1589,7 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c /* TCP/UDP checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); + ena_trace(ENA_DBG, "RX L4 checksum error"); } else { mbuf->m_pkthdr.csum_flags = CSUM_IP_CHECKED; mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; @@ -1619,6 +1645,8 @@ ena_rx_cleanup(struct ena_ring *rx_ring) io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; next_to_clean = rx_ring->next_to_clean; + ena_trace(ENA_DBG, "rx: qid %d", qid); + do { ena_rx_ctx.ena_bufs = rx_ring->ena_bufs; ena_rx_ctx.max_bufs = adapter->max_rx_sgl_size; @@ -1631,6 +1659,11 @@ ena_rx_cleanup(struct ena_ring *rx_ring) if (unlikely(ena_rx_ctx.descs == 0)) break; + ena_trace(ENA_DBG | ENA_RXPTH, "rx: q %d got packet from ena. " + "descs #: %d l3 proto %d l4 proto %d hash: %x", + rx_ring->qid, ena_rx_ctx.descs, ena_rx_ctx.l3_proto, + ena_rx_ctx.l4_proto, ena_rx_ctx.hash); + /* Receive mbuf from the ring */ mbuf = ena_rx_mbuf(rx_ring, rx_ring->ena_bufs, &ena_rx_ctx, &next_to_clean); @@ -1647,8 +1680,6 @@ ena_rx_cleanup(struct ena_ring *rx_ring) } break; } - ena_trace(ENA_DBG | ENA_RXPTH, "Rx: %d bytes", - mbuf->m_pkthdr.len); if (((ifp->if_capenable & IFCAP_RXCSUM) != 0) || ((ifp->if_capenable & IFCAP_RXCSUM_IPV6) != 0)) { @@ -1804,8 +1835,7 @@ ena_enable_msix(struct ena_adapter *adapter) adapter->msix_entries = malloc(msix_vecs * sizeof(struct msix_entry), M_DEVBUF, M_WAITOK | M_ZERO); - device_printf(dev, "Allocated msix_entries, vectors (cnt: %d)\n", - msix_vecs); + ena_trace(ENA_DBG, "trying to enable MSI-X, vectors: %d", msix_vecs); for (i = 0; i < msix_vecs; i++) { adapter->msix_entries[i].entry = i; @@ -1863,7 +1893,6 @@ ena_setup_io_intr(struct ena_adapter *adapter) { static int last_bind_cpu = -1; int irq_idx; - ena_trace(ENA_DBG, "enter"); for (int i = 0; i < adapter->num_queues; i++) { irq_idx = ENA_IO_IRQ_IDX(i); @@ -1934,7 +1963,7 @@ ena_request_mgmnt_irq(struct ena_adapter *adapter) return (rc); err_res_free: - device_printf(adapter->pdev, "releasing resource for irq %d\n", + ena_trace(ENA_INFO | ENA_ADMQ, "releasing resource for irq %d\n", irq->vector); rcc = bus_release_resource(adapter->pdev, SYS_RES_IRQ, irq->vector, irq->res); @@ -1954,7 +1983,8 @@ ena_request_io_irq(struct ena_adapter *adapter) int rc = 0, i, rcc; if (unlikely(adapter->msix_enabled == 0)) { - device_printf(adapter->pdev, "failed to request irq\n"); + device_printf(adapter->pdev, + "failed to request I/O IRQ: MSI-X is not enabled\n"); return (EINVAL); } else { flags = RF_ACTIVE | RF_SHAREABLE; @@ -1986,10 +2016,10 @@ ena_request_io_irq(struct ena_adapter *adapter) irq->requested = true; #ifdef RSS - device_printf(adapter->pdev, "queue %d - RSS bucket %d\n", + ena_trace(ENA_INFO, "queue %d - RSS bucket %d\n", i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); #else - device_printf(adapter->pdev, "queue %d - cpu %d\n", + ena_trace(ENA_INFO, "queue %d - cpu %d\n", i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); #endif } @@ -2306,7 +2336,7 @@ ena_media_status(if_t ifp, struct ifmediareq *ifmr) if (!adapter->link_status) { mtx_unlock(&adapter->global_mtx); - ena_trace(ENA_WARNING, "link_status = false"); + ena_trace(ENA_INFO, "link_status = false"); return; } @@ -2496,11 +2526,9 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *ada if_t ifp; int caps = 0; - ena_trace(ENA_DBG, "enter"); - ifp = adapter->ifp = if_gethandle(IFT_ETHER); if (unlikely(ifp == NULL)) { - device_printf(pdev, "can not allocate ifnet structure\n"); + ena_trace(ENA_ALERT, "can not allocate ifnet structure\n"); return (ENXIO); } if_initname(ifp, device_get_name(pdev), device_get_unit(pdev)); @@ -2783,7 +2811,7 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** /* Prepare the packet's descriptors and send them to device */ rc = ena_com_prepare_tx(io_sq, &ena_tx_ctx, &nb_hw_desc); if (unlikely(rc != 0)) { - ena_trace(ENA_WARNING, "failed to prepare tx bufs\n"); + device_printf(adapter->pdev, "failed to prepare tx bufs\n"); counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1); goto dma_error; } @@ -2839,7 +2867,7 @@ ena_start_xmit(struct ena_ring *tx_ring) while ((mbuf = drbr_peek(adapter->ifp, tx_ring->br)) != NULL) { ena_trace(ENA_DBG | ENA_TXPTH, "\ndequeued mbuf %p with flags %#x and" " header csum flags %#jx", - mbuf, mbuf->m_flags, mbuf->m_pkthdr.csum_flags); + mbuf, mbuf->m_flags, (uint64_t)mbuf->m_pkthdr.csum_flags); if (unlikely(!ena_com_sq_have_enough_space(io_sq, ENA_TX_CLEANUP_THRESHOLD))) @@ -3041,7 +3069,7 @@ ena_rss_init_default(struct ena_adapter *adapter) rc = ena_com_rss_init(ena_dev, ENA_RX_RSS_TABLE_LOG_SIZE); if (unlikely(rc != 0)) { - device_printf(dev, "Cannot init RSS\n"); + device_printf(dev, "Cannot init indirect table\n"); return (rc); } @@ -3090,7 +3118,7 @@ ena_rss_init_default_deferred(void *arg) dc = devclass_find("ena"); if (unlikely(dc == NULL)) { - ena_trace(ENA_DBG, "No devclass ena\n"); + ena_trace(ENA_ALERT, "No devclass ena\n"); return; } @@ -3370,11 +3398,10 @@ check_missing_comp_in_queue(struct ena_adapter *adapte if (unlikely(missed_tx > adapter->missing_tx_threshold)) { device_printf(adapter->pdev, - "The number of lost tx completion " - "is above the threshold (%d > %d). " - "Reset the device\n", - missed_tx, - adapter->missing_tx_threshold); + "The number of lost tx completion " + "is above the threshold (%d > %d). " + "Reset the device\n", + missed_tx, adapter->missing_tx_threshold); adapter->reset_reason = ENA_REGS_RESET_MISS_TX_CMPL; adapter->trigger_reset = true; @@ -3695,12 +3722,16 @@ ena_attach(device_t pdev) /* set up dma tags for rx and tx buffers */ rc = ena_setup_tx_dma_tag(adapter); - if (unlikely(rc != 0)) + if (unlikely(rc != 0)) { + device_printf(pdev, "Failed to create TX DMA tag\n"); goto err_com_free; + } rc = ena_setup_rx_dma_tag(adapter); - if (unlikely(rc != 0)) + if (unlikely(rc != 0)) { + device_printf(pdev, "Failed to create RX DMA tag\n"); goto err_tx_tag_free; + } /* initialize rings basic information */ device_printf(pdev, "initalize %d io queues\n", io_queue_num); @@ -3709,7 +3740,7 @@ ena_attach(device_t pdev) /* setup network interface */ rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); if (unlikely(rc != 0)) { - device_printf(pdev,"Error with network interface setup\n"); + device_printf(pdev, "Error with network interface setup\n"); goto err_io_free; } From owner-svn-src-all@freebsd.org Thu Nov 9 13:33:03 2017 Return-Path: Delivered-To: svn-src-all@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 CB10FE5056C; Thu, 9 Nov 2017 13:33:03 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9852966193; Thu, 9 Nov 2017 13:33:03 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9DX2WG092946; Thu, 9 Nov 2017 13:33:02 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9DX2Pd092945; Thu, 9 Nov 2017 13:33:02 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091333.vA9DX2Pd092945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 13:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325590 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 13:33:03 -0000 Author: mw Date: Thu Nov 9 13:33:02 2017 New Revision: 325590 URL: https://svnweb.freebsd.org/changeset/base/325590 Log: Fix calculating io queues number in ENA driver The maximum number of io_cq was the same number as maximum io_sq indicated by the device working in normal mode (without LLQ). It is not always true, especially when LLQ is being enabled. Fix it. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12869 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 13:30:39 2017 (r325589) +++ head/sys/dev/ena/ena.c Thu Nov 9 13:33:02 2017 (r325590) @@ -3006,7 +3006,7 @@ ena_calc_io_queue_num(struct ena_adapter *adapter, int io_sq_num, io_cq_num, io_queue_num; io_sq_num = get_feat_ctx->max_queues.max_sq_num; - io_cq_num = get_feat_ctx->max_queues.max_sq_num; + io_cq_num = get_feat_ctx->max_queues.max_cq_num; io_queue_num = min_t(int, mp_ncpus, ENA_MAX_NUM_IO_QUEUES); io_queue_num = min_t(int, io_queue_num, io_sq_num); From owner-svn-src-all@freebsd.org Thu Nov 9 13:35:08 2017 Return-Path: Delivered-To: svn-src-all@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 EDE65E50621; Thu, 9 Nov 2017 13:35:08 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C7A96662FF; Thu, 9 Nov 2017 13:35:08 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9DZ7BC093061; Thu, 9 Nov 2017 13:35:07 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9DZ7YP093059; Thu, 9 Nov 2017 13:35:07 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091335.vA9DZ7YP093059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 13:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325591 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 13:35:09 -0000 Author: mw Date: Thu Nov 9 13:35:07 2017 New Revision: 325591 URL: https://svnweb.freebsd.org/changeset/base/325591 Log: Read max MTU from the ENA device The device now provides driver with max available MTU value it can handle. The function setting MTU for the interface was simplified and reworked to follow up this changes. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12870 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 13:33:02 2017 (r325590) +++ head/sys/dev/ena/ena.c Thu Nov 9 13:35:07 2017 (r325591) @@ -351,39 +351,25 @@ static int ena_change_mtu(if_t ifp, int new_mtu) { struct ena_adapter *adapter = if_getsoftc(ifp); - struct ena_com_dev_get_features_ctx get_feat_ctx; - int rc, old_mtu, max_frame; + int rc; - rc = ena_com_get_dev_attr_feat(adapter->ena_dev, &get_feat_ctx); - if (unlikely(rc != 0)) { - device_printf(adapter->pdev, - "Cannot get attribute for ena device\n"); - return (ENXIO); - } - - /* Save old MTU in case of fail */ - old_mtu = if_getmtu(ifp); - - /* Change MTU and calculate max frame */ - if_setmtu(ifp, new_mtu); - max_frame = ETHER_MAX_FRAME(ifp, ETHERTYPE_VLAN, 1); - - if (unlikely((new_mtu < ENA_MIN_FRAME_LEN) || - (new_mtu > get_feat_ctx.dev_attr.max_mtu) || - (max_frame > ENA_MAX_FRAME_LEN))) { + if ((new_mtu > adapter->max_mtu) || (new_mtu < ENA_MIN_MTU)) { device_printf(adapter->pdev, "Invalid MTU setting. " - "new_mtu: %d\n", new_mtu); - goto error; + "new_mtu: %d max mtu: %d min mtu: %d\n", + new_mtu, adapter->max_mtu, ENA_MIN_MTU); + return (EINVAL); } rc = ena_com_set_dev_mtu(adapter->ena_dev, new_mtu); - if (rc != 0) - goto error; + if (likely(rc == 0)) { + ena_trace(ENA_DBG, "set MTU to %d\n", new_mtu); + if_setmtu(ifp, new_mtu); + } else { + device_printf(adapter->pdev, "Failed to set MTU to %d\n", + new_mtu); + } - return (0); -error: - if_setmtu(ifp, old_mtu); - return (EINVAL); + return (rc); } static inline void @@ -3703,6 +3689,8 @@ ena_attach(device_t pdev) ENA_ASSERT(io_queue_num > 0, "Invalid queue number: %d\n", io_queue_num); adapter->num_queues = io_queue_num; + + adapter->max_mtu = get_feat_ctx.dev_attr.max_mtu; /* calculatre ring sizes */ queue_size = ena_calc_queue_size(adapter,&tx_sgl_size, Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Nov 9 13:33:02 2017 (r325590) +++ head/sys/dev/ena/ena.h Thu Nov 9 13:35:07 2017 (r325591) @@ -103,6 +103,8 @@ #define RX_IRQ_INTERVAL 20 #define TX_IRQ_INTERVAL 50 +#define ENA_MIN_MTU 128 + #define ENA_TSO_MAXSIZE 65536 #define ENA_MMIO_DISABLE_REG_READ BIT(0) @@ -325,6 +327,8 @@ struct ena_adapter { bus_dma_tag_t tx_buf_tag; bus_dma_tag_t rx_buf_tag; int dma_width; + + uint32_t max_mtu; uint16_t max_tx_sgl_size; uint16_t max_rx_sgl_size; From owner-svn-src-all@freebsd.org Thu Nov 9 13:36:43 2017 Return-Path: Delivered-To: svn-src-all@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 CEAE3E506D6; Thu, 9 Nov 2017 13:36:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A8D5366474; Thu, 9 Nov 2017 13:36:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9Dagv4093158; Thu, 9 Nov 2017 13:36:42 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9DagNx093155; Thu, 9 Nov 2017 13:36:42 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091336.vA9DagNx093155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 13:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325592 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 13:36:43 -0000 Author: mw Date: Thu Nov 9 13:36:42 2017 New Revision: 325592 URL: https://svnweb.freebsd.org/changeset/base/325592 Log: Allow usage of more RX descriptors than 1 in ENA driver Using only 1 descriptor on RX could be an issue, if system would be low on resources and could not provide driver with large chunks of contiguous memory. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12871 Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 13:35:07 2017 (r325591) +++ head/sys/dev/ena/ena.c Thu Nov 9 13:36:42 2017 (r325592) @@ -549,7 +549,7 @@ ena_setup_rx_dma_tag(struct ena_adapter *adapter) BUS_SPACE_MAXADDR, /* highaddr of excl window */ NULL, NULL, /* filter, filterarg */ MJUM16BYTES, /* maxsize */ - 1, /* nsegments */ + adapter->max_rx_sgl_size, /* nsegments */ MJUM16BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ @@ -950,6 +950,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, struct ena_com_buf *ena_buf; bus_dma_segment_t segs[1]; int nsegs, error; + int mlen; /* if previous allocated frag is not used */ if (unlikely(rx_info->mbuf != NULL)) @@ -959,11 +960,18 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); if (unlikely(rx_info->mbuf == NULL)) { - counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); - return (ENOMEM); + counter_u64_add(rx_ring->rx_stats.mjum_alloc_fail, 1); + rx_info->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (unlikely(rx_info->mbuf == NULL)) { + counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); + return (ENOMEM); + } + mlen = MCLBYTES; + } else { + mlen = MJUM16BYTES; } /* Set mbuf length*/ - rx_info->mbuf->m_pkthdr.len = rx_info->mbuf->m_len = MJUM16BYTES; + rx_info->mbuf->m_pkthdr.len = rx_info->mbuf->m_len = mlen; /* Map packets for DMA */ ena_trace(ENA_DBG | ENA_RSC | ENA_RXPTH, @@ -983,7 +991,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, ena_buf = &rx_info->ena_buf; ena_buf->paddr = segs[0].ds_addr; - ena_buf->len = MJUM16BYTES; + ena_buf->len = mlen; ena_trace(ENA_DBG | ENA_RSC | ENA_RXPTH, "ALLOC RX BUF: mbuf %p, rx_info %p, len %d, paddr %#jx\n", Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu Nov 9 13:35:07 2017 (r325591) +++ head/sys/dev/ena/ena.h Thu Nov 9 13:36:42 2017 (r325592) @@ -215,6 +215,7 @@ struct ena_stats_rx { counter_u64_t bytes; counter_u64_t refil_partial; counter_u64_t bad_csum; + counter_u64_t mjum_alloc_fail; counter_u64_t mbuf_alloc_fail; counter_u64_t dma_mapping_err; counter_u64_t bad_desc_num; Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu Nov 9 13:35:07 2017 (r325591) +++ head/sys/dev/ena/ena_sysctl.c Thu Nov 9 13:36:42 2017 (r325592) @@ -200,6 +200,9 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) "mbuf_alloc_fail", CTLFLAG_RD, &rx_stats->mbuf_alloc_fail, "Failed mbuf allocs"); SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, + "mjum_alloc_fail", CTLFLAG_RD, + &rx_stats->mjum_alloc_fail, "Failed jumbo mbuf allocs"); + SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, "dma_mapping_err", CTLFLAG_RD, &rx_stats->dma_mapping_err, "DMA mapping errors"); SYSCTL_ADD_COUNTER_U64(ctx, rx_list, OID_AUTO, From owner-svn-src-all@freebsd.org Thu Nov 9 13:38:19 2017 Return-Path: Delivered-To: svn-src-all@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 316BFE50770; Thu, 9 Nov 2017 13:38:19 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F2852665EC; Thu, 9 Nov 2017 13:38:18 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9DcIAx093267; Thu, 9 Nov 2017 13:38:18 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9DcIHj093266; Thu, 9 Nov 2017 13:38:18 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201711091338.vA9DcIHj093266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 9 Nov 2017 13:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325593 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 325593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 13:38:19 -0000 Author: mw Date: Thu Nov 9 13:38:17 2017 New Revision: 325593 URL: https://svnweb.freebsd.org/changeset/base/325593 Log: Fix setting AENQ group in ENA driver With the current state of the AENQ handlers in the ENA driver, only implemented handlers should be indicated. Submitted by: Michal Krawczyk Reviewed by: byenduri_gmail.com Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D12872 Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu Nov 9 13:36:42 2017 (r325592) +++ head/sys/dev/ena/ena.c Thu Nov 9 13:38:17 2017 (r325593) @@ -3245,11 +3245,7 @@ ena_device_init(struct ena_adapter *adapter, device_t goto err_admin_init; } - aenq_groups = BIT(ENA_ADMIN_LINK_CHANGE) | - BIT(ENA_ADMIN_FATAL_ERROR) | - BIT(ENA_ADMIN_WARNING) | - BIT(ENA_ADMIN_NOTIFICATION) | - BIT(ENA_ADMIN_KEEP_ALIVE); + aenq_groups = BIT(ENA_ADMIN_LINK_CHANGE) | BIT(ENA_ADMIN_KEEP_ALIVE); aenq_groups &= get_feat_ctx->aenq.supported_groups; rc = ena_com_set_aenq_config(ena_dev, aenq_groups); From owner-svn-src-all@freebsd.org Thu Nov 9 13:38:25 2017 Return-Path: Delivered-To: svn-src-all@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 DB2A6E507B8; Thu, 9 Nov 2017 13:38:25 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A40CA66632; Thu, 9 Nov 2017 13:38:25 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9DcOJw093325; Thu, 9 Nov 2017 13:38:24 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9DcOgZ093324; Thu, 9 Nov 2017 13:38:24 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201711091338.vA9DcOgZ093324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Thu, 9 Nov 2017 13:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325594 - head/sys/ddb X-SVN-Group: head X-SVN-Commit-Author: gavin X-SVN-Commit-Paths: head/sys/ddb X-SVN-Commit-Revision: 325594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 13:38:26 -0000 Author: gavin Date: Thu Nov 9 13:38:24 2017 New Revision: 325594 URL: https://svnweb.freebsd.org/changeset/base/325594 Log: Point people towards our https web site for documentation, http accesses are just redirected anyway. MFC after: 1 week Modified: head/sys/ddb/db_command.c Modified: head/sys/ddb/db_command.c ============================================================================== --- head/sys/ddb/db_command.c Thu Nov 9 13:38:17 2017 (r325593) +++ head/sys/ddb/db_command.c Thu Nov 9 13:38:24 2017 (r325594) @@ -398,7 +398,7 @@ db_command(struct command **last_cmdp, struct command_ case CMD_HELP: if (cmd_table == &db_cmd_table) { db_printf("This is ddb(4), the kernel debugger; " - "see http://man.freebsd.org/ddb/4 for help.\n"); + "see https://man.FreeBSD.org/ddb/4 for help.\n"); db_printf("Use \"bt\" for backtrace, \"dump\" for " "kernel core dump, \"reset\" to reboot.\n"); db_printf("Available commands:\n"); From owner-svn-src-all@freebsd.org Thu Nov 9 14:31:27 2017 Return-Path: Delivered-To: svn-src-all@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 3A8CAE51C24; Thu, 9 Nov 2017 14:31:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 055B76880D; Thu, 9 Nov 2017 14:31:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9EVP3e019435; Thu, 9 Nov 2017 14:31:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9EVPPh019434; Thu, 9 Nov 2017 14:31:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711091431.vA9EVPPh019434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 9 Nov 2017 14:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325595 - head/usr.sbin X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin X-SVN-Commit-Revision: 325595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 14:31:27 -0000 Author: imp Date: Thu Nov 9 14:31:25 2017 New Revision: 325595 URL: https://svnweb.freebsd.org/changeset/base/325595 Log: Remove useless .if. The whole point of SUBDIR.yes was so that we didn't need this construct. Sponsored by: Netflix Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Nov 9 13:38:24 2017 (r325594) +++ head/usr.sbin/Makefile Thu Nov 9 14:31:25 2017 (r325595) @@ -114,10 +114,8 @@ SUBDIR.${MK_AUDIT}+= auditreduce SUBDIR.${MK_AUDIT}+= praudit SUBDIR.${MK_AUTHPF}+= authpf SUBDIR.${MK_AUTOFS}+= autofs -.if ${MK_BLACKLIST} != "no" SUBDIR.${MK_BLACKLIST}+= blacklistctl SUBDIR.${MK_BLACKLIST}+= blacklistd -.endif SUBDIR.${MK_BLUETOOTH}+= bluetooth SUBDIR.${MK_BOOTPARAMD}+= bootparamd SUBDIR.${MK_BSDINSTALL}+= bsdinstall From owner-svn-src-all@freebsd.org Thu Nov 9 15:08:14 2017 Return-Path: Delivered-To: svn-src-all@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 EA679E52B7C; Thu, 9 Nov 2017 15:08:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C939769E7C; Thu, 9 Nov 2017 15:08:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id E40CF6806; Thu, 9 Nov 2017 15:08:13 +0000 (UTC) Date: Thu, 9 Nov 2017 16:08:13 +0100 From: Baptiste Daroussin To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325422 - head/lib/libc/sys Message-ID: <20171109150813.sejhhfhgz52tch2j@ivaldir.net> References: <201711050302.vA532JBM015186@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2qnkwws7o7z3iga2" Content-Disposition: inline In-Reply-To: <201711050302.vA532JBM015186@repo.freebsd.org> User-Agent: NeoMutt/20171027 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 15:08:15 -0000 --2qnkwws7o7z3iga2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 05, 2017 at 03:02:19AM +0000, Ed Maste wrote: > Author: emaste > Date: Sun Nov 5 03:02:19 2017 > New Revision: 325422 > URL: https://svnweb.freebsd.org/changeset/base/325422 >=20 > Log: > posix_fallocate.2: add an EINVAL errno case > =20 > As of r325320 posix_fallocate returns EINVAL on ZFS to indicate that > the underlying filesystem does not support this operation, per > POSIX.1-2008. Document this case in the man page. I would have expected a EOPNOTSUPP no? Best regards, Bapt --2qnkwws7o7z3iga2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAloEb1oACgkQY4mL3PG3 PlopsRAAsQ9umFDvvFjV2zYpHCMn5BUXwqMqgyY4j8y+gLXYqHWFxzkZTE/QIrnK Ou1vH8HH5NGYYZYs9abexWuYmMKAHMtC3/tbFGD1y2y/qgIOPrdyDnqPeyxUewLv 0yM/umrhmMDFcR0+uH2s1lNO6ZGA0LPL/Nh1bEQdMi2v5XQLd4DD+8UIyYiGBT86 RBkQBC3uz9+SKQrXwpd7tACCIqLhzx0cDkTB8hi/tGOYUjxoTYeItji0PXlVUPZB g8Q2ZKXH0knb0rUTBYc3+mcCfMQt9oEP2EtdSX5568Wp0uTZP1z46/yp3uPP0/Gn ipaiirlUOldhCCWzVK71O0FjNGJLC4UbHAXiMmL1swRYFYK2vrNEiR9TYYm2U1Ro OiUxIS92ioi4iaDUXB0fXjGSkV9/urQuMqg8b6fa+fb9rXWrf8mHM3SAv8VG+IvU AAo434h/eNsCke5MO4r0j7Oq28WPcIWyCVNDwU/3ZdtZJCyN9bN/gDtAdK50t5Ej DcImnXlBrbo06TI+4dmbgfPeqGu+dQdnEW2Pr485pFhTgp1TX7nb/GeS6ATX1Iim /2yKYBB6ey+m9Sz0LmlANjIhtcgSu1GkNBA+/B402olLpd8rDoOnC32nyOTAVXYo 2JX79Oe48Fgdmm45YrdPxjOeIe8VeVM8aJSaGPvYFc00gXsLxBk= =JZFH -----END PGP SIGNATURE----- --2qnkwws7o7z3iga2-- From owner-svn-src-all@freebsd.org Thu Nov 9 15:10:02 2017 Return-Path: Delivered-To: svn-src-all@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 53668E52C54; Thu, 9 Nov 2017 15:10:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 328A66A00A; Thu, 9 Nov 2017 15:10:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id 865086957; Thu, 9 Nov 2017 15:10:01 +0000 (UTC) Date: Thu, 9 Nov 2017 16:10:01 +0100 From: Baptiste Daroussin To: Ed Maste Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r325422 - head/lib/libc/sys Message-ID: <20171109151001.nnxnwy65bjf6s7o3@ivaldir.net> References: <201711050302.vA532JBM015186@repo.freebsd.org> <20171109150813.sejhhfhgz52tch2j@ivaldir.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pymxcmeizg5n5464" Content-Disposition: inline In-Reply-To: <20171109150813.sejhhfhgz52tch2j@ivaldir.net> User-Agent: NeoMutt/20171027 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 15:10:02 -0000 --pymxcmeizg5n5464 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 09, 2017 at 04:08:13PM +0100, Baptiste Daroussin wrote: > On Sun, Nov 05, 2017 at 03:02:19AM +0000, Ed Maste wrote: > > Author: emaste > > Date: Sun Nov 5 03:02:19 2017 > > New Revision: 325422 > > URL: https://svnweb.freebsd.org/changeset/base/325422 > >=20 > > Log: > > posix_fallocate.2: add an EINVAL errno case > > =20 > > As of r325320 posix_fallocate returns EINVAL on ZFS to indicate that > > the underlying filesystem does not support this operation, per > > POSIX.1-2008. Document this case in the man page. >=20 > I would have expected a EOPNOTSUPP no? By that I would have mean rather than changing the documentation, change the error returned on ZFS Bapt --pymxcmeizg5n5464 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAloEb8kACgkQY4mL3PG3 PlptKw//XqlvQw40p0D8i2ypCWPGP0QU+MMKa4Jq0aJyX/XmnTy/yUjcAYMwl6i3 etpv3BxImXaRosXTSAho0skRpbvY+7SUNUaqViaf7hcbb15qJNFc7fJ00pIo0sTU amnWd1dGXXbHzHQlgED1GRxo3uNT4PbLoh5aSQYOjzF0zItarMcSMO95KB083AQP +oGBzedPYqqVTTtmD/xlHZKmnl0J1stq3LMC7E+lG+OrrWdMYvV5vf8EYkG39RGH nPXvUAkjgcWN8hOooE4wn6rv7MVqOTjlYjJfu28uNB7fukx6J0y+Mo9gCfEh9vWs VkL1leRt+sKm26d2NGKg6v+qld00PruoqIR4uV18Y+9YZ1snM95psHQaOZPeSU1h jCs200hk5WExj/R85nLmdGLLMPjnBRWT/fKKnCed0S+l9aHsYJqvFQW04FnIO7pO QYn1pw/fUvjUC9/6s7wAXSivb0xfbLR3jkVJDNs0NbK4yYIZuX50bXO49Dm0YDYQ d0hEvaydnJymyXWskEycizQ3Ewkffmg8pk63fsFDKmL7Un0ybuwQdqcCgL+SEICt fV8tjvrPj7oZGcS7TF+ldcq+XGAbwyRLVCx+LWmhP6C09B+3Mll8gm/jMUbHrVyS 7nVKT74mpLNH5ba/JlUMNIvh36+huuDeC/UXWdNhwW+Z5fPZ6CU= =/SiX -----END PGP SIGNATURE----- --pymxcmeizg5n5464-- From owner-svn-src-all@freebsd.org Thu Nov 9 15:10:25 2017 Return-Path: Delivered-To: svn-src-all@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 44349E52CA7 for ; Thu, 9 Nov 2017 15:10:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (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 072B56A14C for ; Thu, 9 Nov 2017 15:10:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id h70so10157810ioi.4 for ; Thu, 09 Nov 2017 07:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=LjH9L3nU0VrBB2k4E5M3dN7i6zMqfiNy6IS5EZIs8vw=; b=e9dHMBgz2Mx4iIcCrwsqdqwAQP7nheEZEPDiMbCAmGGhIghOyAAomMuytyRGhqAdgw JDJnYSZ7WW1db7KH+w+6hevySJ/n/nNzr4rkto8yv/fB0br+JtyELqjXhrvbDnV5VOFd wGQ9L7navH2OGJpwgmGFUnYKppde1P8NI0HkITzmDhnGlDNx0j2nN3aE2u37O4jCVT52 FrSmJXgXpx51kxh6Ibq2OfmC8yScamOj2htaNOhooscAYrQvGmNeHggj0eQEAwCRlnzf lWji9I3DdBfTV+9lHykiHfELjY06K6Ky8OE6IbTb4vdzSx4q+usRH9GA8cnNXRVEnndf Ai4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=LjH9L3nU0VrBB2k4E5M3dN7i6zMqfiNy6IS5EZIs8vw=; b=mp4VzxQ5ex5RuAd8OS8oQsm1fEGToHk7LbX0i1y8+SjjJYFqOz850CroA4bvPsAM+/ ABzfMGmcNJlLOROImcvlyii6Xb+uIMQ2etPyTVkVtj+ULwMTACEXUoZiffFcoF0ZoZNG pUxeiAkERwoE9aPATSjlXGVnj+KS7JHbqRTvXgEXpS7memuw1pyaZODX86uUFnSAX/WK z2TrCFY6Crcj3gWzUmEVfNANsMLD5pq1IVOWai+GLIviRNXJsAwhbqjYJGwGETriH6iv ZtkZ5O0GjD3w/WvAQd8b5gAnyPeas2fiyGZaeOiGwYrutMXcCEhAGQGiXYtKooMmCdJu z8YQ== X-Gm-Message-State: AJaThX4wwSBPEm2SLdEvZt5zEehQ/2EAiXSs4PuKoQ1q65o16t96bRbi NOid0Ax9oprPbdHaLOAOgLnmOZXp5vQNn4NUxNJs7Q== X-Google-Smtp-Source: ABhQp+Q1lmQddnDCpcttPwadk9NULfsIk4L/8lDBF5m0YGzT3Bp5aBZDOdLqzTDozP/g+4k/Qubi6O03o1MFKnlj5Mg= X-Received: by 10.107.46.216 with SMTP id u85mr908062iou.136.1510240224215; Thu, 09 Nov 2017 07:10:24 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Thu, 9 Nov 2017 07:10:23 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:48b2:e409:663b:8d66] In-Reply-To: <20171109150813.sejhhfhgz52tch2j@ivaldir.net> References: <201711050302.vA532JBM015186@repo.freebsd.org> <20171109150813.sejhhfhgz52tch2j@ivaldir.net> From: Warner Losh Date: Thu, 9 Nov 2017 08:10:23 -0700 X-Google-Sender-Auth: 6gHrHYi0C249w7SsSy_0Ua0l32U Message-ID: Subject: Re: svn commit: r325422 - head/lib/libc/sys To: Baptiste Daroussin Cc: Ed Maste , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 15:10:25 -0000 On Thu, Nov 9, 2017 at 8:08 AM, Baptiste Daroussin wrote: > On Sun, Nov 05, 2017 at 03:02:19AM +0000, Ed Maste wrote: > > Author: emaste > > Date: Sun Nov 5 03:02:19 2017 > > New Revision: 325422 > > URL: https://svnweb.freebsd.org/changeset/base/325422 > > > > Log: > > posix_fallocate.2: add an EINVAL errno case > > > > As of r325320 posix_fallocate returns EINVAL on ZFS to indicate that > > the underlying filesystem does not support this operation, per > > POSIX.1-2008. Document this case in the man page. > > I would have expected a EOPNOTSUPP no? > Me too, but POSIX specifically requires EINVAL. Warner From owner-svn-src-all@freebsd.org Thu Nov 9 15:35:52 2017 Return-Path: Delivered-To: svn-src-all@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 6AEBCE5398F; Thu, 9 Nov 2017 15:35:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 375226B19A; Thu, 9 Nov 2017 15:35:52 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9FZpQ6045037; Thu, 9 Nov 2017 15:35:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9FZp6Q045036; Thu, 9 Nov 2017 15:35:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201711091535.vA9FZp6Q045036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 9 Nov 2017 15:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325596 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 325596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 15:35:52 -0000 Author: np Date: Thu Nov 9 15:35:51 2017 New Revision: 325596 URL: https://svnweb.freebsd.org/changeset/base/325596 Log: cxgbe(4): Do not request settings not supported by the port. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Thu Nov 9 14:31:25 2017 (r325595) +++ head/sys/dev/cxgbe/common/t4_hw.c Thu Nov 9 15:35:51 2017 (r325596) @@ -3682,7 +3682,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m { struct fw_port_cmd c; unsigned int mdi = V_FW_PORT_CAP_MDI(FW_PORT_CAP_MDI_AUTO); - unsigned int aneg, fc, fec, speed; + unsigned int aneg, fc, fec, speed, rcap; fc = 0; if (lc->requested_fc & PAUSE_RX) @@ -3727,6 +3727,13 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED); } + rcap = aneg | speed | fc | fec | mdi; + if ((rcap | lc->supported) != lc->supported) { + CH_WARN(adap, "rcap 0x%08x, pcap 0x%08x\n", rcap, + lc->supported); + rcap &= lc->supported; + } + memset(&c, 0, sizeof(c)); c.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | F_FW_CMD_REQUEST | F_FW_CMD_EXEC | @@ -3734,7 +3741,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m c.action_to_len16 = cpu_to_be32(V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_L1_CFG) | FW_LEN16(c)); - c.u.l1cfg.rcap = cpu_to_be32(aneg | speed | fc | fec | mdi); + c.u.l1cfg.rcap = cpu_to_be32(rcap); return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL); } From owner-svn-src-all@freebsd.org Thu Nov 9 15:38:06 2017 Return-Path: Delivered-To: svn-src-all@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 D6FBFE53A92; Thu, 9 Nov 2017 15:38:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 562666B35F; Thu, 9 Nov 2017 15:38:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9Fc5lh045182; Thu, 9 Nov 2017 15:38:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9Fc2J2045154; Thu, 9 Nov 2017 15:38:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201711091538.vA9Fc2J2045154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 9 Nov 2017 15:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r325597 - in vendor/zstd/dist: . contrib/gen_html contrib/pzstd contrib/pzstd/test contrib/pzstd/utils contrib/pzstd/utils/test contrib/seekable_format contrib/seekable_format/examples ... X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/zstd/dist: . contrib/gen_html contrib/pzstd contrib/pzstd/test contrib/pzstd/utils contrib/pzstd/utils/test contrib/seekable_format contrib/seekable_format/examples doc doc/educational_decod... X-SVN-Commit-Revision: 325597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 15:38:07 -0000 Author: bapt Date: Thu Nov 9 15:38:02 2017 New Revision: 325597 URL: https://svnweb.freebsd.org/changeset/base/325597 Log: import zstd 1.3.2 Added: vendor/zstd/dist/COPYING vendor/zstd/dist/contrib/seekable_format/ vendor/zstd/dist/contrib/seekable_format/examples/ vendor/zstd/dist/contrib/seekable_format/examples/.gitignore vendor/zstd/dist/contrib/seekable_format/examples/Makefile (contents, props changed) vendor/zstd/dist/contrib/seekable_format/examples/parallel_compression.c (contents, props changed) vendor/zstd/dist/contrib/seekable_format/examples/parallel_processing.c (contents, props changed) vendor/zstd/dist/contrib/seekable_format/examples/seekable_compression.c (contents, props changed) vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression.c (contents, props changed) vendor/zstd/dist/contrib/seekable_format/zstd_seekable.h (contents, props changed) vendor/zstd/dist/contrib/seekable_format/zstd_seekable_compression_format.md vendor/zstd/dist/contrib/seekable_format/zstdseek_compress.c (contents, props changed) vendor/zstd/dist/contrib/seekable_format/zstdseek_decompress.c (contents, props changed) vendor/zstd/dist/doc/educational_decoder/Makefile (contents, props changed) vendor/zstd/dist/lib/compress/zstd_compress.h (contents, props changed) vendor/zstd/dist/lib/compress/zstd_double_fast.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_double_fast.h (contents, props changed) vendor/zstd/dist/lib/compress/zstd_fast.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_fast.h (contents, props changed) vendor/zstd/dist/lib/compress/zstd_lazy.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_lazy.h (contents, props changed) vendor/zstd/dist/lib/compress/zstd_ldm.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_ldm.h (contents, props changed) vendor/zstd/dist/lib/compress/zstd_opt.c (contents, props changed) vendor/zstd/dist/tests/fuzz/block_decompress.c (contents, props changed) vendor/zstd/dist/tests/fuzz/block_round_trip.c (contents, props changed) vendor/zstd/dist/tests/fuzz/default.options vendor/zstd/dist/tests/fuzz/fuzz.py (contents, props changed) vendor/zstd/dist/tests/fuzz/zstd_helpers.c (contents, props changed) vendor/zstd/dist/tests/fuzz/zstd_helpers.h (contents, props changed) Deleted: vendor/zstd/dist/LICENSE-examples Modified: vendor/zstd/dist/Makefile vendor/zstd/dist/NEWS vendor/zstd/dist/appveyor.yml vendor/zstd/dist/circle.yml vendor/zstd/dist/contrib/gen_html/Makefile vendor/zstd/dist/contrib/gen_html/gen_html.cpp vendor/zstd/dist/contrib/pzstd/ErrorHolder.h vendor/zstd/dist/contrib/pzstd/Logging.h vendor/zstd/dist/contrib/pzstd/Makefile vendor/zstd/dist/contrib/pzstd/Options.cpp vendor/zstd/dist/contrib/pzstd/Options.h vendor/zstd/dist/contrib/pzstd/Pzstd.cpp vendor/zstd/dist/contrib/pzstd/Pzstd.h vendor/zstd/dist/contrib/pzstd/SkippableFrame.cpp vendor/zstd/dist/contrib/pzstd/SkippableFrame.h vendor/zstd/dist/contrib/pzstd/main.cpp vendor/zstd/dist/contrib/pzstd/test/OptionsTest.cpp vendor/zstd/dist/contrib/pzstd/test/PzstdTest.cpp vendor/zstd/dist/contrib/pzstd/test/RoundTrip.h vendor/zstd/dist/contrib/pzstd/test/RoundTripTest.cpp vendor/zstd/dist/contrib/pzstd/utils/Buffer.h vendor/zstd/dist/contrib/pzstd/utils/FileSystem.h vendor/zstd/dist/contrib/pzstd/utils/Likely.h vendor/zstd/dist/contrib/pzstd/utils/Range.h vendor/zstd/dist/contrib/pzstd/utils/ResourcePool.h vendor/zstd/dist/contrib/pzstd/utils/ScopeGuard.h vendor/zstd/dist/contrib/pzstd/utils/ThreadPool.h vendor/zstd/dist/contrib/pzstd/utils/WorkQueue.h vendor/zstd/dist/contrib/pzstd/utils/test/BufferTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/RangeTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/ResourcePoolTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/ScopeGuardTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/ThreadPoolTest.cpp vendor/zstd/dist/contrib/pzstd/utils/test/WorkQueueTest.cpp vendor/zstd/dist/doc/educational_decoder/harness.c vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c vendor/zstd/dist/doc/educational_decoder/zstd_decompress.h vendor/zstd/dist/doc/zstd_manual.html vendor/zstd/dist/lib/.gitignore vendor/zstd/dist/lib/Makefile vendor/zstd/dist/lib/README.md vendor/zstd/dist/lib/common/bitstream.h vendor/zstd/dist/lib/common/compiler.h vendor/zstd/dist/lib/common/error_private.c vendor/zstd/dist/lib/common/error_private.h vendor/zstd/dist/lib/common/fse.h vendor/zstd/dist/lib/common/huf.h vendor/zstd/dist/lib/common/mem.h vendor/zstd/dist/lib/common/pool.c vendor/zstd/dist/lib/common/pool.h vendor/zstd/dist/lib/common/threading.c vendor/zstd/dist/lib/common/threading.h vendor/zstd/dist/lib/common/zstd_common.c vendor/zstd/dist/lib/common/zstd_errors.h vendor/zstd/dist/lib/common/zstd_internal.h vendor/zstd/dist/lib/compress/fse_compress.c vendor/zstd/dist/lib/compress/huf_compress.c vendor/zstd/dist/lib/compress/zstd_compress.c vendor/zstd/dist/lib/compress/zstd_opt.h vendor/zstd/dist/lib/compress/zstdmt_compress.c vendor/zstd/dist/lib/compress/zstdmt_compress.h vendor/zstd/dist/lib/decompress/zstd_decompress.c vendor/zstd/dist/lib/deprecated/zbuff.h vendor/zstd/dist/lib/deprecated/zbuff_common.c vendor/zstd/dist/lib/deprecated/zbuff_compress.c vendor/zstd/dist/lib/deprecated/zbuff_decompress.c vendor/zstd/dist/lib/dictBuilder/cover.c vendor/zstd/dist/lib/dictBuilder/zdict.c vendor/zstd/dist/lib/dictBuilder/zdict.h vendor/zstd/dist/lib/legacy/zstd_legacy.h vendor/zstd/dist/lib/legacy/zstd_v01.c vendor/zstd/dist/lib/legacy/zstd_v01.h vendor/zstd/dist/lib/legacy/zstd_v02.c vendor/zstd/dist/lib/legacy/zstd_v02.h vendor/zstd/dist/lib/legacy/zstd_v03.c vendor/zstd/dist/lib/legacy/zstd_v03.h vendor/zstd/dist/lib/legacy/zstd_v04.c vendor/zstd/dist/lib/legacy/zstd_v04.h vendor/zstd/dist/lib/legacy/zstd_v05.c vendor/zstd/dist/lib/legacy/zstd_v05.h vendor/zstd/dist/lib/legacy/zstd_v06.c vendor/zstd/dist/lib/legacy/zstd_v06.h vendor/zstd/dist/lib/legacy/zstd_v07.c vendor/zstd/dist/lib/legacy/zstd_v07.h vendor/zstd/dist/lib/zstd.h vendor/zstd/dist/programs/Makefile vendor/zstd/dist/programs/README.md vendor/zstd/dist/programs/bench.c vendor/zstd/dist/programs/bench.h vendor/zstd/dist/programs/datagen.c vendor/zstd/dist/programs/datagen.h vendor/zstd/dist/programs/dibio.c vendor/zstd/dist/programs/dibio.h vendor/zstd/dist/programs/fileio.c vendor/zstd/dist/programs/fileio.h vendor/zstd/dist/programs/platform.h vendor/zstd/dist/programs/util.h vendor/zstd/dist/programs/zstd.1 vendor/zstd/dist/programs/zstd.1.md vendor/zstd/dist/programs/zstdcli.c vendor/zstd/dist/tests/.gitignore vendor/zstd/dist/tests/Makefile vendor/zstd/dist/tests/datagencli.c vendor/zstd/dist/tests/decodecorpus.c vendor/zstd/dist/tests/fullbench.c vendor/zstd/dist/tests/fuzz/Makefile vendor/zstd/dist/tests/fuzz/README.md vendor/zstd/dist/tests/fuzz/fuzz.h vendor/zstd/dist/tests/fuzz/fuzz_helpers.h vendor/zstd/dist/tests/fuzz/regression_driver.c vendor/zstd/dist/tests/fuzz/simple_decompress.c vendor/zstd/dist/tests/fuzz/simple_round_trip.c vendor/zstd/dist/tests/fuzz/stream_decompress.c vendor/zstd/dist/tests/fuzz/stream_round_trip.c vendor/zstd/dist/tests/fuzzer.c vendor/zstd/dist/tests/gzip/Makefile vendor/zstd/dist/tests/invalidDictionaries.c vendor/zstd/dist/tests/legacy.c vendor/zstd/dist/tests/longmatch.c vendor/zstd/dist/tests/namespaceTest.c vendor/zstd/dist/tests/paramgrill.c vendor/zstd/dist/tests/playTests.sh vendor/zstd/dist/tests/poolTests.c vendor/zstd/dist/tests/roundTripCrash.c vendor/zstd/dist/tests/symbols.c vendor/zstd/dist/tests/test-zstd-speed.py vendor/zstd/dist/tests/test-zstd-versions.py vendor/zstd/dist/tests/zbufftest.c vendor/zstd/dist/tests/zstreamtest.c vendor/zstd/dist/zlibWrapper/Makefile vendor/zstd/dist/zlibWrapper/examples/zwrapbench.c vendor/zstd/dist/zlibWrapper/gzcompatibility.h vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.c vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.h Added: vendor/zstd/dist/COPYING ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/COPYING Thu Nov 9 15:38:02 2017 (r325597) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file Modified: vendor/zstd/dist/Makefile ============================================================================== --- vendor/zstd/dist/Makefile Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/Makefile Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ # ################################################################ -# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). # ################################################################ PRGDIR = programs @@ -12,6 +12,7 @@ ZSTDDIR = lib BUILDIR = build ZWRAPDIR = zlibWrapper TESTDIR = tests +FUZZDIR = $(TESTDIR)/fuzz # Define nul output VOID = /dev/null @@ -29,15 +30,12 @@ default: lib-release zstd-release all: | allmost examples manual .PHONY: allmost -allmost: - $(MAKE) -C $(ZSTDDIR) all - $(MAKE) -C $(PRGDIR) all - $(MAKE) -C $(TESTDIR) all +allmost: allzstd $(MAKE) -C $(ZWRAPDIR) all #skip zwrapper, can't build that on alternate architectures without the proper zlib installed -.PHONY: allarch -allarch: +.PHONY: allzstd +allzstd: $(MAKE) -C $(ZSTDDIR) all $(MAKE) -C $(PRGDIR) all $(MAKE) -C $(TESTDIR) all @@ -100,6 +98,7 @@ clean: @$(MAKE) -C examples/ $@ > $(VOID) @$(MAKE) -C contrib/gen_html $@ > $(VOID) @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* + @$(RM) -r lz4 @echo Cleaning completed #------------------------------------------------------------------------------ @@ -114,7 +113,7 @@ CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUI list: @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs -.PHONY: install clangtest gpptest armtest usan asan uasan +.PHONY: install clangtest armtest usan asan uasan install: @$(MAKE) -C $(ZSTDDIR) $@ @$(MAKE) -C $(PRGDIR) $@ @@ -158,16 +157,16 @@ m32build: clean $(MAKE) all32 armbuild: clean - CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allarch + CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allzstd aarch64build: clean - CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allarch + CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd ppcbuild: clean - CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allarch + CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd ppc64build: clean - CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allarch + CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd armfuzz: clean CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest @@ -181,8 +180,10 @@ ppcfuzz: clean ppc64fuzz: clean CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest -gpptest: clean - CC=$(CXX) $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" +.PHONY: cxxtest +cxxtest: CXXFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror +cxxtest: clean + $(MAKE) -C $(PRGDIR) all CC="$(CXX) -Wno-deprecated" CFLAGS="$(CXXFLAGS)" # adding -Wno-deprecated to avoid clang++ warning on dealing with C files directly gcc5test: clean gcc-5 -v @@ -218,6 +219,15 @@ arm-ppc-compilation: $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" +regressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest + +uasanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined" CXXFLAGS="-O3 -fsanitize=address,undefined" + +msanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory" + # run UBsan with -fsanitize-recover=signed-integer-overflow # due to a bug in UBsan when doing pointer subtraction # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303 @@ -277,6 +287,10 @@ gpp6install: apt-add-repo clang38install: APT_PACKAGES="clang-3.8" $(MAKE) apt-install +# Ubuntu 14.04 ships a too-old lz4 +lz4install: + [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install + endif @@ -287,7 +301,7 @@ endif #------------------------------------------------------------------------ -#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets +# target specific tests #------------------------------------------------------------------------ ifneq (,$(filter $(HOST_OS),MSYS POSIX)) cmakebuild: @@ -297,38 +311,38 @@ cmakebuild: cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall c90build: clean - gcc -v + $(CC) -v CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long` gnu90build: clean - gcc -v + $(CC) -v CFLAGS="-std=gnu90" $(MAKE) allmost c99build: clean - gcc -v + $(CC) -v CFLAGS="-std=c99" $(MAKE) allmost gnu99build: clean - gcc -v + $(CC) -v CFLAGS="-std=gnu99" $(MAKE) allmost c11build: clean - gcc -v + $(CC) -v CFLAGS="-std=c11" $(MAKE) allmost bmix64build: clean - gcc -v + $(CC) -v CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test bmix32build: clean - gcc -v + $(CC) -v CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test bmi32build: clean - gcc -v + $(CC) -v CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test staticAnalyze: clean - gcc -v + $(CC) -v CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all endif Modified: vendor/zstd/dist/NEWS ============================================================================== --- vendor/zstd/dist/NEWS Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/NEWS Thu Nov 9 15:38:02 2017 (r325597) @@ -1,3 +1,26 @@ +v1.3.2 +new : long range mode, using --long command, by Stella Lau (@stellamplau) +new : ability to generate and decode magicless frames (#591) +changed : maximum nb of threads reduced to 200, to avoid address space exhaustion in 32-bits mode +fix : multi-threading compression works with custom allocators +fix : ZSTD_sizeof_CStream() was over-evaluating memory usage +fix : a rare compression bug when compression generates very large distances and bunch of other conditions (only possible at --ultra -22) +fix : 32-bits build can now decode large offsets (levels 21+) +cli : added LZ4 frame support by default, by Felix Handte (@felixhandte) +cli : improved --list output +cli : new : can split input file for dictionary training, using command -B# +cli : new : clean operation artefact on Ctrl-C interruption +cli : fix : do not change /dev/null permissions when using command -t with root access, reported by @mike155 (#851) +cli : fix : write file size in header in multiple-files mode +api : added macro ZSTD_COMPRESSBOUND() for static allocation +api : experimental : new advanced decompression API +api : fix : sizeof_CCtx() used to over-estimate +build: fix : no-multithread variant compiles without pool.c dependency, reported by Mitchell Blank Jr (@mitchblank) (#819) +build: better compatibility with reproducible builds, by Bernhard M. Wiedemann (@bmwiedemann) (#818) +example : added streaming_memory_usage +license : changed /examples license to BSD + GPLv2 +license : fix a few header files to reflect new license (#825) + v1.3.1 New license : BSD + GPLv2 perf: substantially decreased memory usage in Multi-threading mode, thanks to reports by Tino Reichardt (@mcmilk) Modified: vendor/zstd/dist/appveyor.yml ============================================================================== --- vendor/zstd/dist/appveyor.yml Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/appveyor.yml Thu Nov 9 15:38:02 2017 (r325597) @@ -9,19 +9,19 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allarch && make -C tests test-symbols fullbench-dll fullbench-lib" + SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests test-symbols fullbench-dll fullbench-lib" ARTIFACT: "true" BUILD: "true" - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x86" - SCRIPT: "make allarch" + SCRIPT: "make allzstd MOREFLAGS=-static" ARTIFACT: "true" BUILD: "true" - COMPILER: "clang" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allarch" + SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd" BUILD: "true" - COMPILER: "gcc" @@ -172,15 +172,15 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allarch" + SCRIPT: "make allzstd" - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x86" - SCRIPT: "make allarch" + SCRIPT: "make allzstd" - COMPILER: "clang" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allarch" + SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd" - COMPILER: "visual" HOST: "visual" Modified: vendor/zstd/dist/circle.yml ============================================================================== --- vendor/zstd/dist/circle.yml Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/circle.yml Thu Nov 9 15:38:02 2017 (r325597) @@ -9,7 +9,7 @@ dependencies: test: override: - ? | - if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then cc -v; make all && make clean; fi && + if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then cc -v; make all && make clean && make -C lib libzstd-nomt && make clean; fi && if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gnu90build && make clean; fi : parallel: true @@ -45,12 +45,17 @@ test: parallel: true - ? | if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make ppc64build && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc7build && make clean; fi #could add another test here + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc7build && make clean; fi : parallel: true - ? | if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make shortest && make clean; fi && if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make -C tests test-legacy test-longmatch test-symbols && make clean; fi + : + parallel: true + - ? | + if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make -j regressiontest && make clean; fi && + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then true; fi # Could add another test here : parallel: true Modified: vendor/zstd/dist/contrib/gen_html/Makefile ============================================================================== --- vendor/zstd/dist/contrib/gen_html/Makefile Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/gen_html/Makefile Thu Nov 9 15:38:02 2017 (r325597) @@ -1,11 +1,11 @@ -# ########################################################################## +# ################################################################ # Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# ########################################################################## +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ CFLAGS ?= -O3 CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wno-comment Modified: vendor/zstd/dist/contrib/gen_html/gen_html.cpp ============================================================================== --- vendor/zstd/dist/contrib/gen_html/gen_html.cpp Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/gen_html/gen_html.cpp Thu Nov 9 15:38:02 2017 (r325597) @@ -2,9 +2,9 @@ * Copyright (c) 2016-present, Przemyslaw Skibinski, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include Modified: vendor/zstd/dist/contrib/pzstd/ErrorHolder.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/ErrorHolder.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/ErrorHolder.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: vendor/zstd/dist/contrib/pzstd/Logging.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/Logging.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/Logging.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: vendor/zstd/dist/contrib/pzstd/Makefile ============================================================================== --- vendor/zstd/dist/contrib/pzstd/Makefile Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/Makefile Thu Nov 9 15:38:02 2017 (r325597) @@ -1,11 +1,11 @@ -# ########################################################################## +# ################################################################ # Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# ########################################################################## +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ # Standard variables for installation DESTDIR ?= Modified: vendor/zstd/dist/contrib/pzstd/Options.cpp ============================================================================== --- vendor/zstd/dist/contrib/pzstd/Options.cpp Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/Options.cpp Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Options.h" #include "util.h" Modified: vendor/zstd/dist/contrib/pzstd/Options.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/Options.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/Options.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: vendor/zstd/dist/contrib/pzstd/Pzstd.cpp ============================================================================== --- vendor/zstd/dist/contrib/pzstd/Pzstd.cpp Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/Pzstd.cpp Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Pzstd.h" #include "SkippableFrame.h" Modified: vendor/zstd/dist/contrib/pzstd/Pzstd.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/Pzstd.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/Pzstd.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: vendor/zstd/dist/contrib/pzstd/SkippableFrame.cpp ============================================================================== --- vendor/zstd/dist/contrib/pzstd/SkippableFrame.cpp Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/SkippableFrame.cpp Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "SkippableFrame.h" #include "mem.h" Modified: vendor/zstd/dist/contrib/pzstd/SkippableFrame.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/SkippableFrame.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/SkippableFrame.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: vendor/zstd/dist/contrib/pzstd/main.cpp ============================================================================== --- vendor/zstd/dist/contrib/pzstd/main.cpp Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/main.cpp Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "ErrorHolder.h" #include "Options.h" Modified: vendor/zstd/dist/contrib/pzstd/test/OptionsTest.cpp ============================================================================== --- vendor/zstd/dist/contrib/pzstd/test/OptionsTest.cpp Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/test/OptionsTest.cpp Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Options.h" Modified: vendor/zstd/dist/contrib/pzstd/test/PzstdTest.cpp ============================================================================== --- vendor/zstd/dist/contrib/pzstd/test/PzstdTest.cpp Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/test/PzstdTest.cpp Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Pzstd.h" extern "C" { Modified: vendor/zstd/dist/contrib/pzstd/test/RoundTrip.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/test/RoundTrip.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/test/RoundTrip.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: vendor/zstd/dist/contrib/pzstd/test/RoundTripTest.cpp ============================================================================== --- vendor/zstd/dist/contrib/pzstd/test/RoundTripTest.cpp Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/test/RoundTripTest.cpp Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ extern "C" { #include "datagen.h" Modified: vendor/zstd/dist/contrib/pzstd/utils/Buffer.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/utils/Buffer.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/utils/Buffer.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: vendor/zstd/dist/contrib/pzstd/utils/FileSystem.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/utils/FileSystem.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/utils/FileSystem.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: vendor/zstd/dist/contrib/pzstd/utils/Likely.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/utils/Likely.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/utils/Likely.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** Modified: vendor/zstd/dist/contrib/pzstd/utils/Range.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/utils/Range.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/utils/Range.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** Modified: vendor/zstd/dist/contrib/pzstd/utils/ResourcePool.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/utils/ResourcePool.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/utils/ResourcePool.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: vendor/zstd/dist/contrib/pzstd/utils/ScopeGuard.h ============================================================================== --- vendor/zstd/dist/contrib/pzstd/utils/ScopeGuard.h Thu Nov 9 15:35:51 2017 (r325596) +++ vendor/zstd/dist/contrib/pzstd/utils/ScopeGuard.h Thu Nov 9 15:38:02 2017 (r325597) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 9 15:43:17 2017 Return-Path: Delivered-To: svn-src-all@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 C6910E53D23; Thu, 9 Nov 2017 15:43:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2CF696B792; Thu, 9 Nov 2017 15:43:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9FhGkJ049047; Thu, 9 Nov 2017 15:43:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9FhGqF049043; Thu, 9 Nov 2017 15:43:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201711091543.vA9FhGqF049043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 9 Nov 2017 15:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r325598 - in vendor/zstd/1.3.2: . contrib/gen_html contrib/pzstd contrib/pzstd/test contrib/pzstd/utils contrib/pzstd/utils/test contrib/seekable_format doc doc/educational_decoder lib ... X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/zstd/1.3.2: . contrib/gen_html contrib/pzstd contrib/pzstd/test contrib/pzstd/utils contrib/pzstd/utils/test contrib/seekable_format doc doc/educational_decoder lib lib/common lib/compress l... X-SVN-Commit-Revision: 325598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 15:43:17 -0000 Author: bapt Date: Thu Nov 9 15:43:15 2017 New Revision: 325598 URL: https://svnweb.freebsd.org/changeset/base/325598 Log: Tag import of zstd 1.3.2 Added: vendor/zstd/1.3.2/ - copied from r325595, vendor/zstd/dist/ vendor/zstd/1.3.2/COPYING - copied unchanged from r325597, vendor/zstd/dist/COPYING vendor/zstd/1.3.2/contrib/seekable_format/ - copied from r325597, vendor/zstd/dist/contrib/seekable_format/ vendor/zstd/1.3.2/doc/educational_decoder/Makefile - copied unchanged from r325597, vendor/zstd/dist/doc/educational_decoder/Makefile vendor/zstd/1.3.2/lib/compress/zstd_compress.h - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_compress.h vendor/zstd/1.3.2/lib/compress/zstd_double_fast.c - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_double_fast.c vendor/zstd/1.3.2/lib/compress/zstd_double_fast.h - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_double_fast.h vendor/zstd/1.3.2/lib/compress/zstd_fast.c - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_fast.c vendor/zstd/1.3.2/lib/compress/zstd_fast.h - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_fast.h vendor/zstd/1.3.2/lib/compress/zstd_lazy.c - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_lazy.c vendor/zstd/1.3.2/lib/compress/zstd_lazy.h - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_lazy.h vendor/zstd/1.3.2/lib/compress/zstd_ldm.c - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_ldm.c vendor/zstd/1.3.2/lib/compress/zstd_ldm.h - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_ldm.h vendor/zstd/1.3.2/lib/compress/zstd_opt.c - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_opt.c vendor/zstd/1.3.2/tests/fuzz/block_decompress.c - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/block_decompress.c vendor/zstd/1.3.2/tests/fuzz/block_round_trip.c - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/block_round_trip.c vendor/zstd/1.3.2/tests/fuzz/default.options - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/default.options vendor/zstd/1.3.2/tests/fuzz/fuzz.py - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/fuzz.py vendor/zstd/1.3.2/tests/fuzz/zstd_helpers.c - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/zstd_helpers.c vendor/zstd/1.3.2/tests/fuzz/zstd_helpers.h - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/zstd_helpers.h Replaced: vendor/zstd/1.3.2/Makefile - copied unchanged from r325597, vendor/zstd/dist/Makefile vendor/zstd/1.3.2/NEWS - copied unchanged from r325597, vendor/zstd/dist/NEWS vendor/zstd/1.3.2/appveyor.yml - copied unchanged from r325597, vendor/zstd/dist/appveyor.yml vendor/zstd/1.3.2/circle.yml - copied unchanged from r325597, vendor/zstd/dist/circle.yml vendor/zstd/1.3.2/contrib/gen_html/Makefile - copied unchanged from r325597, vendor/zstd/dist/contrib/gen_html/Makefile vendor/zstd/1.3.2/contrib/gen_html/gen_html.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/gen_html/gen_html.cpp vendor/zstd/1.3.2/contrib/pzstd/ErrorHolder.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/ErrorHolder.h vendor/zstd/1.3.2/contrib/pzstd/Logging.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/Logging.h vendor/zstd/1.3.2/contrib/pzstd/Makefile - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/Makefile vendor/zstd/1.3.2/contrib/pzstd/Options.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/Options.cpp vendor/zstd/1.3.2/contrib/pzstd/Options.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/Options.h vendor/zstd/1.3.2/contrib/pzstd/Pzstd.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/Pzstd.cpp vendor/zstd/1.3.2/contrib/pzstd/Pzstd.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/Pzstd.h vendor/zstd/1.3.2/contrib/pzstd/SkippableFrame.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/SkippableFrame.cpp vendor/zstd/1.3.2/contrib/pzstd/SkippableFrame.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/SkippableFrame.h vendor/zstd/1.3.2/contrib/pzstd/main.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/main.cpp vendor/zstd/1.3.2/contrib/pzstd/test/OptionsTest.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/test/OptionsTest.cpp vendor/zstd/1.3.2/contrib/pzstd/test/PzstdTest.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/test/PzstdTest.cpp vendor/zstd/1.3.2/contrib/pzstd/test/RoundTrip.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/test/RoundTrip.h vendor/zstd/1.3.2/contrib/pzstd/test/RoundTripTest.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/test/RoundTripTest.cpp vendor/zstd/1.3.2/contrib/pzstd/utils/Buffer.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/Buffer.h vendor/zstd/1.3.2/contrib/pzstd/utils/FileSystem.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/FileSystem.h vendor/zstd/1.3.2/contrib/pzstd/utils/Likely.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/Likely.h vendor/zstd/1.3.2/contrib/pzstd/utils/Range.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/Range.h vendor/zstd/1.3.2/contrib/pzstd/utils/ResourcePool.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/ResourcePool.h vendor/zstd/1.3.2/contrib/pzstd/utils/ScopeGuard.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/ScopeGuard.h vendor/zstd/1.3.2/contrib/pzstd/utils/ThreadPool.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/ThreadPool.h vendor/zstd/1.3.2/contrib/pzstd/utils/WorkQueue.h - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/WorkQueue.h vendor/zstd/1.3.2/contrib/pzstd/utils/test/BufferTest.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/test/BufferTest.cpp vendor/zstd/1.3.2/contrib/pzstd/utils/test/RangeTest.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/test/RangeTest.cpp vendor/zstd/1.3.2/contrib/pzstd/utils/test/ResourcePoolTest.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/test/ResourcePoolTest.cpp vendor/zstd/1.3.2/contrib/pzstd/utils/test/ScopeGuardTest.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/test/ScopeGuardTest.cpp vendor/zstd/1.3.2/contrib/pzstd/utils/test/ThreadPoolTest.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/test/ThreadPoolTest.cpp vendor/zstd/1.3.2/contrib/pzstd/utils/test/WorkQueueTest.cpp - copied unchanged from r325597, vendor/zstd/dist/contrib/pzstd/utils/test/WorkQueueTest.cpp vendor/zstd/1.3.2/doc/educational_decoder/harness.c - copied unchanged from r325597, vendor/zstd/dist/doc/educational_decoder/harness.c vendor/zstd/1.3.2/doc/educational_decoder/zstd_decompress.c - copied unchanged from r325597, vendor/zstd/dist/doc/educational_decoder/zstd_decompress.c vendor/zstd/1.3.2/doc/educational_decoder/zstd_decompress.h - copied unchanged from r325597, vendor/zstd/dist/doc/educational_decoder/zstd_decompress.h vendor/zstd/1.3.2/doc/zstd_manual.html - copied unchanged from r325597, vendor/zstd/dist/doc/zstd_manual.html vendor/zstd/1.3.2/lib/.gitignore - copied unchanged from r325597, vendor/zstd/dist/lib/.gitignore vendor/zstd/1.3.2/lib/Makefile - copied unchanged from r325597, vendor/zstd/dist/lib/Makefile vendor/zstd/1.3.2/lib/README.md - copied unchanged from r325597, vendor/zstd/dist/lib/README.md vendor/zstd/1.3.2/lib/common/bitstream.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/bitstream.h vendor/zstd/1.3.2/lib/common/compiler.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/compiler.h vendor/zstd/1.3.2/lib/common/error_private.c - copied unchanged from r325597, vendor/zstd/dist/lib/common/error_private.c vendor/zstd/1.3.2/lib/common/error_private.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/error_private.h vendor/zstd/1.3.2/lib/common/fse.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/fse.h vendor/zstd/1.3.2/lib/common/huf.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/huf.h vendor/zstd/1.3.2/lib/common/mem.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/mem.h vendor/zstd/1.3.2/lib/common/pool.c - copied unchanged from r325597, vendor/zstd/dist/lib/common/pool.c vendor/zstd/1.3.2/lib/common/pool.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/pool.h vendor/zstd/1.3.2/lib/common/threading.c - copied unchanged from r325597, vendor/zstd/dist/lib/common/threading.c vendor/zstd/1.3.2/lib/common/threading.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/threading.h vendor/zstd/1.3.2/lib/common/zstd_common.c - copied unchanged from r325597, vendor/zstd/dist/lib/common/zstd_common.c vendor/zstd/1.3.2/lib/common/zstd_errors.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/zstd_errors.h vendor/zstd/1.3.2/lib/common/zstd_internal.h - copied unchanged from r325597, vendor/zstd/dist/lib/common/zstd_internal.h vendor/zstd/1.3.2/lib/compress/fse_compress.c - copied unchanged from r325597, vendor/zstd/dist/lib/compress/fse_compress.c vendor/zstd/1.3.2/lib/compress/huf_compress.c - copied unchanged from r325597, vendor/zstd/dist/lib/compress/huf_compress.c vendor/zstd/1.3.2/lib/compress/zstd_compress.c - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_compress.c vendor/zstd/1.3.2/lib/compress/zstd_opt.h - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstd_opt.h vendor/zstd/1.3.2/lib/compress/zstdmt_compress.c - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstdmt_compress.c vendor/zstd/1.3.2/lib/compress/zstdmt_compress.h - copied unchanged from r325597, vendor/zstd/dist/lib/compress/zstdmt_compress.h vendor/zstd/1.3.2/lib/decompress/zstd_decompress.c - copied unchanged from r325597, vendor/zstd/dist/lib/decompress/zstd_decompress.c vendor/zstd/1.3.2/lib/deprecated/zbuff.h - copied unchanged from r325597, vendor/zstd/dist/lib/deprecated/zbuff.h vendor/zstd/1.3.2/lib/deprecated/zbuff_common.c - copied unchanged from r325597, vendor/zstd/dist/lib/deprecated/zbuff_common.c vendor/zstd/1.3.2/lib/deprecated/zbuff_compress.c - copied unchanged from r325597, vendor/zstd/dist/lib/deprecated/zbuff_compress.c vendor/zstd/1.3.2/lib/deprecated/zbuff_decompress.c - copied unchanged from r325597, vendor/zstd/dist/lib/deprecated/zbuff_decompress.c vendor/zstd/1.3.2/lib/dictBuilder/cover.c - copied unchanged from r325597, vendor/zstd/dist/lib/dictBuilder/cover.c vendor/zstd/1.3.2/lib/dictBuilder/zdict.c - copied unchanged from r325597, vendor/zstd/dist/lib/dictBuilder/zdict.c vendor/zstd/1.3.2/lib/dictBuilder/zdict.h - copied unchanged from r325597, vendor/zstd/dist/lib/dictBuilder/zdict.h vendor/zstd/1.3.2/lib/legacy/zstd_legacy.h - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_legacy.h vendor/zstd/1.3.2/lib/legacy/zstd_v01.c - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v01.c vendor/zstd/1.3.2/lib/legacy/zstd_v01.h - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v01.h vendor/zstd/1.3.2/lib/legacy/zstd_v02.c - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v02.c vendor/zstd/1.3.2/lib/legacy/zstd_v02.h - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v02.h vendor/zstd/1.3.2/lib/legacy/zstd_v03.c - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v03.c vendor/zstd/1.3.2/lib/legacy/zstd_v03.h - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v03.h vendor/zstd/1.3.2/lib/legacy/zstd_v04.c - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v04.c vendor/zstd/1.3.2/lib/legacy/zstd_v04.h - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v04.h vendor/zstd/1.3.2/lib/legacy/zstd_v05.c - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v05.c vendor/zstd/1.3.2/lib/legacy/zstd_v05.h - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v05.h vendor/zstd/1.3.2/lib/legacy/zstd_v06.c - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v06.c vendor/zstd/1.3.2/lib/legacy/zstd_v06.h - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v06.h vendor/zstd/1.3.2/lib/legacy/zstd_v07.c - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v07.c vendor/zstd/1.3.2/lib/legacy/zstd_v07.h - copied unchanged from r325597, vendor/zstd/dist/lib/legacy/zstd_v07.h vendor/zstd/1.3.2/lib/zstd.h - copied unchanged from r325597, vendor/zstd/dist/lib/zstd.h vendor/zstd/1.3.2/programs/Makefile - copied unchanged from r325597, vendor/zstd/dist/programs/Makefile vendor/zstd/1.3.2/programs/README.md - copied unchanged from r325597, vendor/zstd/dist/programs/README.md vendor/zstd/1.3.2/programs/bench.c - copied unchanged from r325597, vendor/zstd/dist/programs/bench.c vendor/zstd/1.3.2/programs/bench.h - copied unchanged from r325597, vendor/zstd/dist/programs/bench.h vendor/zstd/1.3.2/programs/datagen.c - copied unchanged from r325597, vendor/zstd/dist/programs/datagen.c vendor/zstd/1.3.2/programs/datagen.h - copied unchanged from r325597, vendor/zstd/dist/programs/datagen.h vendor/zstd/1.3.2/programs/dibio.c - copied unchanged from r325597, vendor/zstd/dist/programs/dibio.c vendor/zstd/1.3.2/programs/dibio.h - copied unchanged from r325597, vendor/zstd/dist/programs/dibio.h vendor/zstd/1.3.2/programs/fileio.c - copied unchanged from r325597, vendor/zstd/dist/programs/fileio.c vendor/zstd/1.3.2/programs/fileio.h - copied unchanged from r325597, vendor/zstd/dist/programs/fileio.h vendor/zstd/1.3.2/programs/platform.h - copied unchanged from r325597, vendor/zstd/dist/programs/platform.h vendor/zstd/1.3.2/programs/util.h - copied unchanged from r325597, vendor/zstd/dist/programs/util.h vendor/zstd/1.3.2/programs/zstd.1 - copied unchanged from r325597, vendor/zstd/dist/programs/zstd.1 vendor/zstd/1.3.2/programs/zstd.1.md - copied unchanged from r325597, vendor/zstd/dist/programs/zstd.1.md vendor/zstd/1.3.2/programs/zstdcli.c - copied unchanged from r325597, vendor/zstd/dist/programs/zstdcli.c vendor/zstd/1.3.2/tests/.gitignore - copied unchanged from r325597, vendor/zstd/dist/tests/.gitignore vendor/zstd/1.3.2/tests/Makefile - copied unchanged from r325597, vendor/zstd/dist/tests/Makefile vendor/zstd/1.3.2/tests/datagencli.c - copied unchanged from r325597, vendor/zstd/dist/tests/datagencli.c vendor/zstd/1.3.2/tests/decodecorpus.c - copied unchanged from r325597, vendor/zstd/dist/tests/decodecorpus.c vendor/zstd/1.3.2/tests/fullbench.c - copied unchanged from r325597, vendor/zstd/dist/tests/fullbench.c vendor/zstd/1.3.2/tests/fuzz/Makefile - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/Makefile vendor/zstd/1.3.2/tests/fuzz/README.md - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/README.md vendor/zstd/1.3.2/tests/fuzz/fuzz.h - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/fuzz.h vendor/zstd/1.3.2/tests/fuzz/fuzz_helpers.h - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/fuzz_helpers.h vendor/zstd/1.3.2/tests/fuzz/regression_driver.c - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/regression_driver.c vendor/zstd/1.3.2/tests/fuzz/simple_decompress.c - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/simple_decompress.c vendor/zstd/1.3.2/tests/fuzz/simple_round_trip.c - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/simple_round_trip.c vendor/zstd/1.3.2/tests/fuzz/stream_decompress.c - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/stream_decompress.c vendor/zstd/1.3.2/tests/fuzz/stream_round_trip.c - copied unchanged from r325597, vendor/zstd/dist/tests/fuzz/stream_round_trip.c vendor/zstd/1.3.2/tests/fuzzer.c - copied unchanged from r325597, vendor/zstd/dist/tests/fuzzer.c vendor/zstd/1.3.2/tests/gzip/Makefile - copied unchanged from r325597, vendor/zstd/dist/tests/gzip/Makefile vendor/zstd/1.3.2/tests/invalidDictionaries.c - copied unchanged from r325597, vendor/zstd/dist/tests/invalidDictionaries.c vendor/zstd/1.3.2/tests/legacy.c - copied unchanged from r325597, vendor/zstd/dist/tests/legacy.c vendor/zstd/1.3.2/tests/longmatch.c - copied unchanged from r325597, vendor/zstd/dist/tests/longmatch.c vendor/zstd/1.3.2/tests/namespaceTest.c - copied unchanged from r325597, vendor/zstd/dist/tests/namespaceTest.c vendor/zstd/1.3.2/tests/paramgrill.c - copied unchanged from r325597, vendor/zstd/dist/tests/paramgrill.c vendor/zstd/1.3.2/tests/playTests.sh - copied unchanged from r325597, vendor/zstd/dist/tests/playTests.sh vendor/zstd/1.3.2/tests/poolTests.c - copied unchanged from r325597, vendor/zstd/dist/tests/poolTests.c vendor/zstd/1.3.2/tests/roundTripCrash.c - copied unchanged from r325597, vendor/zstd/dist/tests/roundTripCrash.c vendor/zstd/1.3.2/tests/symbols.c - copied unchanged from r325597, vendor/zstd/dist/tests/symbols.c vendor/zstd/1.3.2/tests/test-zstd-speed.py - copied unchanged from r325597, vendor/zstd/dist/tests/test-zstd-speed.py vendor/zstd/1.3.2/tests/test-zstd-versions.py - copied unchanged from r325597, vendor/zstd/dist/tests/test-zstd-versions.py vendor/zstd/1.3.2/tests/zbufftest.c - copied unchanged from r325597, vendor/zstd/dist/tests/zbufftest.c vendor/zstd/1.3.2/tests/zstreamtest.c - copied unchanged from r325597, vendor/zstd/dist/tests/zstreamtest.c vendor/zstd/1.3.2/zlibWrapper/Makefile - copied unchanged from r325597, vendor/zstd/dist/zlibWrapper/Makefile vendor/zstd/1.3.2/zlibWrapper/examples/zwrapbench.c - copied unchanged from r325597, vendor/zstd/dist/zlibWrapper/examples/zwrapbench.c vendor/zstd/1.3.2/zlibWrapper/gzcompatibility.h - copied unchanged from r325597, vendor/zstd/dist/zlibWrapper/gzcompatibility.h vendor/zstd/1.3.2/zlibWrapper/zstd_zlibwrapper.c - copied unchanged from r325597, vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.c vendor/zstd/1.3.2/zlibWrapper/zstd_zlibwrapper.h - copied unchanged from r325597, vendor/zstd/dist/zlibWrapper/zstd_zlibwrapper.h Deleted: vendor/zstd/1.3.2/LICENSE-examples Copied: vendor/zstd/1.3.2/COPYING (from r325597, vendor/zstd/dist/COPYING) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.3.2/COPYING Thu Nov 9 15:43:15 2017 (r325598, copy of r325597, vendor/zstd/dist/COPYING) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file Copied: vendor/zstd/1.3.2/Makefile (from r325597, vendor/zstd/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.3.2/Makefile Thu Nov 9 15:43:15 2017 (r325598, copy of r325597, vendor/zstd/dist/Makefile) @@ -0,0 +1,348 @@ +# ################################################################ +# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ + +PRGDIR = programs +ZSTDDIR = lib +BUILDIR = build +ZWRAPDIR = zlibWrapper +TESTDIR = tests +FUZZDIR = $(TESTDIR)/fuzz + +# Define nul output +VOID = /dev/null + +ifneq (,$(filter Windows%,$(OS))) +EXT =.exe +else +EXT = +endif + +.PHONY: default +default: lib-release zstd-release + +.PHONY: all +all: | allmost examples manual + +.PHONY: allmost +allmost: allzstd + $(MAKE) -C $(ZWRAPDIR) all + +#skip zwrapper, can't build that on alternate architectures without the proper zlib installed +.PHONY: allzstd +allzstd: + $(MAKE) -C $(ZSTDDIR) all + $(MAKE) -C $(PRGDIR) all + $(MAKE) -C $(TESTDIR) all + +.PHONY: all32 +all32: + $(MAKE) -C $(PRGDIR) zstd32 + $(MAKE) -C $(TESTDIR) all32 + +.PHONY: lib +lib: + @$(MAKE) -C $(ZSTDDIR) $@ + +.PHONY: lib-release +lib-release: + @$(MAKE) -C $(ZSTDDIR) + +.PHONY: zstd +zstd: + @$(MAKE) -C $(PRGDIR) $@ + cp $(PRGDIR)/zstd$(EXT) . + +.PHONY: zstd-release +zstd-release: + @$(MAKE) -C $(PRGDIR) + cp $(PRGDIR)/zstd$(EXT) . + +.PHONY: zstdmt +zstdmt: + @$(MAKE) -C $(PRGDIR) $@ + cp $(PRGDIR)/zstd$(EXT) ./zstdmt$(EXT) + +.PHONY: zlibwrapper +zlibwrapper: + $(MAKE) -C $(ZWRAPDIR) test + +.PHONY: test shortest +test shortest: + $(MAKE) -C $(PRGDIR) allVariants + $(MAKE) -C $(TESTDIR) $@ + +.PHONY: examples +examples: + CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all + +.PHONY: manual +manual: + $(MAKE) -C contrib/gen_html $@ + +.PHONY: cleanTabs +cleanTabs: + cd contrib; ./cleanTabs + +.PHONY: clean +clean: + @$(MAKE) -C $(ZSTDDIR) $@ > $(VOID) + @$(MAKE) -C $(PRGDIR) $@ > $(VOID) + @$(MAKE) -C $(TESTDIR) $@ > $(VOID) + @$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID) + @$(MAKE) -C examples/ $@ > $(VOID) + @$(MAKE) -C contrib/gen_html $@ > $(VOID) + @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* + @$(RM) -r lz4 + @echo Cleaning completed + +#------------------------------------------------------------------------------ +# make install is validated only for Linux, OSX, Hurd and some BSD targets +#------------------------------------------------------------------------------ +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD DragonFly NetBSD MSYS_NT)) + +HOST_OS = POSIX +CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON + +.PHONY: list +list: + @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs + +.PHONY: install clangtest armtest usan asan uasan +install: + @$(MAKE) -C $(ZSTDDIR) $@ + @$(MAKE) -C $(PRGDIR) $@ + +.PHONY: uninstall +uninstall: + @$(MAKE) -C $(ZSTDDIR) $@ + @$(MAKE) -C $(PRGDIR) $@ + +.PHONY: travis-install +travis-install: + $(MAKE) install PREFIX=~/install_test_dir + +.PHONY: gppbuild +gppbuild: clean + g++ -v + CC=g++ $(MAKE) -C programs all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" + +.PHONY: gcc5build +gcc5build: clean + gcc-5 -v + CC=gcc-5 $(MAKE) all MOREFLAGS="-Werror" + +.PHONY: gcc6build +gcc6build: clean + gcc-6 -v + CC=gcc-6 $(MAKE) all MOREFLAGS="-Werror" + +.PHONY: gcc7build +gcc7build: clean + gcc-7 -v + CC=gcc-7 $(MAKE) all MOREFLAGS="-Werror" + +.PHONY: clangbuild +clangbuild: clean + clang -v + CXX=clang++ CC=clang $(MAKE) all MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" + +m32build: clean + gcc -v + $(MAKE) all32 + +armbuild: clean + CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allzstd + +aarch64build: clean + CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd + +ppcbuild: clean + CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd + +ppc64build: clean + CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd + +armfuzz: clean + CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +aarch64fuzz: clean + CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +ppcfuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +ppc64fuzz: clean + CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest + +.PHONY: cxxtest +cxxtest: CXXFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror +cxxtest: clean + $(MAKE) -C $(PRGDIR) all CC="$(CXX) -Wno-deprecated" CFLAGS="$(CXXFLAGS)" # adding -Wno-deprecated to avoid clang++ warning on dealing with C files directly + +gcc5test: clean + gcc-5 -v + $(MAKE) all CC=gcc-5 MOREFLAGS="-Werror" + +gcc6test: clean + gcc-6 -v + $(MAKE) all CC=gcc-6 MOREFLAGS="-Werror" + +clangtest: clean + clang -v + $(MAKE) all CXX=clang-++ CC=clang MOREFLAGS="-Werror -Wconversion -Wno-sign-conversion -Wdocumentation" + +armtest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests + +aarch64test: + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" FUZZER_FLAGS=--no-big-tests + +ppctest: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" FUZZER_FLAGS=--no-big-tests + +ppc64test: clean + $(MAKE) -C $(TESTDIR) datagen # use native, faster + $(MAKE) -C $(TESTDIR) test CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests + +arm-ppc-compilation: + $(MAKE) -C $(PRGDIR) clean zstd CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static ZSTDRTTEST= MOREFLAGS="-Werror -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" + $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" + +regressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest + +uasanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined" CXXFLAGS="-O3 -fsanitize=address,undefined" + +msanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory" + +# run UBsan with -fsanitize-recover=signed-integer-overflow +# due to a bug in UBsan when doing pointer subtraction +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303 + +usan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined" + +asan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address" + +asan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address" $(MAKE) -C $(TESTDIR) $* + +msan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason + +msan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $* + +asan32: clean + $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address" + +uasan: clean + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" + +uasan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $* + +tsan-%: clean + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests + +apt-install: + sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES) + +apt-add-repo: + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt-get update -y -qq + +ppcinstall: + APT_PACKAGES="qemu-system-ppc qemu-user-static gcc-powerpc-linux-gnu" $(MAKE) apt-install + +arminstall: + APT_PACKAGES="qemu-system-arm qemu-user-static gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross" $(MAKE) apt-install + +valgrindinstall: + APT_PACKAGES="valgrind" $(MAKE) apt-install + +libc6install: + APT_PACKAGES="libc6-dev-i386 gcc-multilib" $(MAKE) apt-install + +gcc6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-6 gcc-6-multilib" $(MAKE) apt-install + +gpp6install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install + +clang38install: + APT_PACKAGES="clang-3.8" $(MAKE) apt-install + +# Ubuntu 14.04 ships a too-old lz4 +lz4install: + [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install + +endif + + +ifneq (,$(filter MSYS%,$(shell uname))) +HOST_OS = MSYS +CMAKE_PARAMS = -G"MSYS Makefiles" -DZSTD_MULTITHREAD_SUPPORT:BOOL=OFF -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON +endif + + +#------------------------------------------------------------------------ +# target specific tests +#------------------------------------------------------------------------ +ifneq (,$(filter $(HOST_OS),MSYS POSIX)) +cmakebuild: + cmake --version + $(RM) -r $(BUILDIR)/cmake/build + mkdir $(BUILDIR)/cmake/build + cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall + +c90build: clean + $(CC) -v + CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long` + +gnu90build: clean + $(CC) -v + CFLAGS="-std=gnu90" $(MAKE) allmost + +c99build: clean + $(CC) -v + CFLAGS="-std=c99" $(MAKE) allmost + +gnu99build: clean + $(CC) -v + CFLAGS="-std=gnu99" $(MAKE) allmost + +c11build: clean + $(CC) -v + CFLAGS="-std=c11" $(MAKE) allmost + +bmix64build: clean + $(CC) -v + CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test + +bmix32build: clean + $(CC) -v + CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test + +bmi32build: clean + $(CC) -v + CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test + +staticAnalyze: clean + $(CC) -v + CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all +endif Copied: vendor/zstd/1.3.2/NEWS (from r325597, vendor/zstd/dist/NEWS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/1.3.2/NEWS Thu Nov 9 15:43:15 2017 (r325598, copy of r325597, vendor/zstd/dist/NEWS) @@ -0,0 +1,336 @@ +v1.3.2 +new : long range mode, using --long command, by Stella Lau (@stellamplau) +new : ability to generate and decode magicless frames (#591) +changed : maximum nb of threads reduced to 200, to avoid address space exhaustion in 32-bits mode +fix : multi-threading compression works with custom allocators +fix : ZSTD_sizeof_CStream() was over-evaluating memory usage +fix : a rare compression bug when compression generates very large distances and bunch of other conditions (only possible at --ultra -22) +fix : 32-bits build can now decode large offsets (levels 21+) +cli : added LZ4 frame support by default, by Felix Handte (@felixhandte) +cli : improved --list output +cli : new : can split input file for dictionary training, using command -B# +cli : new : clean operation artefact on Ctrl-C interruption +cli : fix : do not change /dev/null permissions when using command -t with root access, reported by @mike155 (#851) +cli : fix : write file size in header in multiple-files mode +api : added macro ZSTD_COMPRESSBOUND() for static allocation +api : experimental : new advanced decompression API +api : fix : sizeof_CCtx() used to over-estimate +build: fix : no-multithread variant compiles without pool.c dependency, reported by Mitchell Blank Jr (@mitchblank) (#819) +build: better compatibility with reproducible builds, by Bernhard M. Wiedemann (@bmwiedemann) (#818) +example : added streaming_memory_usage +license : changed /examples license to BSD + GPLv2 +license : fix a few header files to reflect new license (#825) + +v1.3.1 +New license : BSD + GPLv2 +perf: substantially decreased memory usage in Multi-threading mode, thanks to reports by Tino Reichardt (@mcmilk) +perf: Multi-threading supports up to 256 threads. Cap at 256 when more are requested (#760) +cli : improved and fixed --list command, by @ib (#772) +cli : command -vV to list supported formats, by @ib (#771) +build : fixed binary variants, reported by @svenha (#788) +build : fix Visual compilation for non x86/x64 targets, reported by Greg Slazinski (@GregSlazinski) (#718) +API exp : breaking change : ZSTD_getframeHeader() provides more information +API exp : breaking change : pinned down values of error codes +doc : fixed huffman example, by Ulrich Kunitz (@ulikunitz) +new : contrib/adaptive-compression, I/O driven compression strength, by Paul Cruz (@paulcruz74) +new : contrib/long_distance_matching, statistics by Stella Lau (@stellamplau) +updated : contrib/linux-kernel, by Nick Terrell (@terrelln) + +v1.3.0 +cli : new : `--list` command, by Paul Cruz +cli : changed : xz/lzma support enabled by default +cli : changed : `-t *` continue processing list after a decompression error +API : added : ZSTD_versionString() +API : promoted to stable status : ZSTD_getFrameContentSize(), by Sean Purcell +API exp : new advanced API : ZSTD_compress_generic(), ZSTD_CCtx_setParameter() +API exp : new : API for static or external allocation : ZSTD_initStatic?Ctx() +API exp : added : ZSTD_decompressBegin_usingDDict(), requested by Guy Riddle (#700) +API exp : clarified memory estimation / measurement functions. +API exp : changed : strongest strategy renamed ZSTD_btultra, fastest strategy ZSTD_fast set to 1 +tools : decodecorpus can generate random dictionary-compressed samples, by Paul Cruz +new : contrib/seekable_format, demo and API, by Sean Purcell +changed : contrib/linux-kernel, updated version and license, by Nick Terrell + +v1.2.0 +cli : changed : Multithreading enabled by default (use target zstd-nomt or HAVE_THREAD=0 to disable) +cli : new : command -T0 means "detect and use nb of cores", by Sean Purcell +cli : new : zstdmt symlink hardwired to `zstd -T0` +cli : new : command --threads=# (#671) +cli : changed : cover dictionary builder by default, for improved quality, by Nick Terrell +cli : new : commands --train-cover and --train-legacy, to select dictionary algorithm and parameters +cli : experimental targets `zstd4` and `xzstd4`, with support for lz4 format, by Sean Purcell +cli : fix : does not output compressed data on console +cli : fix : ignore symbolic links unless --force specified, +API : breaking change : ZSTD_createCDict_advanced(), only use compressionParameters as argument +API : added : prototypes ZSTD_*_usingCDict_advanced(), for direct control over frameParameters. +API : improved: ZSTDMT_compressCCtx() reduced memory usage +API : fix : ZSTDMT_compressCCtx() now provides srcSize in header (#634) +API : fix : src size stored in frame header is controlled at end of frame +API : fix : enforced consistent rules for pledgedSrcSize==0 (#641) +API : fix : error code "GENERIC" replaced by "dstSizeTooSmall" when appropriate +build: improved cmake script, by @Majlen +build: enabled Multi-threading support for *BSD, by Baptiste Daroussin +tools: updated Paramgrill. Command -O# provides best parameters for sample and speed target. +new : contrib/linux-kernel version, by Nick Terrell + +v1.1.4 +cli : new : can compress in *.gz format, using --format=gzip command, by Przemyslaw Skibinski +cli : new : advanced benchmark command --priority=rt +cli : fix : write on sparse-enabled file systems in 32-bits mode, by @ds77 +cli : fix : --rm remains silent when input is stdin +cli : experimental : xzstd, with support for xz/lzma decoding, by Przemyslaw Skibinski +speed : improved decompression speed in streaming mode for single shot scenarios (+5%) +memory: DDict (decompression dictionary) memory usage down from 150 KB to 20 KB +arch: 32-bits variant able to generate and decode very long matches (>32 MB), by Sean Purcell +API : new : ZSTD_findFrameCompressedSize(), ZSTD_getFrameContentSize(), ZSTD_findDecompressedSize() +API : changed : dropped support of legacy versions <= v0.3 (can be changed by modifying ZSTD_LEGACY_SUPPORT value) +build : new: meson build system in contrib/meson, by Dima Krasner +build : improved cmake script, by @Majlen +build : added -Wformat-security flag, as recommended by Padraig Brady +doc : new : educational decoder, by Sean Purcell + +v1.1.3 +cli : zstd can decompress .gz files (can be disabled with `make zstd-nogz` or `make HAVE_ZLIB=0`) +cli : new : experimental target `make zstdmt`, with multi-threading support +cli : new : improved dictionary builder "cover" (experimental), by Nick Terrell, based on prior work by Giuseppe Ottaviano. +cli : new : advanced commands for detailed parameters, by Przemyslaw Skibinski +cli : fix zstdless on Mac OS-X, by Andrew Janke +cli : fix #232 "compress non-files" +dictBuilder : improved dictionary generation quality, thanks to Nick Terrell +API : new : lib/compress/ZSTDMT_compress.h multithreading API (experimental) +API : new : ZSTD_create?Dict_byReference(), requested by Bartosz Taudul +API : new : ZDICT_finalizeDictionary() +API : fix : ZSTD_initCStream_usingCDict() properly writes dictID into frame header, by Gregory Szorc (#511) +API : fix : all symbols properly exposed in libzstd, by Nick Terrell +build : support for Solaris target, by Przemyslaw Skibinski +doc : clarified specification, by Sean Purcell + +v1.1.2 +API : streaming : decompression : changed : automatic implicit reset when chain-decoding new frames without init +API : experimental : added : dictID retrieval functions, and ZSTD_initCStream_srcSize() +API : zbuff : changed : prototypes now generate deprecation warnings +lib : improved : faster decompression speed at ultra compression settings and 32-bits mode +lib : changed : only public ZSTD_ symbols are now exposed +lib : changed : reduced usage of stack memory +lib : fixed : several corner case bugs, by Nick Terrell +cli : new : gzstd, experimental version able to decode .gz files, by Przemyslaw Skibinski +cli : new : preserve file attributes +cli : new : added zstdless and zstdgrep tools +cli : fixed : status displays total amount decoded, even for file consisting of multiple frames (like pzstd) +cli : fixed : zstdcat +zlib_wrapper : added support for gz* functions, by Przemyslaw Skibinski +install : better compatibility with FreeBSD, by Dimitry Andric +source tree : changed : zbuff source files moved to lib/deprecated + +v1.1.1 +New : command -M#, --memory=, --memlimit=, --memlimit-decompress= to limit allowed memory consumption +New : doc/zstd_manual.html, by Przemyslaw Skibinski +Improved : slightly better compression ratio at --ultra levels (>= 20) +Improved : better memory usage when using streaming compression API, thanks to @Rogier-5 report +Added : API : ZSTD_initCStream_usingCDict(), ZSTD_initDStream_usingDDict() (experimental section) +Added : example/multiple_streaming_compression.c +Changed : zstd_errors.h is now installed within /include (and replaces errors_public.h) +Updated man page +Fixed : zstd-small, zstd-compress and zstd-decompress compilation targets + +v1.1.0 +New : contrib/pzstd, parallel version of zstd, by Nick Terrell +added : NetBSD install target (#338) +Improved : speed for batches of small files +Improved : speed of zlib wrapper, by Przemyslaw Skibinski +Changed : libzstd on Windows supports legacy formats, by Christophe Chevalier +Fixed : CLI -d output to stdout by default when input is stdin (#322) +Fixed : CLI correctly detects console on Mac OS-X +Fixed : CLI supports recursive mode `-r` on Mac OS-X +Fixed : Legacy decoders use unified error codes, reported by benrg (#341), fixed by Przemyslaw Skibinski +Fixed : compatibility with OpenBSD, reported by Juan Francisco Cantero Hurtado (#319) +Fixed : compatibility with Hurd, by Przemyslaw Skibinski (#365) +Fixed : zstd-pgo, reported by octoploid (#329) + +v1.0.0 +Change Licensing, all project is now BSD, Copyright Facebook +Small decompression speed improvement +API : Streaming API supports legacy format +API : ZDICT_getDictID(), ZSTD_sizeof_{CCtx, DCtx, CStream, DStream}(), ZSTD_setDStreamParamter() +CLI supports legacy formats v0.4+ +Fixed : compression fails on certain huge files, reported by Jesse McGrew +Enhanced documentation, by Przemyslaw Skibinski + +v0.8.1 +New streaming API +Changed : --ultra now enables levels beyond 19 +Changed : -i# now selects benchmark time in second +Fixed : ZSTD_compress* can now compress > 4 GB in a single pass, reported by Nick Terrell +Fixed : speed regression on specific patterns (#272) +Fixed : support for Z_SYNC_FLUSH, by Dmitry Krot (#291) +Fixed : ICC compilation, by Przemyslaw Skibinski + +v0.8.0 +Improved : better speed on clang and gcc -O2, thanks to Eric Biggers +New : Build on FreeBSD and DragonFly, thanks to JrMarino +Changed : modified API : ZSTD_compressEnd() +Fixed : legacy mode with ZSTD_HEAPMODE=0, by Christopher Bergqvist +Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers +Fixed : large dictionaries (> 384 KB), reported by Ilona Papava +Fixed : checksum correctly checked in single-pass mode +Fixed : combined --test amd --rm, reported by Andreas M. Nilsson +Modified : minor compression level adaptations +Updated : compression format specification to v0.2.0 +changed : zstd.h moved to /lib directory + +v0.7.5 +Transition version, supporting decoding of v0.8.x + +v0.7.4 +Added : homebrew for Mac, by Daniel Cade +Added : more examples +Fixed : segfault when using small dictionaries, reported by Felix Handte +Modified : default compression level for CLI is now 3 +Updated : specification, to v0.1.1 + +v0.7.3 +New : compression format specification +New : `--` separator, stating that all following arguments are file names. Suggested by Chip Turner. +New : `ZSTD_getDecompressedSize()` +New : OpenBSD target, by Juan Francisco Cantero Hurtado +New : `examples` directory +fixed : dictBuilder using HC levels, reported by Bartosz Taudul +fixed : legacy support from ZSTD_decompress_usingDDict(), reported by Felix Handte +fixed : multi-blocks decoding with intermediate uncompressed blocks, reported by Greg Slazinski +modified : removed "mem.h" and "error_public.h" dependencies from "zstd.h" (experimental section) +modified : legacy functions no longer need magic number + +v0.7.2 +fixed : ZSTD_decompressBlock() using multiple consecutive blocks. Reported by Greg Slazinski. +fixed : potential segfault on very large files (many gigabytes). Reported by Chip Turner. +fixed : CLI displays system error message when destination file cannot be created (#231). Reported by Chip Turner. + +v0.7.1 +fixed : ZBUFF_compressEnd() called multiple times with too small `dst` buffer, reported by Christophe Chevalier +fixed : dictBuilder fails if first sample is too small, reported by РуÑлан Ковалёв +fixed : corruption issue, reported by cj +modified : checksum enabled by default in command line mode + +v0.7.0 +New : Support for directory compression, using `-r`, thanks to Przemyslaw Skibinski +New : Command `--rm`, to remove source file after successful de/compression +New : Visual build scripts, by Christophe Chevalier +New : Support for Sparse File-systems (do not use space for zero-filled sectors) +New : Frame checksum support +New : Support pass-through mode (when using `-df`) +API : more efficient Dictionary API : `ZSTD_compress_usingCDict()`, `ZSTD_decompress_usingDDict()` +API : create dictionary files from custom content, by Giuseppe Ottaviano +API : support for custom malloc/free functions +New : controllable Dictionary ID +New : Support for skippable frames + +v0.6.1 +New : zlib wrapper API, thanks to Przemyslaw Skibinski +New : Ability to compile compressor / decompressor separately +Changed : new lib directory structure +Fixed : Legacy codec v0.5 compatible with dictionary decompression +Fixed : Decoder corruption error (#173) +Fixed : null-string roundtrip (#176) +New : benchmark mode can select directory as input +Experimental : midipix support, VMS support + +v0.6.0 +Stronger high compression modes, thanks to Przemyslaw Skibinski +API : ZSTD_getFrameParams() provides size of decompressed content +New : highest compression modes require `--ultra` command to fully unleash their capacity +Fixed : zstd cli return error code > 0 and removes dst file artifact when decompression fails, thanks to Chip Turner + +v0.5.1 +New : Optimal parsing => Very high compression modes, thanks to Przemyslaw Skibinski +Changed : Dictionary builder integrated into libzstd and zstd cli +Changed (!) : zstd cli now uses "multiple input files" as default mode. See `zstd -h`. +Fix : high compression modes for big-endian platforms +New : zstd cli : `-t` | `--test` command + +v0.5.0 +New : dictionary builder utility +Changed : streaming & dictionary API +Improved : better compression of small data + +v0.4.7 +Improved : small compression speed improvement in HC mode +Changed : `zstd_decompress.c` has ZSTD_LEGACY_SUPPORT to 0 by default +fix : bt search bug + +v0.4.6 +fix : fast compression mode on Windows +New : cmake configuration file, thanks to Artyom Dymchenko +Improved : high compression mode on repetitive data +New : block-level API +New : ZSTD_duplicateCCtx() + +v0.4.5 +new : -m/--multiple : compress/decompress multiple files + +v0.4.4 +Fixed : high compression modes for Windows 32 bits +new : external dictionary API extended to buffered mode and accessible through command line +new : windows DLL project, thanks to Christophe Chevalier + +v0.4.3 : +new : external dictionary API +new : zstd-frugal + +v0.4.2 : +Generic minor improvements for small blocks +Fixed : big-endian compatibility, by Peter Harris (#85) + +v0.4.1 +Fixed : ZSTD_LEGACY_SUPPORT=0 build mode (reported by Luben) +removed `zstd.c` + +v0.4.0 +Command line utility compatible with high compression levels +Removed zstdhc => merged into zstd +Added : ZBUFF API (see zstd_buffered.h) +Rolling buffer support + +v0.3.6 +small blocks params + +v0.3.5 +minor generic compression improvements + +v0.3.4 +Faster fast cLevels + +v0.3.3 +Small compression ratio improvement *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 9 17:02:21 2017 Return-Path: Delivered-To: svn-src-all@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 7C3B0E560ED; Thu, 9 Nov 2017 17:02:21 +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 562466F5E1; Thu, 9 Nov 2017 17:02:21 +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 vA9H2KUK085699; Thu, 9 Nov 2017 17:02:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9H2Kas085698; Thu, 9 Nov 2017 17:02:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091702.vA9H2Kas085698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 17:02: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: r325599 - stable/10/sys/dev/mlx5/mlx5_ib X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 325599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 17:02:21 -0000 Author: hselasky Date: Thu Nov 9 17:02:20 2017 New Revision: 325599 URL: https://svnweb.freebsd.org/changeset/base/325599 Log: Use MAC-based GID format for the GID table entries in mlx5ib(4) to be compatible with the ibcore module in FreeBSD 10-stable. This fixes RDMA over VLAN, because the MAC-based GID format embeds the VLAN ID into the GID itself and this is what ibcore expects when requesting GID indexes from the GID cache. RoCE V1.5 and V2 is not supported in 10-stable by mlx5ib(4). This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Modified: stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Nov 9 15:43:15 2017 (r325598) +++ stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Nov 9 17:02:20 2017 (r325599) @@ -541,49 +541,32 @@ int mlx5_ib_query_port(struct ib_device *ibdev, u8 por } } -static inline int -mlx5_addrconf_ifid_eui48(u8 *eui, struct net_device *dev) +static void +mlx5_addrconf_ifid_eui48(u8 *eui, u16 vlan_id, struct net_device *dev) { if (dev->if_addrlen != ETH_ALEN) - return -1; + return; + memcpy(eui, IF_LLADDR(dev), 3); memcpy(eui + 5, IF_LLADDR(dev) + 3, 3); - /* NOTE: The scope ID is added by the GID to IP conversion */ - - eui[3] = 0xFF; - eui[4] = 0xFE; + if (vlan_id < 0x1000) { + eui[3] = vlan_id >> 8; + eui[4] = vlan_id & 0xff; + } else { + eui[3] = 0xFF; + eui[4] = 0xFE; + } eui[0] ^= 2; - return 0; } static void mlx5_make_default_gid(struct net_device *dev, union ib_gid *gid) { gid->global.subnet_prefix = cpu_to_be64(0xfe80000000000000LL); - mlx5_addrconf_ifid_eui48(&gid->raw[8], dev); + mlx5_addrconf_ifid_eui48(&gid->raw[8], 0xFFFF, dev); } -static inline int -mlx5_ip2gid(const struct sockaddr *addr, union ib_gid *gid) -{ - switch (addr->sa_family) { - case AF_INET: - ipv6_addr_set_v4mapped(((const struct sockaddr_in *)addr)->sin_addr.s_addr, - (struct in6_addr *)gid->raw); - break; - case AF_INET6: - memcpy(gid->raw, &((const struct sockaddr_in6 *)addr)->sin6_addr, 16); - /* clear SCOPE ID */ - gid->raw[2] = 0; - gid->raw[3] = 0; - break; - default: - return -EINVAL; - } - return 0; -} - static void mlx5_ib_roce_port_update(void *arg) { @@ -593,7 +576,6 @@ mlx5_ib_roce_port_update(void *arg) struct net_device *xdev[MLX5_IB_GID_MAX]; struct net_device *idev; struct net_device *ndev; - struct ifaddr *ifa; union ib_gid gid_temp; while (port->port_gone == 0) { @@ -626,38 +608,36 @@ mlx5_ib_roce_port_update(void *arg) } if (idev != NULL) { TAILQ_FOREACH(idev, &V_ifnet, if_link) { + u16 vid; + if (idev != ndev) { if (idev->if_type != IFT_L2VLAN) continue; if (ndev != rdma_vlan_dev_real_dev(idev)) continue; } - /* clone address information for IPv4 and IPv6 */ - IF_ADDR_RLOCK(idev); - TAILQ_FOREACH(ifa, &idev->if_addrhead, ifa_link) { - if (ifa->ifa_addr == NULL || - (ifa->ifa_addr->sa_family != AF_INET && - ifa->ifa_addr->sa_family != AF_INET6) || - gid_index >= MLX5_IB_GID_MAX) - continue; - memset(&gid_temp, 0, sizeof(gid_temp)); - mlx5_ip2gid(ifa->ifa_addr, &gid_temp); - /* check for existing entry */ - for (j = 0; j != gid_index; j++) { - if (bcmp(&gid_temp, &port->gid_table[j], sizeof(gid_temp)) == 0) - break; + + /* setup valid MAC-based GID */ + memset(&gid_temp, 0, sizeof(gid_temp)); + gid_temp.global.subnet_prefix = cpu_to_be64(0xfe80000000000000LL); + vid = rdma_vlan_dev_vlan_id(idev); + mlx5_addrconf_ifid_eui48(&gid_temp.raw[8], vid, idev); + + /* check for existing entry */ + for (j = 0; j != gid_index; j++) { + if (bcmp(&gid_temp, &port->gid_table[j], sizeof(gid_temp)) == 0) + break; + } + + /* check if new entry should be added */ + if (j == gid_index && gid_index < MLX5_IB_GID_MAX) { + if (bcmp(&gid_temp, &port->gid_table[gid_index], sizeof(gid_temp))) { + port->gid_table[gid_index] = gid_temp; + update = 1; } - /* check if new entry must be added */ - if (j == gid_index) { - if (bcmp(&gid_temp, &port->gid_table[gid_index], sizeof(gid_temp))) { - port->gid_table[gid_index] = gid_temp; - update = 1; - } - xdev[gid_index] = idev; - gid_index++; - } + xdev[gid_index] = idev; + gid_index++; } - IF_ADDR_RUNLOCK(idev); } } IFNET_RUNLOCK(); From owner-svn-src-all@freebsd.org Thu Nov 9 17:47:35 2017 Return-Path: Delivered-To: svn-src-all@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 59B0FE56FE4; Thu, 9 Nov 2017 17:47:35 +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 1FFF670B23; Thu, 9 Nov 2017 17:47:35 +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 vA9HlY6l002663; Thu, 9 Nov 2017 17:47:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9HlYki002662; Thu, 9 Nov 2017 17:47:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091747.vA9HlYki002662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 17:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325600 - stable/11/sys/ofed/include/rdma X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/ofed/include/rdma X-SVN-Commit-Revision: 325600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 17:47:35 -0000 Author: hselasky Date: Thu Nov 9 17:47:33 2017 New Revision: 325600 URL: https://svnweb.freebsd.org/changeset/base/325600 Log: MFC r324492: Make sure the IPv6 scope ID gets zeroed inside the GID. Else searching for a valid GID entry based on IPv6 addresses can fail. Sponsored by: Mellanox Technologies Modified: stable/11/sys/ofed/include/rdma/ib_addr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- stable/11/sys/ofed/include/rdma/ib_addr.h Thu Nov 9 17:02:20 2017 (r325599) +++ stable/11/sys/ofed/include/rdma/ib_addr.h Thu Nov 9 17:47:33 2017 (r325600) @@ -157,6 +157,12 @@ static inline int rdma_ip2gid(struct sockaddr *addr, u case AF_INET6: memcpy(gid->raw, &((struct sockaddr_in6 *)addr)->sin6_addr, 16); + /* make sure scope ID gets zeroed inside GID */ + if (IN6_IS_SCOPE_LINKLOCAL((struct in6_addr *)gid->raw) || + IN6_IS_ADDR_MC_INTFACELOCAL((struct in6_addr *)gid->raw)) { + gid->raw[2] = 0; + gid->raw[3] = 0; + } break; default: return -EINVAL; From owner-svn-src-all@freebsd.org Thu Nov 9 17:49:46 2017 Return-Path: Delivered-To: svn-src-all@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 8377BE5705C; Thu, 9 Nov 2017 17:49:46 +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 5D15C70C93; Thu, 9 Nov 2017 17:49:46 +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 vA9HnjbQ002787; Thu, 9 Nov 2017 17:49:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9HnjEJ002786; Thu, 9 Nov 2017 17:49:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091749.vA9HnjEJ002786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 17:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325601 - stable/11/sys/contrib/rdma/krping X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/contrib/rdma/krping X-SVN-Commit-Revision: 325601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 17:49:46 -0000 Author: hselasky Date: Thu Nov 9 17:49:45 2017 New Revision: 325601 URL: https://svnweb.freebsd.org/changeset/base/325601 Log: MFC r324490: Add support for parsing and using IPv6 addresses in krping. Sponsored by: Mellanox Technologies Modified: stable/11/sys/contrib/rdma/krping/krping.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/11/sys/contrib/rdma/krping/krping.c Thu Nov 9 17:47:33 2017 (r325600) +++ stable/11/sys/contrib/rdma/krping/krping.c Thu Nov 9 17:49:45 2017 (r325601) @@ -85,6 +85,7 @@ static const struct krping_option krping_opts[] = { {"count", OPT_INT, 'C'}, {"size", OPT_INT, 'S'}, {"addr", OPT_STRING, 'a'}, + {"addr6", OPT_STRING, 'A'}, {"port", OPT_INT, 'p'}, {"verbose", OPT_NOPARAM, 'v'}, {"validate", OPT_NOPARAM, 'V'}, @@ -219,7 +220,11 @@ struct krping_cb { struct krping_stats stats; uint16_t port; /* dst port in NBO */ - struct in_addr addr; /* dst addr in NBO */ + union { + struct in_addr v4; + struct in6_addr v6; + } addr; /* dst addr in NBO */ + int addr_type; /* AF_INET or AF_INET6 */ char *addr_str; /* dst addr string */ int verbose; /* verbose logging */ int count; /* ping count */ @@ -1599,15 +1604,31 @@ static int fastreg_supported(struct krping_cb *cb, int static int krping_bind_server(struct krping_cb *cb) { - struct sockaddr_in sin; + union { + struct sockaddr_in v4; + struct sockaddr_in6 v6; + } sin; int ret; memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof sin; - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = cb->addr.s_addr; - sin.sin_port = cb->port; + switch (cb->addr_type) { + case AF_INET: + sin.v4.sin_len = sizeof sin.v4; + sin.v4.sin_family = AF_INET; + sin.v4.sin_addr = cb->addr.v4; + sin.v4.sin_port = cb->port; + break; + case AF_INET6: + sin.v6.sin6_len = sizeof sin.v6; + sin.v6.sin6_family = AF_INET6; + sin.v6.sin6_addr = cb->addr.v6; + sin.v6.sin6_port = cb->port; + break; + default: + return (-EINVAL); + } + ret = rdma_bind_addr(cb->cm_id, (struct sockaddr *) &sin); if (ret) { PRINTF(cb, "rdma_bind_addr error %d\n", ret); @@ -3058,15 +3079,31 @@ static int krping_connect_client(struct krping_cb *cb) static int krping_bind_client(struct krping_cb *cb) { - struct sockaddr_in sin; + union { + struct sockaddr_in v4; + struct sockaddr_in6 v6; + } sin; int ret; memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof sin; - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = cb->addr.s_addr; - sin.sin_port = cb->port; + switch (cb->addr_type) { + case AF_INET: + sin.v4.sin_len = sizeof sin.v4; + sin.v4.sin_family = AF_INET; + sin.v4.sin_addr = cb->addr.v4; + sin.v4.sin_port = cb->port; + break; + case AF_INET6: + sin.v6.sin6_len = sizeof sin.v6; + sin.v6.sin6_family = AF_INET6; + sin.v6.sin6_addr = cb->addr.v6; + sin.v6.sin6_port = cb->port; + break; + default: + return (-EINVAL); + } + ret = rdma_resolve_addr(cb->cm_id, NULL, (struct sockaddr *) &sin, 2000); if (ret) { @@ -3139,12 +3176,29 @@ err1: krping_free_qp(cb); } +static uint16_t +krping_get_ipv6_scope_id(char *name) +{ + struct ifnet *ifp; + uint16_t retval; + + if (name == NULL) + return (0); + ifp = ifunit_ref(name); + if (ifp == NULL) + return (0); + retval = ifp->if_index; + if_rele(ifp); + return (retval); +} + int krping_doit(char *cmd, void *cookie) { struct krping_cb *cb; int op; int ret = 0; char *optarg; + char *scope; unsigned long optint; cb = kzalloc(sizeof(*cb), GFP_KERNEL); @@ -3161,6 +3215,7 @@ int krping_doit(char *cmd, void *cookie) cb->size = 64; cb->txdepth = RPING_SQ_DEPTH; cb->mem = DMA; + cb->addr_type = AF_INET; init_waitqueue_head(&cb->sem); while ((op = krping_getopt("krping", &cmd, krping_opts, NULL, &optarg, @@ -3168,11 +3223,33 @@ int krping_doit(char *cmd, void *cookie) switch (op) { case 'a': cb->addr_str = optarg; - DEBUG_LOG(cb, "ipaddr (%s)\n", optarg); - if (!inet_aton(optarg, &cb->addr)) { + cb->addr_type = AF_INET; + DEBUG_LOG(cb, "ipv4addr (%s)\n", optarg); + if (inet_pton(AF_INET, optarg, &cb->addr) != 1) { PRINTF(cb, "bad addr string %s\n", optarg); ret = EINVAL; + } + break; + case 'A': + cb->addr_str = optarg; + cb->addr_type = AF_INET6; + DEBUG_LOG(cb, "ipv6addr (%s)\n", optarg); + scope = strstr(optarg, "%"); + /* extract scope ID, if any */ + if (scope != NULL) + *scope++ = 0; + /* extract IPv6 network address */ + if (inet_pton(AF_INET6, optarg, &cb->addr) != 1) { + PRINTF(cb, "bad addr string %s\n", + optarg); + ret = EINVAL; + } else if (IN6_IS_SCOPE_LINKLOCAL(&cb->addr.v6) || + IN6_IS_ADDR_MC_INTFACELOCAL(&cb->addr.v6)) { + uint16_t scope_id = krping_get_ipv6_scope_id(scope); + DEBUG_LOG(cb, "ipv6 scope ID = %d\n", scope_id); + cb->addr.v6.s6_addr[2] = scope_id >> 8; + cb->addr.v6.s6_addr[3] = scope_id & 0xFF; } break; case 'p': From owner-svn-src-all@freebsd.org Thu Nov 9 17:51:56 2017 Return-Path: Delivered-To: svn-src-all@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 35FE4E5725E; Thu, 9 Nov 2017 17:51:56 +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 0FFD270FBB; Thu, 9 Nov 2017 17:51:55 +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 vA9HptGl006867; Thu, 9 Nov 2017 17:51:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9HptuU006866; Thu, 9 Nov 2017 17:51:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091751.vA9HptuU006866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 17:51: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: r325602 - stable/10/sys/contrib/rdma/krping X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/contrib/rdma/krping X-SVN-Commit-Revision: 325602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 17:51:56 -0000 Author: hselasky Date: Thu Nov 9 17:51:55 2017 New Revision: 325602 URL: https://svnweb.freebsd.org/changeset/base/325602 Log: MFC r324490: Add support for parsing and using IPv6 addresses in krping. Sponsored by: Mellanox Technologies Modified: stable/10/sys/contrib/rdma/krping/krping.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/10/sys/contrib/rdma/krping/krping.c Thu Nov 9 17:49:45 2017 (r325601) +++ stable/10/sys/contrib/rdma/krping/krping.c Thu Nov 9 17:51:55 2017 (r325602) @@ -82,6 +82,7 @@ static const struct krping_option krping_opts[] = { {"count", OPT_INT, 'C'}, {"size", OPT_INT, 'S'}, {"addr", OPT_STRING, 'a'}, + {"addr6", OPT_STRING, 'A'}, {"port", OPT_INT, 'p'}, {"verbose", OPT_NOPARAM, 'v'}, {"validate", OPT_NOPARAM, 'V'}, @@ -216,7 +217,11 @@ struct krping_cb { struct krping_stats stats; uint16_t port; /* dst port in NBO */ - struct in_addr addr; /* dst addr in NBO */ + union { + struct in_addr v4; + struct in6_addr v6; + } addr; /* dst addr in NBO */ + int addr_type; /* AF_INET or AF_INET6 */ char *addr_str; /* dst addr string */ int verbose; /* verbose logging */ int count; /* ping count */ @@ -1562,15 +1567,31 @@ static int fastreg_supported(struct krping_cb *cb) static int krping_bind_server(struct krping_cb *cb) { - struct sockaddr_in sin; + union { + struct sockaddr_in v4; + struct sockaddr_in6 v6; + } sin; int ret; memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof sin; - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = cb->addr.s_addr; - sin.sin_port = cb->port; + switch (cb->addr_type) { + case AF_INET: + sin.v4.sin_len = sizeof sin.v4; + sin.v4.sin_family = AF_INET; + sin.v4.sin_addr = cb->addr.v4; + sin.v4.sin_port = cb->port; + break; + case AF_INET6: + sin.v6.sin6_len = sizeof sin.v6; + sin.v6.sin6_family = AF_INET6; + sin.v6.sin6_addr = cb->addr.v6; + sin.v6.sin6_port = cb->port; + break; + default: + return (-EINVAL); + } + ret = rdma_bind_addr(cb->cm_id, (struct sockaddr *) &sin); if (ret) { PRINTF(cb, "rdma_bind_addr error %d\n", ret); @@ -2033,15 +2054,31 @@ static int krping_connect_client(struct krping_cb *cb) static int krping_bind_client(struct krping_cb *cb) { - struct sockaddr_in sin; + union { + struct sockaddr_in v4; + struct sockaddr_in6 v6; + } sin; int ret; memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof sin; - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = cb->addr.s_addr; - sin.sin_port = cb->port; + switch (cb->addr_type) { + case AF_INET: + sin.v4.sin_len = sizeof sin.v4; + sin.v4.sin_family = AF_INET; + sin.v4.sin_addr = cb->addr.v4; + sin.v4.sin_port = cb->port; + break; + case AF_INET6: + sin.v6.sin6_len = sizeof sin.v6; + sin.v6.sin6_family = AF_INET6; + sin.v6.sin6_addr = cb->addr.v6; + sin.v6.sin6_port = cb->port; + break; + default: + return (-EINVAL); + } + ret = rdma_resolve_addr(cb->cm_id, NULL, (struct sockaddr *) &sin, 2000); if (ret) { @@ -2114,12 +2151,29 @@ err1: krping_free_qp(cb); } +static uint16_t +krping_get_ipv6_scope_id(char *name) +{ + struct ifnet *ifp; + uint16_t retval; + + if (name == NULL) + return (0); + ifp = ifunit_ref(name); + if (ifp == NULL) + return (0); + retval = ifp->if_index; + if_rele(ifp); + return (retval); +} + int krping_doit(char *cmd, void *cookie) { struct krping_cb *cb; int op; int ret = 0; char *optarg; + char *scope; unsigned long optint; cb = kzalloc(sizeof(*cb), GFP_KERNEL); @@ -2136,6 +2190,7 @@ int krping_doit(char *cmd, void *cookie) cb->size = 64; cb->txdepth = RPING_SQ_DEPTH; cb->mem = DMA; + cb->addr_type = AF_INET; init_waitqueue_head(&cb->sem); while ((op = krping_getopt("krping", &cmd, krping_opts, NULL, &optarg, @@ -2143,11 +2198,33 @@ int krping_doit(char *cmd, void *cookie) switch (op) { case 'a': cb->addr_str = optarg; - DEBUG_LOG(cb, "ipaddr (%s)\n", optarg); - if (!inet_aton(optarg, &cb->addr)) { + cb->addr_type = AF_INET; + DEBUG_LOG(cb, "ipv4addr (%s)\n", optarg); + if (inet_pton(AF_INET, optarg, &cb->addr) != 1) { PRINTF(cb, "bad addr string %s\n", optarg); ret = EINVAL; + } + break; + case 'A': + cb->addr_str = optarg; + cb->addr_type = AF_INET6; + DEBUG_LOG(cb, "ipv6addr (%s)\n", optarg); + scope = strstr(optarg, "%"); + /* extract scope ID, if any */ + if (scope != NULL) + *scope++ = 0; + /* extract IPv6 network address */ + if (inet_pton(AF_INET6, optarg, &cb->addr) != 1) { + PRINTF(cb, "bad addr string %s\n", + optarg); + ret = EINVAL; + } else if (IN6_IS_SCOPE_LINKLOCAL(&cb->addr.v6) || + IN6_IS_ADDR_MC_INTFACELOCAL(&cb->addr.v6)) { + uint16_t scope_id = krping_get_ipv6_scope_id(scope); + DEBUG_LOG(cb, "ipv6 scope ID = %d\n", scope_id); + cb->addr.v6.s6_addr[2] = scope_id >> 8; + cb->addr.v6.s6_addr[3] = scope_id & 0xFF; } break; case 'p': From owner-svn-src-all@freebsd.org Thu Nov 9 17:54:01 2017 Return-Path: Delivered-To: svn-src-all@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 E2132E572E9; Thu, 9 Nov 2017 17:54:01 +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 ADBBC7118A; Thu, 9 Nov 2017 17:54:01 +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 vA9Hs0VT006993; Thu, 9 Nov 2017 17:54:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9Hs08J006992; Thu, 9 Nov 2017 17:54:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091754.vA9Hs08J006992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 17:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325603 - stable/11/sys/dev/mlx5/mlx5_ib X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 325603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 17:54:02 -0000 Author: hselasky Date: Thu Nov 9 17:54:00 2017 New Revision: 325603 URL: https://svnweb.freebsd.org/changeset/base/325603 Log: MFC r324491: Use common rdma_ip2gid() function instead of custom mlx5_ip2gid() one. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Nov 9 17:51:55 2017 (r325602) +++ stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Nov 9 17:54:00 2017 (r325603) @@ -562,26 +562,6 @@ mlx5_make_default_gid(struct net_device *dev, union ib mlx5_addrconf_ifid_eui48(&gid->raw[8], dev); } -static inline int -mlx5_ip2gid(const struct sockaddr *addr, union ib_gid *gid) -{ - switch (addr->sa_family) { - case AF_INET: - ipv6_addr_set_v4mapped(((const struct sockaddr_in *)addr)->sin_addr.s_addr, - (struct in6_addr *)gid->raw); - break; - case AF_INET6: - memcpy(gid->raw, &((const struct sockaddr_in6 *)addr)->sin6_addr, 16); - /* clear SCOPE ID */ - gid->raw[2] = 0; - gid->raw[3] = 0; - break; - default: - return -EINVAL; - } - return 0; -} - static void mlx5_ib_roce_port_update(void *arg) { @@ -639,7 +619,7 @@ mlx5_ib_roce_port_update(void *arg) gid_index >= MLX5_IB_GID_MAX) continue; memset(&gid_temp, 0, sizeof(gid_temp)); - mlx5_ip2gid(ifa->ifa_addr, &gid_temp); + rdma_ip2gid(ifa->ifa_addr, &gid_temp); /* check for existing entry */ for (j = 0; j != gid_index; j++) { if (bcmp(&gid_temp, &port->gid_table[j], sizeof(gid_temp)) == 0) From owner-svn-src-all@freebsd.org Thu Nov 9 17:58:59 2017 Return-Path: Delivered-To: svn-src-all@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 EA4E9E574E3; Thu, 9 Nov 2017 17:58:59 +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 8D5947146A; Thu, 9 Nov 2017 17:58:59 +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 vA9HwwYI007229; Thu, 9 Nov 2017 17:58:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9Hwva2007220; Thu, 9 Nov 2017 17:58:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091758.vA9Hwva2007220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 17:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325604 - in stable/11/sys: dev/cxgbe/iw_cxgbe dev/mlx5/mlx5_ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/hw/mthca ofed/include/rdma X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: dev/cxgbe/iw_cxgbe dev/mlx5/mlx5_ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/hw/mthca ofed/include/rdma X-SVN-Commit-Revision: 325604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 17:59:00 -0000 Author: hselasky Date: Thu Nov 9 17:58:57 2017 New Revision: 325604 URL: https://svnweb.freebsd.org/changeset/base/325604 Log: MFC r324792: The remote DMA TCP portspace selector, RDMA_PS_TCP, is used for both iWarp and RoCE in ibcore. The selection of RDMA_PS_TCP can not be used to indicate iWarp protocol use. Backport the proper IB device capabilities from Linux upstream to distinguish between iWarp and RoCE. Only allocate the additional socket required for iWarp for RDMA IDs when at least one iWarp device present. This resolves interopability issues between iWarp and RoCE in ibcore Reviewed by: np @ Differential Revision: https://reviews.freebsd.org/D12563 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/provider.c stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c stable/11/sys/ofed/drivers/infiniband/core/cma.c stable/11/sys/ofed/drivers/infiniband/core/device.c stable/11/sys/ofed/drivers/infiniband/hw/mlx4/main.c stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c stable/11/sys/ofed/include/rdma/ib_mad.h stable/11/sys/ofed/include/rdma/ib_verbs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/provider.c Thu Nov 9 17:54:00 2017 (r325603) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/provider.c Thu Nov 9 17:58:57 2017 (r325604) @@ -388,6 +388,24 @@ c4iw_query_port(struct ib_device *ibdev, u8 port, stru return 0; } +static int c4iw_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + int err; + + immutable->core_cap_flags = RDMA_CORE_PORT_IWARP; + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + + return 0; +} + /* * Returns -errno on error. */ @@ -471,6 +489,7 @@ c4iw_register_device(struct c4iw_dev *dev) ibdev->post_send = c4iw_post_send; ibdev->post_recv = c4iw_post_receive; ibdev->uverbs_abi_ver = C4IW_UVERBS_ABI_VERSION; + ibdev->get_port_immutable = c4iw_port_immutable; iwcm = kmalloc(sizeof(*iwcm), GFP_KERNEL); if (iwcm == NULL) Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Nov 9 17:54:00 2017 (r325603) +++ stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Nov 9 17:58:57 2017 (r325604) @@ -1670,6 +1670,57 @@ static void destroy_dev_resources(struct mlx5_ib_resou mlx5_ib_dealloc_pd(devr->p0); } +static u32 get_core_cap_flags(struct ib_device *ibdev) +{ + struct mlx5_ib_dev *dev = to_mdev(ibdev); + enum rdma_link_layer ll = mlx5_ib_port_link_layer(ibdev, 1); + u8 l3_type_cap = MLX5_CAP_ROCE(dev->mdev, l3_type); + u8 roce_version_cap = MLX5_CAP_ROCE(dev->mdev, roce_version); + u32 ret = 0; + + if (ll == IB_LINK_LAYER_INFINIBAND) + return RDMA_CORE_PORT_IBA_IB; + + ret = RDMA_CORE_PORT_RAW_PACKET; + + if (!(l3_type_cap & MLX5_ROCE_L3_TYPE_IPV4_CAP)) + return ret; + + if (!(l3_type_cap & MLX5_ROCE_L3_TYPE_IPV6_CAP)) + return ret; + + if (roce_version_cap & MLX5_ROCE_VERSION_1_CAP) + ret |= RDMA_CORE_PORT_IBA_ROCE; + + if (roce_version_cap & MLX5_ROCE_VERSION_2_CAP) + ret |= RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP; + + return ret; +} + +static int mlx5_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + struct mlx5_ib_dev *dev = to_mdev(ibdev); + enum rdma_link_layer ll = mlx5_ib_port_link_layer(ibdev, port_num); + int err; + + immutable->core_cap_flags = get_core_cap_flags(ibdev); + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + immutable->core_cap_flags = get_core_cap_flags(ibdev); + if ((ll == IB_LINK_LAYER_INFINIBAND) || MLX5_CAP_GEN(dev->mdev, roce)) + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + + return 0; +} + static void enable_dc_tracer(struct mlx5_ib_dev *dev) { struct device *device = dev->ib_dev.dma_device; @@ -2115,6 +2166,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) dev->ib_dev.attach_mcast = mlx5_ib_mcg_attach; dev->ib_dev.detach_mcast = mlx5_ib_mcg_detach; dev->ib_dev.process_mad = mlx5_ib_process_mad; + dev->ib_dev.get_port_immutable = mlx5_port_immutable; dev->ib_dev.alloc_fast_reg_mr = mlx5_ib_alloc_fast_reg_mr; dev->ib_dev.alloc_fast_reg_page_list = mlx5_ib_alloc_fast_reg_page_list; dev->ib_dev.free_fast_reg_page_list = mlx5_ib_free_fast_reg_page_list; Modified: stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Thu Nov 9 17:54:00 2017 (r325603) +++ stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Thu Nov 9 17:58:57 2017 (r325604) @@ -1576,7 +1576,7 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, cons int gid_type; if ((ll == IB_LINK_LAYER_ETHERNET) || (ah->ah_flags & IB_AH_GRH)) { - int len = dev->ib_dev.gid_tbl_len[port - 1]; + int len = dev->mdev->port_caps[port - 1].gid_table_len; if (ah->grh.sgid_index >= len) { printf("mlx5_ib: ERR: ""sgid_index (%u) too large. max is %d\n", ah->grh.sgid_index, len - 1); return -EINVAL; Modified: stable/11/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 17:54:00 2017 (r325603) +++ stable/11/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 17:58:57 2017 (r325604) @@ -75,11 +75,6 @@ static int def_prec2sl = 3; module_param_named(def_prec2sl, def_prec2sl, int, 0644); MODULE_PARM_DESC(def_prec2sl, "Default value for SL priority with RoCE. Valid values 0 - 7"); -static int unify_tcp_port_space = 1; -module_param(unify_tcp_port_space, int, 0644); -MODULE_PARM_DESC(unify_tcp_port_space, "Unify the host TCP and RDMA port " - "space allocation (default=1)"); - static int debug_level = 0; #define cma_pr(level, priv, format, arg...) \ printk(level "CMA: %p: %s: " format, ((struct rdma_id_priv *) priv) , __func__, ## arg) @@ -198,6 +193,7 @@ struct rdma_id_private { /* cache for mc record params */ struct ib_sa_mcmember_rec rec; int is_valid_rec; + int unify_ps_tcp; }; struct cma_multicast { @@ -799,29 +795,24 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib int ret = 0; id_priv = container_of(id, struct rdma_id_private, id); - switch (rdma_node_get_transport(id_priv->id.device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (!id_priv->cm_id.ib || (id_priv->id.qp_type == IB_QPT_UD)) ret = cma_ib_init_qp_attr(id_priv, qp_attr, qp_attr_mask); else ret = ib_cm_init_qp_attr(id_priv->cm_id.ib, qp_attr, qp_attr_mask); + if (qp_attr->qp_state == IB_QPS_RTR) qp_attr->rq_psn = id_priv->seq_num; - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) { if (!id_priv->cm_id.iw) { qp_attr->qp_access_flags = 0; *qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS; } else ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr, qp_attr_mask); - break; - default: + } else ret = -ENOSYS; - break; - } return ret; } @@ -1082,6 +1073,10 @@ static void __rdma_free(struct work_struct *work) if (id_priv->internal_id) cma_deref_id(id_priv->id.context); + if (id_priv->sock != NULL && !id_priv->internal_id && + !id_priv->unify_ps_tcp) + sock_release(id_priv->sock); + kfree(id_priv->id.route.path_rec); kfree(id_priv); } @@ -1105,8 +1100,7 @@ void rdma_destroy_id(struct rdma_cm_id *id) mutex_unlock(&id_priv->handler_mutex); if (id_priv->cma_dev) { - switch (rdma_node_get_transport(id_priv->id.device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id_priv->id.device, 1)) { spin_lock_irqsave(&id_priv->cm_lock, flags); if (id_priv->cm_id.ib && !IS_ERR(id_priv->cm_id.ib)) { ib = id_priv->cm_id.ib; @@ -1115,14 +1109,9 @@ void rdma_destroy_id(struct rdma_cm_id *id) ib_destroy_cm_id(ib); } else spin_unlock_irqrestore(&id_priv->cm_lock, flags); - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id_priv->id.device, 1)) { if (id_priv->cm_id.iw) iw_destroy_cm_id(id_priv->cm_id.iw); - break; - default: - break; } cma_leave_mc_groups(id_priv); cma_release_dev(id_priv); @@ -2118,27 +2107,15 @@ int rdma_resolve_route(struct rdma_cm_id *id, int time return -EINVAL; atomic_inc(&id_priv->refcount); - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: - switch (rdma_port_get_link_layer(id->device, id->port_num)) { - case IB_LINK_LAYER_INFINIBAND: - ret = cma_resolve_ib_route(id_priv, timeout_ms); - break; - case IB_LINK_LAYER_ETHERNET: - ret = cma_resolve_iboe_route(id_priv); - break; - default: - ret = -ENOSYS; - } - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + if (rdma_cap_ib_sa(id->device, id->port_num)) + ret = cma_resolve_ib_route(id_priv, timeout_ms); + else if (rdma_protocol_roce(id->device, id->port_num)) + ret = cma_resolve_iboe_route(id_priv); + else if (rdma_protocol_iwarp(id->device, id->port_num)) ret = cma_resolve_iw_route(id_priv, timeout_ms); - break; - default: + else ret = -ENOSYS; - break; - } + if (ret) goto err; @@ -2585,6 +2562,10 @@ static int cma_get_tcp_port(struct rdma_id_private *id (struct sockaddr *) &id_priv->id.route.addr.src_addr, ip_addr_size((struct sockaddr *) &id_priv->id.route.addr.src_addr)); #else + SOCK_LOCK(sock); + sock->so_options |= SO_REUSEADDR; + SOCK_UNLOCK(sock); + ret = -sobind(sock, (struct sockaddr *)&id_priv->id.route.addr.src_addr, curthread); @@ -2609,6 +2590,7 @@ static int cma_get_tcp_port(struct rdma_id_private *id static int cma_get_port(struct rdma_id_private *id_priv) { + struct cma_device *cma_dev; struct idr *ps; int ret; @@ -2618,7 +2600,18 @@ static int cma_get_port(struct rdma_id_private *id_pri break; case RDMA_PS_TCP: ps = &tcp_ps; - if (unify_tcp_port_space) { + + mutex_lock(&lock); + /* check if there are any iWarp IB devices present */ + list_for_each_entry(cma_dev, &dev_list, list) { + if (rdma_protocol_iwarp(cma_dev->device, 1)) { + id_priv->unify_ps_tcp = 1; + break; + } + } + mutex_unlock(&lock); + + if (id_priv->unify_ps_tcp) { ret = cma_get_tcp_port(id_priv); if (ret) goto out; @@ -2690,19 +2683,15 @@ int rdma_listen(struct rdma_cm_id *id, int backlog) id_priv->backlog = backlog; if (id->device) { - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, 1)) { ret = cma_ib_listen(id_priv); if (ret) goto err; - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, 1)) { ret = cma_iw_listen(id_priv, backlog); if (ret) goto err; - break; - default: + } else { ret = -ENOSYS; goto err; } @@ -3071,21 +3060,15 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_co id_priv->srq = conn_param->srq; } - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (id->qp_type == IB_QPT_UD) ret = cma_resolve_ib_udp(id_priv, conn_param); else ret = cma_connect_ib(id_priv, conn_param); - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) ret = cma_connect_iw(id_priv, conn_param); - break; - default: + else ret = -ENOSYS; - break; - } if (ret) goto err; @@ -3191,8 +3174,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_con id_priv->srq = conn_param->srq; } - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (id->qp_type == IB_QPT_UD) { if (conn_param) ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS, @@ -3207,15 +3189,10 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_con else ret = cma_rep_recv(id_priv); } - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) ret = cma_accept_iw(id_priv, conn_param); - break; - default: + else ret = -ENOSYS; - break; - } if (ret) goto reject; @@ -3259,8 +3236,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *pri if (!id_priv->cm_id.ib) return -EINVAL; - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (id->qp_type == IB_QPT_UD) ret = cma_send_sidr_rep(id_priv, IB_SIDR_REJECT, private_data, private_data_len); @@ -3270,16 +3246,12 @@ int rdma_reject(struct rdma_cm_id *id, const void *pri IB_CM_REJ_CONSUMER_DEFINED, NULL, 0, private_data, private_data_len); } - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) { ret = iw_cm_reject(id_priv->cm_id.iw, private_data, private_data_len); - break; - default: + } else ret = -ENOSYS; - break; - } + return ret; } EXPORT_SYMBOL(rdma_reject); @@ -3293,8 +3265,7 @@ int rdma_disconnect(struct rdma_cm_id *id) if (!id_priv->cm_id.ib) return -EINVAL; - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { ret = cma_modify_qp_err(id_priv); if (ret) goto out; @@ -3304,15 +3275,11 @@ int rdma_disconnect(struct rdma_cm_id *id) cma_dbg(id_priv, "sending DREP\n"); ib_send_cm_drep(id_priv->cm_id.ib, NULL, 0); } - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) { ret = iw_cm_disconnect(id_priv->cm_id.iw, 0); - break; - default: + } else ret = -EINVAL; - break; - } + out: return ret; } Modified: stable/11/sys/ofed/drivers/infiniband/core/device.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/device.c Thu Nov 9 17:54:00 2017 (r325603) +++ stable/11/sys/ofed/drivers/infiniband/core/device.c Thu Nov 9 17:58:57 2017 (r325604) @@ -90,7 +90,8 @@ static int ib_device_check_mandatory(struct ib_device IB_MANDATORY_FUNC(poll_cq), IB_MANDATORY_FUNC(req_notify_cq), IB_MANDATORY_FUNC(get_dma_mr), - IB_MANDATORY_FUNC(dereg_mr) + IB_MANDATORY_FUNC(dereg_mr), + IB_MANDATORY_FUNC(get_port_immutable) }; int i; @@ -149,13 +150,13 @@ static int alloc_name(char *name) return 0; } -static int start_port(struct ib_device *device) +static int rdma_start_port(struct ib_device *device) { return (device->node_type == RDMA_NODE_IB_SWITCH) ? 0 : 1; } -static int end_port(struct ib_device *device) +static int rdma_end_port(struct ib_device *device) { return (device->node_type == RDMA_NODE_IB_SWITCH) ? 0 : device->phys_port_cnt; @@ -193,6 +194,7 @@ EXPORT_SYMBOL(ib_alloc_device); void ib_dealloc_device(struct ib_device *device) { if (device->reg_state == IB_DEV_UNINITIALIZED) { + kfree(device->port_immutable); kfree(device); return; } @@ -225,43 +227,42 @@ static int add_client_context(struct ib_device *device return 0; } -static int read_port_table_lengths(struct ib_device *device) +static int verify_immutable(const struct ib_device *dev, u8 port) { - struct ib_port_attr *tprops = NULL; - int num_ports, ret = -ENOMEM; - u8 port_index; + return WARN_ON(!rdma_cap_ib_mad(dev, port) && + rdma_max_mad_size(dev, port) != 0); +} - tprops = kmalloc(sizeof *tprops, GFP_KERNEL); - if (!tprops) - goto out; +static int read_port_immutable(struct ib_device *device) +{ + int ret; + u8 start_port = rdma_start_port(device); + u8 end_port = rdma_end_port(device); + u8 port; - num_ports = end_port(device) - start_port(device) + 1; + /** + * device->port_immutable is indexed directly by the port number to make + * access to this data as efficient as possible. + * + * Therefore port_immutable is declared as a 1 based array with + * potential empty slots at the beginning. + */ + device->port_immutable = kzalloc(sizeof(*device->port_immutable) + * (end_port + 1), + GFP_KERNEL); + if (!device->port_immutable) + return -ENOMEM; - device->pkey_tbl_len = kmalloc(sizeof *device->pkey_tbl_len * num_ports, - GFP_KERNEL); - device->gid_tbl_len = kmalloc(sizeof *device->gid_tbl_len * num_ports, - GFP_KERNEL); - if (!device->pkey_tbl_len || !device->gid_tbl_len) - goto err; - - for (port_index = 0; port_index < num_ports; ++port_index) { - ret = ib_query_port(device, port_index + start_port(device), - tprops); + for (port = start_port; port <= end_port; ++port) { + ret = device->get_port_immutable(device, port, + &device->port_immutable[port]); if (ret) - goto err; - device->pkey_tbl_len[port_index] = tprops->pkey_tbl_len; - device->gid_tbl_len[port_index] = tprops->gid_tbl_len; - } + return ret; - ret = 0; - goto out; - -err: - kfree(device->gid_tbl_len); - kfree(device->pkey_tbl_len); -out: - kfree(tprops); - return ret; + if (verify_immutable(device, port)) + return -EINVAL; + } + return 0; } /** @@ -297,10 +298,11 @@ int ib_register_device(struct ib_device *device, spin_lock_init(&device->event_handler_lock); spin_lock_init(&device->client_data_lock); - ret = read_port_table_lengths(device); + + ret = read_port_immutable(device); if (ret) { - printk(KERN_WARNING "Couldn't create table lengths cache for device %s\n", - device->name); + printk(KERN_WARNING "Couldn't create per port immutable data %s\n", + device->name); goto out; } @@ -308,8 +310,7 @@ int ib_register_device(struct ib_device *device, if (ret) { printk(KERN_WARNING "Couldn't register device %s with driver model\n", device->name); - kfree(device->gid_tbl_len); - kfree(device->pkey_tbl_len); + kfree(device->port_immutable); goto out; } @@ -351,9 +352,6 @@ void ib_unregister_device(struct ib_device *device) list_del(&device->core_list); - kfree(device->gid_tbl_len); - kfree(device->pkey_tbl_len); - mutex_unlock(&device_mutex); ib_device_unregister_sysfs(device); @@ -578,7 +576,7 @@ int ib_query_port(struct ib_device *device, u8 port_num, struct ib_port_attr *port_attr) { - if (port_num < start_port(device) || port_num > end_port(device)) + if (port_num < rdma_start_port(device) || port_num > rdma_end_port(device)) return -EINVAL; return device->query_port(device, port_num, port_attr); @@ -656,7 +654,7 @@ int ib_modify_port(struct ib_device *device, if (!device->modify_port) return -ENOSYS; - if (port_num < start_port(device) || port_num > end_port(device)) + if (port_num < rdma_start_port(device) || port_num > rdma_end_port(device)) return -EINVAL; return device->modify_port(device, port_num, port_modify_mask, @@ -679,8 +677,8 @@ int ib_find_gid(struct ib_device *device, union ib_gid union ib_gid tmp_gid; int ret, port, i; - for (port = start_port(device); port <= end_port(device); ++port) { - for (i = 0; i < device->gid_tbl_len[port - start_port(device)]; ++i) { + for (port = rdma_start_port(device); port <= rdma_end_port(device); ++port) { + for (i = 0; i < device->port_immutable[port].gid_tbl_len; ++i) { ret = ib_query_gid(device, port, i, &tmp_gid); if (ret) return ret; @@ -712,7 +710,7 @@ int ib_find_pkey(struct ib_device *device, u16 tmp_pkey; int partial_ix = -1; - for (i = 0; i < device->pkey_tbl_len[port_num - start_port(device)]; ++i) { + for (i = 0; i < device->port_immutable[port_num].pkey_tbl_len; ++i) { ret = ib_query_pkey(device, port_num, i, &tmp_pkey); if (ret) return ret; Modified: stable/11/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/hw/mlx4/main.c Thu Nov 9 17:54:00 2017 (r325603) +++ stable/11/sys/ofed/drivers/infiniband/hw/mlx4/main.c Thu Nov 9 17:58:57 2017 (r325604) @@ -2230,6 +2230,38 @@ static int mlx4_ib_dev_idx(struct mlx4_dev *dev) return -1; } +static int mlx4_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + struct mlx4_ib_dev *mdev = to_mdev(ibdev); + int err; + + if (mlx4_ib_port_link_layer(ibdev, port_num) == IB_LINK_LAYER_INFINIBAND) { + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_IB; + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + } else { + if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE) + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE; + if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCEV2) + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE | + RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP; + immutable->core_cap_flags |= RDMA_CORE_PORT_RAW_PACKET; + if (immutable->core_cap_flags & (RDMA_CORE_PORT_IBA_ROCE | + RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP)) + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + } + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + + return 0; +} + static void *mlx4_ib_add(struct mlx4_dev *dev) { struct mlx4_ib_dev *ibdev; @@ -2361,6 +2393,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ibdev->ib_dev.attach_mcast = mlx4_ib_mcg_attach; ibdev->ib_dev.detach_mcast = mlx4_ib_mcg_detach; ibdev->ib_dev.process_mad = mlx4_ib_process_mad; + ibdev->ib_dev.get_port_immutable = mlx4_port_immutable; ibdev->ib_dev.get_netdev = mlx4_ib_get_netdev; ibdev->ib_dev.ioctl = mlx4_ib_ioctl; ibdev->ib_dev.query_values = mlx4_ib_query_values; Modified: stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c Thu Nov 9 17:54:00 2017 (r325603) +++ stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c Thu Nov 9 17:58:57 2017 (r325604) @@ -1297,6 +1297,25 @@ out: return err; } +static int mthca_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + int err; + + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_IB; + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + + return 0; +} + int mthca_register_device(struct mthca_dev *dev) { int ret; @@ -1376,6 +1395,7 @@ int mthca_register_device(struct mthca_dev *dev) dev->ib_dev.reg_phys_mr = mthca_reg_phys_mr; dev->ib_dev.reg_user_mr = mthca_reg_user_mr; dev->ib_dev.dereg_mr = mthca_dereg_mr; + dev->ib_dev.get_port_immutable = mthca_port_immutable; if (dev->mthca_flags & MTHCA_FLAG_FMR) { dev->ib_dev.alloc_fmr = mthca_alloc_fmr; Modified: stable/11/sys/ofed/include/rdma/ib_mad.h ============================================================================== --- stable/11/sys/ofed/include/rdma/ib_mad.h Thu Nov 9 17:54:00 2017 (r325603) +++ stable/11/sys/ofed/include/rdma/ib_mad.h Thu Nov 9 17:58:57 2017 (r325604) @@ -134,6 +134,7 @@ enum { IB_MGMT_SA_DATA = 200, IB_MGMT_DEVICE_HDR = 64, IB_MGMT_DEVICE_DATA = 192, + IB_MGMT_MAD_SIZE = IB_MGMT_MAD_HDR + IB_MGMT_MAD_DATA, }; struct ib_mad_hdr { Modified: stable/11/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- stable/11/sys/ofed/include/rdma/ib_verbs.h Thu Nov 9 17:54:00 2017 (r325603) +++ stable/11/sys/ofed/include/rdma/ib_verbs.h Thu Nov 9 17:58:57 2017 (r325604) @@ -348,6 +348,56 @@ union rdma_protocol_stats { struct iw_protocol_stats iw; }; +/* Define bits for the various functionality this port needs to be supported by + * the core. + */ +/* Management 0x00000FFF */ +#define RDMA_CORE_CAP_IB_MAD 0x00000001 +#define RDMA_CORE_CAP_IB_SMI 0x00000002 +#define RDMA_CORE_CAP_IB_CM 0x00000004 +#define RDMA_CORE_CAP_IW_CM 0x00000008 +#define RDMA_CORE_CAP_IB_SA 0x00000010 +#define RDMA_CORE_CAP_OPA_MAD 0x00000020 + +/* Address format 0x000FF000 */ +#define RDMA_CORE_CAP_AF_IB 0x00001000 +#define RDMA_CORE_CAP_ETH_AH 0x00002000 +#define RDMA_CORE_CAP_OPA_AH 0x00004000 + +/* Protocol 0xFFF00000 */ +#define RDMA_CORE_CAP_PROT_IB 0x00100000 +#define RDMA_CORE_CAP_PROT_ROCE 0x00200000 +#define RDMA_CORE_CAP_PROT_IWARP 0x00400000 +#define RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP 0x00800000 +#define RDMA_CORE_CAP_PROT_RAW_PACKET 0x01000000 +#define RDMA_CORE_CAP_PROT_USNIC 0x02000000 + +#define RDMA_CORE_PORT_IBA_IB (RDMA_CORE_CAP_PROT_IB \ + | RDMA_CORE_CAP_IB_MAD \ + | RDMA_CORE_CAP_IB_SMI \ + | RDMA_CORE_CAP_IB_CM \ + | RDMA_CORE_CAP_IB_SA \ + | RDMA_CORE_CAP_AF_IB) +#define RDMA_CORE_PORT_IBA_ROCE (RDMA_CORE_CAP_PROT_ROCE \ + | RDMA_CORE_CAP_IB_MAD \ + | RDMA_CORE_CAP_IB_CM \ + | RDMA_CORE_CAP_AF_IB \ + | RDMA_CORE_CAP_ETH_AH) +#define RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP \ + (RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP \ + | RDMA_CORE_CAP_IB_MAD \ + | RDMA_CORE_CAP_IB_CM \ + | RDMA_CORE_CAP_AF_IB \ + | RDMA_CORE_CAP_ETH_AH) +#define RDMA_CORE_PORT_IWARP (RDMA_CORE_CAP_PROT_IWARP \ + | RDMA_CORE_CAP_IW_CM) +#define RDMA_CORE_PORT_INTEL_OPA (RDMA_CORE_PORT_IBA_IB \ + | RDMA_CORE_CAP_OPA_MAD) + +#define RDMA_CORE_PORT_RAW_PACKET (RDMA_CORE_CAP_PROT_RAW_PACKET) + +#define RDMA_CORE_PORT_USNIC (RDMA_CORE_CAP_PROT_USNIC) + struct ib_port_attr { enum ib_port_state state; enum ib_mtu max_mtu; @@ -1623,6 +1673,14 @@ struct ib_dma_mapping_ops { }; struct iw_cm_verbs; + +struct ib_port_immutable { + int pkey_tbl_len; + int gid_tbl_len; + u32 core_cap_flags; + u32 max_mad_size; +}; + struct ib_exp_device_attr; struct ib_exp_qp_init_attr; @@ -1639,8 +1697,10 @@ struct ib_device { struct list_head client_data_list; struct ib_cache cache; - int *pkey_tbl_len; - int *gid_tbl_len; + /** + * port_immutable is indexed by port number + */ + struct ib_port_immutable *port_immutable; int num_comp_vectors; @@ -1845,6 +1905,15 @@ struct ib_device { u32 cmd_n; spinlock_t cmd_perf_lock; + + /** + * The following mandatory functions are used only at device + * registration. Keep functions such as these at the end of this + * structure to avoid cache line misses when accessing struct ib_device + * in fast paths. + */ + int (*get_port_immutable)(struct ib_device *, u8, struct ib_port_immutable *); + /* * Experimental data and functions */ @@ -1927,6 +1996,252 @@ int ib_query_port(struct ib_device *device, enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_num); + +static inline bool rdma_protocol_ib(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IB; +} + +static inline bool rdma_protocol_roce(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & + (RDMA_CORE_CAP_PROT_ROCE | RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP); +} + +static inline bool rdma_protocol_roce_udp_encap(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP; +} + +static inline bool rdma_protocol_roce_eth_encap(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_ROCE; +} + +static inline bool rdma_protocol_iwarp(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IWARP; +} + +static inline bool rdma_ib_or_roce(const struct ib_device *device, u8 port_num) +{ + return rdma_protocol_ib(device, port_num) || + rdma_protocol_roce(device, port_num); +} + +/** + * rdma_cap_ib_mad - Check if the port of a device supports Infiniband + * Management Datagrams. + * @device: Device to check + * @port_num: Port number to check + * + * Management Datagrams (MAD) are a required part of the InfiniBand + * specification and are supported on all InfiniBand devices. A slightly + * extended version are also supported on OPA interfaces. + * + * Return: true if the port supports sending/receiving of MAD packets. + */ +static inline bool rdma_cap_ib_mad(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_MAD; +} + +/** + * rdma_cap_opa_mad - Check if the port of device provides support for OPA + * Management Datagrams. + * @device: Device to check + * @port_num: Port number to check + * + * Intel OmniPath devices extend and/or replace the InfiniBand Management + * datagrams with their own versions. These OPA MADs share many but not all of + * the characteristics of InfiniBand MADs. + * + * OPA MADs differ in the following ways: + * + * 1) MADs are variable size up to 2K + * IBTA defined MADs remain fixed at 256 bytes + * 2) OPA SMPs must carry valid PKeys + * 3) OPA SMP packets are a different format + * + * Return: true if the port supports OPA MAD packet formats. + */ +static inline bool rdma_cap_opa_mad(struct ib_device *device, u8 port_num) +{ + return (device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_OPA_MAD) + == RDMA_CORE_CAP_OPA_MAD; +} + +/** + * rdma_cap_ib_smi - Check if the port of a device provides an Infiniband + * Subnet Management Agent (SMA) on the Subnet Management Interface (SMI). + * @device: Device to check + * @port_num: Port number to check + * + * Each InfiniBand node is required to provide a Subnet Management Agent + * that the subnet manager can access. Prior to the fabric being fully + * configured by the subnet manager, the SMA is accessed via a well known + * interface called the Subnet Management Interface (SMI). This interface + * uses directed route packets to communicate with the SM to get around the + * chicken and egg problem of the SM needing to know what's on the fabric + * in order to configure the fabric, and needing to configure the fabric in + * order to send packets to the devices on the fabric. These directed + * route packets do not need the fabric fully configured in order to reach + * their destination. The SMI is the only method allowed to send + * directed route packets on an InfiniBand fabric. + * + * Return: true if the port provides an SMI. + */ +static inline bool rdma_cap_ib_smi(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SMI; +} + +/** + * rdma_cap_ib_cm - Check if the port of device has the capability Infiniband + * Communication Manager. + * @device: Device to check + * @port_num: Port number to check + * + * The InfiniBand Communication Manager is one of many pre-defined General + * Service Agents (GSA) that are accessed via the General Service + * Interface (GSI). It's role is to facilitate establishment of connections + * between nodes as well as other management related tasks for established + * connections. + * + * Return: true if the port supports an IB CM (this does not guarantee that + * a CM is actually running however). + */ +static inline bool rdma_cap_ib_cm(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_CM; +} + +/** + * rdma_cap_iw_cm - Check if the port of device has the capability IWARP + * Communication Manager. + * @device: Device to check + * @port_num: Port number to check + * + * Similar to above, but specific to iWARP connections which have a different + * managment protocol than InfiniBand. + * + * Return: true if the port supports an iWARP CM (this does not guarantee that + * a CM is actually running however). + */ +static inline bool rdma_cap_iw_cm(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IW_CM; +} + +/** + * rdma_cap_ib_sa - Check if the port of device has the capability Infiniband + * Subnet Administration. + * @device: Device to check + * @port_num: Port number to check + * + * An InfiniBand Subnet Administration (SA) service is a pre-defined General + * Service Agent (GSA) provided by the Subnet Manager (SM). On InfiniBand + * fabrics, devices should resolve routes to other hosts by contacting the + * SA to query the proper route. + * + * Return: true if the port should act as a client to the fabric Subnet + * Administration interface. This does not imply that the SA service is + * running locally. + */ +static inline bool rdma_cap_ib_sa(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SA; +} + +/** + * rdma_cap_ib_mcast - Check if the port of device has the capability Infiniband + * Multicast. + * @device: Device to check + * @port_num: Port number to check + * + * InfiniBand multicast registration is more complex than normal IPv4 or + * IPv6 multicast registration. Each Host Channel Adapter must register + * with the Subnet Manager when it wishes to join a multicast group. It + * should do so only once regardless of how many queue pairs it subscribes + * to this group. And it should leave the group only after all queue pairs + * attached to the group have been detached. + * + * Return: true if the port must undertake the additional adminstrative + * overhead of registering/unregistering with the SM and tracking of the + * total number of queue pairs attached to the multicast group. + */ +static inline bool rdma_cap_ib_mcast(const struct ib_device *device, u8 port_num) +{ + return rdma_cap_ib_sa(device, port_num); +} + +/** + * rdma_cap_af_ib - Check if the port of device has the capability + * Native Infiniband Address. + * @device: Device to check + * @port_num: Port number to check + * + * InfiniBand addressing uses a port's GUID + Subnet Prefix to make a default + * GID. RoCE uses a different mechanism, but still generates a GID via + * a prescribed mechanism and port specific data. + * + * Return: true if the port uses a GID address to identify devices on the + * network. + */ +static inline bool rdma_cap_af_ib(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_AF_IB; +} + +/** + * rdma_cap_eth_ah - Check if the port of device has the capability *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 9 18:06:19 2017 Return-Path: Delivered-To: svn-src-all@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 6A234E57822; Thu, 9 Nov 2017 18:06:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36DA771A9B; Thu, 9 Nov 2017 18:06:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9I6Ia9011627; Thu, 9 Nov 2017 18:06:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9I6ISI011626; Thu, 9 Nov 2017 18:06:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711091806.vA9I6ISI011626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 9 Nov 2017 18:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r325605 - vendor-sys/illumos/dist/common/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: avg X-SVN-Commit-Paths: vendor-sys/illumos/dist/common/zfs X-SVN-Commit-Revision: 325605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 18:06:19 -0000 Author: avg Date: Thu Nov 9 18:06:18 2017 New Revision: 325605 URL: https://svnweb.freebsd.org/changeset/base/325605 Log: 8713 Buffer overflow in dsl_dataset_name() illumos/illumos-gate@f37ae9a714b97eca91c74c680c20c750c7cf5c02 https://github.com/illumos/illumos-gate/commit/f37ae9a714b97eca91c74c680c20c750c7cf5c02 https://www.illumos.org/issues/8713 If we're creating a pool with version >= SPA_VERSION_DSL_SCRUB (v11) we need to account for additional space needed by the origin dataset which will also be snapshotted: "poolname"+"/"+"$ORIGIN"+"@"+"$ORIGIN". Enforce this limit in pool_namecheck(). Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: loli10K Modified: vendor-sys/illumos/dist/common/zfs/zfs_namecheck.c Modified: vendor-sys/illumos/dist/common/zfs/zfs_namecheck.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfs_namecheck.c Thu Nov 9 17:58:57 2017 (r325604) +++ vendor-sys/illumos/dist/common/zfs/zfs_namecheck.c Thu Nov 9 18:06:18 2017 (r325605) @@ -44,6 +44,7 @@ #include #endif +#include #include #include #include "zfs_namecheck.h" @@ -301,8 +302,14 @@ pool_namecheck(const char *pool, namecheck_err_t *why, /* * Make sure the name is not too long. + * If we're creating a pool with version >= SPA_VERSION_DSL_SCRUB (v11) + * we need to account for additional space needed by the origin ds which + * will also be snapshotted: "poolname"+"/"+"$ORIGIN"+"@"+"$ORIGIN". + * Play it safe and enforce this limit even if the pool version is < 11 + * so it can be upgraded without issues. */ - if (strlen(pool) >= ZFS_MAX_DATASET_NAME_LEN) { + if (strlen(pool) >= (ZFS_MAX_DATASET_NAME_LEN - 2 - + strlen(ORIGIN_DIR_NAME) * 2)) { if (why) *why = NAME_ERR_TOOLONG; return (-1); From owner-svn-src-all@freebsd.org Thu Nov 9 18:12:22 2017 Return-Path: Delivered-To: svn-src-all@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 D4C75E57D79; Thu, 9 Nov 2017 18:12:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1CD771FF4; Thu, 9 Nov 2017 18:12:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9ICLu0015552; Thu, 9 Nov 2017 18:12:21 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9ICLVx015551; Thu, 9 Nov 2017 18:12:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711091812.vA9ICLVx015551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 9 Nov 2017 18:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325606 - head/sys/cddl/contrib/opensolaris/common/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/common/zfs X-SVN-Commit-Revision: 325606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 18:12:22 -0000 Author: avg Date: Thu Nov 9 18:12:21 2017 New Revision: 325606 URL: https://svnweb.freebsd.org/changeset/base/325606 Log: MFV r325605: 8713 Buffer overflow in dsl_dataset_name() illumos/illumos-gate@f37ae9a714b97eca91c74c680c20c750c7cf5c02 https://github.com/illumos/illumos-gate/commit/f37ae9a714b97eca91c74c680c20c750c7cf5c02 https://www.illumos.org/issues/8713 If we're creating a pool with version >= SPA_VERSION_DSL_SCRUB (v11) we need to account for additional space needed by the origin dataset which will also be snapshotted: "poolname"+"/"+"$ORIGIN"+"@"+"$ORIGIN". Enforce this limit in pool_namecheck(). Reviewed by: Prakash Surya Reviewed by: Matthew Ahrens Approved by: Dan McDonald Author: loli10K MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c Thu Nov 9 18:06:18 2017 (r325605) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c Thu Nov 9 18:12:21 2017 (r325606) @@ -44,6 +44,7 @@ #include #endif +#include #include #include #include "zfs_namecheck.h" @@ -301,8 +302,14 @@ pool_namecheck(const char *pool, namecheck_err_t *why, /* * Make sure the name is not too long. + * If we're creating a pool with version >= SPA_VERSION_DSL_SCRUB (v11) + * we need to account for additional space needed by the origin ds which + * will also be snapshotted: "poolname"+"/"+"$ORIGIN"+"@"+"$ORIGIN". + * Play it safe and enforce this limit even if the pool version is < 11 + * so it can be upgraded without issues. */ - if (strlen(pool) >= ZFS_MAX_DATASET_NAME_LEN) { + if (strlen(pool) >= (ZFS_MAX_DATASET_NAME_LEN - 2 - + strlen(ORIGIN_DIR_NAME) * 2)) { if (why) *why = NAME_ERR_TOOLONG; return (-1); From owner-svn-src-all@freebsd.org Thu Nov 9 18:13:27 2017 Return-Path: Delivered-To: svn-src-all@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 907E2E57E09; Thu, 9 Nov 2017 18:13:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AB0E72169; Thu, 9 Nov 2017 18:13:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9IDQl7015644; Thu, 9 Nov 2017 18:13:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9IDQw3015642; Thu, 9 Nov 2017 18:13:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711091813.vA9IDQw3015642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 9 Nov 2017 18:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r325607 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys X-SVN-Commit-Author: avg X-SVN-Commit-Paths: vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Commit-Revision: 325607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 18:13:27 -0000 Author: avg Date: Thu Nov 9 18:13:26 2017 New Revision: 325607 URL: https://svnweb.freebsd.org/changeset/base/325607 Log: 8607 zfs: variable set but not used illumos/illumos-gate@b852c2f54326f8ac1daa372a88bfe951dd7e20ed https://github.com/illumos/illumos-gate/commit/b852c2f54326f8ac1daa372a88bfe951dd7e20ed https://www.illumos.org/issues/8607 Reviewed by: Yuri Pankov Reviewed by: Igor Kozhukhov Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Toomas Soome Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Thu Nov 9 18:12:21 2017 (r325606) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Thu Nov 9 18:13:26 2017 (r325607) @@ -387,7 +387,6 @@ dsl_pool_create(spa_t *spa, nvlist_t *zplprops, uint64 int err; dsl_pool_t *dp = dsl_pool_open_impl(spa, txg); dmu_tx_t *tx = dmu_tx_create_assigned(dp, txg); - objset_t *os; dsl_dataset_t *ds; uint64_t obj; @@ -438,12 +437,15 @@ dsl_pool_create(spa_t *spa, nvlist_t *zplprops, uint64 /* create the root objset */ VERIFY0(dsl_dataset_hold_obj(dp, obj, FTAG, &ds)); - rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); - os = dmu_objset_create_impl(dp->dp_spa, ds, - dsl_dataset_get_blkptr(ds), DMU_OST_ZFS, tx); - rrw_exit(&ds->ds_bp_rwlock, FTAG); #ifdef _KERNEL - zfs_create_fs(os, kcred, zplprops, tx); + { + objset_t *os; + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); + os = dmu_objset_create_impl(dp->dp_spa, ds, + dsl_dataset_get_blkptr(ds), DMU_OST_ZFS, tx); + rrw_exit(&ds->ds_bp_rwlock, FTAG); + zfs_create_fs(os, kcred, zplprops, tx); + } #endif dsl_dataset_rele(ds, FTAG); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Thu Nov 9 18:12:21 2017 (r325606) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Thu Nov 9 18:13:26 2017 (r325607) @@ -5554,10 +5554,6 @@ zfs_ioc_send_space(const char *snapname, nvlist_t *inn dsl_dataset_t *tosnap; int error; char *fromname; - /* LINTED E_FUNC_SET_NOT_USED */ - boolean_t largeblockok; - /* LINTED E_FUNC_SET_NOT_USED */ - boolean_t embedok; boolean_t compressok; uint64_t space; @@ -5571,8 +5567,6 @@ zfs_ioc_send_space(const char *snapname, nvlist_t *inn return (error); } - largeblockok = nvlist_exists(innvl, "largeblockok"); - embedok = nvlist_exists(innvl, "embedok"); compressok = nvlist_exists(innvl, "compressok"); error = nvlist_lookup_string(innvl, "from", &fromname); @@ -5613,7 +5607,9 @@ zfs_ioc_send_space(const char *snapname, nvlist_t *inn goto out; } } else { - // If estimating the size of a full send, use dmu_send_estimate + /* + * If estimating the size of a full send, use dmu_send_estimate. + */ error = dmu_send_estimate(tosnap, NULL, compressok, &space); } From owner-svn-src-all@freebsd.org Thu Nov 9 18:14:43 2017 Return-Path: Delivered-To: svn-src-all@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 B521CE57EB0; Thu, 9 Nov 2017 18:14:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F568722C1; Thu, 9 Nov 2017 18:14:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9IEg2e015758; Thu, 9 Nov 2017 18:14:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9IEgto015756; Thu, 9 Nov 2017 18:14:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711091814.vA9IEgto015756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 9 Nov 2017 18:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325608 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 325608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 18:14:43 -0000 Author: avg Date: Thu Nov 9 18:14:42 2017 New Revision: 325608 URL: https://svnweb.freebsd.org/changeset/base/325608 Log: MFV r325607: 8607 zfs: variable set but not used illumos/illumos-gate@b852c2f54326f8ac1daa372a88bfe951dd7e20ed https://github.com/illumos/illumos-gate/commit/b852c2f54326f8ac1daa372a88bfe951dd7e20ed https://www.illumos.org/issues/8607 Reviewed by: Yuri Pankov Reviewed by: Igor Kozhukhov Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Toomas Soome MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Thu Nov 9 18:13:26 2017 (r325607) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Thu Nov 9 18:14:42 2017 (r325608) @@ -487,7 +487,6 @@ dsl_pool_create(spa_t *spa, nvlist_t *zplprops, uint64 int err; dsl_pool_t *dp = dsl_pool_open_impl(spa, txg); dmu_tx_t *tx = dmu_tx_create_assigned(dp, txg); - objset_t *os; dsl_dataset_t *ds; uint64_t obj; @@ -538,12 +537,15 @@ dsl_pool_create(spa_t *spa, nvlist_t *zplprops, uint64 /* create the root objset */ VERIFY0(dsl_dataset_hold_obj(dp, obj, FTAG, &ds)); - rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); - os = dmu_objset_create_impl(dp->dp_spa, ds, - dsl_dataset_get_blkptr(ds), DMU_OST_ZFS, tx); - rrw_exit(&ds->ds_bp_rwlock, FTAG); #ifdef _KERNEL - zfs_create_fs(os, kcred, zplprops, tx); + { + objset_t *os; + rrw_enter(&ds->ds_bp_rwlock, RW_READER, FTAG); + os = dmu_objset_create_impl(dp->dp_spa, ds, + dsl_dataset_get_blkptr(ds), DMU_OST_ZFS, tx); + rrw_exit(&ds->ds_bp_rwlock, FTAG); + zfs_create_fs(os, kcred, zplprops, tx); + } #endif dsl_dataset_rele(ds, FTAG); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Nov 9 18:13:26 2017 (r325607) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Nov 9 18:14:42 2017 (r325608) @@ -5827,10 +5827,6 @@ zfs_ioc_send_space(const char *snapname, nvlist_t *inn dsl_dataset_t *tosnap; int error; char *fromname; - /* LINTED E_FUNC_SET_NOT_USED */ - boolean_t largeblockok; - /* LINTED E_FUNC_SET_NOT_USED */ - boolean_t embedok; boolean_t compressok; uint64_t space; @@ -5844,8 +5840,6 @@ zfs_ioc_send_space(const char *snapname, nvlist_t *inn return (error); } - largeblockok = nvlist_exists(innvl, "largeblockok"); - embedok = nvlist_exists(innvl, "embedok"); compressok = nvlist_exists(innvl, "compressok"); error = nvlist_lookup_string(innvl, "from", &fromname); @@ -5886,7 +5880,9 @@ zfs_ioc_send_space(const char *snapname, nvlist_t *inn goto out; } } else { - // If estimating the size of a full send, use dmu_send_estimate + /* + * If estimating the size of a full send, use dmu_send_estimate. + */ error = dmu_send_estimate(tosnap, NULL, compressok, &space); } From owner-svn-src-all@freebsd.org Thu Nov 9 18:21:19 2017 Return-Path: Delivered-To: svn-src-all@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 33E11E582CD; Thu, 9 Nov 2017 18:21:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7327272B; Thu, 9 Nov 2017 18:21:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9ILIW9016790; Thu, 9 Nov 2017 18:21:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9ILIOf016788; Thu, 9 Nov 2017 18:21:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711091821.vA9ILIOf016788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 9 Nov 2017 18:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r325609 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 325609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 18:21:19 -0000 Author: avg Date: Thu Nov 9 18:21:17 2017 New Revision: 325609 URL: https://svnweb.freebsd.org/changeset/base/325609 Log: 7531 Assign correct flags to prefetched buffers illumos/illumos-gate@272952165423c254ad7708f1b3fe2ff0a6ce408b https://github.com/illumos/illumos-gate/commit/272952165423c254ad7708f1b3fe2ff0a6ce408b https://www.illumos.org/issues/7531 I found that some buffers that could be L2ARC eligible are not flagged such, leading to some performance impact. As a test I ran the same IO workload 10 times in a raw. It is a metadata only workload (files listing). l2arc_noprefetch=0. Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Approved by: Dan McDonald Author: benrubson MFC after: 8 days Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Thu Nov 9 18:14:42 2017 (r325608) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Thu Nov 9 18:21:17 2017 (r325609) @@ -2374,6 +2374,10 @@ dbuf_prefetch_indirect_done(zio_t *zio, arc_buf_t *abu arc_flags_t iter_aflags = ARC_FLAG_NOWAIT; zbookmark_phys_t zb; + /* flag if L2ARC eligible, l2arc_noprefetch then decides */ + if (dpa->dpa_aflags & ARC_FLAG_L2CACHE) + iter_aflags |= ARC_FLAG_L2CACHE; + ASSERT3U(dpa->dpa_curlevel, ==, BP_GET_LEVEL(bp)); SET_BOOKMARK(&zb, dpa->dpa_zb.zb_objset, @@ -2483,6 +2487,10 @@ dbuf_prefetch(dnode_t *dn, int64_t level, uint64_t blk dpa->dpa_epbs = epbs; dpa->dpa_zio = pio; + /* flag if L2ARC eligible, l2arc_noprefetch then decides */ + if (DNODE_LEVEL_IS_L2CACHEABLE(dn, level)) + dpa->dpa_aflags |= ARC_FLAG_L2CACHE; + /* * If we have the indirect just above us, no need to do the asynchronous * prefetch chain; we'll just run the last step ourselves. If we're at @@ -2497,6 +2505,10 @@ dbuf_prefetch(dnode_t *dn, int64_t level, uint64_t blk } else { arc_flags_t iter_aflags = ARC_FLAG_NOWAIT; zbookmark_phys_t zb; + + /* flag if L2ARC eligible, l2arc_noprefetch then decides */ + if (DNODE_LEVEL_IS_L2CACHEABLE(dn, level)) + iter_aflags |= ARC_FLAG_L2CACHE; SET_BOOKMARK(&zb, ds != NULL ? ds->ds_object : DMU_META_OBJSET, dn->dn_object, curlevel, curblkid); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h Thu Nov 9 18:14:42 2017 (r325608) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h Thu Nov 9 18:21:17 2017 (r325609) @@ -347,6 +347,12 @@ boolean_t dbuf_is_metadata(dmu_buf_impl_t *db); (dbuf_is_metadata(_db) && \ ((_db)->db_objset->os_secondary_cache == ZFS_CACHE_METADATA))) +#define DNODE_LEVEL_IS_L2CACHEABLE(_dn, _level) \ + ((_dn)->dn_objset->os_secondary_cache == ZFS_CACHE_ALL || \ + (((_level) > 0 || \ + DMU_OT_IS_METADATA((_dn)->dn_handle->dnh_dnode->dn_type)) && \ + ((_dn)->dn_objset->os_secondary_cache == ZFS_CACHE_METADATA))) + #ifdef ZFS_DEBUG /* From owner-svn-src-all@freebsd.org Thu Nov 9 18:22:43 2017 Return-Path: Delivered-To: svn-src-all@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 F1A1AE58384; Thu, 9 Nov 2017 18:22:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBA3A72A44; Thu, 9 Nov 2017 18:22:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9IMg2Z020002; Thu, 9 Nov 2017 18:22:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9IMge9020000; Thu, 9 Nov 2017 18:22:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711091822.vA9IMge9020000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 9 Nov 2017 18:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325610 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 325610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 18:22:44 -0000 Author: avg Date: Thu Nov 9 18:22:42 2017 New Revision: 325610 URL: https://svnweb.freebsd.org/changeset/base/325610 Log: MFV r325609: 7531 Assign correct flags to prefetched buffers illumos/illumos-gate@272952165423c254ad7708f1b3fe2ff0a6ce408b https://github.com/illumos/illumos-gate/commit/272952165423c254ad7708f1b3fe2ff0a6ce408b https://www.illumos.org/issues/7531 I found that some buffers that could be L2ARC eligible are not flagged such, leading to some performance impact. As a test I ran the same IO workload 10 times in a raw. It is a metadata only workload (files listing). l2arc_noprefetch=0. Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Approved by: Dan McDonald Author: benrubson MFC after: 8 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Nov 9 18:21:17 2017 (r325609) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Nov 9 18:22:42 2017 (r325610) @@ -2373,6 +2373,10 @@ dbuf_prefetch_indirect_done(zio_t *zio, arc_buf_t *abu arc_flags_t iter_aflags = ARC_FLAG_NOWAIT; zbookmark_phys_t zb; + /* flag if L2ARC eligible, l2arc_noprefetch then decides */ + if (dpa->dpa_aflags & ARC_FLAG_L2CACHE) + iter_aflags |= ARC_FLAG_L2CACHE; + ASSERT3U(dpa->dpa_curlevel, ==, BP_GET_LEVEL(bp)); SET_BOOKMARK(&zb, dpa->dpa_zb.zb_objset, @@ -2482,6 +2486,10 @@ dbuf_prefetch(dnode_t *dn, int64_t level, uint64_t blk dpa->dpa_epbs = epbs; dpa->dpa_zio = pio; + /* flag if L2ARC eligible, l2arc_noprefetch then decides */ + if (DNODE_LEVEL_IS_L2CACHEABLE(dn, level)) + dpa->dpa_aflags |= ARC_FLAG_L2CACHE; + /* * If we have the indirect just above us, no need to do the asynchronous * prefetch chain; we'll just run the last step ourselves. If we're at @@ -2496,6 +2504,10 @@ dbuf_prefetch(dnode_t *dn, int64_t level, uint64_t blk } else { arc_flags_t iter_aflags = ARC_FLAG_NOWAIT; zbookmark_phys_t zb; + + /* flag if L2ARC eligible, l2arc_noprefetch then decides */ + if (DNODE_LEVEL_IS_L2CACHEABLE(dn, level)) + iter_aflags |= ARC_FLAG_L2CACHE; SET_BOOKMARK(&zb, ds != NULL ? ds->ds_object : DMU_META_OBJSET, dn->dn_object, curlevel, curblkid); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Thu Nov 9 18:21:17 2017 (r325609) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Thu Nov 9 18:22:42 2017 (r325610) @@ -347,6 +347,12 @@ boolean_t dbuf_is_metadata(dmu_buf_impl_t *db); (dbuf_is_metadata(_db) && \ ((_db)->db_objset->os_secondary_cache == ZFS_CACHE_METADATA))) +#define DNODE_LEVEL_IS_L2CACHEABLE(_dn, _level) \ + ((_dn)->dn_objset->os_secondary_cache == ZFS_CACHE_ALL || \ + (((_level) > 0 || \ + DMU_OT_IS_METADATA((_dn)->dn_handle->dnh_dnode->dn_type)) && \ + ((_dn)->dn_objset->os_secondary_cache == ZFS_CACHE_METADATA))) + #ifdef ZFS_DEBUG /* From owner-svn-src-all@freebsd.org Thu Nov 9 19:00:14 2017 Return-Path: Delivered-To: svn-src-all@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 32F05E58BEE; Thu, 9 Nov 2017 19:00:14 +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 CB1CB736B8; Thu, 9 Nov 2017 19:00:13 +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 vA9J0DNQ032736; Thu, 9 Nov 2017 19:00:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9J0Ce4032726; Thu, 9 Nov 2017 19:00:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091900.vA9J0Ce4032726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 19:00: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: r325611 - in stable/10/sys: dev/cxgbe/iw_cxgbe dev/mlx5/mlx5_ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/hw/mthca ofed/include/linux ofed/inc... X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys: dev/cxgbe/iw_cxgbe dev/mlx5/mlx5_ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/hw/mthca ofed/include/linux ofed/include/rdma X-SVN-Commit-Revision: 325611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 19:00:14 -0000 Author: hselasky Date: Thu Nov 9 19:00:11 2017 New Revision: 325611 URL: https://svnweb.freebsd.org/changeset/base/325611 Log: MFC r324792: The remote DMA TCP portspace selector, RDMA_PS_TCP, is used for both iWarp and RoCE in ibcore. The selection of RDMA_PS_TCP can not be used to indicate iWarp protocol use. Backport the proper IB device capabilities from Linux upstream to distinguish between iWarp and RoCE. Only allocate the additional socket required for iWarp for RDMA IDs when at least one iWarp device present. This resolves interopability issues between iWarp and RoCE in ibcore Reviewed by: np @ Differential Revision: https://reviews.freebsd.org/D12563 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c stable/10/sys/ofed/drivers/infiniband/core/cma.c stable/10/sys/ofed/drivers/infiniband/core/device.c stable/10/sys/ofed/drivers/infiniband/hw/mlx4/main.c stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c stable/10/sys/ofed/include/linux/kernel.h stable/10/sys/ofed/include/rdma/ib_mad.h stable/10/sys/ofed/include/rdma/ib_verbs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c Thu Nov 9 19:00:11 2017 (r325611) @@ -388,6 +388,24 @@ c4iw_query_port(struct ib_device *ibdev, u8 port, stru return 0; } +static int c4iw_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + int err; + + immutable->core_cap_flags = RDMA_CORE_PORT_IWARP; + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + + return 0; +} + /* * Returns -errno on error. */ @@ -471,6 +489,7 @@ c4iw_register_device(struct c4iw_dev *dev) ibdev->post_send = c4iw_post_send; ibdev->post_recv = c4iw_post_receive; ibdev->uverbs_abi_ver = C4IW_UVERBS_ABI_VERSION; + ibdev->get_port_immutable = c4iw_port_immutable; iwcm = kmalloc(sizeof(*iwcm), GFP_KERNEL); if (iwcm == NULL) Modified: stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Nov 9 19:00:11 2017 (r325611) @@ -1671,6 +1671,57 @@ static void destroy_dev_resources(struct mlx5_ib_resou mlx5_ib_dealloc_pd(devr->p0); } +static u32 get_core_cap_flags(struct ib_device *ibdev) +{ + struct mlx5_ib_dev *dev = to_mdev(ibdev); + enum rdma_link_layer ll = mlx5_ib_port_link_layer(ibdev, 1); + u8 l3_type_cap = MLX5_CAP_ROCE(dev->mdev, l3_type); + u8 roce_version_cap = MLX5_CAP_ROCE(dev->mdev, roce_version); + u32 ret = 0; + + if (ll == IB_LINK_LAYER_INFINIBAND) + return RDMA_CORE_PORT_IBA_IB; + + ret = RDMA_CORE_PORT_RAW_PACKET; + + if (!(l3_type_cap & MLX5_ROCE_L3_TYPE_IPV4_CAP)) + return ret; + + if (!(l3_type_cap & MLX5_ROCE_L3_TYPE_IPV6_CAP)) + return ret; + + if (roce_version_cap & MLX5_ROCE_VERSION_1_CAP) + ret |= RDMA_CORE_PORT_IBA_ROCE; + + if (roce_version_cap & MLX5_ROCE_VERSION_2_CAP) + ret |= RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP; + + return ret; +} + +static int mlx5_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + struct mlx5_ib_dev *dev = to_mdev(ibdev); + enum rdma_link_layer ll = mlx5_ib_port_link_layer(ibdev, port_num); + int err; + + immutable->core_cap_flags = get_core_cap_flags(ibdev); + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + immutable->core_cap_flags = get_core_cap_flags(ibdev); + if ((ll == IB_LINK_LAYER_INFINIBAND) || MLX5_CAP_GEN(dev->mdev, roce)) + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + + return 0; +} + static void enable_dc_tracer(struct mlx5_ib_dev *dev) { struct device *device = dev->ib_dev.dma_device; @@ -2115,6 +2166,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) dev->ib_dev.attach_mcast = mlx5_ib_mcg_attach; dev->ib_dev.detach_mcast = mlx5_ib_mcg_detach; dev->ib_dev.process_mad = mlx5_ib_process_mad; + dev->ib_dev.get_port_immutable = mlx5_port_immutable; dev->ib_dev.alloc_fast_reg_mr = mlx5_ib_alloc_fast_reg_mr; dev->ib_dev.alloc_fast_reg_page_list = mlx5_ib_alloc_fast_reg_page_list; dev->ib_dev.free_fast_reg_page_list = mlx5_ib_free_fast_reg_page_list; Modified: stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Thu Nov 9 19:00:11 2017 (r325611) @@ -1576,7 +1576,7 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, cons int gid_type; if ((ll == IB_LINK_LAYER_ETHERNET) || (ah->ah_flags & IB_AH_GRH)) { - int len = dev->ib_dev.gid_tbl_len[port - 1]; + int len = dev->mdev->port_caps[port - 1].gid_table_len; if (ah->grh.sgid_index >= len) { printf("mlx5_ib: ERR: ""sgid_index (%u) too large. max is %d\n", ah->grh.sgid_index, len - 1); return -EINVAL; Modified: stable/10/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 19:00:11 2017 (r325611) @@ -171,6 +171,7 @@ struct rdma_id_private { u32 qp_num; u8 srq; u8 tos; + int unify_ps_tcp; }; struct cma_multicast { @@ -739,28 +740,24 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib int ret = 0; id_priv = container_of(id, struct rdma_id_private, id); - switch (rdma_node_get_transport(id_priv->id.device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (!id_priv->cm_id.ib || cma_is_ud_ps(id_priv->id.ps)) ret = cma_ib_init_qp_attr(id_priv, qp_attr, qp_attr_mask); else ret = ib_cm_init_qp_attr(id_priv->cm_id.ib, qp_attr, qp_attr_mask); + if (qp_attr->qp_state == IB_QPS_RTR) qp_attr->rq_psn = id_priv->seq_num; - break; - case RDMA_TRANSPORT_IWARP: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) { if (!id_priv->cm_id.iw) { qp_attr->qp_access_flags = 0; *qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS; } else ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr, qp_attr_mask); - break; - default: + } else ret = -ENOSYS; - break; - } return ret; } @@ -1000,17 +997,12 @@ void rdma_destroy_id(struct rdma_cm_id *id) mutex_lock(&lock); if (id_priv->cma_dev) { mutex_unlock(&lock); - switch (rdma_node_get_transport(id_priv->id.device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id_priv->id.device, 1)) { if (id_priv->cm_id.ib && !IS_ERR(id_priv->cm_id.ib)) ib_destroy_cm_id(id_priv->cm_id.ib); - break; - case RDMA_TRANSPORT_IWARP: + } else if (rdma_cap_iw_cm(id_priv->id.device, 1)) { if (id_priv->cm_id.iw && !IS_ERR(id_priv->cm_id.iw)) iw_destroy_cm_id(id_priv->cm_id.iw); - break; - default: - break; } cma_leave_mc_groups(id_priv); mutex_lock(&lock); @@ -1025,6 +1017,10 @@ void rdma_destroy_id(struct rdma_cm_id *id) if (id_priv->internal_id) cma_deref_id(id_priv->id.context); + if (id_priv->sock != NULL && !id_priv->internal_id && + !id_priv->unify_ps_tcp) + sock_release(id_priv->sock); + kfree(id_priv->id.route.path_rec); kfree(id_priv); } @@ -1663,18 +1659,15 @@ int rdma_listen(struct rdma_cm_id *id, int backlog) id_priv->backlog = backlog; if (id->device) { - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, 1)) { ret = cma_ib_listen(id_priv); if (ret) goto err; - break; - case RDMA_TRANSPORT_IWARP: + } else if (rdma_cap_iw_cm(id->device, 1)) { ret = cma_iw_listen(id_priv, backlog); if (ret) goto err; - break; - default: + } else { ret = -ENOSYS; goto err; } @@ -1979,26 +1972,15 @@ int rdma_resolve_route(struct rdma_cm_id *id, int time return -EINVAL; atomic_inc(&id_priv->refcount); - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: - switch (rdma_port_get_link_layer(id->device, id->port_num)) { - case IB_LINK_LAYER_INFINIBAND: - ret = cma_resolve_ib_route(id_priv, timeout_ms); - break; - case IB_LINK_LAYER_ETHERNET: - ret = cma_resolve_iboe_route(id_priv); - break; - default: - ret = -ENOSYS; - } - break; - case RDMA_TRANSPORT_IWARP: + if (rdma_cap_ib_sa(id->device, id->port_num)) + ret = cma_resolve_ib_route(id_priv, timeout_ms); + else if (rdma_protocol_roce(id->device, id->port_num)) + ret = cma_resolve_iboe_route(id_priv); + else if (rdma_protocol_iwarp(id->device, id->port_num)) ret = cma_resolve_iw_route(id_priv, timeout_ms); - break; - default: + else ret = -ENOSYS; - break; - } + if (ret) goto err; @@ -2348,6 +2330,10 @@ static int cma_get_tcp_port(struct rdma_id_private *id (struct sockaddr *) &id_priv->id.route.addr.src_addr, ip_addr_size((struct sockaddr *) &id_priv->id.route.addr.src_addr)); #else + SOCK_LOCK(sock); + sock->so_options |= SO_REUSEADDR; + SOCK_UNLOCK(sock); + ret = -sobind(sock, (struct sockaddr *)&id_priv->id.route.addr.src_addr, curthread); @@ -2372,6 +2358,7 @@ static int cma_get_tcp_port(struct rdma_id_private *id static int cma_get_port(struct rdma_id_private *id_priv) { + struct cma_device *cma_dev; struct idr *ps; int ret; @@ -2381,7 +2368,18 @@ static int cma_get_port(struct rdma_id_private *id_pri break; case RDMA_PS_TCP: ps = &tcp_ps; - if (unify_tcp_port_space) { + + mutex_lock(&lock); + /* check if there are any iWarp IB devices present */ + list_for_each_entry(cma_dev, &dev_list, list) { + if (rdma_protocol_iwarp(cma_dev->device, 1)) { + id_priv->unify_ps_tcp = 1; + break; + } + } + mutex_unlock(&lock); + + if (id_priv->unify_ps_tcp) { ret = cma_get_tcp_port(id_priv); if (ret) goto out; @@ -2765,20 +2763,15 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_co id_priv->srq = conn_param->srq; } - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (cma_is_ud_ps(id->ps)) ret = cma_resolve_ib_udp(id_priv, conn_param); else ret = cma_connect_ib(id_priv, conn_param); - break; - case RDMA_TRANSPORT_IWARP: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) ret = cma_connect_iw(id_priv, conn_param); - break; - default: + else ret = -ENOSYS; - break; - } if (ret) goto err; @@ -2878,8 +2871,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_con id_priv->srq = conn_param->srq; } - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (cma_is_ud_ps(id->ps)) ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS, conn_param->private_data, @@ -2888,14 +2880,10 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_con ret = cma_accept_ib(id_priv, conn_param); else ret = cma_rep_recv(id_priv); - break; - case RDMA_TRANSPORT_IWARP: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) ret = cma_accept_iw(id_priv, conn_param); - break; - default: + else ret = -ENOSYS; - break; - } if (ret) goto reject; @@ -2939,8 +2927,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *pri if (!cma_has_cm_dev(id_priv)) return -EINVAL; - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (cma_is_ud_ps(id->ps)) ret = cma_send_sidr_rep(id_priv, IB_SIDR_REJECT, private_data, private_data_len); @@ -2948,15 +2935,12 @@ int rdma_reject(struct rdma_cm_id *id, const void *pri ret = ib_send_cm_rej(id_priv->cm_id.ib, IB_CM_REJ_CONSUMER_DEFINED, NULL, 0, private_data, private_data_len); - break; - case RDMA_TRANSPORT_IWARP: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) { ret = iw_cm_reject(id_priv->cm_id.iw, private_data, private_data_len); - break; - default: + } else ret = -ENOSYS; - break; - } + return ret; } EXPORT_SYMBOL(rdma_reject); @@ -2970,22 +2954,18 @@ int rdma_disconnect(struct rdma_cm_id *id) if (!cma_has_cm_dev(id_priv)) return -EINVAL; - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { ret = cma_modify_qp_err(id_priv); if (ret) goto out; /* Initiate or respond to a disconnect. */ if (ib_send_cm_dreq(id_priv->cm_id.ib, NULL, 0)) ib_send_cm_drep(id_priv->cm_id.ib, NULL, 0); - break; - case RDMA_TRANSPORT_IWARP: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) { ret = iw_cm_disconnect(id_priv->cm_id.iw, 0); - break; - default: + } else ret = -EINVAL; - break; - } + out: return ret; } Modified: stable/10/sys/ofed/drivers/infiniband/core/device.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/device.c Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/ofed/drivers/infiniband/core/device.c Thu Nov 9 19:00:11 2017 (r325611) @@ -94,7 +94,8 @@ static int ib_device_check_mandatory(struct ib_device IB_MANDATORY_FUNC(poll_cq), IB_MANDATORY_FUNC(req_notify_cq), IB_MANDATORY_FUNC(get_dma_mr), - IB_MANDATORY_FUNC(dereg_mr) + IB_MANDATORY_FUNC(dereg_mr), + IB_MANDATORY_FUNC(get_port_immutable) }; int i; @@ -153,13 +154,13 @@ static int alloc_name(char *name) return 0; } -static int start_port(struct ib_device *device) +static int rdma_start_port(struct ib_device *device) { return (device->node_type == RDMA_NODE_IB_SWITCH) ? 0 : 1; } -static int end_port(struct ib_device *device) +static int rdma_end_port(struct ib_device *device) { return (device->node_type == RDMA_NODE_IB_SWITCH) ? 0 : device->phys_port_cnt; @@ -192,6 +193,7 @@ EXPORT_SYMBOL(ib_alloc_device); void ib_dealloc_device(struct ib_device *device) { if (device->reg_state == IB_DEV_UNINITIALIZED) { + kfree(device->port_immutable); kfree(device); return; } @@ -224,43 +226,42 @@ static int add_client_context(struct ib_device *device return 0; } -static int read_port_table_lengths(struct ib_device *device) +static int verify_immutable(const struct ib_device *dev, u8 port) { - struct ib_port_attr *tprops = NULL; - int num_ports, ret = -ENOMEM; - u8 port_index; + return WARN_ON(!rdma_cap_ib_mad(dev, port) && + rdma_max_mad_size(dev, port) != 0); +} - tprops = kmalloc(sizeof *tprops, GFP_KERNEL); - if (!tprops) - goto out; +static int read_port_immutable(struct ib_device *device) +{ + int ret; + u8 start_port = rdma_start_port(device); + u8 end_port = rdma_end_port(device); + u8 port; - num_ports = end_port(device) - start_port(device) + 1; + /** + * device->port_immutable is indexed directly by the port number to make + * access to this data as efficient as possible. + * + * Therefore port_immutable is declared as a 1 based array with + * potential empty slots at the beginning. + */ + device->port_immutable = kzalloc(sizeof(*device->port_immutable) + * (end_port + 1), + GFP_KERNEL); + if (!device->port_immutable) + return -ENOMEM; - device->pkey_tbl_len = kmalloc(sizeof *device->pkey_tbl_len * num_ports, - GFP_KERNEL); - device->gid_tbl_len = kmalloc(sizeof *device->gid_tbl_len * num_ports, - GFP_KERNEL); - if (!device->pkey_tbl_len || !device->gid_tbl_len) - goto err; - - for (port_index = 0; port_index < num_ports; ++port_index) { - ret = ib_query_port(device, port_index + start_port(device), - tprops); + for (port = start_port; port <= end_port; ++port) { + ret = device->get_port_immutable(device, port, + &device->port_immutable[port]); if (ret) - goto err; - device->pkey_tbl_len[port_index] = tprops->pkey_tbl_len; - device->gid_tbl_len[port_index] = tprops->gid_tbl_len; - } + return ret; - ret = 0; - goto out; - -err: - kfree(device->gid_tbl_len); - kfree(device->pkey_tbl_len); -out: - kfree(tprops); - return ret; + if (verify_immutable(device, port)) + return -EINVAL; + } + return 0; } /** @@ -298,10 +299,11 @@ int ib_register_device(struct ib_device *device, device->ib_uverbs_xrcd_table = RB_ROOT; mutex_init(&device->xrcd_table_mutex); - ret = read_port_table_lengths(device); + + ret = read_port_immutable(device); if (ret) { - printk(KERN_WARNING "Couldn't create table lengths cache for device %s\n", - device->name); + printk(KERN_WARNING "Couldn't create per port immutable data %s\n", + device->name); goto out; } @@ -309,8 +311,7 @@ int ib_register_device(struct ib_device *device, if (ret) { printk(KERN_WARNING "Couldn't register device %s with driver model\n", device->name); - kfree(device->gid_tbl_len); - kfree(device->pkey_tbl_len); + kfree(device->port_immutable); goto out; } @@ -352,9 +353,6 @@ void ib_unregister_device(struct ib_device *device) list_del(&device->core_list); - kfree(device->gid_tbl_len); - kfree(device->pkey_tbl_len); - mutex_unlock(&device_mutex); ib_device_unregister_sysfs(device); @@ -579,7 +577,7 @@ int ib_query_port(struct ib_device *device, u8 port_num, struct ib_port_attr *port_attr) { - if (port_num < start_port(device) || port_num > end_port(device)) + if (port_num < rdma_start_port(device) || port_num > rdma_end_port(device)) return -EINVAL; return device->query_port(device, port_num, port_attr); @@ -651,7 +649,7 @@ int ib_modify_port(struct ib_device *device, u8 port_num, int port_modify_mask, struct ib_port_modify *port_modify) { - if (port_num < start_port(device) || port_num > end_port(device)) + if (port_num < rdma_start_port(device) || port_num > rdma_end_port(device)) return -EINVAL; return device->modify_port(device, port_num, port_modify_mask, @@ -674,8 +672,8 @@ int ib_find_gid(struct ib_device *device, union ib_gid union ib_gid tmp_gid; int ret, port, i; - for (port = start_port(device); port <= end_port(device); ++port) { - for (i = 0; i < device->gid_tbl_len[port - start_port(device)]; ++i) { + for (port = rdma_start_port(device); port <= rdma_end_port(device); ++port) { + for (i = 0; i < device->port_immutable[port].gid_tbl_len; ++i) { ret = ib_query_gid(device, port, i, &tmp_gid); if (ret) return ret; @@ -706,7 +704,7 @@ int ib_find_pkey(struct ib_device *device, int ret, i; u16 tmp_pkey; - for (i = 0; i < device->pkey_tbl_len[port_num - start_port(device)]; ++i) { + for (i = 0; i < device->port_immutable[port_num].pkey_tbl_len; ++i) { ret = ib_query_pkey(device, port_num, i, &tmp_pkey); if (ret) return ret; Modified: stable/10/sys/ofed/drivers/infiniband/hw/mlx4/main.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mlx4/main.c Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/ofed/drivers/infiniband/hw/mlx4/main.c Thu Nov 9 19:00:11 2017 (r325611) @@ -1864,6 +1864,38 @@ err: "is incorrect. The parameter value is discarded!"); } +static int mlx4_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + struct mlx4_ib_dev *mdev = to_mdev(ibdev); + int err; + + if (mlx4_ib_port_link_layer(ibdev, port_num) == IB_LINK_LAYER_INFINIBAND) { + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_IB; + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + } else { + if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE) + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE; + if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCEV2) + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE | + RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP; + immutable->core_cap_flags |= RDMA_CORE_PORT_RAW_PACKET; + if (immutable->core_cap_flags & (RDMA_CORE_PORT_IBA_ROCE | + RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP)) + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + } + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + + return 0; +} + static void *mlx4_ib_add(struct mlx4_dev *dev) { struct mlx4_ib_dev *ibdev; @@ -1993,6 +2025,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ibdev->ib_dev.attach_flow = mlx4_ib_flow_attach; ibdev->ib_dev.detach_flow = mlx4_ib_flow_detach; ibdev->ib_dev.process_mad = mlx4_ib_process_mad; + ibdev->ib_dev.get_port_immutable = mlx4_port_immutable; if (!mlx4_is_slave(ibdev->dev)) { ibdev->ib_dev.alloc_fmr = mlx4_ib_fmr_alloc; Modified: stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c Thu Nov 9 19:00:11 2017 (r325611) @@ -1297,6 +1297,25 @@ out: return err; } +static int mthca_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + int err; + + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_IB; + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + + return 0; +} + int mthca_register_device(struct mthca_dev *dev) { int ret; @@ -1376,6 +1395,7 @@ int mthca_register_device(struct mthca_dev *dev) dev->ib_dev.reg_phys_mr = mthca_reg_phys_mr; dev->ib_dev.reg_user_mr = mthca_reg_user_mr; dev->ib_dev.dereg_mr = mthca_dereg_mr; + dev->ib_dev.get_port_immutable = mthca_port_immutable; if (dev->mthca_flags & MTHCA_FLAG_FMR) { dev->ib_dev.alloc_fmr = mthca_alloc_fmr; Modified: stable/10/sys/ofed/include/linux/kernel.h ============================================================================== --- stable/10/sys/ofed/include/linux/kernel.h Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/ofed/include/linux/kernel.h Thu Nov 9 19:00:11 2017 (r325611) @@ -63,7 +63,14 @@ #define BUG() panic("BUG") #define BUG_ON(condition) do { if (condition) BUG(); } while(0) -#define WARN_ON BUG_ON +#define WARN_ON(cond) ({ \ + bool __ret = (cond); \ + if (__ret) { \ + printf("WARNING %s failed at %s:%d\n", \ + __stringify(cond), __FILE__, __LINE__); \ + } \ + unlikely(__ret); \ +}) #undef ALIGN #define ALIGN(x, y) roundup2((x), (y)) Modified: stable/10/sys/ofed/include/rdma/ib_mad.h ============================================================================== --- stable/10/sys/ofed/include/rdma/ib_mad.h Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/ofed/include/rdma/ib_mad.h Thu Nov 9 19:00:11 2017 (r325611) @@ -125,6 +125,7 @@ enum { IB_MGMT_SA_DATA = 200, IB_MGMT_DEVICE_HDR = 64, IB_MGMT_DEVICE_DATA = 192, + IB_MGMT_MAD_SIZE = IB_MGMT_MAD_HDR + IB_MGMT_MAD_DATA, }; struct ib_mad_hdr { Modified: stable/10/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- stable/10/sys/ofed/include/rdma/ib_verbs.h Thu Nov 9 18:22:42 2017 (r325610) +++ stable/10/sys/ofed/include/rdma/ib_verbs.h Thu Nov 9 19:00:11 2017 (r325611) @@ -306,6 +306,56 @@ union rdma_protocol_stats { struct iw_protocol_stats iw; }; +/* Define bits for the various functionality this port needs to be supported by + * the core. + */ +/* Management 0x00000FFF */ +#define RDMA_CORE_CAP_IB_MAD 0x00000001 +#define RDMA_CORE_CAP_IB_SMI 0x00000002 +#define RDMA_CORE_CAP_IB_CM 0x00000004 +#define RDMA_CORE_CAP_IW_CM 0x00000008 +#define RDMA_CORE_CAP_IB_SA 0x00000010 +#define RDMA_CORE_CAP_OPA_MAD 0x00000020 + +/* Address format 0x000FF000 */ +#define RDMA_CORE_CAP_AF_IB 0x00001000 +#define RDMA_CORE_CAP_ETH_AH 0x00002000 +#define RDMA_CORE_CAP_OPA_AH 0x00004000 + +/* Protocol 0xFFF00000 */ +#define RDMA_CORE_CAP_PROT_IB 0x00100000 +#define RDMA_CORE_CAP_PROT_ROCE 0x00200000 +#define RDMA_CORE_CAP_PROT_IWARP 0x00400000 +#define RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP 0x00800000 +#define RDMA_CORE_CAP_PROT_RAW_PACKET 0x01000000 +#define RDMA_CORE_CAP_PROT_USNIC 0x02000000 + +#define RDMA_CORE_PORT_IBA_IB (RDMA_CORE_CAP_PROT_IB \ + | RDMA_CORE_CAP_IB_MAD \ + | RDMA_CORE_CAP_IB_SMI \ + | RDMA_CORE_CAP_IB_CM \ + | RDMA_CORE_CAP_IB_SA \ + | RDMA_CORE_CAP_AF_IB) +#define RDMA_CORE_PORT_IBA_ROCE (RDMA_CORE_CAP_PROT_ROCE \ + | RDMA_CORE_CAP_IB_MAD \ + | RDMA_CORE_CAP_IB_CM \ + | RDMA_CORE_CAP_AF_IB \ + | RDMA_CORE_CAP_ETH_AH) +#define RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP \ + (RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP \ + | RDMA_CORE_CAP_IB_MAD \ + | RDMA_CORE_CAP_IB_CM \ + | RDMA_CORE_CAP_AF_IB \ + | RDMA_CORE_CAP_ETH_AH) +#define RDMA_CORE_PORT_IWARP (RDMA_CORE_CAP_PROT_IWARP \ + | RDMA_CORE_CAP_IW_CM) +#define RDMA_CORE_PORT_INTEL_OPA (RDMA_CORE_PORT_IBA_IB \ + | RDMA_CORE_CAP_OPA_MAD) + +#define RDMA_CORE_PORT_RAW_PACKET (RDMA_CORE_CAP_PROT_RAW_PACKET) + +#define RDMA_CORE_PORT_USNIC (RDMA_CORE_CAP_PROT_USNIC) + struct ib_port_attr { enum ib_port_state state; enum ib_mtu max_mtu; @@ -1170,6 +1220,13 @@ struct ib_dma_mapping_ops { struct iw_cm_verbs; +struct ib_port_immutable { + int pkey_tbl_len; + int gid_tbl_len; + u32 core_cap_flags; + u32 max_mad_size; +}; + struct ib_device { struct device *dma_device; @@ -1183,8 +1240,10 @@ struct ib_device { struct list_head client_data_list; struct ib_cache cache; - int *pkey_tbl_len; - int *gid_tbl_len; + /** + * port_immutable is indexed by port number + */ + struct ib_port_immutable *port_immutable; int num_comp_vectors; @@ -1387,6 +1446,14 @@ struct ib_device { u8 phys_port_cnt; struct rb_root ib_uverbs_xrcd_table; struct mutex xrcd_table_mutex; + + /** + * The following mandatory functions are used only at device + * registration. Keep functions such as these at the end of this + * structure to avoid cache line misses when accessing struct ib_device + * in fast paths. + */ + int (*get_port_immutable)(struct ib_device *, u8, struct ib_port_immutable *); }; struct ib_client { @@ -1452,6 +1519,252 @@ int ib_query_port(struct ib_device *device, enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_num); + +static inline bool rdma_protocol_ib(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IB; +} + +static inline bool rdma_protocol_roce(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & + (RDMA_CORE_CAP_PROT_ROCE | RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP); +} + +static inline bool rdma_protocol_roce_udp_encap(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP; +} + +static inline bool rdma_protocol_roce_eth_encap(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_ROCE; +} + +static inline bool rdma_protocol_iwarp(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IWARP; +} + +static inline bool rdma_ib_or_roce(const struct ib_device *device, u8 port_num) +{ + return rdma_protocol_ib(device, port_num) || + rdma_protocol_roce(device, port_num); +} + +/** + * rdma_cap_ib_mad - Check if the port of a device supports Infiniband + * Management Datagrams. + * @device: Device to check + * @port_num: Port number to check + * + * Management Datagrams (MAD) are a required part of the InfiniBand + * specification and are supported on all InfiniBand devices. A slightly + * extended version are also supported on OPA interfaces. + * + * Return: true if the port supports sending/receiving of MAD packets. + */ +static inline bool rdma_cap_ib_mad(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_MAD; +} + +/** + * rdma_cap_opa_mad - Check if the port of device provides support for OPA + * Management Datagrams. + * @device: Device to check + * @port_num: Port number to check + * + * Intel OmniPath devices extend and/or replace the InfiniBand Management + * datagrams with their own versions. These OPA MADs share many but not all of + * the characteristics of InfiniBand MADs. + * + * OPA MADs differ in the following ways: + * + * 1) MADs are variable size up to 2K + * IBTA defined MADs remain fixed at 256 bytes + * 2) OPA SMPs must carry valid PKeys + * 3) OPA SMP packets are a different format + * + * Return: true if the port supports OPA MAD packet formats. + */ +static inline bool rdma_cap_opa_mad(struct ib_device *device, u8 port_num) +{ + return (device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_OPA_MAD) + == RDMA_CORE_CAP_OPA_MAD; +} + +/** + * rdma_cap_ib_smi - Check if the port of a device provides an Infiniband + * Subnet Management Agent (SMA) on the Subnet Management Interface (SMI). + * @device: Device to check + * @port_num: Port number to check + * + * Each InfiniBand node is required to provide a Subnet Management Agent + * that the subnet manager can access. Prior to the fabric being fully + * configured by the subnet manager, the SMA is accessed via a well known + * interface called the Subnet Management Interface (SMI). This interface + * uses directed route packets to communicate with the SM to get around the + * chicken and egg problem of the SM needing to know what's on the fabric + * in order to configure the fabric, and needing to configure the fabric in + * order to send packets to the devices on the fabric. These directed + * route packets do not need the fabric fully configured in order to reach + * their destination. The SMI is the only method allowed to send + * directed route packets on an InfiniBand fabric. + * + * Return: true if the port provides an SMI. + */ +static inline bool rdma_cap_ib_smi(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SMI; +} + +/** + * rdma_cap_ib_cm - Check if the port of device has the capability Infiniband + * Communication Manager. + * @device: Device to check + * @port_num: Port number to check + * + * The InfiniBand Communication Manager is one of many pre-defined General + * Service Agents (GSA) that are accessed via the General Service + * Interface (GSI). It's role is to facilitate establishment of connections + * between nodes as well as other management related tasks for established + * connections. + * + * Return: true if the port supports an IB CM (this does not guarantee that + * a CM is actually running however). + */ +static inline bool rdma_cap_ib_cm(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_CM; +} + +/** + * rdma_cap_iw_cm - Check if the port of device has the capability IWARP + * Communication Manager. + * @device: Device to check + * @port_num: Port number to check + * + * Similar to above, but specific to iWARP connections which have a different + * managment protocol than InfiniBand. + * + * Return: true if the port supports an iWARP CM (this does not guarantee that + * a CM is actually running however). + */ +static inline bool rdma_cap_iw_cm(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IW_CM; +} + +/** + * rdma_cap_ib_sa - Check if the port of device has the capability Infiniband + * Subnet Administration. + * @device: Device to check + * @port_num: Port number to check + * + * An InfiniBand Subnet Administration (SA) service is a pre-defined General + * Service Agent (GSA) provided by the Subnet Manager (SM). On InfiniBand + * fabrics, devices should resolve routes to other hosts by contacting the + * SA to query the proper route. + * + * Return: true if the port should act as a client to the fabric Subnet + * Administration interface. This does not imply that the SA service is + * running locally. + */ +static inline bool rdma_cap_ib_sa(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SA; +} + +/** + * rdma_cap_ib_mcast - Check if the port of device has the capability Infiniband + * Multicast. + * @device: Device to check + * @port_num: Port number to check + * + * InfiniBand multicast registration is more complex than normal IPv4 or + * IPv6 multicast registration. Each Host Channel Adapter must register + * with the Subnet Manager when it wishes to join a multicast group. It + * should do so only once regardless of how many queue pairs it subscribes + * to this group. And it should leave the group only after all queue pairs + * attached to the group have been detached. + * + * Return: true if the port must undertake the additional adminstrative + * overhead of registering/unregistering with the SM and tracking of the + * total number of queue pairs attached to the multicast group. + */ +static inline bool rdma_cap_ib_mcast(const struct ib_device *device, u8 port_num) +{ + return rdma_cap_ib_sa(device, port_num); +} + +/** + * rdma_cap_af_ib - Check if the port of device has the capability + * Native Infiniband Address. + * @device: Device to check + * @port_num: Port number to check + * + * InfiniBand addressing uses a port's GUID + Subnet Prefix to make a default + * GID. RoCE uses a different mechanism, but still generates a GID via + * a prescribed mechanism and port specific data. + * + * Return: true if the port uses a GID address to identify devices on the + * network. + */ +static inline bool rdma_cap_af_ib(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_AF_IB; +} + +/** + * rdma_cap_eth_ah - Check if the port of device has the capability + * Ethernet Address Handle. + * @device: Device to check + * @port_num: Port number to check + * + * RoCE is InfiniBand over Ethernet, and it uses a well defined technique + * to fabricate GIDs over Ethernet/IP specific addresses native to the + * port. Normally, packet headers are generated by the sending host + * adapter, but when sending connectionless datagrams, we must manually + * inject the proper headers for the fabric we are communicating over. + * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 9 19:08:31 2017 Return-Path: Delivered-To: svn-src-all@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 CC9B8E58EE6; Thu, 9 Nov 2017 19:08:31 +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 983D673B9D; Thu, 9 Nov 2017 19:08:31 +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 vA9J8Uu8036778; Thu, 9 Nov 2017 19:08:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9J8UMx036777; Thu, 9 Nov 2017 19:08:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091908.vA9J8UMx036777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 19:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325612 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 325612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 19:08:31 -0000 Author: hselasky Date: Thu Nov 9 19:08:30 2017 New Revision: 325612 URL: https://svnweb.freebsd.org/changeset/base/325612 Log: MFC r325278: Unconditionally include "opt_inet6.h" in the LinuxKPI. This makes sure the INET6 macro gets properly defined, also for kernel module builds. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/in6.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/in6.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/in6.h Thu Nov 9 19:00:11 2017 (r325611) +++ stable/11/sys/compat/linuxkpi/common/include/linux/in6.h Thu Nov 9 19:08:30 2017 (r325612) @@ -31,8 +31,6 @@ #ifndef _LINUX_IN6_H_ #define _LINUX_IN6_H_ -#ifndef KLD_MODULE #include "opt_inet6.h" -#endif #endif /* _LINUX_IN6_H_ */ From owner-svn-src-all@freebsd.org Thu Nov 9 19:15:30 2017 Return-Path: Delivered-To: svn-src-all@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 1DB35E59184; Thu, 9 Nov 2017 19:15:30 +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 D546373FAD; Thu, 9 Nov 2017 19:15:29 +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 vA9JFSGU040894; Thu, 9 Nov 2017 19:15:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9JFSK3040893; Thu, 9 Nov 2017 19:15:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091915.vA9JFSK3040893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 19:15: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: r325613 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/include/linux X-SVN-Commit-Revision: 325613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 19:15:30 -0000 Author: hselasky Date: Thu Nov 9 19:15:28 2017 New Revision: 325613 URL: https://svnweb.freebsd.org/changeset/base/325613 Log: MFC r325278: Unconditionally include "opt_inet6.h" in the LinuxKPI. This makes sure the INET6 macro gets properly defined, also for kernel module builds. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/in6.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/in6.h ============================================================================== --- stable/10/sys/ofed/include/linux/in6.h Thu Nov 9 19:08:30 2017 (r325612) +++ stable/10/sys/ofed/include/linux/in6.h Thu Nov 9 19:15:28 2017 (r325613) @@ -30,8 +30,6 @@ #ifndef _LINUX_IN6_H_ #define _LINUX_IN6_H_ -#ifndef KLD_MODULE #include "opt_inet6.h" -#endif #endif /* _LINUX_IN6_H_ */ From owner-svn-src-all@freebsd.org Thu Nov 9 19:22:45 2017 Return-Path: Delivered-To: svn-src-all@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 69DD4E59555; Thu, 9 Nov 2017 19:22:45 +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 31B90744F9; Thu, 9 Nov 2017 19:22:45 +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 vA9JMiCW044832; Thu, 9 Nov 2017 19:22:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9JMhV7044827; Thu, 9 Nov 2017 19:22:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091922.vA9JMhV7044827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 19:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325614 - in head/sys/ofed: drivers/infiniband/core include/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/ofed: drivers/infiniband/core include/rdma X-SVN-Commit-Revision: 325614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 19:22:45 -0000 Author: hselasky Date: Thu Nov 9 19:22:43 2017 New Revision: 325614 URL: https://svnweb.freebsd.org/changeset/base/325614 Log: Multiple fixes for using IPv6 link-local addresses with RDMA in ibcore. 1) Fail to resolve RDMA address if rtalloc1() returns the loopback device, lo0, as the gateway interface. Currently RDMA loopback is not supported. 2) Use ip_dev_find() and ip6_dev_find() to lookup network interfaces with matching IPv4 and IPv6 addresses, respectivly. 3) In addr_resolve() make sure the "ifa" pointer is always set, also when the "ifp" is NULL. Else a NULL pointer access might happen trying to read from the "ifa" pointer later on. 4) In rdma_addr_find_dmac_by_grh() make sure the "bound_dev_if" field gets set properly instead of passing the scope ID through the IPv6 socket address structure. This is more in line with upstream OFED in Linux. 5) In rdma_addr_find_smac_by_sgid() there is no need to pass the scope ID for IPv6. Either it is stored in the "bound_dev_if" field or ip6_dev_find() will find the correct network device regardless of the scope ID. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/addr.c head/sys/ofed/drivers/infiniband/core/cma.c head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c head/sys/ofed/drivers/infiniband/core/verbs.c head/sys/ofed/include/rdma/ib_addr.h Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Nov 9 19:15:28 2017 (r325613) +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Nov 9 19:22:43 2017 (r325614) @@ -110,14 +110,6 @@ int rdma_copy_addr(struct rdma_dev_addr *dev_addr, str } EXPORT_SYMBOL(rdma_copy_addr); -#define SCOPE_ID_CACHE(_scope_id, _addr6) do { \ - (_addr6)->sin6_addr.s6_addr[3] = (_scope_id); \ - (_addr6)->sin6_scope_id = 0; } while (0) - -#define SCOPE_ID_RESTORE(_scope_id, _addr6) do { \ - (_addr6)->sin6_scope_id = (_scope_id); \ - (_addr6)->sin6_addr.s6_addr[3] = 0; } while (0) - int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr, u16 *vlan_id) { @@ -149,34 +141,17 @@ int rdma_translate_ip(struct sockaddr *addr, struct rd #if defined(INET6) case AF_INET6: - { - struct sockaddr_in6 *sin6; - struct ifaddr *ifa; - in_port_t port; - uint32_t scope_id; + dev = ip6_dev_find(&init_net, + ((const struct sockaddr_in6 *)addr)->sin6_addr); - sin6 = (struct sockaddr_in6 *)addr; - port = sin6->sin6_port; - sin6->sin6_port = 0; - scope_id = sin6->sin6_scope_id; - if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) - SCOPE_ID_CACHE(scope_id, sin6); - CURVNET_SET_QUIET(&init_net); - ifa = ifa_ifwithaddr(addr); - CURVNET_RESTORE(); - sin6->sin6_port = port; - if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) - SCOPE_ID_RESTORE(scope_id, sin6); - if (ifa == NULL) { - ret = -ENODEV; - break; - } - ret = rdma_copy_addr(dev_addr, ifa->ifa_ifp, NULL); - if (vlan_id) - *vlan_id = rdma_vlan_dev_vlan_id(ifa->ifa_ifp); - ifa_free(ifa); - break; - } + if (!dev) + return ret; + + ret = rdma_copy_addr(dev_addr, dev, NULL); + if (vlan_id) + *vlan_id = rdma_vlan_dev_vlan_id(dev); + dev_put(dev); + break; #endif default: break; @@ -222,12 +197,9 @@ static int addr_resolve(struct sockaddr *src_in, struct ifaddr *ifa; struct ifnet *ifp; struct rtentry *rte; -#if defined(INET) || defined(INET6) - in_port_t port; +#if defined(INET6) + struct sockaddr_in6 dstv6_tmp; #endif -#ifdef INET6 - uint32_t scope_id; -#endif u_char edst[MAX_ADDR_LEN]; int multi; int bcast; @@ -247,11 +219,7 @@ static int addr_resolve(struct sockaddr *src_in, ifp = NULL; rte = NULL; ifa = NULL; - ifp = NULL; memset(edst, 0, sizeof(edst)); -#ifdef INET6 - scope_id = -1U; -#endif switch (dst_in->sa_family) { #ifdef INET @@ -263,29 +231,11 @@ static int addr_resolve(struct sockaddr *src_in, multi = 1; sin = (struct sockaddr_in *)src_in; if (sin->sin_addr.s_addr != INADDR_ANY) { - /* - * Address comparison fails if the port is set - * cache it here to be restored later. - */ - port = sin->sin_port; - sin->sin_port = 0; - memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); - - /* - * If we have a source address to use look it - * up first and verify that it is a local - * interface: - */ - CURVNET_SET_QUIET(&init_net); - ifa = ifa_ifwithaddr(src_in); - CURVNET_RESTORE(); - sin->sin_port = port; - if (ifa == NULL) { + ifp = ip_dev_find(&init_net, sin->sin_addr.s_addr); + if (ifp == NULL) { error = ENETUNREACH; goto done; } - ifp = ifa->ifa_ifp; - ifa_free(ifa); if (bcast || multi) goto mcast; } @@ -293,42 +243,26 @@ static int addr_resolve(struct sockaddr *src_in, #endif #ifdef INET6 case AF_INET6: + /* Make destination socket address writeable */ + dstv6_tmp = *(struct sockaddr_in6 *)dst_in; + dst_in = (struct sockaddr *)&dstv6_tmp; sin6 = (struct sockaddr_in6 *)dst_in; if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) multi = 1; - if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) { - /* - * The IB address comparison fails if the - * scope ID is set and not part of the addr: - */ - scope_id = sin6->sin6_scope_id; - if (scope_id < 256) - SCOPE_ID_CACHE(scope_id, sin6); - } + /* + * Make sure the scope ID gets embedded, else rtalloc1() will + * resolve to the loopback interface. + */ + sin6->sin6_scope_id = addr->bound_dev_if; + sa6_embedscope(sin6, 0); + sin6 = (struct sockaddr_in6 *)src_in; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { - port = sin6->sin6_port; - sin6->sin6_port = 0; - if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) { - if (scope_id < 256) - SCOPE_ID_CACHE(scope_id, sin6); - } - - /* - * If we have a source address to use look it - * up first and verify that it is a local - * interface: - */ - CURVNET_SET_QUIET(&init_net); - ifa = ifa_ifwithaddr(src_in); - CURVNET_RESTORE(); - sin6->sin6_port = port; - if (ifa == NULL) { + ifp = ip6_dev_find(&init_net, sin6->sin6_addr); + if (ifp == NULL) { error = ENETUNREACH; goto done; } - ifp = ifa->ifa_ifp; - ifa_free(ifa); if (bcast || multi) goto mcast; } @@ -342,9 +276,13 @@ static int addr_resolve(struct sockaddr *src_in, * Make sure the route exists and has a valid link. */ rte = rtalloc1(dst_in, 1, 0); - if (rte == NULL || rte->rt_ifp == NULL || !RT_LINK_IS_UP(rte->rt_ifp)) { - if (rte) + if (rte == NULL || rte->rt_ifp == NULL || + RT_LINK_IS_UP(rte->rt_ifp) == 0 || + rte->rt_ifp == V_loif) { + if (rte != NULL) { RTFREE_LOCKED(rte); + rte = NULL; + } error = EHOSTUNREACH; goto done; } @@ -356,20 +294,27 @@ static int addr_resolve(struct sockaddr *src_in, * correct interface pointer and unlock the route. */ if (multi || bcast) { + /* rt_ifa holds the route answer source address */ + ifa = rte->rt_ifa; + if (ifp == NULL) { ifp = rte->rt_ifp; - /* rt_ifa holds the route answer source address */ - ifa = rte->rt_ifa; + dev_hold(ifp); } RTFREE_LOCKED(rte); - } else if (ifp && ifp != rte->rt_ifp) { + rte = NULL; + } else if (ifp != NULL && ifp != rte->rt_ifp) { RTFREE_LOCKED(rte); + rte = NULL; error = ENETUNREACH; goto done; } else { + /* rt_ifa holds the route answer source address */ + ifa = rte->rt_ifa; + if (ifp == NULL) { ifp = rte->rt_ifp; - ifa = rte->rt_ifa; + dev_hold(ifp); } RT_UNLOCK(rte); } @@ -418,23 +363,17 @@ mcast: error = EINVAL; break; } - RTFREE(rte); done: if (error == 0) error = -rdma_copy_addr(addr, ifp, edst); if (error == 0) memcpy(src_in, ifa->ifa_addr, ip_addr_size(ifa->ifa_addr)); -#ifdef INET6 - if (scope_id < 256) { - sin6 = (struct sockaddr_in6 *)src_in; - if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr)) - SCOPE_ID_RESTORE(scope_id, sin6); - sin6 = (struct sockaddr_in6 *)dst_in; - SCOPE_ID_RESTORE(scope_id, sin6); - } -#endif if (error == EWOULDBLOCK) error = ENODATA; + if (rte != NULL) + RTFREE(rte); + if (ifp != NULL) + dev_put(ifp); CURVNET_RESTORE(); return -error; @@ -567,7 +506,7 @@ static void resolve_cb(int status, struct sockaddr *sr } int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, union ib_gid *dgid, u8 *dmac, - u16 *vlan_id, u32 scope_id) + u16 *vlan_id, int *if_index) { int ret = 0; struct rdma_dev_addr dev_addr; @@ -580,16 +519,17 @@ int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, uni struct sockaddr_in6 _sockaddr_in6; } sgid_addr, dgid_addr; - - ret = rdma_gid2ip(&sgid_addr._sockaddr, sgid, scope_id); + ret = rdma_gid2ip(&sgid_addr._sockaddr, sgid); if (ret) return ret; - ret = rdma_gid2ip(&dgid_addr._sockaddr, dgid, scope_id); + ret = rdma_gid2ip(&dgid_addr._sockaddr, dgid); if (ret) return ret; memset(&dev_addr, 0, sizeof(dev_addr)); + if (if_index) + dev_addr.bound_dev_if = *if_index; ctx.addr = &dev_addr; init_completion(&ctx.comp); @@ -611,24 +551,8 @@ int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, uni } EXPORT_SYMBOL(rdma_addr_find_dmac_by_grh); -u32 rdma_get_ipv6_scope_id(struct ib_device *ib, u8 port_num) +int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id) { -#ifdef INET6 - struct ifnet *ifp; - if (ib->get_netdev == NULL) - return (-1U); - ifp = ib->get_netdev(ib, port_num); - if (ifp == NULL) - return (-1U); - return (in6_getscopezone(ifp, IPV6_ADDR_SCOPE_LINKLOCAL)); -#else - return (-1U); -#endif -} - -int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id, - u32 scope_id) -{ int ret = 0; struct rdma_dev_addr dev_addr; union { @@ -637,7 +561,7 @@ int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 struct sockaddr_in6 _sockaddr_in6; } gid_addr; - ret = rdma_gid2ip(&gid_addr._sockaddr, sgid, scope_id); + ret = rdma_gid2ip(&gid_addr._sockaddr, sgid); if (ret) return ret; memset(&dev_addr, 0, sizeof(dev_addr)); Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 19:15:28 2017 (r325613) +++ head/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 19:22:43 2017 (r325614) @@ -51,6 +51,9 @@ #include #include +#include +#include + #include #include #include @@ -710,11 +713,7 @@ static int cma_modify_qp_rtr(struct rdma_id_private *i == RDMA_TRANSPORT_IB && rdma_port_get_link_layer(id_priv->id.device, id_priv->id.port_num) == IB_LINK_LAYER_ETHERNET) { - u32 scope_id = rdma_get_ipv6_scope_id(id_priv->id.device, - id_priv->id.port_num); - - ret = rdma_addr_find_smac_by_sgid(&sgid, qp_attr.smac, NULL, - scope_id); + ret = rdma_addr_find_smac_by_sgid(&sgid, qp_attr.smac, NULL); if (ret) goto out; } @@ -1452,19 +1451,16 @@ static int cma_req_handler(struct ib_cm_id *cm_id, str goto err3; if (is_iboe && !is_sidr) { - u32 scope_id = rdma_get_ipv6_scope_id(cm_id->device, - ib_event->param.req_rcvd.port); - if (ib_event->param.req_rcvd.primary_path != NULL) rdma_addr_find_smac_by_sgid( &ib_event->param.req_rcvd.primary_path->sgid, - psmac, NULL, scope_id); + psmac, NULL); else psmac = NULL; if (ib_event->param.req_rcvd.alternate_path != NULL) rdma_addr_find_smac_by_sgid( &ib_event->param.req_rcvd.alternate_path->sgid, - palt_smac, NULL, scope_id); + palt_smac, NULL); else palt_smac = NULL; } @@ -2311,8 +2307,12 @@ static int cma_bind_addr(struct rdma_cm_id *id, struct src_addr->sa_family = dst_addr->sa_family; #ifdef INET6 if (dst_addr->sa_family == AF_INET6) { - ((struct sockaddr_in6 *) src_addr)->sin6_scope_id = - ((struct sockaddr_in6 *) dst_addr)->sin6_scope_id; + struct sockaddr_in6 *src_addr6 = (struct sockaddr_in6 *) src_addr; + struct sockaddr_in6 *dst_addr6 = (struct sockaddr_in6 *) dst_addr; + src_addr6->sin6_scope_id = dst_addr6->sin6_scope_id; + if (IN6_IS_SCOPE_LINKLOCAL(&dst_addr6->sin6_addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&dst_addr6->sin6_addr)) + id->route.addr.dev_addr.bound_dev_if = dst_addr6->sin6_scope_id; } #endif } @@ -2666,20 +2666,23 @@ out: static int cma_check_linklocal(struct rdma_dev_addr *dev_addr, struct sockaddr *addr) { -#if defined(INET6) - struct sockaddr_in6 *sin6; +#ifdef INET6 + struct sockaddr_in6 sin6; if (addr->sa_family != AF_INET6) return 0; - sin6 = (struct sockaddr_in6 *) addr; - if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr) && - !sin6->sin6_scope_id) - return -EINVAL; + sin6 = *(struct sockaddr_in6 *)addr; - dev_addr->bound_dev_if = sin6->sin6_scope_id; + if (IN6_IS_SCOPE_LINKLOCAL(&sin6.sin6_addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&sin6.sin6_addr)) { + /* check if IPv6 scope ID is set */ + if (sa6_recoverscope(&sin6) || sin6.sin6_scope_id == 0) + return -EINVAL; + dev_addr->bound_dev_if = sin6.sin6_scope_id; + } #endif - return 0; + return (0); } int rdma_listen(struct rdma_cm_id *id, int backlog) Modified: head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Thu Nov 9 19:15:28 2017 (r325613) +++ head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c Thu Nov 9 19:22:43 2017 (r325614) @@ -2094,13 +2094,23 @@ static ssize_t __uverbs_modify_qp(struct ib_uverbs_fil attr->smac); attr->vlan_id = rdma_get_vlan_id(&sgid); } else { + struct net_device *idev; + int if_index; + + if (qp->device->get_netdev != NULL && + (idev = qp->device->get_netdev(qp->device, port_num)) != NULL) + if_index = idev->if_index; + else + if_index = 0; + ret = rdma_addr_find_dmac_by_grh(&sgid, dgid, attr->ah_attr.dmac, - &attr->vlan_id, -1U); + &attr->vlan_id, + &if_index); if (ret) goto out; ret = rdma_addr_find_smac_by_sgid(&sgid, attr->smac, - NULL, -1U); + NULL); if (ret) goto out; } Modified: head/sys/ofed/drivers/infiniband/core/verbs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/verbs.c Thu Nov 9 19:15:28 2017 (r325613) +++ head/sys/ofed/drivers/infiniband/core/verbs.c Thu Nov 9 19:22:43 2017 (r325614) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -207,10 +208,18 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 po memcpy(ah_attr->dmac, wc->smac, ETH_ALEN); ah_attr->vlan_id = wc->vlan_id; } else { - u32 scope_id = rdma_get_ipv6_scope_id(device, port_num); + struct net_device *idev; + int if_index; + + if (device->get_netdev != NULL && + (idev = device->get_netdev(device, port_num)) != NULL) + if_index = idev->if_index; + else + if_index = 0; + ret = rdma_addr_find_dmac_by_grh(&grh->dgid, &grh->sgid, ah_attr->dmac, &ah_attr->vlan_id, - scope_id); + &if_index); if (ret) return ret; } Modified: head/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- head/sys/ofed/include/rdma/ib_addr.h Thu Nov 9 19:15:28 2017 (r325613) +++ head/sys/ofed/include/rdma/ib_addr.h Thu Nov 9 19:22:43 2017 (r325614) @@ -105,10 +105,9 @@ void rdma_addr_cancel(struct rdma_dev_addr *addr); int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev, const unsigned char *dst_dev_addr); -int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id, - u32 scope_id); +int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id); int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, union ib_gid *dgid, u8 *smac, - u16 *vlan_id, u32 scope_id); + u16 *vlan_id, int *if_index); static inline int ip_addr_size(struct sockaddr *addr) { @@ -171,8 +170,7 @@ static inline int rdma_ip2gid(struct sockaddr *addr, u } /* Important - sockaddr should be a union of sockaddr_in and sockaddr_in6 */ -static inline int rdma_gid2ip(struct sockaddr *out, union ib_gid *gid, - uint32_t scope_id) +static inline int rdma_gid2ip(struct sockaddr *out, union ib_gid *gid) { if (ipv6_addr_v4mapped((struct in6_addr *)gid)) { struct sockaddr_in *out_in = (struct sockaddr_in *)out; @@ -186,14 +184,9 @@ static inline int rdma_gid2ip(struct sockaddr *out, un out_in->sin6_len = sizeof(*out_in); out_in->sin6_family = AF_INET6; memcpy(&out_in->sin6_addr.s6_addr, gid->raw, 16); - if (scope_id < 256 && - IN6_IS_SCOPE_LINKLOCAL(&out_in->sin6_addr)) - out_in->sin6_scope_id = scope_id; } return 0; } - -u32 rdma_get_ipv6_scope_id(struct ib_device *ib, u8 port_num); /* This func is called only in loopback ip address (127.0.0.1) * case in which sgid is not relevant From owner-svn-src-all@freebsd.org Thu Nov 9 19:27:30 2017 Return-Path: Delivered-To: svn-src-all@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 6BDB4E596AC; Thu, 9 Nov 2017 19:27:30 +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 381D17470F; Thu, 9 Nov 2017 19:27:30 +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 vA9JRTF9045027; Thu, 9 Nov 2017 19:27:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9JRTBu045026; Thu, 9 Nov 2017 19:27:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091927.vA9JRTBu045026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 19:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325615 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 325615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 19:27:30 -0000 Author: hselasky Date: Thu Nov 9 19:27:29 2017 New Revision: 325615 URL: https://svnweb.freebsd.org/changeset/base/325615 Log: Make sure the IPv6 scope ID gets zeroed when exchanging CMA messages in ibcore. Else the IPv6 address matching might fail. This change adds support for both embedded and non-embedded IPv6 scope IDs when passing a IPv6 link-local socket address to RDMA. Prior to this change only global IPv6 addresses would work with RDMA. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/cma.c Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 19:22:43 2017 (r325614) +++ head/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 19:27:29 2017 (r325615) @@ -934,6 +934,17 @@ static int cma_get_net_info(void *hdr, enum rdma_port_ return 0; } +static void cma_ip6_clear_scope_id(struct in6_addr *addr) +{ + /* make sure link local scope ID gets zeroed */ + if (IN6_IS_SCOPE_LINKLOCAL(addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(addr)) { + /* use byte-access to be alignment safe */ + addr->s6_addr[2] = 0; + addr->s6_addr[3] = 0; + } +} + static void cma_save_net_info(struct rdma_addr *addr, struct rdma_addr *listen_addr, u8 ip_ver, __be16 port, @@ -965,6 +976,7 @@ static void cma_save_net_info(struct rdma_addr *addr, ip6->sin6_port = listen6->sin6_port; ip6->sin6_len = sizeof(struct sockaddr_in6); ip6->sin6_scope_id = listen6->sin6_scope_id; + cma_ip6_clear_scope_id(&ip6->sin6_addr); ip6 = (struct sockaddr_in6 *) &addr->dst_addr; ip6->sin6_family = listen6->sin6_family; @@ -972,6 +984,7 @@ static void cma_save_net_info(struct rdma_addr *addr, ip6->sin6_port = port; ip6->sin6_len = sizeof(struct sockaddr_in6); ip6->sin6_scope_id = listen6->sin6_scope_id; + cma_ip6_clear_scope_id(&ip6->sin6_addr); break; default: break; @@ -1535,6 +1548,7 @@ static void cma_set_compare_data(enum rdma_port_space break; case AF_INET6: ip6_addr = ((struct sockaddr_in6 *) addr)->sin6_addr; + cma_ip6_clear_scope_id(&ip6_addr); if (ps == RDMA_PS_SDP) { sdp_set_ip_ver(sdp_data, 6); sdp_set_ip_ver(sdp_mask, 0xF); @@ -2840,6 +2854,8 @@ static int cma_format_hdr(void *hdr, enum rdma_port_sp cma_hdr->src_addr.ip6 = src6->sin6_addr; cma_hdr->dst_addr.ip6 = dst6->sin6_addr; cma_hdr->port = src6->sin6_port; + cma_ip6_clear_scope_id(&cma_hdr->src_addr.ip6); + cma_ip6_clear_scope_id(&cma_hdr->dst_addr.ip6); break; } } From owner-svn-src-all@freebsd.org Thu Nov 9 19:30:11 2017 Return-Path: Delivered-To: svn-src-all@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 CDC6AE59774; Thu, 9 Nov 2017 19:30:11 +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 96299748C6; Thu, 9 Nov 2017 19:30:11 +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 vA9JUAq1045181; Thu, 9 Nov 2017 19:30:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9JUAwS045180; Thu, 9 Nov 2017 19:30:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091930.vA9JUAwS045180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 19:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325616 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 325616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 19:30:11 -0000 Author: hselasky Date: Thu Nov 9 19:30:10 2017 New Revision: 325616 URL: https://svnweb.freebsd.org/changeset/base/325616 Log: Make sure sin_zero is zero in ibcore. Else socket address maching using bcmp() might fail. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/cma.c Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 19:27:29 2017 (r325615) +++ head/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 19:30:10 2017 (r325616) @@ -961,12 +961,14 @@ static void cma_save_net_info(struct rdma_addr *addr, ip4->sin_addr.s_addr = dst->ip4.addr; ip4->sin_port = listen4->sin_port; ip4->sin_len = sizeof(struct sockaddr_in); + memset(ip4->sin_zero, 0, sizeof(ip4->sin_zero)); ip4 = (struct sockaddr_in *) &addr->dst_addr; ip4->sin_family = listen4->sin_family; ip4->sin_addr.s_addr = src->ip4.addr; ip4->sin_port = port; ip4->sin_len = sizeof(struct sockaddr_in); + memset(ip4->sin_zero, 0, sizeof(ip4->sin_zero)); break; case 6: listen6 = (struct sockaddr_in6 *) &listen_addr->src_addr; From owner-svn-src-all@freebsd.org Thu Nov 9 19:46:41 2017 Return-Path: Delivered-To: svn-src-all@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 DC691E5A047; Thu, 9 Nov 2017 19:46:41 +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 A5D4D75A7C; Thu, 9 Nov 2017 19:46:41 +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 vA9Jked5054894; Thu, 9 Nov 2017 19:46:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9JkeYV054893; Thu, 9 Nov 2017 19:46:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711091946.vA9JkeYV054893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 9 Nov 2017 19:46:40 +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: r325617 - stable/10/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 325617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 19:46:42 -0000 Author: hselasky Date: Thu Nov 9 19:46:40 2017 New Revision: 325617 URL: https://svnweb.freebsd.org/changeset/base/325617 Log: Remove the now obsolete "unify_tcp_port_space" ibcore module parameter. Missed as part of the MFC of r324792 in r325611. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/infiniband/core/cma.c Modified: stable/10/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/10/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 19:30:10 2017 (r325616) +++ stable/10/sys/ofed/drivers/infiniband/core/cma.c Thu Nov 9 19:46:40 2017 (r325617) @@ -62,11 +62,6 @@ static int tavor_quirk = 0; module_param_named(tavor_quirk, tavor_quirk, int, 0644); MODULE_PARM_DESC(tavor_quirk, "Tavor performance quirk: limit MTU to 1K if > 0"); -int unify_tcp_port_space = 1; -module_param(unify_tcp_port_space, int, 0644); -MODULE_PARM_DESC(unify_tcp_port_space, "Unify the host TCP and RDMA port " - "space allocation (default=1)"); - #define CMA_CM_RESPONSE_TIMEOUT 20 #define CMA_MAX_CM_RETRIES 15 #define CMA_CM_MRA_SETTING (IB_CM_MRA_FLAG_DELAY | 24) From owner-svn-src-all@freebsd.org Thu Nov 9 19:52:58 2017 Return-Path: Delivered-To: svn-src-all@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 ED94BE5A29E; Thu, 9 Nov 2017 19:52:58 +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 6727675E89; Thu, 9 Nov 2017 19:52:58 +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 vA9Jqv0T058797; Thu, 9 Nov 2017 19:52:57 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9Jqvo0058789; Thu, 9 Nov 2017 19:52:57 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201711091952.vA9Jqvo0058789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 9 Nov 2017 19:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325618 - in stable/11: share/man/man4 sys/conf sys/contrib/dev/liquidio sys/dev/ixgbe sys/dev/liquidio sys/dev/liquidio/base sys/modules sys/modules/lio X-SVN-Group: stable-11 X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/conf sys/contrib/dev/liquidio sys/dev/ixgbe sys/dev/liquidio sys/dev/liquidio/base sys/modules sys/modules/lio X-SVN-Commit-Revision: 325618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 19:52:59 -0000 Author: sbruno Date: Thu Nov 9 19:52:56 2017 New Revision: 325618 URL: https://svnweb.freebsd.org/changeset/base/325618 Log: Merge r323509 and r324994 adding Cavium LiquidIO Driver (lio) to stable/11. Submitted by: pkanneganti@cavium.com ((Prasad V Kanneganti) Sponsored by: Cavium Networks Differential Revision: https://reviews.freebsd.org/D12425 Added: stable/11/share/man/man4/liquidio.4 (contents, props changed) stable/11/sys/contrib/dev/liquidio/ stable/11/sys/contrib/dev/liquidio/lio_23xx_nic.bin.uu stable/11/sys/dev/liquidio/ stable/11/sys/dev/liquidio/base/ stable/11/sys/dev/liquidio/base/cn23xx_pf_device.c (contents, props changed) stable/11/sys/dev/liquidio/base/cn23xx_pf_device.h (contents, props changed) stable/11/sys/dev/liquidio/base/cn23xx_pf_regs.h (contents, props changed) stable/11/sys/dev/liquidio/base/lio_common.h (contents, props changed) stable/11/sys/dev/liquidio/base/lio_config.h (contents, props changed) stable/11/sys/dev/liquidio/base/lio_console.c (contents, props changed) stable/11/sys/dev/liquidio/base/lio_ctrl.c (contents, props changed) stable/11/sys/dev/liquidio/base/lio_ctrl.h (contents, props changed) stable/11/sys/dev/liquidio/base/lio_device.c (contents, props changed) stable/11/sys/dev/liquidio/base/lio_device.h (contents, props changed) stable/11/sys/dev/liquidio/base/lio_droq.c (contents, props changed) stable/11/sys/dev/liquidio/base/lio_droq.h (contents, props changed) stable/11/sys/dev/liquidio/base/lio_image.h (contents, props changed) stable/11/sys/dev/liquidio/base/lio_iq.h (contents, props changed) stable/11/sys/dev/liquidio/base/lio_mem_ops.c (contents, props changed) stable/11/sys/dev/liquidio/base/lio_mem_ops.h (contents, props changed) stable/11/sys/dev/liquidio/base/lio_request_manager.c (contents, props changed) stable/11/sys/dev/liquidio/base/lio_response_manager.c (contents, props changed) stable/11/sys/dev/liquidio/base/lio_response_manager.h (contents, props changed) stable/11/sys/dev/liquidio/lio_bsd.h (contents, props changed) stable/11/sys/dev/liquidio/lio_core.c (contents, props changed) stable/11/sys/dev/liquidio/lio_ioctl.c (contents, props changed) stable/11/sys/dev/liquidio/lio_ioctl.h (contents, props changed) stable/11/sys/dev/liquidio/lio_main.c (contents, props changed) stable/11/sys/dev/liquidio/lio_main.h (contents, props changed) stable/11/sys/dev/liquidio/lio_network.h (contents, props changed) stable/11/sys/dev/liquidio/lio_rss.c (contents, props changed) stable/11/sys/dev/liquidio/lio_rss.h (contents, props changed) stable/11/sys/dev/liquidio/lio_rxtx.c (contents, props changed) stable/11/sys/dev/liquidio/lio_rxtx.h (contents, props changed) stable/11/sys/dev/liquidio/lio_sysctl.c (contents, props changed) stable/11/sys/modules/lio/ stable/11/sys/modules/lio/Makefile (contents, props changed) Modified: stable/11/share/man/man4/Makefile stable/11/share/man/man4/altq.4 stable/11/share/man/man4/vlan.4 stable/11/sys/conf/NOTES stable/11/sys/conf/files stable/11/sys/dev/ixgbe/if_ix.c stable/11/sys/modules/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Thu Nov 9 19:46:40 2017 (r325617) +++ stable/11/share/man/man4/Makefile Thu Nov 9 19:52:56 2017 (r325618) @@ -258,6 +258,7 @@ MAN= aac.4 \ led.4 \ lge.4 \ ${_linux.4} \ + ${_liquidio.4} \ lm75.4 \ lmc.4 \ lo.4 \ @@ -821,6 +822,7 @@ _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _io.4= io.4 _linux.4= linux.4 +_liquidio.4= liquidio.4 _ndis.4= ndis.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 Modified: stable/11/share/man/man4/altq.4 ============================================================================== --- stable/11/share/man/man4/altq.4 Thu Nov 9 19:46:40 2017 (r325617) +++ stable/11/share/man/man4/altq.4 Thu Nov 9 19:52:56 2017 (r325618) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2015 +.Dd September 20, 2017 .Dt ALTQ 4 .Os .Sh NAME @@ -155,6 +155,7 @@ They have been applied to the following hardware drive .Xr ixgbe 4 , .Xr jme 4 , .Xr le 4 , +.Xr liquidio 4 , .Xr msk 4 , .Xr mxge 4 , .Xr my 4 , Added: stable/11/share/man/man4/liquidio.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/liquidio.4 Thu Nov 9 19:52:56 2017 (r325618) @@ -0,0 +1,133 @@ +.\" BSD LICENSE +.\" +.\" Copyright(c) 2017 Cavium, Inc.. All rights reserved. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" * Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" * 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. +.\" * Neither the name of Cavium, Inc. nor the names of its +.\" contributors may be used to endorse or promote products derived +.\" from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT +.\" OWNER(S) 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 September 20, 2017 +.Dt LIQUIDIO 4 +.Os +.Sh NAME +.Nm liquidio +.Nd "Cavium 10Gb/25Gb Ethernet driver for the FreeBSD operating system" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device lio" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_lio_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for 23XX 10Gb/25Gb Ethernet adapters. +The driver supports Jumbo Frames, Transmit/Receive checksum +offload, TCP segmentation offload (TSO), Large Receive Offload (LRO), +VLAN tag insertion/extraction, VLAN checksum offload, +VLAN TSO, and Receive Side Steering (RSS) +.Pp +Support for Jumbo Frames is provided via the interface MTU setting. +Selecting an MTU larger than 1500 bytes with the +.Xr ifconfig 8 +utility configures the adapter to receive and transmit Jumbo Frames. +The maximum MTU size for Jumbo Frames is 16000. +.Pp +For more information on configuring this device, see ifconfig(8). +.Sh HARDWARE +The +.Nm +driver supports the following cards: +.Pp +.Bl -bullet -compact +.It +LiquidIO II CN2350 210SV/225SV +.It +LiquidIO II CN2360 210SV/225SV +.El +.Sh LOADER TUBABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Pp +.Bl -tag -width indent +.It Va hw.lio.fw_type +.Pp +String that specifies type of firmware to be loaded. +Default is "nic". Use "none" to load firmware from flash. +.It Va hw.lio.num_queues_per_pf0 +.Pp +Unsigned integers that specify number of queues per PF0. +Valid range is 0 to 64. +Use 0 to derive autoconfigures based on the number of +cpus with a max of 8 +.It Va hw.lio.num_queues_per_pf1 +.Pp +Unsigned integers that specify number of queues per PF1. +Valid range is 0 to 64. +Use 0 to derive autoconfigures based on the number of +cpus with a max of 8 +.It Va hw.lio.console_bitmask +.Pp +Bitmask indicating which consoles have debug output +redirected to syslog. +.It Va hw.lio.rss +.Pp +To enable/disable driver RSS support +.It Va hw.lio.hwlro +.Pp +To enable/disable hardware LRO +.Sh SUPPORT +For general information and support, +go to the Cavium support website at: +.Pa http://support.cavium.com . +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Derek Chickles Aq Mt derek.chickles@cavium.com . Modified: stable/11/share/man/man4/vlan.4 ============================================================================== --- stable/11/share/man/man4/vlan.4 Thu Nov 9 19:46:40 2017 (r325617) +++ stable/11/share/man/man4/vlan.4 Thu Nov 9 19:52:56 2017 (r325618) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2016 +.Dd September 20, 2017 .Dt VLAN 4 .Os .Sh NAME @@ -135,6 +135,7 @@ in hardware: .Xr ixgb 4 , .Xr ixgbe 4 , .Xr jme 4 , +.Xr liquidio 4 , .Xr msk 4 , .Xr mxge 4 , .Xr nxge 4 , Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Thu Nov 9 19:46:40 2017 (r325617) +++ stable/11/sys/conf/NOTES Thu Nov 9 19:52:56 2017 (r325618) @@ -1981,6 +1981,7 @@ device xmphy # XaQti XMAC II # lge: Support for PCI gigabit ethernet adapters based on the Level 1 # LXT1001 NetCellerator chipset. This includes the D-Link DGE-500SX, # SMC TigerCard 1000 (SMC9462SX), and some Addtron cards. +# lio: Support for Cavium 23XX Ethernet adapters # malo: Marvell Libertas wireless NICs. # mwl: Marvell 88W8363 802.11n wireless NICs. # Requires the mwl firmware module Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Nov 9 19:46:40 2017 (r325617) +++ stable/11/sys/conf/files Thu Nov 9 19:52:56 2017 (r325618) @@ -2162,6 +2162,62 @@ dev/le/if_le_pci.c optional le pci dev/le/lance.c optional le dev/led/led.c standard dev/lge/if_lge.c optional lge +dev/liquidio/base/cn23xx_pf_device.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/base/lio_console.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/base/lio_ctrl.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/base/lio_device.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/base/lio_droq.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/base/lio_mem_ops.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/base/lio_request_manager.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/base/lio_response_manager.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/lio_core.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/lio_ioctl.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/lio_main.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/lio_rss.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/lio_rxtx.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +dev/liquidio/lio_sysctl.c optional lio \ + compile-with "${NORMAL_C} \ + -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP" +lio.c optional lio \ + compile-with "${AWK} -f $S/tools/fw_stub.awk lio_23xx_nic.bin.fw:lio_23xx_nic.bin -mlio_23xx_nic.bin -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "lio.c" +lio_23xx_nic.bin.fw.fwo optional lio \ + dependency "lio_23xx_nic.bin.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "lio_23xx_nic.bin.fw.fwo" +lio_23xx_nic.bin.fw optional lio \ + dependency "$S/contrib/dev/liquidio/lio_23xx_nic.bin.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "lio_23xx_nic.bin.fw" dev/lmc/if_lmc.c optional lmc dev/malo/if_malo.c optional malo dev/malo/if_malohal.c optional malo Added: stable/11/sys/contrib/dev/liquidio/lio_23xx_nic.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/contrib/dev/liquidio/lio_23xx_nic.bin.uu Thu Nov 9 19:52:56 2017 (r325618) @@ -0,0 +1,28149 @@ +begin 644 lio_23xx_nic.bin +M0TY)0S$N-BXQ``````````````!B;V]T;V-T(#!X,C$P,#`P,#`@;G5M8V]R +M97,])"AN=6UC;W)E]`#``````/`(4&&>]_\B,0E:, +M_[$`"```B"W_OP`P_[4`*/^T`"#_LP`8_[(`$!!```3_L```/`00"PP"?WID +MA#F`/!#__#P4__`V$``)-I0`)0`0A#@`%*7X-A!``3P3$`M\$@`[-I0!`WY2 +M"<,`$(=X/!44&&9S.9``$I$\`!2E.`)0$"4\`P`@W$8```(#&"V.HE:,`D,8 +M)680``APQ2CR`+0H+0"R*"7]`#@4 +MH``$`````/R````#X``(`````-RB``A\I4@!?$,(`GQ"2((``QR\``(5/`!B +M$"4`12@E_(4```/@``@`````?(9Z`#P%``T`!C(``(`0+32E`P!\`K@'0`-X +M``#%*"L0H``N/`4#`!1%``@\!0#_`&0P)C2E_Q``Q2@D%*``&B0"``$#X``( +M`````!1```<`9#`F-*7_#P#%*"04H``2)`(``0/@``@`````/`4!`!1%``<\ +M!@(``&0H)GRE>@`4H``))`(``0/@``@`````%$8`!0!D$"8DI?\?`$4H)!"@ +M_^@D`@`!?((&@!1```,\!0#_`^``"```$"TTI?\0`&48)`"%("0`9!@K$&#_ +M^20"``$#X``(`````!1%``@\!0#_`&0P)C2E_T``Q2@D%*``)20"``$#X``( +M`````!1```<`9#`F-*7_/P#%*"04H``=)`(``0/@``@`````/`4(`!1%``@\ +M!0#_`&0P)C2E_S@`Q2@D%*``$R0"``$#X``(`````#P%`@`410`(/`4`_P!D +M,"8TI?]``,4H)!2@``DD`@`!`^``"``````\!0$`%$4`!`!D*"9\I7H`$*#_ +ML"0"``%\@@=`$$``"#P%__)\8K@`-*7]`#0&C0``12@A`*8H*Q2@_Z8D`@`! +M?(('@!!```<\!?_R?&:X`#2E<```Q2@A+*4$`!2@_YTD`@`!!($`!SP%__)\ +M9K@`-*5L``#%*"$LI0$`%*#_E20"``%\@@<`$$``"'R"!H`\!0`-?&:X`#2E +ME0``Q2@K$*#_C"0"``%\@@:`$$#_I0`````\`@#_-$+_0`!B&"0`@A`D`&(0 +M*Q!`_YX``````^``""0"``$`````9[W_./^_`,#_O@"X`(#P+?^Q`(``H(@M +M_[<`L/^V`*C_M0"@_[0`F/^S`)#_L@"(#`(P7O^P`'@,`(=Z`$`@+3P%``,\ +M`Q0`)`(``?QE1<@D!20`/`,4`#P&``?\947`)`4`0#P#%``TQO___&5%N#P# +M%`#\8$6P/`4`/S2E__X\`Q0`_&5%J#P#%`#\8D6@)`4`"(^$@8`\`Q0`_&5% +MF#P#%`#\9D60/`,4`/QB18@\`Q0`#`"(&*QB18`00`#W/`,4``P`&#@````` +M#`!^N``````40`"3/`(4&`P`?'*,1%=D%$``=#P$$`L,`&[6`````!1``-\\ +M`Q0`D&(!&!!``63_HP!P/`0!SCP&$`LTA!@`)`4`@&3&/M@,`+1>/!`4`!!` +M`-C^`D8(/`8!S@!`("T``"@M#`)F8#3&&``\`Q08W&)6@#P$$`O>`T8(/`40 +M"SP&$`L\!Q`+9(0^\&2E/Q#\0P`X9,8_&`P`%Y9DYS\@*\(`!!1``&\GWO_\ +M9B(`('/>^/)F,0`8`%[P+3P7$`L\%A`+/!40"SP4$`L\$Q`+"``!<3P2$`L, +M`C@L9@0`#-XP``!FI3]8)`8`#0P"@G0"`"`M$$``-P`````"`"`M9H4_:`P" +M@G0D!@`/$$``3``````"`"`M9F4_>`P"@G0D!@`1$$``0@`````"`"`M9D4_ +MD`P"@G0D!@`.$$``.`````!F,0`($CX`1SP$$`O>,```/`40"V2E/S@D!@`' +M#`*"=`(`("T40``&`@`@+20#``$\`A0`K$-%U-XP```"`"`M9N4_0`P"@G0D +M!@`'%$``!@(`("TD`P`!/`(4&*Q#5HS>,````@`@+6;%/T@,`H)T)`8`#!!` +M_\<"`"`M9J4_6`P"@G0D!@`-%$#_S`(`("T,`C?^``````@``5S>,```#``7 +MEF2$/GC?OP#`)`(``=^^`+C?MP"PW[8`J-^U`*#?M`"8W[,`D-^R`(C?L0"` +MW[``>`/@``AGO0#(#`(X9&8$``X(``%O9C$`"`P",%8`````"``!:-XP```, +M`CA&9@0`#P@``6+>,```/`00"PP`%Y9DA#Y`"``!F=^_`,`\!!`+/`40"V2$ +M/Z!DI3^P`Z`P+0P`%Y8\$!(4/`@Q+C4(-BX\`A(4K$B^,#P&$`L\!Q`+9$.^ +M,&3&/\ADYS_@9@2^H"0%`&HD`C$`#`)_UJ1B``1F!;Z@`Z`@+0P"@?"@H`!I +M#``%I@`````,`'W8CX2!@!1`_\7?OP#`#``&L@`````40/_!W[\`P#P#%!C< +M8E:`/`,4&-QC5WC\0P``/`(4&-Q%5H!DI`!@#`#..&2E`&@\`A08W$-6@#P" +M%!ED0IY8/`0`"P!$("UD8P!PW$@``-Q'``C<1@`0W$4`&&1"`"#\:```_&<` +M"/QF`!#\90`8%$3_]F1C`"`,`#[<`````!1`_Z'?OP#`#``^W@`````,`C%T +M``````P`?>@`````$$``$#P$$`L,`!>69(1`(`@``9G?OP#`/`00"PP`%Y9D +MA#ZH"``!F=^_`,`\!!`+#``7EF2$/_`(``&9W[\`P/^C`'`,`(=L``````P` +M!T``````#`(Q#@`````,`(@8CX2!@!!``$??HP!PD&(!&!!``)LD!0(`#`$X +M'"0$#``,`)3H)`0``0P`B$0\$@"O/!4``GP$`#M\A`G##`%93@``@"T,`3R. +M/!$4`#P4`,1F4X0`-K6A@-XB1@``5!@MC&20,`($*"H0H``+`````'(5&`,F +M$``!`$,H+0!S("T"12@M`$0@+0P`09;\H(0@"``"+MXB1@`,`)1PC&60-`P` +M``H`````/`4`#7P$`#LTI?`5#`#`)'R$"<,D`X`!``, +M`E:`W$,``-Q$`&#<10!H/`(4&`P`SD#\0U=X)`0``PP!.&(``"@MW@56@#P# +M%!D\!``+9&.>6&2B`'``1"`MW$D``-Q(``C<1P`0W$8`&&1"`"#\:0``_&@` +M"/QG`!#\9@`8%$3_]F1C`"#``"$/A^0A(*`$#X"0````#>`A5X`%$8*Q1@__AD0@`!#``" +MO@`````\`A`+9$(V8!!```4D`@`!/`00#@P"S9ADA)P`)`(``:)B%7#?OP`@ +MW[,`&-^R`!#?L0`(W[````/@``AGO0`H9[W_^/^_``#?OP```^``"&>]``@` +M````/`(0"V>]__AD0C/8$$``!O^_```\!!`./`42$F2$G``,`LSV9*45@#P$ +M$@_<@MJX$$``!CP"``!D0@``$$``!-^_````0/@)9(3:N-^_```(``+.9[T` +M"&>]__C_OP``W[\```/@``AGO0`(````````$"```!@@```@(```*"```#`@ +M```X(```0"```$@@``!0(```6"```&`@``!H(```<"```'@@``"H(```L"`` +M`+@@``#`(```R"```-`@``#8(```X"```/`@``#X(#P<$A-GG)'```#X+0.@ +M\"T\"2``0`A@``$)0"4\"00``0E`)4"(8``\"0$`1,GX`"0)__]$J0``1*D( +M`$2I$`!$J1@`1*D@`$2I*`!$J3``1*DX`$2I0`!$J4@`1*E0`$2I6`!$J6`` +M1*EH`$2I<`!$J7@`1*F``$2IB`!$J9``1*F8`$2IH`!$J:@`1*FP`$2IN`!$ +MJ<``1*G(`$2IT`!$J=@`1*G@`$2IZ`!$J?``1*GX`&($```\&1(29SD58`P" +M9M#_)````````#P9$A)G.15@WR0``#P9$`=G.<\8$R``!@`````#(/@)```` +M`!```!\``````````$`9>`$D!/P``R3()"0$``T`!"`\-(0`#?\D`(#_)`$` +M_R0!@/\D`@#_)`*`_R0#`/\D`X#_)`0`_R0$@````0\```$/0!E@`#P$_[\T +MA/__`R3()$"98``\&1`*9SG?F`,@^`D`````$````@``````````/!D0`&]_@`\`@#$ +M_[0!T#P4%`#_MP'HWI=&`/^_`?C_O@'P_[8!X`+B$"W_M0'8_[,!R/^R`<#_ +ML0&X_[`!L(Q"D#000`#]_Z0!J#P2$A(\%0`)9E(>,```F"T``(`M/!$4&#:U +MH(```````Z`@+0``*"TD!@&@#`)F8'X6^`,T`JZ`X@`(V%X` +MX8XB5HP40`$R/`00"P``N"T``'@M``!P+0``:"T``&`M``!8+0``4"T``$@M +M``!`+0``."T``#`M```H+0``("T``!@M``#`+0`6\3@`%LBX/`(4``/9R"_< +M0D8(`S;(+3P>`^"T`61`M`_/X+61"`&@`````W%X`&-Q9 +M````?A@M_Z,`>`,9P"W<60`@`)D@+?^D`(#<60#H`+DH+?^E`4C<60$``-DP +M+?^F`6#<60$X`/DX+?^G`9C<60$(`1E`+?^H`6C<60!``3E(+?^I`*#<60!( +M`5E0+?^J`*C<60!0`7E8+?^K`+#<60!8`9E@+?^L`+C<60!@`;EH+?^M`,#< +M60!H`=EP+?^N`,C<60!P`?EX+?^O`-#<60!X`%40+0+YN"T47__3_[<`V#0" +MKH`#H"@MD +M`:#<2```W$<`"-Q&`!#<10`89$(`(/QH``#\9P`(_&8`$/QE`!@41/_V9&,` +M(-Z71@`\`@#$)A```692`:`"XA`MC$*0-`("$"L40/\-9G,!H-^_`?C?O@'P +MW[#?M0'8W[0!T-^S`69(0[6(XB5HS?I0#8$*``!P`````00/^R`````#P$$`L,`!>69(0[>(XB +M5HP00/^LWZ8!J#P"%!C<0U=H/`00"]^B`4ADA#N8WD4!2`##`!\`8`'T`$`P +M+0!%$"\``!@2`$,`'P!@`?0,`!>6```H$@@`!)".(E:,#``7EF2$.]B.(E:, +MWZ4!0!"@``<`````$$#_MP.@$"T\!!`+#``7EF2$._".(E:,$$#_L#P$$`T, +M`!>69(0HN`@`!+0#H!`M/`00"PP`%Y9DA#GXCB)6C-^E`(`0H/\]WZ,`B!1` +M`&@`````"``$3P``$"T``````@`H+0P`%Y9DA#G`W[@`8-^C`'C?I`"`WZ4! +M2-^F`6#?IP&8WZ@!:-^I`*#?J@"HWZL`L-^L`+C?K0#`WZX`R-^O`-`(``/R +MW[<`V-^E`:@\`A08W$-7:#P$$`O>0@!@9(0YT`+`,"T`HP`?`&`!]`+"$"\` +M`"@2`$4`'P"@`?0,`!>6```H$@@`!#Z.(E:,/`00"PP`%Y9DA#NX"``$E8XB +M5HP\!!`+#``7EF2$.Q@(``2&CB)6C#P$$`L,`!>69(0[.`@`!(N.(E:,/`00 +M"PP`%Y9DA#GH"``$FHXB5HP\!!`+#``7EF2$.?@(``2?CB)6C#P$$`L,`!>6 +M9(0[R`@`!*2.(E:,WZ(!H#P$$`MDA#H@`N(H+0"^*"T,`!>6`+8H+P@`!$^. +M(E:,/`00"PP`%Y9DA#HP"``$5(XB5HP\!!`+#``7EF2$.D@(``19CB)6C#P$ +M$`L,`!>69(0Z"`@`!*F.(E:,/`00"PP`%Y9DA#H@"``$KHXB5HP\!!`+#``7 +MEF2$.>@(``1#CB)6C#P$$`L,`!>69(0Z"`@`!$J.(E:,/`00"PP`%Y9DA#I@ +M"``$7HXB5HP\!!`+#``7EF2$.G@(``1CCB)6C#P$$`L,`!>69(0ZD`@`!&B. +M(E:,/`00"PP`%Y9DA#JH"``$;8XB5HP\!!`+#``7EF2$.K@(``1RCB)6C#P$ +M$`L,`!>69(0ZT`@`!'>.(E:,/`00"PP`%Y9DA#KH"``$?(XB5HP\!!`+#``7 +MEF2$.P`(``2!CB)6C``````\!!`+9[W_^/^_```,`!>69(0\`#P$$`L,`!>6 +M9(0\(-^_```\!!`-9[T`"`@`%Y9DA"BX`````&>]_Z@`@$`M_[(`&#P2%!B. +M0E:,_[\`4/^^`$C_MP!`_[8`./^U`##_M``H_[,`(/^Q`!`40`!L_[``"#P4 +M%!B.@E=D$$``-3P3`H\\%108-G-<*3P6`#``$YQX``"`+69SZX5FM5:0`!.< +M^#P7%``VUN1@"``%V#9S]<,`````)A```0("$"L00``ECD)6C'X1^`,`$1"X +M?J(0"A!`__B.@E=DWN5&``(V("W?@H,0``0@N`"D("T00`!6C)X`(`!>$"T` +M`"`M```!#W!$)-^.0E:,%$``("0")Q#>Y$8``C:(+=^"@Q``$8BX`)&(+1!` +M`$..,0`@`%$0+280``$```$/_$```````0^.@E=D`@(0*Q1`_]]^$?@#CD)6 +MC!1``"3?OP!0W[X`2-^W`$#?M@`XW[4`,-^T`"C?LP`@W[(`&-^Q`!#?L``( +M`^``"&>]`%@``````@`H+7""$`,\!!`+_Z@``&2$/$``2``?`0`!]```$!(` +M`C"Z`-,`'0``,!``!C"Z``9(N``&.3@!)S@M``8P```'2+@`Z3@M`$69(0\,`@`!]__A\ +M!``[_[\```P`R-Y\A`G#/`00"P``*"T,`!>69(0\4#P$$`T,`!>69(0HN#P$ +M$``,`+&J)`4(`!!``#P``"`M/`40"V2E/(@`0#`M)`<(``P`R]`\"``"/`1` +M``P`L:HD!0$`$$``220$``(\!1`+9*4\F`!`,"TD!P$`#`#+T#P(`$`\!`@` +M#`"QJB0%!``00``P)`0``SP%$`MDI3RH`$`P+20'!``,`,O0/`@``CP$"``, +M`+&J)`4$`!!``#LD!``%/`40"V2E/,``0#`M)`<$``P`R]`\"``"/`0"``P` +ML:HD!0$`$$``(20$``0\!1`+9*4\V`!`,"TD!P$`#`#+T#P(``(,`(@Z```` +M`!1```PD`P`!#`&*R#P$``$``A`K"``&D'!#`#H\!!`+/`40"V2$/&@,`GZ\ +M9*4\B"0#``'?OP```&`0+0/@``AGO0`(/`00"SP%$`MDA#QH#`)^O&2E/*@( +M``:0)`,``3P$$`L\!1`+9(0\:`P"?KQDI3S8"``&D"0#``$\!!`+/`40"V2$ +M/&@,`GZ\9*4\F`@`!I`D`P`!`````#P$$`L\!1`+9(0\:`P"?KQDI3S`"``& +MD"0#``$`````9[W_N/^P```D$``!_[\`0/^W`#C_M@`P_[4`*/^T`"#_LP`8 +M_[(`$`P`!C[_L0`($$``#0````#?OP!``@`0+=^W`#C?M@`PW[4`*-^T`"#? +MLP`8W[(`$-^Q``C?L````^``"&>]`$@,`!,8`````!1``$$\!!`+#``2\@`` +M```40``W/`00"PP`%T`D$``!%$#_ZM^_`$`,`(5.`````!1`_^;?OP!`/`+_ +M@#1"`0$``A(\-$(!H-Q"``````$//!44&(ZB5V000``[/!84&#P3`#```(`M +M9M96D"04__\\%Q0`"``&\C9SY&``````CJ)79`("$"L00``P/`/_X'X1^`,` +M$1"X?L(0"A!`__@F$``!)`3__PP`T*P",X@M$%0`.@!`D"W>XD8``!&(N`!1 +MB"VN,@`@WX*#$!!``#D``````%*0+0```0_^0``````!#P@`!N^.HE=D```` +M`#P%$`MDA#T`#``7EF2E1%`(``;4`````#P%$`MDA#SH#``7EF2E1%#?OP!` +MW[<`.`(`$"W?M@`PW[4`*-^T`"#?LP`8W[(`$-^Q``C?L````^``"&>]`$@\ +M`__@)!```31C`%4``QVX-&,`#0`#'3A\`@`[?$()PS1C``@``A$\`$,0)20# +M``'\0P``#``4<@`````40/^0``````P`9.(``(`M"``&P=^_`$`\!!`+)!`` +M`0P`%Y9DA#TH"``&P=^_`$`,`-#X``````@`!P/?@H,0`````&>]__C_OP`` +M#`"%8@`````40``%)`,``0P`?>0````````!#P``&"W?OP```&`0+0/@``AG +MO0`(9[W_N/^_`$#_MP`X_[8`,/^U`"C_M``@_[,`&/^R`!#_L0`(&*``)?^P +M```D%0`!/!00"P`5JCP`@(`M``"X+0``B"UFM?_X)!;__V:4/4`(``=U`*"8 +M+7[2_\:2`@`!?&,6`I('``(P:`#_`B`H+0*`("TF,0`!#``7EGQ'>@22`@`" +MD@,``0)`@"U\8GH$,$+__Q(S``H`5[@AW@,``'QF.`$`U1`M?$(X`11`_^H` +M0)`M"``'90``D"T``+@MW[\`0`+@*"W?M@`P/`00"]^W`#ADA#UHW[4`*-^T +M`"#?LP`8W[(`$-^Q``C?L```"``7EF>]`$AGO?_(_[,`*'T31,+_L@`@,/(# +M__^P`!``@(`M_[\`,/^Q`!C<@P`(C(8`#'QD2((PB0#_`-(P)@`)2,)\`O`[ +M$$#__GX%2`$D"P"`?`H`.Q"K`)D``!`M`(!0+0`)2,!\"CC$``0B`@$J2"4` +M@%`M?2-8AB0$``'^`P`(K@8`#-X#``A\@P@&_@,`"````4\D!``!/`/__'R" +M>P8T8P`+?(*`=\L4(&?&-<`B0%`@%\<=P&``4HO"0#``$`12@D +M``,8O!"C`'4\`P`!E@4`L#1C``$R. +M`@"H?$,%@!1@`%$P0P$`_!&!`-X"`!B6!``8D@,`!'Q"2`$H8P`"%&``5WR" +M_`9\`GM&_`*!"/D1`,@D!0`"```!3SP"%!C<0E=XD$,`#0)#&",L8@"`$$`` +M!3P"%!C<0D@8?$,9BA1@`"\D!``)``X;\ +M$8$`W@(`&)8$`!B2`P`$?$)(`2AC``(08/^K?(+\!B0#``$(``?A?&)[1@`` +M``!]2@G#``E(P``*&@`(``>P`&E()0````"&`@!H/`,4`-QE1@@\`P`)-&.@ +M@'P$`#M\A/@#``(Q.'"#(`,``ABX`,,8+P!B$"T``AEX`*00+0!#$"W<0P&8 +M9&,``?Q#`9B.`@"H?$,%@!1@`'0\!``!W@,`J#2$``$`!"%\`&0H)!"D`",` +M````E@4`N"0$`@$R`P"@`&(8+8QF``!H9``,:&(`!'R%^`-\27P#`25(+0`$(#Z( +M90```24H+0`"$#Y\QAX#`*0H+0"B*"TLP@`&%$``"P`%%#HD!``4``8PN``` +M````@Q`M9(0`!(A"``!\0O@#%(;_^P"B*"T`!10Z9&0`"GRE>`,`11`M``(L +M.GQ">`,`HB@M``44.GRE>`,`11`M.$+__Z""``$``@H"H($``-X#`*@(``A< +MC@(`J-X#`)@\`@`!-$(D!R0%``,``A.\?&1(`0`#(`I\@D@%"``'Y/P"@1`` +M$EI`-2D`57#J"3,`"4J\-2D`4`%I2"T!24@EW2H``'U*>`$`"D@`?41X!0#) +M,"H0P/].K$D``'P$C`8D`@`)"``('7Q$_P8(``@`9$(=L'Q#!@`08``*,$)` +M`)8%`+C_IP```@`@+1!``$C_J``(#`!K*`````#?IP``WZ@`"-X"`*@D`P(! +M``,;O`!#("00@P`;`````)8%`+`R]_[C_MP`X?1=$PO^V`#``H+`M_[4`*`+@J"W_M``@?111@O^S`!@`X)@M +M_[(`$`$`D"W_L````("`+?^_`$#_L0`(```!3SP"`0$PX___$*``5P!B&"5\ +M`O`[$$#__CP"__PD!`!!-$(`"P`$(SQ\!0`[``(3?'RE"<,TA`"```4R`'RB +M.09\Q.T&?&(9!7Y1`,+\1```?D,$0@`1C;A^1`D"D@(`$'QQWL:6`P`(?I'4 +M!GR1_X808`$;?%&L!WQQ>`=P1`!O`!$=NCAC``$``Q@``(,8)!!@``\`%B@K +M<$,`K@!E&"048``+`````-X&``!\PU@",&0(`!2``#X`8#@M``8SO@!%*",P +MQ#``#``^V`"'("7>`@"H/`,``20%`@$T8P`!``4HO"0$``$``QE\`$4H)``$ +M(+P0I``R`$,0)!!#`%0`````C@(`J'Q#!8`48``<`````'Z2@8;Z0@#Y`F`@ +M+=X&`!@"("@M```X+20(``$,`7L\```````"$`#?OP!`W[<`.-^V`##?M0`H +MW[0`(-^S`!C?L@`0W[$`"-^P```#X``(9[T`2'P"\#L40/^K/`+__`@`"9(` +M`````````-X#`*A\9`H"$(#_XGQD"L(4@`!;)`0`098"`+``5[@A)O<``0@` +M"7U^\?8'`````#!C#_`(``EG`&`X+0`````00P!C`````(X"`*A\0P6`%&`` +M]S!"`"#>`P"H)`("`0`"$[P`8A@D$&(`A0````".`@"H?$,&`!!@_\8````` +MW@,`J'QD#`(0@/_"?&0,PA"``$DD!``A``0CO`!D&"0D!``!``0CO!!D`*

`P"@E@(`N`!B +M$"V,1@``:$0`#&A#``1\A?@#?&=\`P#E*"T`!"`^B$<```"G*"T``Q@^?,8> +M`P"D*"T`HR@M+,,`!A1@``L`!1PZ)`0`%``&,+@``````((8+62$``2(8P`` +M?&/X`Q2&__L`HR@M``4<.F1$``I\I7@#`&48+0`#+#I\8W@#`*,H+0`%'#I\ +MI7@#`&48+3AC__^@@P`!``,*`J"!```(``EZC@(`J``$(7P`9!@D)`0``0`$ +M(7P09`!G,$(`0!!`_WX"`"`ME@4`L`P`:ZH`M2@A"``)?GZ2@88`````E@(` +MN`!7N"$F]P`!"``)?7[Q]@<`````E@(`L-X#`*``8A@MC&8``&AD``QH8@`$ +M?(7X`WQ'?`,`Y3@M``0@/HAE````Y2@M``(0/GS&'@,`I"@M`*(H+2S"``84 +M0``+``44.B0$`!0`!C"X``````"#$"UDA``$B$(``'Q"^`,4AO_[`*(H+0`% +M%#ID9``*?*5X`P!%$"T``BPZ?$)X`P"B*"T`!10Z?*5X`P!%$"TX0O__H((` +M`0`""@*@@0``"``)JXX"`*B6`@"XW@,`H`!B&"V,9@``:&0`#&AB``1\A?@# +M?$=\`P#E."T`!"`^B&4```#E*"T``A`^?,8>`P"D*"T`HB@M+,(`!A1```L` +M!10Z)`0`%``&,+@``````(,0+62$``2(0@``?$+X`Q2&__L`HB@M``44.F1D +M``I\I7@#`$40+0`"+#I\0G@#`*(H+0`%%#I\I7@#`$40+3A"__^@@@`!``(* +M`J"!```(``FUC@(`J)8%`+`"`"`M#`!K*`"U*"$(``E^?I*!AI8%`+@"`"`M +M#`!K*`"U*"$(``E^?I*!ACP$$`L\!A`+/`<0"V2$/8`D!02]9,9$:`P"7IID +MYSWX/`+_@#1"`2E\`P`[``(2/'QC"<-\8CD&W$(``!!``"\D`___)`0``WQB +M_\8D`P`!``,8?'R1"`;\0P`(-`.``/Q````D!``!_$,`$'Y)!(+\0``@?E(V +MP]X#`$@`":`+`B`H+20(``'\0P!(W@,`0/Q#`$#>`P`H_%0`4'R#_P8"8"`M +M?D/5!OQ#`"A\0T@!W@8`&``"&`H`8!`M`&`X+20#__]\9T(&"``)A`!).`J6 +M!0"P$$``!0(`("T,`&LH``````@`":_>`P"H#`!KJ@`````(``FOW@,`J#P$ +M$`L,`!>69(0^&`@`"8<``!`M9[W_4/^S`)``@)@M_[(`B/^_`*C_M0"@_[0` +MF/^Q`(#_L`!XW)``&'X0.`$2``%*`,"0+20"__]\4/_&`@6`+0``J"V2`P`, +MD@(`#7QB>@0T`X$`,$+__Q!#`/$D$0`.`A&(+3P#0`".(@``CA3__`!`("U\ +M!-@$$(,`FP`4H@("("`M9Z4`2*.@`%AGI@!0_Z``2`P`:VAGIP!8DZ(`6``` +M6"UP101N<$,!K@"C&"408``&```@+=^C`$B49```E&,``@`$7``!8U@E$D`` +M.C0*__^69@`.-`C__S0)__\T!___D@4`!@`%+#C_I0`P/`40(4BE0@`\!?__ +M2*4"`8^E`#!(I0(&CZ4`-$BE`@9()`(!D@4``'R"?`,`!2PX_Z4`.#P%$"%( +MI4(`/`7__TBE`@&/I0`X2*4"!H^E`#Q(I0(&2"0"`30#__\2@``-?(5\`P`4 +MH#P\`Q`A_[0`0$BC0@`\`___2*,"`8^C`$!(HP(&CZ,`1$BC`@9((P(!?&-\ +M`Q)``-;?OP"H`$40)M^U`*``1A`FW[0`F`!#$";?LP"0W[(`B-^Q`(#?L`!X +M`^``"&>]`+#>(P`(_Z,``#P#$"%(HT(`/`/__TBC`@&/HP``2*,"!H^C``1( +MHP(&2","`=XE`!#_I0`(/`40(4BE0@!\`W@'2*,"`8^C``A(HP(&CZ,`#$BC +M`@9((P(!WB4`&``#'`(P9____Z4`$#P%$"%(I4(```,<`$BC`@&/I0`02*4" +M!H^E`!1(I0(&2"4"`=XE`"#_I0`8/`40(4BE0@!(HP(!CZ,`&$BC`@:/HP`< +M2*,"!D@I`@$`%:PX?2E\`P*B$"7_H@`@/`(0(4BB0@`\`O__2*("`8^B`"!( +MH@(&CZ(`)$BB`@9(*@(!```P+7U*?`,0@/^.-`C__P`+6#P\`A`A_ZL`*$BB +M0@`\`O__2*("`8^B`"A(H@(&CZ(`+$BB`@9(*`(!"``*[7T(?`,`````EB4` +M!@``,"V2(P`),*4__Q2@``P``"`M<&<$;G!E`:X`Y2@E$*``!WQ"'@,``A"X +M`B(0+91$``"40@`"``0T.`#","6.(@`,$D``/XXE`!"69P`.-`C__S0*__\T +M"?__D@8`!@`&-#C_I@!@/`80(4BF0@`\!O__2*8"`8^F`&!(I@(&CZ8`9$BF +M`@9()0(!D@8``'RE?`,`!C0X_Z8`:#P&$"%(ID(`/`;__TBF`@&/I@!H2*8" +M!H^F`&Q(I@(&2"0"`30#__\2@``-?(1\`P`4HCP\`A`A_[0`<$BB0@`\`O__ +M2*("`8^B`'!(H@(&CZ(`=$BB`@9((P(!?&-\`Q)``$W?OP"H`*00)M^U`*`` +M1Q`FW[0`F`!#$";?LP"0W[(`B-^Q`(#?L`!X`^``"&>]`+``````EA4`#B01 +M`!((``K,,K4/_P`%*#Q\0O@#`*(0)?^B`$@\`A`A2*)"`#P"__](H@(!CZ(` +M2$BB`@:/H@!,2*("!D@I`@$`%:PX?2E\`P*C&"4\`A`A_Z,`4$BB0@`\`O__ +M2*("`8^B`%!(H@(&CZ(`5$BB`@9(*@(!```X+7U*?`,0@/^I-`C__P`&,#P\ +M`A`A_Z8`6$BB0@`\`O__2*("`8^B`%A(H@(&CZ(`7$BB`@9(*`(!"``+AGT( +M?`,``````2`/@``AGO0"P"``*PP``@"VD +M@``@```0+0"`&"TD"0`_)`@!`-QE```D1@!`9&,`"!"@``5PIS@D``8```H+6>D!@`D!@(`_[\(8/^^"%C_MPA0/!<4`/^V"$@``+`M +M_[4(0/^T"#C_LP@P_[((*/^Q""`,`F9@_[`(&&>D!````"@M#`)F8"0&`@`` +M`"@M)`8"``P"9F!GI`(``Z`@+0``*"T,`F9@)`8"`#P%`/\\`O_P-*7_/SP$ +M``TT0@`C0`9X`#2$EP``Q2@D``(2_'"D("JOI`@```#(+0@`#+,T7@#XW0(` +M"``$)WQ\0@]"``(7?!!$`",`````)SD``20"`0`3(@`29M8(`-[H1@`T`JZ` +MJ!``" +MQS@M``!H+32EH(!F50(`-QB&H-TN````\A`M9.;^````("W<0P```$40+11& +M__T`@R`MW2\"``"`B"T`]1`M```8+=Q&````11`M%$?__0!F&"T1X``%`&`0 +M+0!O,"L4P`%1``````!O&"\1P``%_2("``".$"L40`%.``````".("\1@``) +M_3$``'!P&`-PD"`#`&P`'P&``?0``!@2`(P`'P&``?0``"`2``0P*P`#$"L` +MPA`D$$``\@``````9``?`(`!]-T&!&C=!`1X_68``/U$`````!`2+$0'T!2` +M`.P`````+$,/H!!@``5D0_!@)`,`"/UC``#]0P``9$/P8"QC#Z`08``%9$/@ +MP"0#``;]8P``_4,``&1#X,`L8P^@$&``!61#T2`D`P`$_6,``/U#``!D0]$@ +M+&,?0!!@`10L0DX@)`(``OUB``#]0@``D0(`-R6M``%E*0`(96L`"&5*``@! +MHA`J%$#_J63G``A\`O@[WZ,("`!#$"L40`$L`````'P"^#L`0Q`OW0,$0!!@ +M`2+?HP@0D0,`-A!@`&D\`Q0`/!'^,=QD1@@\`P'/-&.^"#8QY@`\&``!`$Q@ +M+0"#("T\`P`)904(J`.@,"UGIP(``L0@+0``2"TT8Z"`9C("`#<8AJ`D%0`( +M`````-RN````D1`M9(W^````6"W<2@```$,0+11-__T!:E@M$<``!0%@4"T! +M;A`K%$``^0`````!;E@OW*X"``"2$"W\J@````!0+=Q-````0Q`M%$3__0%- +M4"T1P``%`4`0+0%.:"L5H`#N``````%.4"\1@``)_*("`'%04`-Q<%@#`4P` +M'P&``?0``%`2`6P`'P&``?0``%@2``MH*P`*$"L!HA`D$$``D``````!2P`? +M`6`!]-T-!(#="P1X_.T``/S+`````!`2+$L'T!5@`(H`````+$H/H!%```)D +M2O!@_/4``"U*#Z`10``#_-4``"0*``;\Z@``9$K@P"0+``8M2@^@$4```_S+ +M```D"@`$_.H``&1*T2`D"P`$+4H?0!%``*_\RP``)`(``OSB``#\P@``D0(` +M-B4I``%DI0`(9,8`"&3G``@!(A`J%$#_K&2$``@R9``_%(``!```$"V-`PST +MC0(-``!B$".1#0`W/`X4&-W#5WC`90)T%*#__B0%``'@90)T$*#_^P`````\ +M!?^``!2C0#2E`1\"A"`E``4I/`!-&"$TI2@M`$,8*@`%*3C\I```W*0``!!@ +M`&4\!O^```(4>#3&`1\``"@M``8PO"0*`1@TQ@0!)`___P`&,;@\"0`"`$88 +M+63&`&`(``X$`$8@+0.F,"W#/"<(``T(`&\8+0`.<"<(``T.`(X@+=T*!(C=`@1P_.H```@` +M#;?\P@``)`H``BQ"3B`40/]2_,H``"0"``'\X@``"``-M_S"``#=`P1@W0($ +M +M%!C_HP`(`&`P+=_%5VC<0T6(CX2!@/^&@OAPHQ@##`"((/Q#18@40`&'```` +M``P`AVP\%/^`#`"(1C:4`0%\`P`[?&,)PP`4ICBOHP`$/`,`_S1C_S\VE``# +M0`1X`/^@`"``@Q@DKZ,`$```B"T``(`M/!44`#P6%```%*0X`````)."@P`P +M0@#_%$``!0````"3@H,!,$(`_Q!```:?@H&`)C$``20"``(2(@%1`````)^" +M@8`D`P`!``(0^`!4$"W\0P``#`"(((^$@8`40`"X``````P`B!2/A(&`%$`` +MIMZC1@!\$_@[?`+P.Q!`__Z/HP`$/`+__#1"``L``A-\?&(Y!MQ"```$0`!' +M`````'Q72`$2X`!$)`/__P+@D"U\`!#$"\`PA`K%$``$Y^$@8`\`Q0`C&)% +MU!!```4\!!0`_[(`"(R"1=`00``+GX2!@/^R``@,``.\`N`@+0P`A;@"X"`M +M#`"&B@+@("T,``6T`N`@+9^$@8`\`@`PWJ-&`#1"Y&``@A`M``(0N`!B$"V, +M4@`@?`/X.]^"@Q`00``,`'.8+P!2$"T```$/"``.KG!3`!D\`@#$`&(0+8Q$ +MD#`,`)0NC$60-`@`#L<`````#`#0^`````#?@H,0`%(0+0```0\(``ZN<%,` +M&0P`A-8`````"``.PP`````,`C!B`D`@+0@`#PL\`A!BW0(`""0#``$``B\^ +M$*,`"GQ&-0(,`'WF`D`@+1!`_X``````#`"4L`)`("T(``\+/`(08@`````\ +M`Q`+``80^&1C0%!\8A(*`$``"``````,`&RL`D`@+8Y"`*@$0`!^``````P` +M)+X"0"`M"``/"SP"$&(`````W04`$`)`("T``#`M#`!9%'[W2`%\`P`[```! +M3SP"_X!\8PG#-$(!*0`"$CQ\8CD&_%<```@`#PL\`A!B`````)97`$X"0"`M +MCD<`J``7N``,`&RL_Z<`*-^G`"@2X``,)N/__P)`$"TD!O__)`7__]Q$`$#< +M0@"8```!3W!&`!D```%/)&/__Q1E__D`@!`M!.#_10`````,`3=4`D`@+0@` +M#PL\`A!B#`!,X@)`("T(``\+/`(08MY$`#`,`>2`?O=(`7P#`#L```%//`+_ +M@'QC"<,T0@$I``(5^#1"``$``A1X?&(Y!OQ7```(``\+/`(08@`````,`>L< +M`D`@+0@`#PL\`A!B#``OA@)`("T(``\+/`(08@P`2&X"0"`M"``/"SP"$&(, +M`"YJ`D`@+0@`#PL\`A!B#``P"`)`("T(``\+/`(08@P`+?("0"`M"``/"SP" +M$&(,`"H8`D`@+0@`#PL\`A!B#``JH@)`("T(``\+/`(08@P`0QX"0"`M"``/ +M"SP"$&(,`'1(`D`@+0@`#PL\`A!B`D,@+_^D`!@(``\_`E>X+0P`K+(````` +M"``.NY^"@8`,`##&``````P`3)@"0"`M"``/-?^R`"`,`)3N``````@`#R`` +M````WD(`F````4\D`___<$,`&0```4\(``\+/`(08@P`AF8`````#`!NQ@`` +M```,`$#\``````@`#ID``````````&>]_[`\`P#$_[(`$#P2%`#>0D8`_[\` +M2/^^`$#_MP`X`$,8+?^V`##_M0`H_[0`(/^S`!C_L0`(_[```)1CD"(08`!- +M)!:``3P5__``%K2X-K4`(S;68`$`%:WX`L"@+3:U!$,`%K1X`!2D^#;6(`4` +M%:TX-I2*`0``@"TT%ZZ``!:S>#:U`$@(`!!O`!2B^##F`/\D!P$``.8H"R0' +M(```YB`+,$(`/SP(__``HB@M-0@`(P`%*C@`"$+\`+4H+34(`/@`HR@E`&@X +M)=RB```D!@`!)A```3!"`#\`@B`M``0@^`"4("T`@Q@EW&(``'S"M8=\PH0' +M_&(``-Y"1@#@!`F"T"8"`M#`$X8@!`*"U^(PL#``,9/"0% +M`@``=B`EW(8``"0$0`!\QA@"R,#_RC#'``(``"`M"``040``*"W?OP!(W[X` +M0-^W`#C?M@`PW[4`*-^T`"#?LP`8W[(`$-^Q``C?L````^``"&>]`%`0H``- +M```0+7RC/`,P8P#_+&,``A1@``1\I3`#`^``""0"``$`````)(0`?C"E`/\4 +MI/_Z``````/@``@`````/`,4&-QB5W@00``'<(<3!% +M`G00H/_[`````#P"_X!PA@$R-$(!'P`"$3PT0B@M``(1./Q'``!D0@U@`,(P +M+=S"``!\13P#,*4`_P`%*"L4H``$)(@`?CP"``%]`C`'_,(``-QF5W@0P``$ +M`````````4^LP`)T```!3Q2@`!_<95=X?$8T`GQ".`(`!"-\$*``!W!&$`/` +MI@)T%,#__B0&``'@I@)T$,#_^P`````\!O^```(4>#3&`1\`P"@M``8V.``% +M*3PTQ@`!-*4H+0`&-#@`1A`M``4I./RG``#\1```W&)7>!!```0````````! +M3ZQ``G0```%/`^``"`````!GO?_H_[````"`@"W_OP`0#`&72O^Q``@2```5 +M`$"(+0`","L`!C`O`@`@+0``*"T,`F9@,,8`")(B`,JF`@``DB(`Q*("``*2 +M(@#%H@(``Y(B`,:B`@`$DB(`QZ("``62(@#(H@(`!I(B`,FB`@`'W[\`$-^Q +M``C?L````^``"&>]`!@`````9[W^J"0&`0#_LP$@`*"8+?^P`0@``"@M_[(! +M&`"`@"W_L0$0`Z`@+?^_`5!^$?@#_[X!2#P2%`#_MP%`_[8!./^U`3`,`F9@ +M_[0!*#0$KH!R)"@#WD)&``!%*"W1$8`)`8``0""("VLD``` +MWD=&``#B$"W<1``(?,3_QGP$]T;\1``(CL0``*!``#:@0``WI$0`,*Q7#02. +MQ``0K$0`$([&`!`DQ@`6K$8`&!*``*W?HP$`?`,H!'QC^`-P91@#`.,8+=QC +M`"```R(^``,L/C"$`/\PI0#__$,`('RD>@0P@___K$,`%#0#KH`D!A70`Z`P+1!` +M`'T`0*@M```H+3P&``@,`F9@`J`@+?[3(&C^TR!@9J4`.`)@,"T``!@M9J@` +M,`@`$<<\!P`(`````-[&(&@!`Q`M9&,`0/S"``#>9``(_*0``/YB``C\L__X +M%&?_]V2E`$`,`"06`@`@+1:```0T`JZ`#``K9`(`("TT`JZ````H+7(BB`/> +M0D8`)`9```!1$"T,`F9@W$0N2#P"%!C<0E=H/`4(,=Y#1@`TI2;I``4L.``" +M(+@``C'X`,0@+S2E>-4`@B`M``44N'R$X`%D0O?/`((`'0!QB"T``"`0/`(` +MQ`!B$"T`!"$Z_B0N4)1#D"(D8P`!I$.0(H["`#PD0@`!KL(`/-^_`5#?O@%( +MW[]`5@"8"@M9(1$X`(`,"T,`!>6`J`X+0@`$8Z.P@`\ +M/`00"SP%$`MDA$4@#`)^O&2E27`\!!`+_L`@6#P%$`MDA$5(#``7EF2E26`( +M`!'ZW[\!4#P$$`L\!1`+9(1%B`P`%Y9DI4E@"``1^M^_`5!GO?VH```H+?^Q +M`A`D!@$`_[("&`"`B"W_OP)09Z0!`/^^`D@\$A0`_[<"0/^V`CC_M0(P_[0" +M*/^S`B`,`F9@_[`""-Y"1@`T`ZZ`1D8`,N4/_S"E__\R]___```0+0##&"W<9``P_'8. +M(/QW#BBL=0XP?H1[QOQD`#`0H``$_',N2"0%``%\I'.&_&0`,"0#%=`D!P!` +MD`0`,`+/* +M9Z0!`&>D`0```"@M#`)F8"0&`0`\!1`+9Z0!``*@,"T,`H!&9*5%$`P`L\IG +MI`$`/`(4`/Z`(%@(`!)WW%Y&`!!```,D`@!`"``2=ZZ"`#@(`!)WKH``.&>] +M_^C_OP`0_[$`"#P1$`L,`9=*_[```&8D1=@,`+.(``*`*P`0@"\00``1,A`` +M"-Q"```D$``!$$``!0``("T`0"`M)`+__WQ$_\8LD``!#``0Y@````#?OP`0 +M`@`0+=^Q``C?L````^``"&>]`!@\"1```@`@+0``*"T``#`M)`<`"&8H1=@, +M`+1H92E#F`@`$P@L4``!/`,4`)!C`1@48``#```0+0/@``@`````/`0`Q3P& +M$`MGO?^@-(00@"0%`(!DQD7H_[(`,#P2%`#_OP!8_[8`4/^U`$C_M`!`_[,` +M./^Q`"@,`+1>_[``(!!``27^0D8`/`8`Q0!`("T``"@M#`)F8#3&$(#>0D8` +M/`,4&```@"W<8U:`-!.N@"04`0`(`!-!_&(`"``````F$``!$A0`$-Y"1@!R +M$X@#`%&(+=XB+D@40/_Y)`1```P`L:HD!0"`$$`!$@!`J"T`0"`M```H+0P" +M9F`D!D``"``3/OXU+D@\`P#$)`4`0`!#&"TD!/__/!8``CP5`*ZL99&```"` +M+:QED80VUJ&`_&21B#:UA`#\9)&0)!0`"'(6B`,D!0#_)`8`*"80``$"-8@M +M`%$0+613(1!D42$X#`)F8`)@("T,``P,`F`@+0P`#"`"8"`M)`4`_R0&`"@, +M`F9@`B`@+0P`#`P"("`M#``,(`(@("T6%/_IWD)&`#P#`,0`0Q`M)`,``0P! +METJ@0Y`D$$``Y@````"41@#`),+_U#!#__\L8P`J%&``%#P#$`L\!1`+`Z`@ +M+0P"@$9DI490/`00"V2$1G`,`!>6`Z`H+20"___?OP!8W[8`4-^U`$C?M`!` +MW[,`.-^R`##?L0`HW[``(`/@``AGO0!@<$)X\F1C2!!\8A(*`$``"``````D +M`H`!/`7_\``"%+@\!!`,W(2/P#1"8`,``A>X-*4`(WP#`#M\8PG#-$(`,``# +M&3P`!2K\_Z0```!B$"7\0```-*4`^-Y&1@``92@EW*0``#P#`,3<1P`````@ +M+0##,"T`!S@_K,>1F"0&``C\1@``/`<0`-RE``!DYT)(W$(``#P&%`#>148` +M_,=&B#P'$````A`_9.="B`"C&"T\!A0`K&*1G`P`$*+\QT:`#``0HB0$``$\ +M"!0`90@``-Y*1@`\!`##-(20````&"TD!O__)`4`"`%$("T`@!`MK$8``"1C +M``$49?_]9$(`!(T&```8P``3/`,`KCP)``(T8X0``0`H+0%#&"T``!`M-2FA +M@`````",I@`(9*4`!*Q@`$BL9@```&D8+:R"```D0@`!C08```!&."H4X/_V +M9(0`!#P"`,0\!!`+`4)0+62$1H"M1I`P`Z`H+8T"``0,`!>6K4*0-`@`$XP` +M`!`M)`(`31#"`'$`````)`(S`*>B``0\`DY)-$)#,J^B```D`H`!/`3_\``" +M%+@TA``C-$)@`P`$(OP``A>X-(0`^'P#`#M\8PG#-$(`,``#&3P\!A```&(0 +M)0!D&"7\0```9,9"2-QC`````"`MW$,``#P"%`#>148`_$9&B#P"`,0``Q@_ +M`*(0+:Q#D9@\`Q``9&-"B#P"%``,`!"B_$-&@`P`$*(D!``!/`@4``@`$\IE +M"``H/`+_\#1"`",``A+\-$(5L-Q"```P0@`'$$``.CP#$`L\`Q`+/`@4`-QE +M1B!D8D8@90@`>-Q$``B40P`0D$(`$O^E``#_I``(IZ,`$`@`$\JCH@`2/`(W +M.#P(%``T0GAX90@`4*^B```(`!/*HZ``!#P"$`P\"!0`W$.,(&1"C""40@`( +M90@`\/^C```(`!/*IZ(`"#P"$`P\"!0`W$*,"&4(`,@(`!/*_Z(``#P"$`P\ +M"!0`W$*,J&4(`/`(`!/*_Z(``#P$$`L\!1`+9(1%^`P`%Y9DI4F("``3C"0" +M``$\!!`+/`40"V2$1I`,`!>69*5)J`@`$XPD`@`!"``3C```$"T\"!0`W&5& +M.&1B1C@(`!0P90@`H"0",P"GH@`$/`).231"0S<(`!/^KZ(````````#X``( +M`````&>]_Y@\`@"O_[``&#P0%`#>`T8`)`7___^_`&#_O@!8_[<`4`!B$"W_ +MM@!(_[4`0/^T`#C_LP`P_[(`*/^Q`"`,`2F(C$2$`-X"1@`\`P#$`$,8+8QC +MD#`L9``"%(``%``````\%``")!$``3:4H8`\$P"O/!(`Q'XC^`,D!?__<'08 +M`R8Q``$`0Q`M`F(0+0P!*8B,1(0`W@)&``!2&"V,8Y`P`B,@*Q2`__,````` +M$&``/SP$$`LD%8`!/!3_\``5K/@VE``C-K7`!P`4HOQ\$P`[`!6NN'YS"<,` +M$YD\-K5``S:4`/@\%@`"``"(+3;6H8`\$@"O`!6H^`)TH"5^/O@#)C$``7/6 +M\`,`7A`M`D(0+8Q7A``,`3AF`N`@+0P!.PX`0"`MW@-&`"0&!=P"X"`M`'X8 +M+0)#&"W<980(K&:$$"0&/H"L9H04)`8``7S%M8=\1:Q'#`$X>OQEA`@"X"`M +M#`$X9@!`\"TSW@`#<$(1,@!>\"TD`@7X`![U.`/5\"T#T_`E_\(``-X"1@#> +M@P``/`,`Q`!#&"V,8Y`P`B,8*Q1@_]=^/O@#/`00"PP`%Y9DA$;`#`"()``` +M``#>!$8`/`<`Q"0%``8``!@M`( +M`D8`_K8`*`!4$"T"0A`M9E*$`(Q&A`#_I@`0#`$X9@#`("W?I@`0`$"X+0P! +M.'H`P"`MW@1&``*2*"W_H@`0#`!!E@"%("W?H@`0)`.``3+H``<``QSX``A! +M.#1CP`N`$"$"TT8T`A``(5.``#&/@"("`M`$,0+20%``'?HP`` +M)C$``0!#$"7?HP`(_%8``-QB```D`@`$#``E//ZB`!C>!$8`/`(`Q`""$"V, +M0I`P`B(0*Q!``!\`````?C3X`SP"`*YRDQ@#-$*$`#P2`*\`8A@M`(.H+:Z@ +M`$P"H"`MKJ``4*Z@`%2NH`!$#``F*@````#>!D8`C\16C#P%`,0`Q2@MW*>0 +M*'SG>`$0@/^Y`H>P+3P$$`L"("@M`L`P+0P`%Y9DA$<("``5`W(SH`,````` +M```!#]^_`&```!`MW[X`6-^W`%#?M@!(W[4`0-^T`#C?LP`PW[(`*-^Q`"#? +ML``8`^``"&>]`&AGO?[8_[4!`/^T`/C_L@#H_[``V```@"W_OP$@_[X!&/^W +M`1#_M@$(_[,`\`P!.PS_L0#@?!(`.WY2"<,`0*`M&$``#P)`J"T`$I0`)!$` +M"0@`%7D`0)@M)A```1(3`%P`````,@0`_S2$W@`,`3L.`)(@)0`"$``44?_W +M`````"0$__\"D*`F`A0@"P``*"T,`3@H/!?_\#;W`",#H"@M`!>Z_`!`@"T, +M`2``&CHP!J`K>X):.C`&FCHP!H#`$G7J.C`&=\$``[?A`) +MPP`0A``,`3L,``"P+1A```T`0*`M"``5JP!`D"TFU@`!$M(`#"0"`#\RQ`#_ +M-(3>``P!.PX`D"`E``(0`!11__<`````$I8``R0"`#\RPP`_`&`0+3P#__`" +M8A`M-&,`(P`"$C@``QWX9G,!`#1C!$,``QTX-&,`0`!#$"T`51`EW$,``'_# +M*4?\0P``WN(``"0"`@`68O_;W[\!(```$"W?O@$8W[]^B#<8D8` +M/`0`Q/^T!;`D!?___[\%V/^^!=``1"`M_[<%R/^V!<#_M06X_[,%J/^R!:#_ +ML068_[`%D(R$D##_H`48?`,`._^@!2```QG"_Z`%*#!T``/_H`4PKZ4%&/^@ +M!-C_H`3@_Z`$Z/^@!/#_H`3X_Z`%`/^@!0@8@`$0_Z`%$#P(__P`%$D\-0@` +M"0``J"W_H`5@``A$.*^C!8`U"$`!``A'>`$H0"7_J`6(WZ,%8#P%``(TI:&` +M?!'^A'!E(`./I06`/`,`KV1FA`!\L`P`098PT@__WZ,%B`*`("TD!?__)`8`"-QB +M```P0@`_?%&L!"0"^:,,`6G`?%%X!`1``0O_H@5H9[8$W`*`("TD!?__9[`% +M&`P!:R;_M@5P`@"X+0``F"T\!1`+`L#P+=^F!5@"8#@MKN(```.@("T$0`#P +M9*5'<`P"@$8``````!,8^`(@("TD!?__`Z`P+20'"``\"``"#`#)W@.CL"TT +M!/FCKL($W``"$#^NP@38E\(``!!$`-`\!!`+`L#P+=_&!-@\!1`+W[8%<&2$ +M1XADI4G(`@"8+7S&2@(``/`M#``7EC#&__\(`!96)!<`""?>``%FF/@"@"`MCA8```.SF"W>90389A``!`+` +M,"U\I4H"#`%>[#"E__\#TB@A`H`@+0P!7Q("P#`MWF@$V#P$$`L#P#@M9(1' +MJ`+`*"U]"$H"`D`P+0P`%Y8Q"/__WF4$V`*`("TD!@`!)`<``20(!1%\I4H" +M)`D&(C"E__\D"@`!#`$A0"0+!`"OO@4\`]F!3BOI04X`H`@+=YB!-BO +MO@5$K[X%2"?>``&OH`5,?$)*`J^B!4`,`5WHKZ`%4"0&``@7QO_.WZ0%6&>E +M!``,`2@!`@"T"`"`M#`$X8@!`*"TD!H`!WZ,%>``&-+@T +MQF`!``8T>#3&(`4``RD\``8S>"ZC``(`IB`EW(0``!!@``I\A!@"`J08%^A@ +M``#3&`$@D`P`!`$80+3P&%```12@E +MWZ(%8"1"``'_H@5@W*(``"0%@`$`!2RX-*5@`3!"`#\`!2RX`((@+32E10$` +M!2LX``0@^'R%$@H`A2`MWZ4%8'QB4H=\8AC'?&((1_R"```\!/_PW,)&`#2$ +M`",`!"+\-(0`^-R#```\`P#$`$,8+8QCD#``HQ@J%&#^_M^C!6#?OP78```0 +M+=^^!=#?MP7(W[8%P-^U!;C?M`6PW[,%J-^R!:#?L068W[`%D`/@``AGO07@ +M)G,``20&``AF]P`$$F;_5&?>``@"@"`M#`%K)B0%__\\!1`+WZ8%6`)@."VN +MX@```Z`@+01!_Q)DI4=P/`00"SP%$`O?M@5P9(1'2&2E2<@,`!>6`@"8+0@` +M%E```/`M"``6V"05``(\!!`+/`40"V2$1R`,`!>69*5)R-^_!=C?O@70)`+_ +M_]^W!]!>!GO?\P +M_[\`R/^R`,#_L0"X#`'E!/^P`+`,`>4V`$`@+0P!/;@`````)`/__Q!#`$`\ +M!!`+```!#WP2`#M^4@G#)!```0)`("T,`5EZ`D"(+3P#_^`T8P!5/`+_\``# +M';@T0@`C-&,`#0`"%'@``QTX-$(`$31C``@``A:X`!*1/``1,3P"0Y`E-$(" +M`/Y`````PA`EW$,``#P'__`TYP`C`B`@+0`'.OP#H"@M-.<`^'X#2D?\0P`` +M`,] +M`-``````#``5U@`````40/_UW[\`R`@`%X'?L@#`#``7EF2$1^#?OP#(W[(` +MP"0"``'?L0"XW[``L`/@``AGO0#0`````&>]@!`T`H"8_[1_8#0#@*#_LG]0 +M_[%_2/^_?W#_M7]H_[-_6/^P?T!GO?\@`%T0+0!]&"W\10```(`0+?QF```T +M!H"H`-TP+30#@+#\QP``-`:`N`!]&"T`W3`M_&@``#0#@,#\R0``-`:`R`!] +M&"T`W3`M_&H``#0'@`#\RP``-`:`F`.F&"TT!H`0`-TP+0.G."W\PP``-`.` +M&`!`,"T`?1@M)`(`.`.@("V@8@``-`.`&20"`$``?1@MH&(``#0#@-``?1@M +M-`*`6/SC```T`X!@`%T0+0!]&"WT3```]&T``#0"@&@T`X!P`%T0+0!]&"WT +M3@``]&\``#0"@'@T`X"``%T0+0!]&"WT4```]'$``#0"@(@T`X"0`%T0+0!] +M&"WT4@``]',``#0"@`@T`X#0`'T8+0!=$"W\0P``#`*?T#0%@`"?@X&`/`44 +M`#0$@`!DI4:0`$"(+0`#D/@``QOX`D.0+20"__\"19`MCD,```!D*"L0H``% +M`Z"@+8Y%``0`I"`K%(``.P`````T%8````````(B@"H`0#`M`C`P"P`"$"H` +M$1@J`H`H+0!B$"0`P(`M$$``)`#`F"V.0@`$?$3X`P)B&"%DA``(`'48*Q1@ +M``,"1"`M`J*8(P)@@"T,`F5<`@`P+0```0^.1``$`C"((XY#```"D*`M)`+_ +M_P"3F"$R`,"8+6>]`.#?OW]PW[5_:-^T?V#? +MLW]8W[)_4-^Q?TC?L']``^``"&>]?_``````)&)__P!%$",(`!?Z,$)__SP" +M%!B,1%=D$(``$#P"%``DA/__?(3X`V1"1I``!!CX-`6`"``$(_@`12@M`&08 +M+30$@`@`HQ@MK$```*Q```0`1!`M%$/__``````\`Q``/`(4&&1C7E@#X``( +M_$-MF&>]_^@T`X``_[````"`@"W_OP`0_[$`"(R"````0R`K$(``&@````". +M!``$`(,H*Q"@`!8D17__`*0H(P`%*"]`!AGO?_0_[0`(#P4%!B.@E=D +M_[\`*/^S`!C_L@`0_[$`"!!``!G_L```/!'_@#P3%``V,0$!``"`+0`1CCAF +M]`#!GO?_X/`(>W/^E```T0F]!2*)"````$"U(H@(! +MBZ(``DBB`@:3H@`&2*("!).B``=(H@($2"("`0`"$$`D!___"``8MB1(`@`0 +M2``)`````'!#03(`PQ@MC&4`"!2G__HD0@`!WZ(``*QD``C\8@```^``"&>] +M``AGO?_@_[\`&/^R`!#_L0`(`*"(+?^P```,`3AF`("`+0(`("T,`3AZ`$"0 +M+20#@`$R4@`'``,<^#!"``,T8\`'`!*1.``#'K@"0B`M-&-``0`$)3@``QCX +M?`(`.WQ""<,`@R`M``(1/`""$"7<0P``$B``%20"``$D`@`#?$,8AWP"`#M\ +M0@G#/`7_\``"$3PTI0`C`$0@)0`%*OS\@P``-*4`^-^_`!@`11`EW[(`$-^Q +M``C?L```W$(```/@``AGO0`@``````@`&.!\0QB'9[W_X/^_`!C_L@`0_[$` +M"`"@B"W_L```#`$X9@"`@"T"`"`M#`$X>@!`D"TD`X`!,E(`!P`#'/@P0@`# +M-&/`!P`2D3@``QXX`D(@+31C$`L`!"4X``,9>'P"`#M\0@G#`(,@+0`"$3P` +M@A`EW$,``!(@`!,D`@`!?$,YQWP"`#M\0@G#/`7_\``"$3PTI0`C`$0@)0`% +M*OS\@P``-*4`^-^_`!@`11`EW[(`$-^Q``C?L```W$(```/@``AGO0`@"``9 +M$WP#.<>0B```/`,0"]R)``!D8TH@D(<`!)""``,\!!`+9(1*&'TI!<,`B!@+ +M/`00"V2$2BA\1WH$`&!`+3P#$`MD8THP`(D8"SP$$`MDA$GP"``7E@!@2"T` +M````-`*N@&>]_VAP@A`#_[(`6/^D`$`\$A0`WD1&`/^S`&#_L`!(_[\`D/^^ +M`(C_MP"`_[8`>/^U`'#_M`!H_[$`4/^E`#``@B@MD*(`-WP3`#M^148``C80+0(`("UD0@`#`Z`P+0`"$/@`HA`MW$<`('SG +M5X,PY___`.`H+0P!7<0`X/`MCZ@`"`4!_X\\!/_P/`S_\```N"TUC``C``QE +M^#6,!$D(`!F8``RM.`````#?I`!`-`.N@'"#&`,`0Q`M_$`,Z*!``#;?OP"0 +MW[X`B-^W`(#?M@!XW[4`<-^T`&C?LP!@W[(`6-^Q`%#?L`!(`^``"&>]`)@( +M`!EZ_Z,`(`@`&78``+@M,((`/Q1```0T`ZZ``^``"`````````````0A@P`$ +M(8!P@R`#/`,4`-QH1@`\`_^`-&,!*7P'`#L``QH\?.<)PWSC.0;<9P```00@ +M+9"(`CB,@PST$.``&`$#0"$`X!@M)`G__SP$__!](__&-(0``R0)`(5GO?_X +M``E-?``$(OS_OP``?.0X!?QI``#\8@`(K&4`!/QF`!````%/```H+7R'>@(, +M`(G.)`8``=^_```#X``(9[T`"#P$$`L(`!>69(1*J``````\`__P9[W_J#1C +M`"/_M@`X``,:_``$LCLT8S@8_[,`(``6L?C_MP!``L.8+?^U`#`"8+@M_[0` +M*'P7*0;_OP!0?G.2`O^^`$@PA`#__[(`&`"@H"W_L0`0`,"H+?^P``C>X@`` +M?`+&!_[B```D`@$8$F(`13P"``$\`__P-&,`(S1"``(``QK\,)(`'S1C.`!^ +M0F('`L.`+0(`B"U^$)("?!$I!OXB```D`@$8$@(`1P`````,`+=2)`0``SP# +M``$T8X:@/`0AC7!#$`,TA.]!``0D.#2$:]L`!"1X-(0TVP!$`!T``"@0``4L +MNGP"^#L\!/_P`*(H+32$`",`!"+\-(0X$`+$("U\!"D&`````'P#^#MD8P/H +M?`+X.P!#$"L40/_]`````-R"``#(40`%`````'P#^#L`91@K%&#_]`````#( +M4``$,$/__R0"`4$08@`@`````-^_`%#?O@!(W[<`0-^V`#C?M0`PW[0`*-^S +M`"#?L@`8W[$`$-^P``@#X``(9[T`6-QBR.`\`__P-&,`(SP"``$``QK\-$(` +M`C1C.``PD@`?`L.`+7Y"8@<"`(@M?A"2`GP1*0;^(@``)`(!&!8"_[L````` +M"``:?]QBR/C>X@``?`+&!_[B```D`@$8$F("#3P"__`D`P`0-$(`(P`"$OPT +M0C@(`L*P+0+`\"U^UI("?!XI!O_#```D`P$8$L,!_@`````D`@`6?D)B!_XB +M```D`@$8$@(!\SP"__!\`_@[_Z,```P`MU(D!``#/`0``32$AJ`\!2&-<$00 +M`S2E[T'?HP````4L.#2E:]L`!2QX-*4TVP!%`!W?P@`````@$``$)+K(40`/ +M`(,@+0````!\`O@[`((0*Q1```H`````?`/X.V1C`&1\`O@[`$,0*Q1`__T` +M````W\(``.A1__0`````WN(````5JL`VHP!`?`+&!_[B```D`@$8$F(!PSP" +M__`P8O___\(``"0"`1@2P@&X/`+_\"0"``%^0F('_B(``"0"`1@2`@&M/`+_ +M\'P#^#O_HP``#`"W4B0$``,\!``!-(2&H#P%(8UP1!`#-*7O0=^C````!2PX +M-*5KVP`%+'@TI33;`$4`'=_"`````"`0``0DNLA1``X`@R`M?`+X.P""$"L4 +M0``*`````'P#^#MD8P!D?`+X.P!#$"L40/_]`````-_"``#H4?_T`````-[B +M````%*"`-I0``7P"Q@?^X@``)`(!&!)B`7X\`O_P,I3__R0"`1C_U```$L(! +MX@``?`+&!_[B```D`@$8$F(! +M/#P"__#_P```)`(!&!+"`3(\`O_P)`(``WY"8@?^(@``)`(!&!("`2<\`O_P +M?`/X._^C```,`+=2)`0``SP$``$TA(:@/`4AC7!$$`,TI>]!WZ,````%+#@T +MI6O;``4L>#2E--L`10`=W\(`````(!``!"2ZR%$`#P"#("T`````?`+X.P"" +M$"L40``*`````'P#^#MD8P!D?`+X.P!#$"L40/_]`````-_"``#H4?_T```` +M`-[B```VHP!0?`+&!_[B```D`@$8$F(`^#P"__`P8O___\(``"0"`1@2P@#M +M/`+_\"0"``%^0F('_B(``"0"`1@2`@#B/`+_\'P5^#L,`+=2)`0``SP#``$T +M8X:@/`0AC7!#$`,TA.]!``0D.#2$:]L`!"1X-(0TVP!$`!W?P@`````@$``$ +M)+K(40`/`)4@+0````!\`O@[`((0*Q1```H`````?`/X.V1C`&1\`O@[`$,0 +M*Q1`__T`````W\(``.A1__0`````WN(``'P"Q@?^X@``)`(!&!)B`+<\`O_P +M_]0``"0"`1@2P@"M/`+_\"0"``)^0F('_B(``"0"`1@2`@"B/`+_\'P4^#L, +M`+=2)`0``SP#``$T8X:@/`0AC7!#$`,TA.]!``0D.#2$:]L`!"1X-(0TVP!$ +M`!W?P@`````@$``$)+K(40`/`)0@+0````!\`O@[`((0*Q1```H`````?`/X +M.V1C`&1\`O@[`$,0*Q1`__T`````W\(``.A1__0`````WN(``'P"Q@?^X@`` +M)`(!&!)B`'<\`O_P_\```"0"`1@2P@!M/`+_\"0"``-^0F('_B(``"0"`1@2 +M`@!B/`+_\'P4^#L,`+=2)`0``SP#``$T8X:@/`0AC7!#$`,TA.]!``0D.#2$ +M:]L`!"1X-(0TVP!$`!W?P@`````@$``$)+K(40`/`)0@+0````!\`O@[`((0 +M*Q1```H`````?`/X.V1C`&1\`O@[`$,0*Q1`__T`````W\(``.A1__0````` +MWN(``'P"Q@?^X@``)`(!&!)B`#<\`O_P_\```"0"`1@2P@`M/`+_\"0"`!9^ +M0F('_B(``"0"`1@2`@`B/`+_\'P0^#L,`+=2)`0``SP#``$T8X:@/`0AC7!# +M$`,TA.]!``0D.#2$:]L`!"1X-(0TVP!$`!T``"`0``0DN@"0("T`````W\(` +M`,A1_E@`````?`+X.P""$"L40/Y4`````'P#^#MD8P!D`````'P"^#L`0Q`K +M%$#__0`````(`!Q.`````#1"`",``A+\-$(`^`@`'#W<0@``-$(`(P`"$OPT +M0@#XW$(```@`'#@D`@`6-$(`(P`"$OPT0@#X"``<,]Q"```T0@`C``(2_#1" +M`/@(`!P-W$(``#1"`",``A+\-$(`^-Q"```(`!P()`(``S1"`",``A+\-$(` +M^`@`'`/<0@``-$(`(P`"$OPT0@#X"``;W=Q"```T0@`C``(2_#1"`/C<0@`` +M"``;V"0"``(T0@`C``(2_#1"`/@(`!O3W$(``#1"`",``A+\-$(`^`@`&ZW< +M0@``-$(`(P`"$OPT0@#XW$(```@`&Z@D`@`!-$(`(P`"$OPT0@#XW$(```@` +M&Z,P8O__-$(`(P`"$OPT0@#X"``;>=Q"```T0@`C``(2_#1"`/C<0@``"``; +M="0"``,T0@`C``(2_#1"`/@(`!MOW$(``#1"`",``A+\-$(`^`@`&TC<0@`` +M-$(`(P`"$OPT0@#XW$(```@`&T,D`@`"-$(`(P`"$OPT0@#XW$(```@`&SXR +ME/__-$(`(P`"$OPT0@#X"``;%-Q"```T0@`C``(2_#1"`/C<0@``"``;#R0" +M``$T0@`C``(2_#1"`/C<0@``"``;"C!B__\T0@`C``(2_#1"`/@(`!K?W$(` +M`-Q"R/`(`!K:)`(`%C1"`",``A+\-$(`^-Q"```(`!K-/`+_\`````!GO?_H +M_[\`$/^Q``@`@(@M#`$X9O^P```"("`M#`$X>@!`@"T\!/_\`!"$>#2$``D" +M`A`M``0D>``"&KADA(`+```0+0`$)S@TA!``?&0J"NBN`!=DA``@?&0:"LAB +M``_?OP`0?&4`0WQD",-\HI2',(0`_WQBG,]`!@`````"``=!GQBB`X@`` +MR*`!2`````!\`L8'?C&(`_[B```2(`)#)`(!&!("!&(\`O_P/`/_\#P"``$T +M8P`C-$(``0`#&OPR__``@B`M-]X`(P`>\OPWWC@0 +M`K[P+7P>*09\`_@[9&,#Z'P"^#L`0Q`K%$#__0````#?P@``R%$`!0````!\ +M`_@[`&08*Q1@__0`````WN0``'Q%!`,D`___`$48"P"`$"U\`L8'_N(``"0" +M`1@2`@0<,';__SP"``$T0@`$?F)B!_Y"```D`@$8$B(#X#P"__`,`+=2)`0` +M`SP#``$T8X:@/`0AC7!#$`,TA.]!``0D.#2$:]L`!"1X-(0TVP!$`!T``"`0 +M``0DNGP"^#L`@B`M?`/X.V1C`^A\`O@[`$,0*Q1`__T`````W\(``,A1``4` +M````?`/X.P!D&"L48/_T`````'Q$!`,D`___`$08"S+6`0`RUO__,&/\'Q;` +M`XD``R@`/`,4&,J```6,8E:,%$`"F3P$$`LTI0`@``4H`#*$``(0@``%```` +M`!1``KH\!!`+-*4`0``%*``RA``$$(``!0`````40`*K/`00"S2E`(``!2@` +M,H0`"!"```4`````%$`"G#P$$`LTI0$```4H`#*$`!`0@``',H<`(!1``HT\ +M!!`+EZ8`!C3$`0"GI``&,H<`(!#@``8`````%$`"?3P$$`N7HP`&-'0"`*>T +M``840`,T/`00#=[B```PH___?`+&!_[B```D`@$8$@(#.#P"__`\`O_P-$(` +M(P`"$OPT0C@(`J*H+0*@H"U^M9("?!0I!OZ#```D`P$8$J,#/``````D`@`$ +M?F)B!_Y"```D`@$8$B(#/3P"__!\`_@[_Z,`"`P`MU(D!``#/`0``32$AJ`\ +M!B&-<$00`S3&[T'?HP`(``8T.#3&:]L`!C1X-,8TVP!&`!W>@@`````@$``$ +M)+K(40`.`(,@+7P"^#L`@A`K%$``"@````!\`_@[9&,`9'P"^#L`0Q`K%$#_ +M_0````#>@@``Z%'_]``````6P`)D`````-[B``!\`L8'_N(``"0"`1@2`@-Z +M/`+_\#P"``%^8F('_D(``"0"`1@2(@-O/`+_\`P`MU(D!``#/`,``31CAJ`\ +M!"&-<$,0`S2$[T$`!"0X-(1KVP`$)'@TA#3;`$0`'0``(!``!"2Z?`+X.P"" +M("T`````?`/X.V1C`^A\`O@[`$,0*Q1`__T`````W\(``,A1``4`````?`/X +M.P!D&"L48/_T`````'Q$!`,D`___`$08"R0"``'>Y```,&/__WQ#8P=\!,8' +M_N0``'Q#2D#2$--L`1``=WH(`````(!``!"2ZR%$`#P"0("T`````?`+X +M.P""$"L40``*`````'P#^#MD8P!D?`+X.P!#$"L40/_]`````-Z"``#H4?_T +M`````-^_`&```!`MW[X`6-^W`%#?M@!(W[4`0-^T`#C?LP`PW[(`*-^Q`"#? *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Nov 9 22:08:09 2017 Return-Path: Delivered-To: svn-src-all@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 2741EE5D8C8; Thu, 9 Nov 2017 22:08:09 +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 00CE67AB4C; Thu, 9 Nov 2017 22:08:08 +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 vA9M88dt014248; Thu, 9 Nov 2017 22:08:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9M88Pe014247; Thu, 9 Nov 2017 22:08:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711092208.vA9M88Pe014247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 9 Nov 2017 22:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325619 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 22:08:09 -0000 Author: bdrewery Date: Thu Nov 9 22:08:07 2017 New Revision: 325619 URL: https://svnweb.freebsd.org/changeset/base/325619 Log: Mark targets .PHONY. This avoids the obvious of not running the target when expected, but also avoids META_MODE from showing 'Building'. This is mostly only a problem when directly including bsd.obj.mk as many of these targets were already .PHONY via bsd.sys.mk. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Thu Nov 9 19:52:56 2017 (r325618) +++ head/share/mk/bsd.obj.mk Thu Nov 9 22:08:07 2017 (r325619) @@ -44,8 +44,8 @@ ____: .if ${MK_AUTO_OBJ} == "yes" # it is done by now -objwarn: -obj: +objwarn: .PHONY +obj: .PHONY CANONICALOBJDIR= ${.OBJDIR} # This is also done in bsd.init.mk .if defined(NO_OBJ) @@ -145,7 +145,7 @@ obj: .PHONY .endif .if !target(objlink) -objlink: +objlink: .PHONY @if test -d ${CANONICALOBJDIR}/; then \ rm -f ${.CURDIR}/obj; \ ln -s ${CANONICALOBJDIR} ${.CURDIR}/obj; \ @@ -159,17 +159,17 @@ objlink: # where would that obj directory be? # .if !target(whereobj) -whereobj: +whereobj: .PHONY @echo ${.OBJDIR} .endif # Same check in bsd.progs.mk .if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) && \ (${MK_AUTO_OBJ} == "no" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} == "") -cleanobj: +cleanobj: .PHONY -rm -rf ${CANONICALOBJDIR} .else -cleanobj: clean cleandepend +cleanobj: .PHONY clean cleandepend .endif @if [ -L ${.CURDIR}/obj ]; then rm -f ${.CURDIR}/obj; fi @@ -180,7 +180,7 @@ NOPATH_FILES+= ${CLEANFILES} .endif .if !target(clean) -clean: +clean: .PHONY .if defined(CLEANFILES) && !empty(CLEANFILES) rm -f ${CLEANFILES} .endif @@ -196,7 +196,7 @@ clean: .include -cleandir: .WAIT cleanobj +cleandir: .PHONY .WAIT cleanobj .if make(destroy*) && defined(OBJROOT) # this (rm -rf objdir) is much faster and more reliable than cleaning. @@ -206,18 +206,18 @@ _OBJDIR?= ${.OBJDIR} _CURDIR?= ${.CURDIR} # destroy almost everything -destroy: destroy-all -destroy-all: +destroy: .PHONY destroy-all +destroy-all: .PHONY # just remove our objdir -destroy-arch: .NOMETA +destroy-arch: .PHONY .NOMETA .if ${_OBJDIR} != ${_CURDIR} cd ${_CURDIR} && rm -rf ${_OBJDIR} .endif .if defined(HOST_OBJTOP) destroy-host: destroy.host -destroy.host: .NOMETA +destroy.host: .PHONY .NOMETA cd ${_CURDIR} && rm -rf ${HOST_OBJTOP}/${RELDIR:N.} .endif @@ -226,7 +226,7 @@ destroy-all: destroy-stage .endif # remove the stage tree -destroy-stage: .NOMETA +destroy-stage: .PHONY .NOMETA .if defined(STAGE_ROOT) cd ${_CURDIR} && rm -rf ${STAGE_ROOT} .endif @@ -236,7 +236,7 @@ _destroy_machine_list = common host ${ALL_MACHINE_LIST .for m in ${_destroy_machine_list:O:u} destroy-all: destroy.$m .if !target(destroy.$m) -destroy.$m: .NOMETA +destroy.$m: .PHONY .NOMETA .if ${_OBJDIR} != ${_CURDIR} cd ${_CURDIR} && rm -rf ${OBJROOT}$m*/${RELDIR:N.} .endif From owner-svn-src-all@freebsd.org Thu Nov 9 22:26:50 2017 Return-Path: Delivered-To: svn-src-all@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 BAEA6E5DED9; Thu, 9 Nov 2017 22:26:50 +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 859257B64F; Thu, 9 Nov 2017 22:26:50 +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 vA9MQn4N022754; Thu, 9 Nov 2017 22:26:49 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9MQnAJ022753; Thu, 9 Nov 2017 22:26:49 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201711092226.vA9MQnAJ022753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 9 Nov 2017 22:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325620 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 325620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 22:26:50 -0000 Author: sbruno Date: Thu Nov 9 22:26:49 2017 New Revision: 325620 URL: https://svnweb.freebsd.org/changeset/base/325620 Log: Fix issue with VXLAN-ecapsulated rx h/w checksumming. Submitted by: grehan Reviewed by: bhargava.marreddy@broadcom.com Differential Revision: https://reviews.freebsd.org/D12976 Modified: head/sys/dev/bnxt/bnxt_txrx.c Modified: head/sys/dev/bnxt/bnxt_txrx.c ============================================================================== --- head/sys/dev/bnxt/bnxt_txrx.c Thu Nov 9 22:08:07 2017 (r325619) +++ head/sys/dev/bnxt/bnxt_txrx.c Thu Nov 9 22:26:49 2017 (r325620) @@ -501,9 +501,11 @@ bnxt_pkt_get_l2(struct bnxt_softc *softc, if_rxd_info_ if (!(errors & RX_PKT_CMPL_ERRORS_IP_CS_ERROR)) ri->iri_csum_flags |= CSUM_IP_VALID; } - if (flags2 & RX_PKT_CMPL_FLAGS2_L4_CS_CALC) { + if (flags2 & (RX_PKT_CMPL_FLAGS2_L4_CS_CALC | + RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)) { ri->iri_csum_flags |= CSUM_L4_CALC; - if (!(errors & RX_PKT_CMPL_ERRORS_L4_CS_ERROR)) { + if (!(errors & (RX_PKT_CMPL_ERRORS_L4_CS_ERROR | + RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR))) { ri->iri_csum_flags |= CSUM_L4_VALID; ri->iri_csum_data = 0xffff; } From owner-svn-src-all@freebsd.org Thu Nov 9 22:51:50 2017 Return-Path: Delivered-To: svn-src-all@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 60819E5E671; Thu, 9 Nov 2017 22:51:50 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 24C9D7C17D; Thu, 9 Nov 2017 22:51:50 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9Mpnsc035336; Thu, 9 Nov 2017 22:51:49 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9MpmA1035327; Thu, 9 Nov 2017 22:51:48 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201711092251.vA9MpmA1035327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Thu, 9 Nov 2017 22:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325621 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 325621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 22:51:50 -0000 Author: mjoras Date: Thu Nov 9 22:51:48 2017 New Revision: 325621 URL: https://svnweb.freebsd.org/changeset/base/325621 Log: Introduce EVENTHANDLER_LIST and some users. This introduces a facility to EVENTHANDLER(9) for explicitly defining a reference to an event handler list. This is useful since previously all invokers of events had to do a locked traversal of the global list of event handler lists in order to find the appropriate event handler list. By keeping a pointer to the appropriate list an invoker can avoid this traversal completely. The pointer is initialized with SYSINIT(9) during the eventhandler stage. Users registering interest in events do not need to know if the event is backed by such a list, since the list is added to the global list of lists. As with lists that are not pre-defined it is safe to register for the events before the list has been created. This converts the process_* and thread_* events to using the new facility, as these are events whose locked traversals end up showing up significantly in ports build workflows (and presumably other workflows with many short lived threads/procs). It may be advantageous to convert other events to using the new facility. The el_flags field is now unused, but leave it be so that this revision can be MFC'd. Reviewed by: bdrewery, markj, mjg Approved by: rstone (mentor) In collaboration with: ian MFC after: 4 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12814 Modified: head/share/man/man9/EVENTHANDLER.9 head/sys/kern/init_main.c head/sys/kern/kern_exec.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/kern/kern_thread.c head/sys/kern/subr_eventhandler.c head/sys/sys/eventhandler.h Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Thu Nov 9 22:26:49 2017 (r325620) +++ head/share/man/man9/EVENTHANDLER.9 Thu Nov 9 22:51:48 2017 (r325621) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd October 1, 2017 +.Dd October 31, 2017 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -38,6 +38,9 @@ .Fn EVENTHANDLER_REGISTER name func arg priority .Fn EVENTHANDLER_DEREGISTER name tag .Fn EVENTHANDLER_DEREGISTER_NOWAIT name tag +.Fn EVENTHANDLER_LIST_DECLARE name +.Fn EVENTHANDLER_LIST_DEFINE name +.Fn EVENTHANDLER_DIRECT_INVOKE name .Ft eventhandler_tag .Fo eventhandler_register .Fa "struct eventhandler_list *list" @@ -82,8 +85,13 @@ may be used if the handler does not have a specific pr associated with it. .Pp The normal way to use this subsystem is via the macro interface. -The macros that can be used for working with event handlers and callback -function lists are: +For events that are high frequency it is suggested that you additionally use +.Fn EVENTHANDLER_DEFINE_LIST +so that the event handlers can be invoked directly using +.Fn EVENTHANDLER_DIRECT_INVOKE +(see below). +This saves the invoker from having to do a locked traversal of a global +list of event handler lists. .Bl -tag -width indent .It Fn EVENTHANDLER_DECLARE This macro declares an event handler named by argument @@ -148,6 +156,27 @@ Additional arguments to the macro after the .Fa name parameter are passed as the second and subsequent arguments to each registered callback function. +.It Fn EVENTHANDLER_LIST_DEFINE +This macro defines a reference to an event handler list named by +argument +.Fa name . +It uses +.Xr SYSINIT 9 +to initialize the reference and the eventhandler list. +.It Fn EVENTHANDLER_LIST_DECLARE +This macro declares an event handler list named by argument +.Fa name . +This is only needed for users of +.Fn EVENTHANDLER_DIRECT_INVOKE +which are not in the same compilation unit of that list's definition. +.It Fn EVENTHANDLER_DIRECT_INVOKE +This macro invokes the event handlers registered for the list named by +argument +.Fa name . +This macro can only be used if the list was defined with +.Fn EVENTHANDLER_LIST_DEFINE . +The macro is variadic with the same semantics as +.Fn EVENTHANDLER_INVOKE . .El .Pp The macros are implemented using the following functions: @@ -315,7 +344,7 @@ This is never called. .It Vt process_fork Callbacks invoked when a process forks a child. .It Vt process_init -Callback invoked when a process is initalized. +Callback invoked when a process is initialized. .It Vt random_adaptor_attach Callback invoked when a new random module has been loaded. .It Vt register_framebuffer @@ -337,7 +366,7 @@ Callback invoked when a thread object is created. .It Vt thread_dtor Callback invoked when a thread object is destroyed. .It Vt thread_init -Callback invoked when a thread object is initalized. +Callback invoked when a thread object is initialized. .It Vt thread_fini Callback invoked when a thread object is deinitalized. .It Vt usb_dev_configured @@ -384,4 +413,6 @@ facility first appeared in .Fx 4.0 . .Sh AUTHORS This manual page was written by -.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org . +.An Joseph Koshy Aq Mt jkoshy@FreeBSD.org +and +.An Matt Joras Aq Mt mjoras@FreeBSD.org . Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Nov 9 22:26:49 2017 (r325620) +++ head/sys/kern/init_main.c Thu Nov 9 22:51:48 2017 (r325621) @@ -136,6 +136,11 @@ SET_DECLARE(sysinit_set, struct sysinit); struct sysinit **sysinit, **sysinit_end; struct sysinit **newsysinit, **newsysinit_end; +EVENTHANDLER_LIST_DECLARE(process_init); +EVENTHANDLER_LIST_DECLARE(thread_init); +EVENTHANDLER_LIST_DECLARE(process_ctor); +EVENTHANDLER_LIST_DECLARE(thread_ctor); + /* * Merge a new sysinit set into the current set, reallocating it if * necessary. This can only be called after malloc is running. @@ -580,10 +585,10 @@ proc0_init(void *dummy __unused) * Call the init and ctor for the new thread and proc. We wait * to do this until all other structures are fairly sane. */ - EVENTHANDLER_INVOKE(process_init, p); - EVENTHANDLER_INVOKE(thread_init, td); - EVENTHANDLER_INVOKE(process_ctor, p); - EVENTHANDLER_INVOKE(thread_ctor, td); + EVENTHANDLER_DIRECT_INVOKE(process_init, p); + EVENTHANDLER_DIRECT_INVOKE(thread_init, td); + EVENTHANDLER_DIRECT_INVOKE(process_ctor, p); + EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); /* * Charge root for one process. Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Nov 9 22:26:49 2017 (r325620) +++ head/sys/kern/kern_exec.c Thu Nov 9 22:51:48 2017 (r325621) @@ -144,6 +144,8 @@ static int map_at_zero = 0; SYSCTL_INT(_security_bsd, OID_AUTO, map_at_zero, CTLFLAG_RWTUN, &map_at_zero, 0, "Permit processes to map an object at virtual address 0."); +EVENTHANDLER_LIST_DECLARE(process_exec); + static int sysctl_kern_ps_strings(SYSCTL_HANDLER_ARGS) { @@ -1071,7 +1073,7 @@ exec_new_vmspace(struct image_params *imgp, struct sys imgp->sysent = sv; /* May be called with Giant held */ - EVENTHANDLER_INVOKE(process_exec, p, imgp); + EVENTHANDLER_DIRECT_INVOKE(process_exec, p, imgp); /* * Blow away entire process VM, if address space not shared, Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Thu Nov 9 22:26:49 2017 (r325620) +++ head/sys/kern/kern_exit.c Thu Nov 9 22:51:48 2017 (r325621) @@ -99,6 +99,8 @@ SDT_PROBE_DEFINE1(proc, , , exit, "int"); /* Hook for NFS teardown procedure. */ void (*nlminfo_release_p)(struct proc *p); +EVENTHANDLER_LIST_DECLARE(process_exit); + struct proc * proc_realparent(struct proc *child) { @@ -329,7 +331,7 @@ exit1(struct thread *td, int rval, int signo) * Event handler could change exit status. * XXX what if one of these generates an error? */ - EVENTHANDLER_INVOKE(process_exit, p); + EVENTHANDLER_DIRECT_INVOKE(process_exit, p); /* * If parent is waiting for us to exit or exec, Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Nov 9 22:26:49 2017 (r325620) +++ head/sys/kern/kern_fork.c Thu Nov 9 22:51:48 2017 (r325621) @@ -97,6 +97,8 @@ struct fork_args { }; #endif +EVENTHANDLER_LIST_DECLARE(process_fork); + /* ARGSUSED */ int sys_fork(struct thread *td, struct fork_args *uap) @@ -699,7 +701,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct * Both processes are set up, now check if any loadable modules want * to adjust anything. */ - EVENTHANDLER_INVOKE(process_fork, p1, p2, fr->fr_flags); + EVENTHANDLER_DIRECT_INVOKE(process_fork, p1, p2, fr->fr_flags); /* * Set the child start time and mark the process as being complete. Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Nov 9 22:26:49 2017 (r325620) +++ head/sys/kern/kern_proc.c Thu Nov 9 22:51:48 2017 (r325621) @@ -151,6 +151,17 @@ const int thread_off_td_oncpu = offsetof(struct thread const int thread_off_td_pcb = offsetof(struct thread, td_pcb); const int thread_off_td_plist = offsetof(struct thread, td_plist); +EVENTHANDLER_LIST_DEFINE(process_ctor); +EVENTHANDLER_LIST_DEFINE(process_dtor); +EVENTHANDLER_LIST_DEFINE(process_init); +EVENTHANDLER_LIST_DEFINE(process_fini); +EVENTHANDLER_LIST_DEFINE(process_exit); +EVENTHANDLER_LIST_DEFINE(process_fork); +EVENTHANDLER_LIST_DEFINE(process_exec); + +EVENTHANDLER_LIST_DECLARE(thread_ctor); +EVENTHANDLER_LIST_DECLARE(thread_dtor); + int kstack_pages = KSTACK_PAGES; SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, "Kernel stack size in pages"); @@ -195,12 +206,12 @@ proc_ctor(void *mem, int size, void *arg, int flags) p = (struct proc *)mem; SDT_PROBE4(proc, , ctor , entry, p, size, arg, flags); - EVENTHANDLER_INVOKE(process_ctor, p); + EVENTHANDLER_DIRECT_INVOKE(process_ctor, p); SDT_PROBE4(proc, , ctor , return, p, size, arg, flags); td = FIRST_THREAD_IN_PROC(p); if (td != NULL) { /* Make sure all thread constructors are executed */ - EVENTHANDLER_INVOKE(thread_ctor, td); + EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); } return (0); } @@ -230,9 +241,9 @@ proc_dtor(void *mem, int size, void *arg) MPASS(td->td_su == NULL); /* Make sure all thread destructors are executed */ - EVENTHANDLER_INVOKE(thread_dtor, td); + EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); } - EVENTHANDLER_INVOKE(process_dtor, p); + EVENTHANDLER_DIRECT_INVOKE(process_dtor, p); if (p->p_ksi != NULL) KASSERT(! KSI_ONQ(p->p_ksi), ("SIGCHLD queue")); SDT_PROBE3(proc, , dtor, return, p, size, arg); @@ -256,7 +267,7 @@ proc_init(void *mem, int size, int flags) cv_init(&p->p_pwait, "ppwait"); cv_init(&p->p_dbgwait, "dbgwait"); TAILQ_INIT(&p->p_threads); /* all threads in proc */ - EVENTHANDLER_INVOKE(process_init, p); + EVENTHANDLER_DIRECT_INVOKE(process_init, p); p->p_stats = pstats_alloc(); p->p_pgrp = NULL; SDT_PROBE3(proc, , init, return, p, size, flags); @@ -274,7 +285,7 @@ proc_fini(void *mem, int size) struct proc *p; p = (struct proc *)mem; - EVENTHANDLER_INVOKE(process_fini, p); + EVENTHANDLER_DIRECT_INVOKE(process_fini, p); pstats_free(p->p_stats); thread_free(FIRST_THREAD_IN_PROC(p)); mtx_destroy(&p->p_mtx); Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Thu Nov 9 22:26:49 2017 (r325620) +++ head/sys/kern/kern_thread.c Thu Nov 9 22:51:48 2017 (r325621) @@ -144,6 +144,11 @@ struct tidhashhead *tidhashtbl; u_long tidhash; struct rwlock tidhash_lock; +EVENTHANDLER_LIST_DEFINE(thread_ctor); +EVENTHANDLER_LIST_DEFINE(thread_dtor); +EVENTHANDLER_LIST_DEFINE(thread_init); +EVENTHANDLER_LIST_DEFINE(thread_fini); + static lwpid_t tid_alloc(void) { @@ -201,7 +206,7 @@ thread_ctor(void *mem, int size, void *arg, int flags) */ td->td_critnest = 1; td->td_lend_user_pri = PRI_MAX; - EVENTHANDLER_INVOKE(thread_ctor, td); + EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); #ifdef AUDIT audit_thread_alloc(td); #endif @@ -247,7 +252,7 @@ thread_dtor(void *mem, int size, void *arg) td_softdep_cleanup(td); MPASS(td->td_su == NULL); - EVENTHANDLER_INVOKE(thread_dtor, td); + EVENTHANDLER_DIRECT_INVOKE(thread_dtor, td); tid_free(td->td_tid); } @@ -264,7 +269,7 @@ thread_init(void *mem, int size, int flags) td->td_sleepqueue = sleepq_alloc(); td->td_turnstile = turnstile_alloc(); td->td_rlqe = NULL; - EVENTHANDLER_INVOKE(thread_init, td); + EVENTHANDLER_DIRECT_INVOKE(thread_init, td); umtx_thread_init(td); td->td_kstack = 0; td->td_sel = NULL; @@ -280,7 +285,7 @@ thread_fini(void *mem, int size) struct thread *td; td = (struct thread *)mem; - EVENTHANDLER_INVOKE(thread_fini, td); + EVENTHANDLER_DIRECT_INVOKE(thread_fini, td); rlqentry_free(td->td_rlqe); turnstile_free(td->td_turnstile); sleepq_free(td->td_sleepqueue); Modified: head/sys/kern/subr_eventhandler.c ============================================================================== --- head/sys/kern/subr_eventhandler.c Thu Nov 9 22:26:49 2017 (r325620) +++ head/sys/kern/subr_eventhandler.c Thu Nov 9 22:51:48 2017 (r325621) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_EVENTHANDLER, "eventhandler", "Event handler records"); -/* List of 'slow' lists */ +/* List of all eventhandler lists */ static TAILQ_HEAD(, eventhandler_list) eventhandler_lists; static int eventhandler_lists_initted = 0; static struct mtx eventhandler_mutex; @@ -64,25 +64,11 @@ eventhandler_init(void *dummy __unused) SYSINIT(eventhandlers, SI_SUB_EVENTHANDLER, SI_ORDER_FIRST, eventhandler_init, NULL); -/* - * Insertion is O(n) due to the priority scan, but optimises to O(1) - * if all priorities are identical. - */ -static eventhandler_tag -eventhandler_register_internal(struct eventhandler_list *list, - const char *name, eventhandler_tag epn) +static struct eventhandler_list * +eventhandler_find_or_create_list(const char *name) { - struct eventhandler_list *new_list; - struct eventhandler_entry *ep; - - KASSERT(eventhandler_lists_initted, ("eventhandler registered too early")); - KASSERT(epn != NULL, ("%s: cannot register NULL event", __func__)); + struct eventhandler_list *list, *new_list; - /* lock the eventhandler lists */ - mtx_lock(&eventhandler_mutex); - - /* Do we need to find/create the (slow) list? */ - if (list == NULL) { /* look for a matching, existing list */ list = _eventhandler_find_list(name); @@ -90,8 +76,8 @@ eventhandler_register_internal(struct eventhandler_lis if (list == NULL) { mtx_unlock(&eventhandler_mutex); - new_list = malloc(sizeof(struct eventhandler_list) + - strlen(name) + 1, M_EVENTHANDLER, M_WAITOK); + new_list = malloc(sizeof(*new_list) + strlen(name) + 1, + M_EVENTHANDLER, M_WAITOK | M_ZERO); /* If someone else created it already, then use that one. */ mtx_lock(&eventhandler_mutex); @@ -101,21 +87,35 @@ eventhandler_register_internal(struct eventhandler_lis } else { CTR2(KTR_EVH, "%s: creating list \"%s\"", __func__, name); list = new_list; - list->el_flags = 0; - list->el_runcount = 0; - bzero(&list->el_lock, sizeof(list->el_lock)); - list->el_name = (char *)list + sizeof(struct eventhandler_list); + TAILQ_INIT(&list->el_entries); + mtx_init(&list->el_lock, name, "eventhandler list", MTX_DEF); + list->el_name = (char *)(list + 1); strcpy(list->el_name, name); TAILQ_INSERT_HEAD(&eventhandler_lists, list, el_link); } } + return (list); +} + +/* + * Insertion is O(n) due to the priority scan, but optimises to O(1) + * if all priorities are identical. + */ +static eventhandler_tag +eventhandler_register_internal(struct eventhandler_list *list, + const char *name, eventhandler_tag epn) +{ + struct eventhandler_entry *ep; + + KASSERT(eventhandler_lists_initted, ("eventhandler registered too early")); + KASSERT(epn != NULL, ("%s: cannot register NULL event", __func__)); + + /* Do we need to find/create the list? */ + if (list == NULL) { + mtx_lock(&eventhandler_mutex); + list = eventhandler_find_or_create_list(name); + mtx_unlock(&eventhandler_mutex); } - if (!(list->el_flags & EHL_INITTED)) { - TAILQ_INIT(&list->el_entries); - mtx_init(&list->el_lock, name, "eventhandler list", MTX_DEF); - atomic_store_rel_int(&list->el_flags, EHL_INITTED); - } - mtx_unlock(&eventhandler_mutex); KASSERT(epn->ee_priority != EHE_DEAD_PRIORITY, ("%s: handler for %s registered with dead priority", __func__, name)); @@ -293,4 +293,23 @@ eventhandler_prune_list(struct eventhandler_list *list } if (pruned > 0) wakeup(list); +} + +/* + * Create (or get the existing) list so the pointer can be stored by + * EVENTHANDLER_LIST_DEFINE. + */ +struct eventhandler_list * +eventhandler_create_list(const char *name) +{ + struct eventhandler_list *list; + + KASSERT(eventhandler_lists_initted, + ("eventhandler list created too early")); + + mtx_lock(&eventhandler_mutex); + list = eventhandler_find_or_create_list(name); + mtx_unlock(&eventhandler_mutex); + + return (list); } Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Thu Nov 9 22:26:49 2017 (r325620) +++ head/sys/sys/eventhandler.h Thu Nov 9 22:51:48 2017 (r325621) @@ -51,8 +51,7 @@ struct eventhandler_entry_vimage { struct eventhandler_list { char *el_name; - int el_flags; -#define EHL_INITTED (1<<0) + int el_flags; /* Unused. */ u_int el_runcount; struct mtx el_lock; TAILQ_ENTRY(eventhandler_list) el_link; @@ -72,8 +71,6 @@ typedef struct eventhandler_entry *eventhandler_tag; struct eventhandler_entry *_ep; \ struct eventhandler_entry_ ## name *_t; \ \ - KASSERT((list)->el_flags & EHL_INITTED, \ - ("eventhandler_invoke: running non-inited list")); \ EHL_LOCK_ASSERT((list), MA_OWNED); \ (list)->el_runcount++; \ KASSERT((list)->el_runcount > 0, \ @@ -98,10 +95,41 @@ typedef struct eventhandler_entry *eventhandler_tag; } while (0) /* - * Slow handlers are entirely dynamic; lists are created - * when entries are added to them, and thus have no concept of "owner", - * - * Slow handlers need to be declared, but do not need to be defined. The + * You can optionally use the EVENTHANDLER_LIST and EVENTHANDLER_DIRECT macros + * to pre-define a symbol for the eventhandler list. This symbol can be used by + * EVENTHANDLER_DIRECT_INVOKE, which has the advantage of not needing to do a + * locked search of the global list of eventhandler lists. At least + * EVENTHANDLER_LIST_DEFINE must be be used for EVENTHANDLER_DIRECT_INVOKE to + * work. EVENTHANDLER_LIST_DECLARE is only needed if the call to + * EVENTHANDLER_DIRECT_INVOKE is in a different compilation unit from + * EVENTHANDLER_LIST_DEFINE. If the events are even relatively high frequency + * it is suggested that you directly define a list for them. + */ +#define EVENTHANDLER_LIST_DECLARE(name) \ +extern struct eventhandler_list *_eventhandler_list_ ## name \ + +#define EVENTHANDLER_LIST_DEFINE(name) \ +struct eventhandler_list *_eventhandler_list_ ## name ; \ +static void _ehl_init_ ## name (void * ctx __unused) \ +{ \ + _eventhandler_list_ ## name = eventhandler_create_list(#name); \ +} \ +SYSINIT(name ## _ehl_init, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, \ + _ehl_init_ ## name, NULL); \ + struct __hack + +#define EVENTHANDLER_DIRECT_INVOKE(name, ...) do { \ + struct eventhandler_list *_el; \ + \ + _el = _eventhandler_list_ ## name ; \ + if (!TAILQ_EMPTY(&_el->el_entries)) { \ + EHL_LOCK(_el); \ + _EVENTHANDLER_INVOKE(name, _el , ## __VA_ARGS__); \ + } \ +} while (0) + +/* + * Event handlers need to be declared, but do not need to be defined. The * declaration must be in scope wherever the handler is to be invoked. */ #define EVENTHANDLER_DECLARE(name, type) \ @@ -158,6 +186,7 @@ void eventhandler_deregister_nowait(struct eventhandle eventhandler_tag tag); struct eventhandler_list *eventhandler_find_list(const char *name); void eventhandler_prune_list(struct eventhandler_list *list); +struct eventhandler_list *eventhandler_create_list(const char *name); #ifdef VIMAGE typedef void (*vimage_iterator_func_t)(void *, ...); From owner-svn-src-all@freebsd.org Thu Nov 9 23:36:11 2017 Return-Path: Delivered-To: svn-src-all@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 502A8E5F58D; Thu, 9 Nov 2017 23:36:11 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1D3857DA4F; Thu, 9 Nov 2017 23:36:11 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vA9NaAlG052645; Thu, 9 Nov 2017 23:36:10 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vA9NaAU6052644; Thu, 9 Nov 2017 23:36:10 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201711092336.vA9NaAU6052644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Thu, 9 Nov 2017 23:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325622 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 325622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Nov 2017 23:36:11 -0000 Author: mjoras Date: Thu Nov 9 23:36:10 2017 New Revision: 325622 URL: https://svnweb.freebsd.org/changeset/base/325622 Log: Correct mistake in manpage. Reported by: pluknet Approved by: rstone (mentor) MFC with: r325621 Pointy hat to: mjoras Modified: head/share/man/man9/EVENTHANDLER.9 Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Thu Nov 9 22:51:48 2017 (r325621) +++ head/share/man/man9/EVENTHANDLER.9 Thu Nov 9 23:36:10 2017 (r325622) @@ -86,7 +86,7 @@ associated with it. .Pp The normal way to use this subsystem is via the macro interface. For events that are high frequency it is suggested that you additionally use -.Fn EVENTHANDLER_DEFINE_LIST +.Fn EVENTHANDLER_LIST_DEFINE so that the event handlers can be invoked directly using .Fn EVENTHANDLER_DIRECT_INVOKE (see below). From owner-svn-src-all@freebsd.org Fri Nov 10 01:13:46 2017 Return-Path: Delivered-To: svn-src-all@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 EE8CCE616CF; Fri, 10 Nov 2017 01:13:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB55380354; Fri, 10 Nov 2017 01:13:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAA1Djt5093935; Fri, 10 Nov 2017 01:13:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA1Djco093934; Fri, 10 Nov 2017 01:13:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201711100113.vAA1Djco093934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 10 Nov 2017 01:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325623 - head/libexec/rtld-elf/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/libexec/rtld-elf/mips X-SVN-Commit-Revision: 325623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 01:13:47 -0000 Author: jhb Date: Fri Nov 10 01:13:45 2017 New Revision: 325623 URL: https://svnweb.freebsd.org/changeset/base/325623 Log: Use NESTED() instead of LEAF() for rtld_start. This is only cosmetic, but the entry point for rtld is not a leaf function, and this avoids two .frame directives for rtld_start. Sponsored by: DARPA / AFRL Modified: head/libexec/rtld-elf/mips/rtld_start.S Modified: head/libexec/rtld-elf/mips/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/mips/rtld_start.S Thu Nov 9 23:36:10 2017 (r325622) +++ head/libexec/rtld-elf/mips/rtld_start.S Fri Nov 10 01:13:45 2017 (r325623) @@ -43,8 +43,7 @@ * a2 rtld object (filled in by dynamic loader) * a3 ps_strings */ -LEAF(rtld_start) - .frame sp, 4*PTR_SIZE, ra +NESTED(rtld_start, 4*PTR_SIZE, ra) .mask 0x10090000,-PTR_SIZE .set noreorder SETUP_GP From owner-svn-src-all@freebsd.org Fri Nov 10 01:17:28 2017 Return-Path: Delivered-To: svn-src-all@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 181C3E6184F; Fri, 10 Nov 2017 01:17:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6D228053A; Fri, 10 Nov 2017 01:17:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAA1HQ1Q094113; Fri, 10 Nov 2017 01:17:26 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA1HQqT094112; Fri, 10 Nov 2017 01:17:26 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201711100117.vAA1HQqT094112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 10 Nov 2017 01:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325624 - head/libexec/rtld-elf/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/libexec/rtld-elf/mips X-SVN-Commit-Revision: 325624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 01:17:28 -0000 Author: jhb Date: Fri Nov 10 01:17:26 2017 New Revision: 325624 URL: https://svnweb.freebsd.org/changeset/base/325624 Log: Some fixups to the CFI directives for PLT stub entry points. The directives I added in r323466 and r323501 did not define a valid CFA until several instructions into the associated functions. This triggers an assertion in GDB when generating a stack trace while stopped at the first instruction of PLT stub entry point since there is no valid CFA rule for the first instruction. This is probably just wrong on my part as the non-simple .cfi_startproc would have defined a valid CFA. Instead, define a valid CFA as sp + 0 at the start of the functions and then use .cfa_def_offset to change the offset when sp is adjusted later in the function. Sponsored by: DARPA / AFRL Modified: head/libexec/rtld-elf/mips/rtld_start.S Modified: head/libexec/rtld-elf/mips/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/mips/rtld_start.S Fri Nov 10 01:13:45 2017 (r325623) +++ head/libexec/rtld-elf/mips/rtld_start.S Fri Nov 10 01:17:26 2017 (r325624) @@ -32,6 +32,8 @@ #include + .cfi_sections .debug_frame + .globl _C_LABEL(_rtld_relocate_nonplt_self) .globl _C_LABEL(_rtld) @@ -107,6 +109,7 @@ END(rtld_start) _rtld_bind_start: .frame sp, XCALLFRAME_SIZ, $15 .cfi_startproc simple + .cfi_def_cfa sp, 0 .cfi_register ra, $15 move v1, gp /* save old GP */ #if defined(__mips_o32) || defined(__mips_o64) @@ -114,7 +117,7 @@ _rtld_bind_start: #endif SETUP_GP PTR_SUBU sp, XCALLFRAME_SIZ /* save arguments and sp value in stack */ - .cfi_def_cfa sp, XCALLFRAME_SIZ + .cfi_def_cfa_offset XCALLFRAME_SIZ SETUP_GP64(XCALLFRAME_GP, _rtld_bind_start) SAVE_GP(XCALLFRAME_GP) #if defined(__mips_n32) || defined(__mips_n64) @@ -200,6 +203,7 @@ END(_rtld_bind_start) _rtld_pltbind_start: .frame sp, XCALLFRAME_SIZ, $15 .cfi_startproc simple + .cfi_def_cfa sp, 0 .cfi_register ra, $15 #if defined(__mips_o32) move v1, gp /* save pointer to .got.plt */ @@ -211,7 +215,7 @@ _rtld_pltbind_start: #endif SETUP_GP PTR_SUBU sp, XCALLFRAME_SIZ /* save arguments and sp value in stack */ - .cfi_def_cfa sp, XCALLFRAME_SIZ + .cfi_def_cfa_offset XCALLFRAME_SIZ SETUP_GP64(XCALLFRAME_GP, _rtld_pltbind_start) SAVE_GP(XCALLFRAME_GP) #if defined(__mips_n32) || defined(__mips_n64) From owner-svn-src-all@freebsd.org Fri Nov 10 02:00:41 2017 Return-Path: Delivered-To: svn-src-all@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 7AC85E62336; Fri, 10 Nov 2017 02:00:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3555916CC; Fri, 10 Nov 2017 02:00:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAA20eac011383; Fri, 10 Nov 2017 02:00:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA20epD011382; Fri, 10 Nov 2017 02:00:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201711100200.vAA20epD011382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 10 Nov 2017 02:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325625 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 325625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 02:00:41 -0000 Author: cem Date: Fri Nov 10 02:00:40 2017 New Revision: 325625 URL: https://svnweb.freebsd.org/changeset/base/325625 Log: systm.h: Include cdefs.h first Ever since r143063, machine/atomic.h requires cdefs.h. So, include it first. Weak support: style(9) tells us to include cdefs.h first. Argument against: since code that includes systm.h still compiles, compilation units that include systm.h must already include cdefs.h. So, an argument could be made that the cdefs.h include could just be removed entirely. That is maybe a bigger change and not one I am interested in bikeshedding. Universe compiles. Sponsored by: Dell EMC Isilon Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Nov 10 01:17:26 2017 (r325624) +++ head/sys/sys/systm.h Fri Nov 10 02:00:40 2017 (r325625) @@ -38,10 +38,10 @@ #ifndef _SYS_SYSTM_H_ #define _SYS_SYSTM_H_ +#include #include #include #include -#include #include #include /* for people using printf mainly */ From owner-svn-src-all@freebsd.org Fri Nov 10 02:09:34 2017 Return-Path: Delivered-To: svn-src-all@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 D5C08E62538; Fri, 10 Nov 2017 02:09:34 +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 A6E321D87; Fri, 10 Nov 2017 02:09:34 +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 vAA29XCx015366; Fri, 10 Nov 2017 02:09:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA29XfS015362; Fri, 10 Nov 2017 02:09:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711100209.vAA29XfS015362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 02:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325626 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 325626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 02:09:35 -0000 Author: bdrewery Date: Fri Nov 10 02:09:33 2017 New Revision: 325626 URL: https://svnweb.freebsd.org/changeset/base/325626 Log: Handle some .OBJDIR == .CURDIR cases. - If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH. This only happens at the top-level, and for sub-directories when the user is clever with MAKEOBJDIRPREFIX=/. - Don't bother checking 'test -w' on .CURDIR. - Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases. - Check if the OBJDIR is writable even for *clean* targets since it determines which .OBJDIR the user gets; If they cannot write to an existing eligible .OBJDIR then it needs to clean in .CURDIR instead. - Add guard to cleanworld/cleanuniverse from removing SRCTOP. - Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding libraries since src.libnames.mk is based on OBJTOP. - Avoid some chdir(2) for modifying .OBJDIR Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 head/share/mk/bsd.init.mk head/share/mk/bsd.obj.mk head/share/mk/src.sys.obj.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 10 02:00:40 2017 (r325625) +++ head/Makefile.inc1 Fri Nov 10 02:09:33 2017 (r325626) @@ -2776,7 +2776,8 @@ BW_CANONICALOBJDIR:=${OBJROOT} .endif .endif cleanworld cleanuniverse: .PHONY -.if !empty(BW_CANONICALOBJDIR) && exists(${BW_CANONICALOBJDIR}) +.if !empty(BW_CANONICALOBJDIR) && exists(${BW_CANONICALOBJDIR}) && \ + ${.CURDIR:tA} != ${BW_CANONICALOBJDIR:tA} -rm -rf ${BW_CANONICALOBJDIR}* -chflags -R 0 ${BW_CANONICALOBJDIR} rm -rf ${BW_CANONICALOBJDIR}* Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Fri Nov 10 02:00:40 2017 (r325625) +++ head/share/mk/bsd.init.mk Fri Nov 10 02:09:33 2017 (r325626) @@ -13,7 +13,7 @@ ____: .if ${MK_AUTO_OBJ} == "yes" # This is also done in bsd.obj.mk -.if defined(NO_OBJ) +.if defined(NO_OBJ) && ${.OBJDIR} != ${.CURDIR} .OBJDIR: ${.CURDIR} .endif .endif Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Fri Nov 10 02:00:40 2017 (r325625) +++ head/share/mk/bsd.obj.mk Fri Nov 10 02:09:33 2017 (r325626) @@ -48,7 +48,7 @@ objwarn: .PHONY obj: .PHONY CANONICALOBJDIR= ${.OBJDIR} # This is also done in bsd.init.mk -.if defined(NO_OBJ) +.if defined(NO_OBJ) && ${.OBJDIR} != ${.CURDIR} # but this makefile does not want it! .OBJDIR: ${.CURDIR} .endif Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Fri Nov 10 02:00:40 2017 (r325625) +++ head/share/mk/src.sys.obj.mk Fri Nov 10 02:09:33 2017 (r325626) @@ -70,7 +70,10 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T} .export OBJROOT SRCTOP .endif -.if ${MK_UNIFIED_OBJDIR} == "yes" +# SRCTOP == OBJROOT only happens with clever MAKEOBJDIRPREFIX=/. Don't +# append TARGET.TARGET_ARCH for that case since the user wants to build +# in the source tree. +.if ${MK_UNIFIED_OBJDIR} == "yes" && ${SRCTOP} != ${OBJROOT:tA} OBJTOP:= ${OBJROOT}${TARGET:D${TARGET}.${TARGET_ARCH}:U${MACHINE}.${MACHINE_ARCH}} .else # TARGET.TARGET_ARCH handled in OBJROOT already. @@ -103,13 +106,12 @@ __objdir:= ${MAKEOBJDIR} .endif # Try to enable MK_AUTO_OBJ by default if we can write to the __objdir. Only -# do this if AUTO_OBJ is not disabled by the user, not cleaning, and this is -# the first make ran. +# do this if AUTO_OBJ is not disabled by the user, and this is the first make +# ran. .if ${.MAKE.LEVEL} == 0 && \ ${MK_AUTO_OBJ} == "no" && empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) && \ !defined(WITHOUT_AUTO_OBJ) && !make(showconfig) && !make(print-dir) && \ - !defined(NO_OBJ) && \ - (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "") + !defined(NO_OBJ) # Find the last existing directory component and check if we can write to it. # If the last component is a symlink then recurse on the new path. CheckAutoObj= \ @@ -147,9 +149,13 @@ CheckAutoObj() { \ fi; \ } .if !empty(__objdir) +.if ${.CURDIR} == ${__objdir} +__objdir_writable?= yes +.else __objdir_writable!= \ ${CheckAutoObj}; CheckAutoObj "${__objdir}" || echo no .endif +.endif __objdir_writable?= no # Export the decision to sub-makes. MK_AUTO_OBJ:= ${__objdir_writable} @@ -179,3 +185,14 @@ MK_AUTO_OBJ:= ${__objdir_writable} # auto.obj.mk or bsd.obj.mk will create the directory and fix .OBJDIR later. .OBJDIR: ${.CURDIR} .endif + +# Ensure .OBJDIR=.CURDIR cases have a proper OBJTOP and .OBJDIR +.if defined(NO_OBJ) || ${__objdir_writable:Uunknown} == "no" || \ + ${__objdir} == ${.CURDIR} +OBJTOP= ${SRCTOP} +OBJROOT= ${SRCTOP}/ +# Compare only to avoid an unneeded chdir(2), :tA purposely left out. +.if ${.OBJDIR} != ${.CURDIR} +.OBJDIR: ${.CURDIR} +.endif +.endif # defined(NO_OBJ) From owner-svn-src-all@freebsd.org Fri Nov 10 02:09:39 2017 Return-Path: Delivered-To: svn-src-all@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 1A4D1E62558; Fri, 10 Nov 2017 02:09:39 +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 D4B881DA4; Fri, 10 Nov 2017 02:09: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 vAA29bVH015412; Fri, 10 Nov 2017 02:09:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA29b1h015411; Fri, 10 Nov 2017 02:09:37 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711100209.vAA29b1h015411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 02:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325627 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 02:09:39 -0000 Author: bdrewery Date: Fri Nov 10 02:09:37 2017 New Revision: 325627 URL: https://svnweb.freebsd.org/changeset/base/325627 Log: Deal with src.conf for top-level MAKEOBJDIRPREFIX guard. - Don't discard SRCCONF value since it may incorrectly have MAKEOBJDIRPREFIX in it. - Add note about src.conf not being a suitable place for MAKEOBJDIRPREFIX. Sponsored by: Dell EMC Isilon Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Fri Nov 10 02:09:33 2017 (r325626) +++ head/Makefile Fri Nov 10 02:09:37 2017 (r325627) @@ -191,10 +191,11 @@ PATH= /sbin:/bin:/usr/sbin:/usr/bin MAKEOBJDIRPREFIX?= /usr/obj _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \ ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \ + SRCCONF=${SRCCONF} \ -f /dev/null -V MAKEOBJDIRPREFIX dummy .if !empty(_MAKEOBJDIRPREFIX) .error MAKEOBJDIRPREFIX can only be set in environment, not as a global\ - (in make.conf(5)) or command-line variable. + (in make.conf(5) or src.conf(5)) or command-line variable. .endif # We often need to use the tree's version of make to build it. From owner-svn-src-all@freebsd.org Fri Nov 10 04:14:50 2017 Return-Path: Delivered-To: svn-src-all@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 32FD3E6475F; Fri, 10 Nov 2017 04:14:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC9DE64CB2; Fri, 10 Nov 2017 04:14:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAA4En44070426; Fri, 10 Nov 2017 04:14:49 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA4EnOd070425; Fri, 10 Nov 2017 04:14:49 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711100414.vAA4EnOd070425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 10 Nov 2017 04:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325628 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 325628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 04:14:50 -0000 Author: jhibbits Date: Fri Nov 10 04:14:48 2017 New Revision: 325628 URL: https://svnweb.freebsd.org/changeset/base/325628 Log: Book-E pmap_mapdev_attr() improvements * Check TLB1 in all mapdev cases, in case the memattr matches an existing mapping (doesn't need to be MAP_DEFAULT). * Fix mapping where the starting address is not a multiple of the widest size base. For instance, it will now properly map 0xffffef000, size 0x11000 using 2 TLB entries, basing it at 0x****f000, instead of 0x***00000. MFC after: 2 weeks Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Nov 10 02:09:37 2017 (r325627) +++ head/sys/powerpc/booke/pmap.c Fri Nov 10 04:14:48 2017 (r325628) @@ -3471,16 +3471,17 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_siz * check whether a sequence of TLB1 entries exist that match the * requirement, but now only checks the easy case. */ - if (ma == VM_MEMATTR_DEFAULT) { - for (i = 0; i < TLB1_ENTRIES; i++) { - tlb1_read_entry(&e, i); - if (!(e.mas1 & MAS1_VALID)) - continue; - if (pa >= e.phys && - (pa + size) <= (e.phys + e.size)) - return (void *)(e.virt + - (vm_offset_t)(pa - e.phys)); - } + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(&e, i); + if (!(e.mas1 & MAS1_VALID)) + continue; + if (pa >= e.phys && + (pa + size) <= (e.phys + e.size) && + (ma == VM_MEMATTR_DEFAULT || + tlb_calc_wimg(pa, ma) == + (e.mas2 & (MAS2_WIMGE_MASK & ~_TLB_ENTRY_SHARED)))) + return (void *)(e.virt + + (vm_offset_t)(pa - e.phys)); } size = roundup(size, PAGE_SIZE); @@ -3494,10 +3495,19 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_siz * With a sparse mapdev, align to the largest starting region. This * could feasibly be optimized for a 'best-fit' alignment, but that * calculation could be very costly. + * Align to the smaller of: + * - first set bit in overlap of (pa & size mask) + * - largest size envelope + * + * It's possible the device mapping may start at a PA that's not larger + * than the size mask, so we need to offset in to maximize the TLB entry + * range and minimize the number of used TLB entries. */ do { tmpva = tlb1_map_base; - va = roundup(tlb1_map_base, 1 << flsl(size)); + sz = ffsl(((1 << flsl(size-1)) - 1) & pa); + sz = sz ? min(roundup(sz + 3, 4), flsl(size) - 1) : flsl(size) - 1; + va = roundup(tlb1_map_base, 1 << sz) | (((1 << sz) - 1) & pa); #ifdef __powerpc64__ } while (!atomic_cmpset_long(&tlb1_map_base, tmpva, va + size)); #else @@ -3514,6 +3524,13 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_siz do { sz = 1 << (ilog2(size) & ~1); + /* Align size to PA */ + if (pa % sz != 0) { + do { + sz >>= 2; + } while (pa % sz != 0); + } + /* Now align from there to VA */ if (va % sz != 0) { do { sz >>= 2; @@ -3522,8 +3539,9 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_siz if (bootverbose) printf("Wiring VA=%lx to PA=%jx (size=%lx)\n", va, (uintmax_t)pa, sz); - tlb1_set_entry(va, pa, sz, - _TLB_ENTRY_SHARED | tlb_calc_wimg(pa, ma)); + if (tlb1_set_entry(va, pa, sz, + _TLB_ENTRY_SHARED | tlb_calc_wimg(pa, ma)) < 0) + return (NULL); size -= sz; pa += sz; va += sz; From owner-svn-src-all@freebsd.org Fri Nov 10 04:23:59 2017 Return-Path: Delivered-To: svn-src-all@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 D2A7BE64A29; Fri, 10 Nov 2017 04:23:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D015650F6; Fri, 10 Nov 2017 04:23:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAA4NwTq074410; Fri, 10 Nov 2017 04:23:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA4NwkJ074409; Fri, 10 Nov 2017 04:23:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711100423.vAA4NwkJ074409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 10 Nov 2017 04:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325629 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 325629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 04:23:59 -0000 Author: jhibbits Date: Fri Nov 10 04:23:58 2017 New Revision: 325629 URL: https://svnweb.freebsd.org/changeset/base/325629 Log: Properly initialize the full md_page structure Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Fri Nov 10 04:14:48 2017 (r325628) +++ head/sys/powerpc/booke/pmap.c Fri Nov 10 04:23:58 2017 (r325629) @@ -2884,6 +2884,7 @@ static void mmu_booke_page_init(mmu_t mmu, vm_page_t m) { + m->md.pv_tracked = 0; TAILQ_INIT(&m->md.pv_list); } From owner-svn-src-all@freebsd.org Fri Nov 10 04:47:54 2017 Return-Path: Delivered-To: svn-src-all@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 12A5AE64EA0; Fri, 10 Nov 2017 04:47:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id A57DE65860; Fri, 10 Nov 2017 04:47:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.104] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id C2CA31A0A52; Fri, 10 Nov 2017 15:47:44 +1100 (AEDT) Date: Fri, 10 Nov 2017 15:47:44 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325625 - head/sys/sys In-Reply-To: <201711100200.vAA20epD011382@repo.freebsd.org> Message-ID: <20171110144148.C1160@besplex.bde.org> References: <201711100200.vAA20epD011382@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=HBzeS8a9Jooz5TqGV3gA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 04:47:54 -0000 On Fri, 10 Nov 2017, Conrad Meyer wrote: > Log: > systm.h: Include cdefs.h first > > Ever since r143063, machine/atomic.h requires cdefs.h. So, include it > first. Weak support: style(9) tells us to include cdefs.h first. This just moves a style bug. The existing include of sys/cdefs.h was bogus. machine/atomic.h uses lots of typedefed types, and is not so polluted that it includes sys/types.h, so it has sys/param.h as a prerequisite (not sys/types.h since that would be chummy with the implementation -- perhaps sys/types.h is enough for machine/atomic.h, but sys/systm.h includes the kitchen sink (but not the kitchen sys/param.h), so it is unclear if sys/types.h us enough for it. sys/param.h (and even sys/types.h) includes sys/cdefs.h, and it is a style bug to not depend on this. Rather, it is a style bug to not include both sys/param.h and sys/systm.h in .c files in the kernel, in that order and before any other includes, or to not depend on the standard pollution of them including the kitchen and its sink. In particular, it is a style bug to include machine/atomic.h directly -- this is part of the sink. sys/systm.h defines macros like KASSERT() which may be used in any other header, so all kernel .c files have sys/systm.h as a potential prerequisite, and the implementation of this is to require explicit includes of sys/systm.h and not depend on .h files including it as nonstandard pollution. Some .h files do have this pollution. Some are so bad that they even include sys/param.h too. r143063 added lots of ifdefs using feature test macros defined in cdefs.h, and also some ifdefs that sys/cdefs.h is included before it is used. This was a good idea at the time, but was badly implemented and is worse now. The test for sys/cdefs.h being included before machine/atomic.h is now only done for amd64, i386, mips and powerpc. The feature tests are rarely done outside of i386. Even amd64 mostly doesn't bother with them. On i386, they are mostly for gnu asm (especially in i386/include/atomic.h) and for gcc compiler features that are not in Intel cc. Gnu asm must now be considered standard, so tests for it are vacuously true. Support for Intel cc has rotted. clang strictly needs many more feature tests, but it is still too close to gcc so results of old tests are vacuously the same as for gcc, and there are no new tests. > Argument against: since code that includes systm.h still compiles, > compilation units that include systm.h must already include cdefs.h. So, an Yes, they must include it and much more -- see above. Just using __FBSDID() requires including sys/cdefs.h before, so the requirement of including sys/cdefs.h is automatically satisfied in .c files that don't have the style bug of not using __FBSDID() near the beginning of the file before other includes. But that is not enough for sys/systm.h to be self- sufficient. > argument could be made that the cdefs.h include could just be removed > entirely. That is maybe a bigger change and not one I am interested in > bikeshedding. It is just the correct change... > Modified: head/sys/sys/systm.h > ============================================================================== > --- head/sys/sys/systm.h Fri Nov 10 01:17:26 2017 (r325624) > +++ head/sys/sys/systm.h Fri Nov 10 02:00:40 2017 (r325625) > @@ -38,10 +38,10 @@ > #ifndef _SYS_SYSTM_H_ > #define _SYS_SYSTM_H_ > > +#include > #include > #include > #include > -#include > #include > #include /* for people using printf mainly */ The old include was a style bug in r120610. sys/queue.h is the last place that needs an include of sys/cdefs.h before it, since it has always been documented to be self-sufficient. In 4.4BSD-Lite2, it doesn't include sys/cdefs.h. I don't know if it should have or if FreeBSD grew a dependency on it. The dependency was fixed in r99594 by including sys/cdefs.h in sys/queue.h. r120610 added a use of __predict_false() in KASSERT() in sys/systm.h, and added the above old include in a nonsense place. Adding it before all other includes wouldn't be nonsense. It is just a style bug. My version of style(9) says: Kernel include files (i.e., sys/*.h) come first; normally, or will be needed before any others. includes . Do not include both. Many headers, including , include , and it is OK to depend on that. This doesn't say that it is a style bug to not depend on the other headers including sys/cdefs.h. I actually don't like including sys/cdefs at all. Even or especially for __FBSDID() -- this alone makes most FreeBSD sources unportable almost as well as using __P(()) used to.. __FBSDID() is easy to emulate, but not so if more or subtler macros in it are used. Kernel sources are inherently unportable, but using sys/cdefs.h in the implementation is essential and it is a style bug for the implementation to not understand itself and include sys/cdefs.h in every file. Only headers designed to be self-sufficient should include it. Bruce From owner-svn-src-all@freebsd.org Fri Nov 10 07:44:58 2017 Return-Path: Delivered-To: svn-src-all@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 E2D88E674B5; Fri, 10 Nov 2017 07:44:58 +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 97031697D4; Fri, 10 Nov 2017 07:44:58 +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 vAA7ivTV057795; Fri, 10 Nov 2017 07:44:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA7ivtk057793; Fri, 10 Nov 2017 07:44:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711100744.vAA7ivtk057793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 07:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325630 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 325630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 07:44:59 -0000 Author: hselasky Date: Fri Nov 10 07:44:57 2017 New Revision: 325630 URL: https://svnweb.freebsd.org/changeset/base/325630 Log: Add new USB quirk. Submitted by: Kris G Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Nov 10 04:23:58 2017 (r325629) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Nov 10 07:44:57 2017 (r325630) @@ -95,6 +95,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC), USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS), USB_QUIRK(REALTEK, RTL8196EU, 0x0000, 0xffff, UQ_CFG_INDEX_1), + USB_QUIRK(TPLINK, RTL8153, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1), USB_QUIRK(CISCOLINKSYS, USB3GIGV1, 0x0000, 0xffff, UQ_CFG_INDEX_1), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Nov 10 04:23:58 2017 (r325629) +++ head/sys/dev/usb/usbdevs Fri Nov 10 07:44:57 2017 (r325630) @@ -4539,6 +4539,7 @@ product TPLINK WN822NV4 0x0108 TL-WN822N v4 product TPLINK WN823NV2 0x0109 TL-WN823N v2 product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 +product TPLINK RTL8153 0x0601 RTL8153 USB 10/100/1000 LAN /* Trek Technology products */ product TREK THUMBDRIVE 0x1111 ThumbDrive From owner-svn-src-all@freebsd.org Fri Nov 10 07:52:48 2017 Return-Path: Delivered-To: svn-src-all@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 177FBE67736; Fri, 10 Nov 2017 07:52:48 +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 D883469D12; Fri, 10 Nov 2017 07:52:47 +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 vAA7qlXb062003; Fri, 10 Nov 2017 07:52:47 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA7qlbR062002; Fri, 10 Nov 2017 07:52:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711100752.vAA7qlbR062002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 07:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325631 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 07:52:48 -0000 Author: bdrewery Date: Fri Nov 10 07:52:46 2017 New Revision: 325631 URL: https://svnweb.freebsd.org/changeset/base/325631 Log: Add support for CRUNCH_LIBS_ for specifying a lib only for 1 prog. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Fri Nov 10 07:44:57 2017 (r325630) +++ head/share/mk/bsd.crunchgen.mk Fri Nov 10 07:52:46 2017 (r325631) @@ -100,6 +100,9 @@ ${CONF}: Makefile .else echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ >>${.TARGET} .endif +.ifdef CRUNCH_LIBS_${P} + echo special ${P} lib ${CRUNCH_LIBS_${P}} >>${.TARGET} +.endif .for A in ${CRUNCH_ALIAS_${P}} echo ln ${P} ${A} >>${.TARGET} .endfor From owner-svn-src-all@freebsd.org Fri Nov 10 07:53:00 2017 Return-Path: Delivered-To: svn-src-all@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 2AB8EE67779; Fri, 10 Nov 2017 07:53:00 +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 E3FBA69E4E; Fri, 10 Nov 2017 07:52:59 +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 vAA7qwg8062055; Fri, 10 Nov 2017 07:52:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA7qwtj062052; Fri, 10 Nov 2017 07:52:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711100752.vAA7qwtj062052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 07:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325632 - in head: . rescue/rescue sbin/ipf/ipf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: . rescue/rescue sbin/ipf/ipf X-SVN-Commit-Revision: 325632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 07:53:00 -0000 Author: bdrewery Date: Fri Nov 10 07:52:58 2017 New Revision: 325632 URL: https://svnweb.freebsd.org/changeset/base/325632 Log: rescue ipf: Remove hacks and link in libipf directly. Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 head/rescue/rescue/Makefile head/sbin/ipf/ipf/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 10 07:52:46 2017 (r325631) +++ head/Makefile.inc1 Fri Nov 10 07:52:58 2017 (r325632) @@ -2396,6 +2396,9 @@ lib/libcasper__L: lib/libnv__L lib/liblzma__L: lib/libthr__L _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib} +.if ${MK_IPFILTER} != "no" +_generic_libs+= sbin/ipf/libipf +.endif .for _DIR in ${LOCAL_LIB_DIRS} .if exists(${.CURDIR}/${_DIR}/Makefile) && empty(_generic_libs:M${_DIR}) _generic_libs+= ${_DIR} Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Fri Nov 10 07:52:46 2017 (r325631) +++ head/rescue/rescue/Makefile Fri Nov 10 07:52:58 2017 (r325632) @@ -108,6 +108,7 @@ CRUNCH_PROGS_sbin+= rtsol .if ${MK_IPFILTER} != "no" CRUNCH_PROGS_sbin+= ipf +CRUNCH_LIBS_ipf+= ${LIBIPF} .endif .if ${MK_ROUTED} != "no" Modified: head/sbin/ipf/ipf/Makefile ============================================================================== --- head/sbin/ipf/ipf/Makefile Fri Nov 10 07:52:46 2017 (r325631) +++ head/sbin/ipf/ipf/Makefile Fri Nov 10 07:52:58 2017 (r325632) @@ -30,10 +30,7 @@ ipf_l.h: lexer.h sed -e 's/yy/ipf_yy/g' \ ${.ALLSRC} > ${.TARGET} -.if defined(RESCUE) -LIBIPF_SRCS!= cd ${.CURDIR:H}/libipf && ${MAKE} -V SRCS -SRCS+= ${LIBIPF_SRCS} -.else +.if !defined(RESCUE) LIBADD+= pcap .endif From owner-svn-src-all@freebsd.org Fri Nov 10 07:53:03 2017 Return-Path: Delivered-To: svn-src-all@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 DA521E677A3; Fri, 10 Nov 2017 07:53:03 +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 A71D369E5C; Fri, 10 Nov 2017 07:53:03 +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 vAA7r2tI062108; Fri, 10 Nov 2017 07:53:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA7r2tQ062107; Fri, 10 Nov 2017 07:53:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711100753.vAA7r2tQ062107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 07:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325633 - in head: rescue/rescue tools/bsdbox X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: rescue/rescue tools/bsdbox X-SVN-Commit-Revision: 325633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 07:53:04 -0000 Author: bdrewery Date: Fri Nov 10 07:53:02 2017 New Revision: 325633 URL: https://svnweb.freebsd.org/changeset/base/325633 Log: Avoid referencing private lib names directly. Sponsored by: Dell EMC Isilon Modified: head/rescue/rescue/Makefile head/tools/bsdbox/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Fri Nov 10 07:52:58 2017 (r325632) +++ head/rescue/rescue/Makefile Fri Nov 10 07:53:02 2017 (r325633) @@ -193,7 +193,7 @@ CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat CRUNCH_PROGS_usr.bin+= zstd CRUNCH_ALIAS_zstd= unzstd zstdcat zstdmt -CRUNCH_LIBS+= -lprivatezstd +CRUNCH_LIBS+= ${LDADD_zstd} CRUNCH_PROGS_usr.bin+= tar CRUNCH_LIBS+= -larchive Modified: head/tools/bsdbox/Makefile ============================================================================== --- head/tools/bsdbox/Makefile Fri Nov 10 07:52:58 2017 (r325632) +++ head/tools/bsdbox/Makefile Fri Nov 10 07:53:02 2017 (r325633) @@ -72,7 +72,7 @@ CRUNCH_SRCDIRS+= sbin CRUNCH_LIBS+= -l80211 -lalias -lcam -lcursesw -ldevstat -lipsec # Don't forget this - ifconfig, etc -adrian -CRUNCH_LIBS+= -lprivateifconfig +CRUNCH_LIBS+= ${LDADD_ifconfig} CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lsbuf -lufs ################################################################## From owner-svn-src-all@freebsd.org Fri Nov 10 08:00:10 2017 Return-Path: Delivered-To: svn-src-all@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 9D19AE67ADD; Fri, 10 Nov 2017 08:00:10 +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 6A4D86A1C7; Fri, 10 Nov 2017 08:00:10 +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 vAA809Wm062445; Fri, 10 Nov 2017 08:00:09 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA809uJ062443; Fri, 10 Nov 2017 08:00:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711100800.vAA809uJ062443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 08:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325634 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 08:00:10 -0000 Author: bdrewery Date: Fri Nov 10 08:00:09 2017 New Revision: 325634 URL: https://svnweb.freebsd.org/changeset/base/325634 Log: Add some missed OBJS_SRCS_FILTER from r323637. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.clang-analyze.mk head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.clang-analyze.mk ============================================================================== --- head/share/mk/bsd.clang-analyze.mk Fri Nov 10 07:53:02 2017 (r325633) +++ head/share/mk/bsd.clang-analyze.mk Fri Nov 10 08:00:09 2017 (r325634) @@ -71,7 +71,7 @@ CLANG_ANALYZE_SRCS= \ ${DPSRCS:M*.[cC]} ${DPSRCS:M*.cc} \ ${DPSRCS:M*.cpp} ${DPSRCS:M*.cxx} .if !empty(CLANG_ANALYZE_SRCS) -CLANG_ANALYZE_OBJS= ${CLANG_ANALYZE_SRCS:O:u:R:S,$,.clang-analyzer,} +CLANG_ANALYZE_OBJS= ${CLANG_ANALYZE_SRCS:O:u:${OBJS_SRCS_FILTER:ts:}:S,$,.clang-analyzer,} .NOPATH: ${CLANG_ANALYZE_OBJS} .endif Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Fri Nov 10 07:53:02 2017 (r325633) +++ head/share/mk/bsd.progs.mk Fri Nov 10 08:00:09 2017 (r325634) @@ -104,7 +104,7 @@ _PROGS_ALL_SRCS+= ${s} .if !empty(_PROGS_COMMON_SRCS) _PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:M*.[dhly]} .if !empty(_PROGS_COMMON_SRCS:N*.[dhly]) -_PROGS_COMMON_OBJS+= ${_PROGS_COMMON_SRCS:N*.[dhly]:R:S/$/.o/g} +_PROGS_COMMON_OBJS+= ${_PROGS_COMMON_SRCS:N*.[dhly]:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g} .endif .endif From owner-svn-src-all@freebsd.org Fri Nov 10 08:31:41 2017 Return-Path: Delivered-To: svn-src-all@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 E5109E681B0; Fri, 10 Nov 2017 08:31:41 +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 90C026AD88; Fri, 10 Nov 2017 08:31:41 +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 vAA8VeJY077101; Fri, 10 Nov 2017 08:31:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA8Vefo077100; Fri, 10 Nov 2017 08:31:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711100831.vAA8Vefo077100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 08:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325635 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 325635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 08:31:42 -0000 Author: hselasky Date: Fri Nov 10 08:31:40 2017 New Revision: 325635 URL: https://svnweb.freebsd.org/changeset/base/325635 Log: Remove some not needed comments in the LinuxKPI. Use the Linux source tree to lookup documentation for the functions implemented in the LinuxKPI instead. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/list.h Modified: head/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/list.h Fri Nov 10 08:00:09 2017 (r325634) +++ head/sys/compat/linuxkpi/common/include/linux/list.h Fri Nov 10 08:31:40 2017 (r325635) @@ -391,10 +391,6 @@ hlist_move_list(struct hlist_head *old, struct hlist_h old->first = NULL; } -/** - * list_is_singular - tests whether a list has just one entry. - * @head: the list to test. - */ static inline int list_is_singular(const struct list_head *head) { return !list_empty(head) && (head->next == head->prev); @@ -412,20 +408,6 @@ static inline void __list_cut_position(struct list_hea new_first->prev = head; } -/** - * list_cut_position - cut a list into two - * @list: a new list to add all removed entries - * @head: a list with entries - * @entry: an entry within head, could be the head itself - * and if so we won't cut the list - * - * This helper moves the initial part of @head, up to and - * including @entry, from @head to @list. You should - * pass on @entry an element you know is on @head. @list - * should be an empty list or a list you do not care about - * losing its data. - * - */ static inline void list_cut_position(struct list_head *list, struct list_head *head, struct list_head *entry) { @@ -440,11 +422,6 @@ static inline void list_cut_position(struct list_head __list_cut_position(list, head, entry); } -/** - * list_is_last - tests whether @list is the last entry in list @head - * @list: the entry to test - * @head: the head of the list - */ static inline int list_is_last(const struct list_head *list, const struct list_head *head) { From owner-svn-src-all@freebsd.org Fri Nov 10 08:42:38 2017 Return-Path: Delivered-To: svn-src-all@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 C1BDAE6852E; Fri, 10 Nov 2017 08:42: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 8D8F56B51A; Fri, 10 Nov 2017 08:42: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 vAA8gbkr082838; Fri, 10 Nov 2017 08:42:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA8gb16082836; Fri, 10 Nov 2017 08:42:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711100842.vAA8gb16082836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 08:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325636 - stable/11/sys/fs/cuse X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/fs/cuse X-SVN-Commit-Revision: 325636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 08:42:38 -0000 Author: hselasky Date: Fri Nov 10 08:42:37 2017 New Revision: 325636 URL: https://svnweb.freebsd.org/changeset/base/325636 Log: MFC r325362: Allow CUSE(3) to free all memory mapped memory by using regular SWAP objects instead of malloc(). The SWAP objects are automagically freed when there are no more consumers. This greatly simplifies the mmap logic inside CUSE(3) in the kernel. This change fixes an issue where mmapped memory can accumulate and never get freed, if many different mmap sizes are needed over time. Further this change fixes memory leaks when the CUSE(3) kernel module is unloaded. While at it make sure the CUSE_ALLOC_PAGES_MAX limit is treated as an exclusive limit. CUSE(3) memory maps must be less than CUSE_ALLOC_PAGES_MAX number of pages. Reviewed by: kib @ Differential Revision: https://reviews.freebsd.org/D11392 Sponsored by: Mellanox Technologies Modified: stable/11/sys/fs/cuse/cuse.c stable/11/sys/fs/cuse/cuse_ioctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/cuse/cuse.c ============================================================================== --- stable/11/sys/fs/cuse/cuse.c Fri Nov 10 08:31:40 2017 (r325635) +++ stable/11/sys/fs/cuse/cuse.c Fri Nov 10 08:42:37 2017 (r325636) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2010-2013 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2010-2017 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,9 @@ #include #include +#include +#include +#include #include #include @@ -69,8 +73,6 @@ MODULE_VERSION(cuse, 1); */ MODULE_VERSION(cuse4bsd, 1); -#define NBUSY ((uint8_t *)1) - #ifdef FEATURE FEATURE(cuse, "Userspace character devices"); #endif @@ -94,10 +96,10 @@ struct cuse_client_command { }; struct cuse_memory { - struct cuse_server *owner; - uint8_t *virtaddr; + TAILQ_ENTRY(cuse_memory) entry; + vm_object_t object; uint32_t page_count; - uint32_t is_allocated; + uint32_t alloc_nr; }; struct cuse_server_dev { @@ -112,6 +114,7 @@ struct cuse_server { TAILQ_HEAD(, cuse_client_command) head; TAILQ_HEAD(, cuse_server_dev) hdev; TAILQ_HEAD(, cuse_client) hcli; + TAILQ_HEAD(, cuse_memory) hmem; struct cv cv; struct selinfo selinfo; pid_t pid; @@ -128,8 +131,8 @@ struct cuse_client { uint8_t ioctl_buffer[CUSE_BUFFER_MAX] __aligned(4); - int fflags; /* file flags */ - int cflags; /* client flags */ + int fflags; /* file flags */ + int cflags; /* client flags */ #define CUSE_CLI_IS_CLOSING 0x01 #define CUSE_CLI_KNOTE_NEED_READ 0x02 #define CUSE_CLI_KNOTE_NEED_WRITE 0x04 @@ -140,14 +143,13 @@ struct cuse_client { #define CUSE_CLIENT_CLOSING(pcc) \ ((pcc)->cflags & CUSE_CLI_IS_CLOSING) -static MALLOC_DEFINE(M_CUSE, "cuse", "CUSE memory"); +static MALLOC_DEFINE(M_CUSE, "cuse", "CUSE memory"); static TAILQ_HEAD(, cuse_server) cuse_server_head; static struct mtx cuse_mtx; static struct cdev *cuse_dev; static struct cuse_server *cuse_alloc_unit[CUSE_DEVICES_MAX]; static int cuse_alloc_unit_id[CUSE_DEVICES_MAX]; -static struct cuse_memory cuse_mem[CUSE_ALLOC_UNIT_MAX]; static void cuse_server_wakeup_all_client_locked(struct cuse_server *pcs); static void cuse_client_kqfilter_read_detach(struct knote *kn); @@ -173,7 +175,7 @@ static d_ioctl_t cuse_client_ioctl; static d_read_t cuse_client_read; static d_write_t cuse_client_write; static d_poll_t cuse_client_poll; -static d_mmap_t cuse_client_mmap; +static d_mmap_single_t cuse_client_mmap_single; static d_kqfilter_t cuse_client_kqfilter; static struct cdevsw cuse_client_devsw = { @@ -186,7 +188,7 @@ static struct cdevsw cuse_client_devsw = { .d_read = cuse_client_read, .d_write = cuse_client_write, .d_poll = cuse_client_poll, - .d_mmap = cuse_client_mmap, + .d_mmap_single = cuse_client_mmap_single, .d_kqfilter = cuse_client_kqfilter, }; @@ -196,7 +198,7 @@ static d_ioctl_t cuse_server_ioctl; static d_read_t cuse_server_read; static d_write_t cuse_server_write; static d_poll_t cuse_server_poll; -static d_mmap_t cuse_server_mmap; +static d_mmap_single_t cuse_server_mmap_single; static struct cdevsw cuse_server_devsw = { .d_version = D_VERSION, @@ -208,7 +210,7 @@ static struct cdevsw cuse_server_devsw = { .d_read = cuse_server_read, .d_write = cuse_server_write, .d_poll = cuse_server_poll, - .d_mmap = cuse_server_mmap, + .d_mmap_single = cuse_server_mmap_single, }; static void cuse_client_is_closing(struct cuse_client *); @@ -252,7 +254,6 @@ cuse_kern_init(void *arg) (CUSE_VERSION >> 16) & 0xFF, (CUSE_VERSION >> 8) & 0xFF, (CUSE_VERSION >> 0) & 0xFF); } - SYSINIT(cuse_kern_init, SI_SUB_DEVFS, SI_ORDER_ANY, cuse_kern_init, 0); static void @@ -280,7 +281,6 @@ cuse_kern_uninit(void *arg) mtx_destroy(&cuse_mtx); } - SYSUNINIT(cuse_kern_uninit, SI_SUB_DEVFS, SI_ORDER_ANY, cuse_kern_uninit, 0); static int @@ -398,74 +398,80 @@ cuse_convert_error(int error) } static void -cuse_server_free_memory(struct cuse_server *pcs) +cuse_vm_memory_free(struct cuse_memory *mem) { - struct cuse_memory *mem; - uint32_t n; + /* last user is gone - free */ + vm_object_deallocate(mem->object); - for (n = 0; n != CUSE_ALLOC_UNIT_MAX; n++) { - mem = &cuse_mem[n]; - - /* this memory is never freed */ - if (mem->owner == pcs) { - mem->owner = NULL; - mem->is_allocated = 0; - } - } + /* free CUSE memory */ + free(mem, M_CUSE); } static int -cuse_server_alloc_memory(struct cuse_server *pcs, - struct cuse_memory *mem, uint32_t page_count) +cuse_server_alloc_memory(struct cuse_server *pcs, uint32_t alloc_nr, + uint32_t page_count) { - void *ptr; + struct cuse_memory *temp; + struct cuse_memory *mem; + vm_object_t object; int error; - cuse_lock(); + mem = malloc(sizeof(*mem), M_CUSE, M_WAITOK | M_ZERO); + if (mem == NULL) + return (ENOMEM); - if (mem->virtaddr == NBUSY) { - cuse_unlock(); - return (EBUSY); + object = vm_pager_allocate(OBJT_SWAP, NULL, PAGE_SIZE * page_count, + VM_PROT_DEFAULT, 0, curthread->td_ucred); + if (object == NULL) { + error = ENOMEM; + goto error_0; } - if (mem->virtaddr != NULL) { - if (mem->is_allocated != 0) { - cuse_unlock(); - return (EBUSY); - } - if (mem->page_count == page_count) { - mem->is_allocated = 1; - mem->owner = pcs; - cuse_unlock(); - return (0); - } + + cuse_lock(); + /* check if allocation number already exists */ + TAILQ_FOREACH(temp, &pcs->hmem, entry) { + if (temp->alloc_nr == alloc_nr) + break; + } + if (temp != NULL) { cuse_unlock(); - return (EBUSY); + error = EBUSY; + goto error_1; } - memset(mem, 0, sizeof(*mem)); + mem->object = object; + mem->page_count = page_count; + mem->alloc_nr = alloc_nr; + TAILQ_INSERT_TAIL(&pcs->hmem, mem, entry); + cuse_unlock(); - mem->virtaddr = NBUSY; + return (0); - cuse_unlock(); +error_1: + vm_object_deallocate(object); +error_0: + free(mem, M_CUSE); + return (error); +} - ptr = malloc(page_count * PAGE_SIZE, M_CUSE, M_WAITOK | M_ZERO); - if (ptr == NULL) - error = ENOMEM; - else - error = 0; +static int +cuse_server_free_memory(struct cuse_server *pcs, uint32_t alloc_nr) +{ + struct cuse_memory *mem; cuse_lock(); - - if (error) { - mem->virtaddr = NULL; + TAILQ_FOREACH(mem, &pcs->hmem, entry) { + if (mem->alloc_nr == alloc_nr) + break; + } + if (mem == NULL) { cuse_unlock(); - return (error); + return (EINVAL); } - mem->virtaddr = ptr; - mem->page_count = page_count; - mem->is_allocated = 1; - mem->owner = pcs; + TAILQ_REMOVE(&pcs->hmem, mem, entry); cuse_unlock(); + cuse_vm_memory_free(mem); + return (0); } @@ -646,10 +652,10 @@ cuse_server_free_dev(struct cuse_server_dev *pcsd) } static void -cuse_server_free(void *arg) +cuse_server_unref(struct cuse_server *pcs) { - struct cuse_server *pcs = arg; struct cuse_server_dev *pcsd; + struct cuse_memory *mem; cuse_lock(); pcs->refs--; @@ -672,7 +678,12 @@ cuse_server_free(void *arg) cuse_lock(); } - cuse_server_free_memory(pcs); + while ((mem = TAILQ_FIRST(&pcs->hmem)) != NULL) { + TAILQ_REMOVE(&pcs->hmem, mem, entry); + cuse_unlock(); + cuse_vm_memory_free(mem); + cuse_lock(); + } knlist_clear(&pcs->selinfo.si_note, 1); knlist_destroy(&pcs->selinfo.si_note); @@ -686,6 +697,15 @@ cuse_server_free(void *arg) free(pcs, M_CUSE); } +static void +cuse_server_free(void *arg) +{ + struct cuse_server *pcs = arg; + + /* drop refcount */ + cuse_server_unref(pcs); +} + static int cuse_server_open(struct cdev *dev, int fflags, int devtype, struct thread *td) { @@ -700,13 +720,13 @@ cuse_server_open(struct cdev *dev, int fflags, int dev free(pcs, M_CUSE); return (ENOMEM); } - /* store current process ID */ pcs->pid = curproc->p_pid; TAILQ_INIT(&pcs->head); TAILQ_INIT(&pcs->hdev); TAILQ_INIT(&pcs->hcli); + TAILQ_INIT(&pcs->hmem); cv_init(&pcs->cv, "cuse-server-cv"); @@ -1093,12 +1113,12 @@ cuse_server_ioctl(struct cdev *dev, unsigned long cmd, error = ENOMEM; break; } - if (pai->page_count > CUSE_ALLOC_PAGES_MAX) { + if (pai->page_count >= CUSE_ALLOC_PAGES_MAX) { error = ENOMEM; break; } error = cuse_server_alloc_memory(pcs, - &cuse_mem[pai->alloc_nr], pai->page_count); + pai->alloc_nr, pai->page_count); break; case CUSE_IOCTL_FREE_MEMORY: @@ -1108,16 +1128,7 @@ cuse_server_ioctl(struct cdev *dev, unsigned long cmd, error = ENOMEM; break; } - /* we trust the character device driver in this case */ - - cuse_lock(); - if (cuse_mem[pai->alloc_nr].owner == pcs) { - cuse_mem[pai->alloc_nr].is_allocated = 0; - cuse_mem[pai->alloc_nr].owner = NULL; - } else { - error = EINVAL; - } - cuse_unlock(); + error = cuse_server_free_memory(pcs, pai->alloc_nr); break; case CUSE_IOCTL_GET_SIG: @@ -1276,49 +1287,49 @@ cuse_server_poll(struct cdev *dev, int events, struct } static int -cuse_server_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) +cuse_server_mmap_single(struct cdev *dev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **object, int nprot) { - uint32_t page_nr = offset / PAGE_SIZE; + uint32_t page_nr = *offset / PAGE_SIZE; uint32_t alloc_nr = page_nr / CUSE_ALLOC_PAGES_MAX; struct cuse_memory *mem; struct cuse_server *pcs; - uint8_t *ptr; int error; - if (alloc_nr >= CUSE_ALLOC_UNIT_MAX) - return (ENOMEM); - error = cuse_server_get(&pcs); if (error != 0) - pcs = NULL; + return (error); cuse_lock(); - mem = &cuse_mem[alloc_nr]; - - /* try to enforce slight ownership */ - if ((pcs != NULL) && (mem->owner != pcs)) { - cuse_unlock(); - return (EINVAL); + /* lookup memory structure */ + TAILQ_FOREACH(mem, &pcs->hmem, entry) { + if (mem->alloc_nr == alloc_nr) + break; } - if (mem->virtaddr == NULL) { + if (mem == NULL) { cuse_unlock(); return (ENOMEM); } - if (mem->virtaddr == NBUSY) { - cuse_unlock(); - return (ENOMEM); - } + /* verify page offset */ page_nr %= CUSE_ALLOC_PAGES_MAX; - if (page_nr >= mem->page_count) { cuse_unlock(); return (ENXIO); } - ptr = mem->virtaddr + (page_nr * PAGE_SIZE); + /* verify mmap size */ + if ((size % PAGE_SIZE) != 0 || (size < PAGE_SIZE) || + (size > ((mem->page_count - page_nr) * PAGE_SIZE))) { + cuse_unlock(); + return (EINVAL); + } + vm_object_reference(mem->object); + *object = mem->object; cuse_unlock(); - *paddr = vtophys(ptr); + /* set new VM object offset to use */ + *offset = page_nr * PAGE_SIZE; + /* success */ return (0); } @@ -1351,7 +1362,7 @@ cuse_client_free(void *arg) free(pcc, M_CUSE); /* drop reference on server */ - cuse_server_free(pcs); + cuse_server_unref(pcs); } static int @@ -1394,13 +1405,13 @@ cuse_client_open(struct cdev *dev, int fflags, int dev pcc = malloc(sizeof(*pcc), M_CUSE, M_WAITOK | M_ZERO); if (pcc == NULL) { /* drop reference on server */ - cuse_server_free(pcs); + cuse_server_unref(pcs); return (ENOMEM); } if (devfs_set_cdevpriv(pcc, &cuse_client_free)) { printf("Cuse: Cannot set cdevpriv.\n"); /* drop reference on server */ - cuse_server_free(pcs); + cuse_server_unref(pcs); free(pcc, M_CUSE); return (ENOMEM); } @@ -1550,7 +1561,6 @@ cuse_client_read(struct cdev *dev, struct uio *uio, in error = ENOMEM; break; } - len = uio->uio_iov->iov_len; cuse_lock(); @@ -1610,7 +1620,6 @@ cuse_client_write(struct cdev *dev, struct uio *uio, i error = ENOMEM; break; } - len = uio->uio_iov->iov_len; cuse_lock(); @@ -1753,59 +1762,56 @@ cuse_client_poll(struct cdev *dev, int events, struct } return (revents); - pollnval: +pollnval: /* XXX many clients don't understand POLLNVAL */ return (events & (POLLHUP | POLLPRI | POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM)); } static int -cuse_client_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) +cuse_client_mmap_single(struct cdev *dev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **object, int nprot) { - uint32_t page_nr = offset / PAGE_SIZE; + uint32_t page_nr = *offset / PAGE_SIZE; uint32_t alloc_nr = page_nr / CUSE_ALLOC_PAGES_MAX; struct cuse_memory *mem; - struct cuse_server *pcs; struct cuse_client *pcc; - uint8_t *ptr; int error; - if (alloc_nr >= CUSE_ALLOC_UNIT_MAX) - return (ENOMEM); - error = cuse_client_get(&pcc); if (error != 0) - pcs = NULL; - else - pcs = pcc->server; + return (error); cuse_lock(); - mem = &cuse_mem[alloc_nr]; - - /* try to enforce slight ownership */ - if ((pcs != NULL) && (mem->owner != pcs)) { - cuse_unlock(); - return (EINVAL); + /* lookup memory structure */ + TAILQ_FOREACH(mem, &pcc->server->hmem, entry) { + if (mem->alloc_nr == alloc_nr) + break; } - if (mem->virtaddr == NULL) { + if (mem == NULL) { cuse_unlock(); return (ENOMEM); } - if (mem->virtaddr == NBUSY) { - cuse_unlock(); - return (ENOMEM); - } + /* verify page offset */ page_nr %= CUSE_ALLOC_PAGES_MAX; - if (page_nr >= mem->page_count) { cuse_unlock(); return (ENXIO); } - ptr = mem->virtaddr + (page_nr * PAGE_SIZE); + /* verify mmap size */ + if ((size % PAGE_SIZE) != 0 || (size < PAGE_SIZE) || + (size > ((mem->page_count - page_nr) * PAGE_SIZE))) { + cuse_unlock(); + return (EINVAL); + } + vm_object_reference(mem->object); + *object = mem->object; cuse_unlock(); - *paddr = vtophys(ptr); + /* set new VM object offset to use */ + *offset = page_nr * PAGE_SIZE; + /* success */ return (0); } Modified: stable/11/sys/fs/cuse/cuse_ioctl.h ============================================================================== --- stable/11/sys/fs/cuse/cuse_ioctl.h Fri Nov 10 08:31:40 2017 (r325635) +++ stable/11/sys/fs/cuse/cuse_ioctl.h Fri Nov 10 08:42:37 2017 (r325636) @@ -35,6 +35,7 @@ #define CUSE_BUF_MIN_PTR 0x10000UL #define CUSE_BUF_MAX_PTR 0x20000UL #define CUSE_ALLOC_UNIT_MAX 128 /* units */ +/* All memory allocations must be less than the following limit */ #define CUSE_ALLOC_PAGES_MAX (((16UL * 1024UL * 1024UL) + PAGE_SIZE - 1) / PAGE_SIZE) struct cuse_dev; From owner-svn-src-all@freebsd.org Fri Nov 10 08:58:43 2017 Return-Path: Delivered-To: svn-src-all@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 C7239E68A3D; Fri, 10 Nov 2017 08:58: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 935996BD23; Fri, 10 Nov 2017 08:58: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 vAA8wgmO087449; Fri, 10 Nov 2017 08:58:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA8wgbm087448; Fri, 10 Nov 2017 08:58:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711100858.vAA8wgbm087448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 08:58:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325637 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Commit-Revision: 325637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 08:58:43 -0000 Author: hselasky Date: Fri Nov 10 08:58:42 2017 New Revision: 325637 URL: https://svnweb.freebsd.org/changeset/base/325637 Log: Mark ipoib device as initialized on device open. Set the IPOIB_FLAG_INITIALIZED on dev_open and clear it on dev_stop to avoid a race between ipoib load and the underlying device driver. The device module must dispatch the IB_EVENT_PORT_ACTIVE event before ipoib module is loaded. Otherwise, the flush will fail since no one set the IPOIB_FLAG_INITIALIZED. Submitted by: Slava Shwartsman Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Fri Nov 10 08:42:37 2017 (r325636) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c Fri Nov 10 08:58:42 2017 (r325637) @@ -638,6 +638,8 @@ int ipoib_ib_dev_open(struct ipoib_dev_priv *priv) clear_bit(IPOIB_STOP_REAPER, &priv->flags); queue_delayed_work(ipoib_workqueue, &priv->ah_reap_task, HZ); + set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags); + return 0; } @@ -744,6 +746,8 @@ int ipoib_ib_dev_stop(struct ipoib_dev_priv *priv, int unsigned long begin; struct ipoib_tx_buf *tx_req; int i; + + clear_bit(IPOIB_FLAG_INITIALIZED, &priv->flags); ipoib_cm_dev_stop(priv); From owner-svn-src-all@freebsd.org Fri Nov 10 09:49:10 2017 Return-Path: Delivered-To: svn-src-all@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 C00F7E69916; Fri, 10 Nov 2017 09:49: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 3E0036D2F5; Fri, 10 Nov 2017 09:49:10 +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 vAA9n9X3008435; Fri, 10 Nov 2017 09:49:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAA9n8Sw008427; Fri, 10 Nov 2017 09:49:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711100949.vAA9n8Sw008427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 09:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325638 - in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Commit-Revision: 325638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 09:49:10 -0000 Author: hselasky Date: Fri Nov 10 09:49:08 2017 New Revision: 325638 URL: https://svnweb.freebsd.org/changeset/base/325638 Log: Refactor the flowsteering APIs used by mlx5en(4). This change is needed by the coming ibcore and mlx5ib updates in order to support traffic redirection to so-called raw ethernet QPs. Remove unused E-switch related routines and files while at it. Sponsored by: Mellanox Technologies MFC after: 1 week Added: head/sys/dev/mlx5/fs.h (contents, props changed) head/sys/dev/mlx5/mlx5_core/fs_core.h (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c (contents, props changed) Deleted: head/sys/dev/mlx5/eswitch_vacl.h head/sys/dev/mlx5/flow_table.h head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c head/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c Modified: head/sys/conf/files head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/modules/mlx5/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 10 08:58:42 2017 (r325637) +++ head/sys/conf/files Fri Nov 10 09:49:08 2017 (r325638) @@ -4644,7 +4644,9 @@ dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 p compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \ compile-with "${OFED_C}" -dev/mlx5/mlx5_core/mlx5_flow_table.c optional mlx5 pci \ +dev/mlx5/mlx5_core/mlx5_fs_cmd.c optional mlx5 pci \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_fs_tree.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_fw.c optional mlx5 pci \ compile-with "${OFED_C}" Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Fri Nov 10 08:58:42 2017 (r325637) +++ head/sys/dev/mlx5/device.h Fri Nov 10 09:49:08 2017 (r325638) @@ -1085,6 +1085,7 @@ enum { MLX5_FLOW_TABLE_TYPE_ESWITCH = 4, MLX5_FLOW_TABLE_TYPE_SNIFFER_RX = 5, MLX5_FLOW_TABLE_TYPE_SNIFFER_TX = 6, + MLX5_FLOW_TABLE_TYPE_NIC_RX_RDMA = 7, }; enum { Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Fri Nov 10 08:58:42 2017 (r325637) +++ head/sys/dev/mlx5/driver.h Fri Nov 10 09:49:08 2017 (r325638) @@ -582,6 +582,7 @@ struct mlx5_special_contexts { int resd_lkey; }; +struct mlx5_flow_root_namespace; struct mlx5_core_dev { struct pci_dev *pdev; char board_id[MLX5_BOARD_ID_LEN]; @@ -600,6 +601,12 @@ struct mlx5_core_dev { u32 issi; struct mlx5_special_contexts special_contexts; unsigned int module_status[MLX5_MAX_PORTS]; + struct mlx5_flow_root_namespace *root_ns; + struct mlx5_flow_root_namespace *fdb_root_ns; + struct mlx5_flow_root_namespace *esw_egress_root_ns; + struct mlx5_flow_root_namespace *esw_ingress_root_ns; + struct mlx5_flow_root_namespace *sniffer_rx_root_ns; + struct mlx5_flow_root_namespace *sniffer_tx_root_ns; u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; }; Added: head/sys/dev/mlx5/fs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/fs.h Fri Nov 10 09:49:08 2017 (r325638) @@ -0,0 +1,232 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 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 _MLX5_FS_ +#define _MLX5_FS_ + +#include + +#include +#include +#include + +enum { + MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO = 1 << 16, +}; + +/*Flow tag*/ +enum { + MLX5_FS_DEFAULT_FLOW_TAG = 0xFFFFFF, + MLX5_FS_ETH_FLOW_TAG = 0xFFFFFE, + MLX5_FS_SNIFFER_FLOW_TAG = 0xFFFFFD, +}; + +enum { + MLX5_FS_FLOW_TAG_MASK = 0xFFFFFF, +}; + +#define FS_MAX_TYPES 10 +#define FS_MAX_ENTRIES 32000U + +enum mlx5_flow_namespace_type { + MLX5_FLOW_NAMESPACE_BYPASS, + MLX5_FLOW_NAMESPACE_KERNEL, + MLX5_FLOW_NAMESPACE_LEFTOVERS, + MLX5_FLOW_NAMESPACE_SNIFFER_RX, + MLX5_FLOW_NAMESPACE_SNIFFER_TX, + MLX5_FLOW_NAMESPACE_FDB, + MLX5_FLOW_NAMESPACE_ESW_EGRESS, + MLX5_FLOW_NAMESPACE_ESW_INGRESS, +}; + +struct mlx5_flow_table; +struct mlx5_flow_group; +struct mlx5_flow_rule; +struct mlx5_flow_namespace; + +struct mlx5_flow_spec { + u8 match_criteria_enable; + u32 match_criteria[MLX5_ST_SZ_DW(fte_match_param)]; + u32 match_value[MLX5_ST_SZ_DW(fte_match_param)]; +}; + +struct mlx5_flow_destination { + u32 type; + union { + u32 tir_num; + struct mlx5_flow_table *ft; + u32 vport_num; + }; +}; + +#define FT_NAME_STR_SZ 20 +#define LEFTOVERS_RULE_NUM 2 +static inline void build_leftovers_ft_param(char *name, + unsigned int *priority, + int *n_ent, + int *n_grp) +{ + snprintf(name, FT_NAME_STR_SZ, "leftovers"); + *priority = 0; /*Priority of leftovers_prio-0*/ + *n_ent = LEFTOVERS_RULE_NUM + 1; /*1: star rules*/ + *n_grp = LEFTOVERS_RULE_NUM; +} + +static inline bool outer_header_zero(u32 *match_criteria) +{ + int size = MLX5_ST_SZ_BYTES(fte_match_param); + char *outer_headers_c = MLX5_ADDR_OF(fte_match_param, match_criteria, + outer_headers); + + return outer_headers_c[0] == 0 && !memcmp(outer_headers_c, + outer_headers_c + 1, + size - 1); +} + +struct mlx5_flow_namespace * +mlx5_get_flow_namespace(struct mlx5_core_dev *dev, + enum mlx5_flow_namespace_type type); + +/* The underlying implementation create two more entries for + * chaining flow tables. the user should be aware that if he pass + * max_num_ftes as 2^N it will result in doubled size flow table + */ +struct mlx5_flow_table * +mlx5_create_auto_grouped_flow_table(struct mlx5_flow_namespace *ns, + int prio, + const char *name, + int num_flow_table_entries, + int max_num_groups); + +struct mlx5_flow_table * +mlx5_create_vport_flow_table(struct mlx5_flow_namespace *ns, + u16 vport, + int prio, + const char *name, + int num_flow_table_entries); + +struct mlx5_flow_table * +mlx5_create_flow_table(struct mlx5_flow_namespace *ns, + int prio, + const char *name, + int num_flow_table_entries); +int mlx5_destroy_flow_table(struct mlx5_flow_table *ft); + +/* inbox should be set with the following values: + * start_flow_index + * end_flow_index + * match_criteria_enable + * match_criteria + */ +struct mlx5_flow_group * +mlx5_create_flow_group(struct mlx5_flow_table *ft, u32 *in); +void mlx5_destroy_flow_group(struct mlx5_flow_group *fg); + +/* Single destination per rule. + * Group ID is implied by the match criteria. + */ +struct mlx5_flow_rule * +mlx5_add_flow_rule(struct mlx5_flow_table *ft, + u8 match_criteria_enable, + u32 *match_criteria, + u32 *match_value, + u32 action, + u32 flow_tag, + struct mlx5_flow_destination *dest); +void mlx5_del_flow_rule(struct mlx5_flow_rule *fr); + +/*The following API is for sniffer*/ +typedef int (*rule_event_fn)(struct mlx5_flow_rule *rule, + bool ctx_changed, + void *client_data, + void *context); + +struct mlx5_flow_handler; + +struct flow_client_priv_data; + +void mlx5e_sniffer_roce_mode_notify( + struct mlx5_core_dev *mdev, + int action); + +int mlx5_set_rule_private_data(struct mlx5_flow_rule *rule, struct + mlx5_flow_handler *handler, void + *client_data); + +struct mlx5_flow_handler *mlx5_register_rule_notifier(struct mlx5_core_dev *dev, + enum mlx5_flow_namespace_type ns_type, + rule_event_fn add_cb, + rule_event_fn del_cb, + void *context); + +void mlx5_unregister_rule_notifier(struct mlx5_flow_handler *handler); + +void mlx5_flow_iterate_existing_rules(struct mlx5_flow_namespace *ns, + rule_event_fn cb, + void *context); + +void mlx5_get_match_criteria(u32 *match_criteria, + struct mlx5_flow_rule *rule); + +void mlx5_get_match_value(u32 *match_value, + struct mlx5_flow_rule *rule); + +u8 mlx5_get_match_criteria_enable(struct mlx5_flow_rule *rule); + +struct mlx5_flow_rules_list *get_roce_flow_rules(u8 roce_mode); + +void mlx5_del_flow_rules_list(struct mlx5_flow_rules_list *rules_list); + +struct mlx5_flow_rules_list { + struct list_head head; +}; + +struct mlx5_flow_rule_node { + struct list_head list; + u32 match_criteria[MLX5_ST_SZ_DW(fte_match_param)]; + u32 match_value[MLX5_ST_SZ_DW(fte_match_param)]; + u8 match_criteria_enable; +}; + +struct mlx5_core_fs_mask { + u8 match_criteria_enable; + u32 match_criteria[MLX5_ST_SZ_DW(fte_match_param)]; +}; + +bool fs_match_exact_val( + struct mlx5_core_fs_mask *mask, + void *val1, + void *val2); + +bool fs_match_exact_mask( + u8 match_criteria_enable1, + u8 match_criteria_enable2, + void *mask1, + void *mask2); +/**********end API for sniffer**********/ + +#endif Added: head/sys/dev/mlx5/mlx5_core/fs_core.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_core/fs_core.h Fri Nov 10 09:49:08 2017 (r325638) @@ -0,0 +1,300 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 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 _MLX5_FS_CORE_ +#define _MLX5_FS_CORE_ + +#include +#include +#include +#include + +enum fs_type { + FS_TYPE_NAMESPACE, + FS_TYPE_PRIO, + FS_TYPE_FLOW_TABLE, + FS_TYPE_FLOW_GROUP, + FS_TYPE_FLOW_ENTRY, + FS_TYPE_FLOW_DEST +}; + +enum fs_ft_type { + FS_FT_NIC_RX = 0x0, + FS_FT_ESW_EGRESS_ACL = 0x2, + FS_FT_ESW_INGRESS_ACL = 0x3, + FS_FT_FDB = 0X4, + FS_FT_SNIFFER_RX = 0x5, + FS_FT_SNIFFER_TX = 0x6 +}; + +enum fs_fte_status { + FS_FTE_STATUS_EXISTING = 1UL << 0, +}; + +/* Should always be the first variable in the struct */ +struct fs_base { + struct list_head list; + struct fs_base *parent; + enum fs_type type; + struct kref refcount; + /* lock the node for writing and traversing */ + struct mutex lock; + struct completion complete; + atomic_t users_refcount; + const char *name; +}; + +struct mlx5_flow_rule { + struct fs_base base; + struct mlx5_flow_destination dest_attr; + struct list_head clients_data; + /*protect clients lits*/ + struct mutex clients_lock; +}; + +struct fs_fte { + struct fs_base base; + u32 val[MLX5_ST_SZ_DW(fte_match_param)]; + uint32_t dests_size; + uint32_t flow_tag; + struct list_head dests; + uint32_t index; /* index in ft */ + u8 action; /* MLX5_FLOW_CONTEXT_ACTION */ + enum fs_fte_status status; +}; + +struct fs_star_rule { + struct mlx5_flow_group *fg; + struct fs_fte *fte; +}; + +struct mlx5_flow_table { + struct fs_base base; + /* sorted list by start_index */ + struct list_head fgs; + struct { + bool active; + unsigned int max_types; + unsigned int num_types; + } autogroup; + unsigned int max_fte; + unsigned int level; + uint32_t id; + u16 vport; + enum fs_ft_type type; + struct fs_star_rule star_rule; + unsigned int shared_refcount; +}; + +enum fs_prio_flags { + MLX5_CORE_FS_PRIO_SHARED = 1 +}; + +struct fs_prio { + struct fs_base base; + struct list_head objs; /* each object is a namespace or ft */ + unsigned int max_ft; + unsigned int num_ft; + unsigned int max_ns; + unsigned int prio; + /*When create shared flow table, this lock should be taken*/ + struct mutex shared_lock; + u8 flags; +}; + +struct mlx5_flow_namespace { + /* parent == NULL => root ns */ + struct fs_base base; + /* sorted by priority number */ + struct list_head prios; /* list of fs_prios */ + struct list_head list_notifiers; + struct rw_semaphore notifiers_rw_sem; + struct rw_semaphore dests_rw_sem; +}; + +struct mlx5_flow_root_namespace { + struct mlx5_flow_namespace ns; + struct mlx5_flow_table *ft_level_0; + enum fs_ft_type table_type; + struct mlx5_core_dev *dev; + struct mlx5_flow_table *root_ft; + /* When chaining flow-tables, this lock should be taken */ + struct mutex fs_chain_lock; +}; + +struct mlx5_flow_group { + struct fs_base base; + struct list_head ftes; + struct mlx5_core_fs_mask mask; + uint32_t start_index; + uint32_t max_ftes; + uint32_t num_ftes; + uint32_t id; +}; + +struct mlx5_flow_handler { + struct list_head list; + rule_event_fn add_dst_cb; + rule_event_fn del_dst_cb; + void *client_context; + struct mlx5_flow_namespace *ns; +}; + +struct fs_client_priv_data { + struct mlx5_flow_handler *fs_handler; + struct list_head list; + void *client_dst_data; +}; + +void _fs_remove_node(struct kref *kref); +#define fs_get_obj(v, _base) {v = container_of((_base), typeof(*v), base); } +#define fs_get_parent(v, child) {v = (child)->base.parent ? \ + container_of((child)->base.parent, \ + typeof(*v), base) : NULL; } + +#define fs_list_for_each_entry(pos, cond, root) \ + list_for_each_entry(pos, root, base.list) \ + if (!(cond)) {} else + +#define fs_list_for_each_entry_continue(pos, cond, root) \ + list_for_each_entry_continue(pos, root, base.list) \ + if (!(cond)) {} else + +#define fs_list_for_each_entry_reverse(pos, cond, root) \ + list_for_each_entry_reverse(pos, root, base.list) \ + if (!(cond)) {} else + +#define fs_list_for_each_entry_continue_reverse(pos, cond, root) \ + list_for_each_entry_continue_reverse(pos, root, base.list) \ + if (!(cond)) {} else + +#define fs_for_each_ft(pos, prio) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_FLOW_TABLE, \ + &(prio)->objs) + +#define fs_for_each_ft_reverse(pos, prio) \ + fs_list_for_each_entry_reverse(pos, \ + (pos)->base.type == FS_TYPE_FLOW_TABLE, \ + &(prio)->objs) + +#define fs_for_each_ns(pos, prio) \ + fs_list_for_each_entry(pos, \ + (pos)->base.type == FS_TYPE_NAMESPACE, \ + &(prio)->objs) + +#define fs_for_each_ns_or_ft_reverse(pos, prio) \ + list_for_each_entry_reverse(pos, &(prio)->objs, list) \ + if (!((pos)->type == FS_TYPE_NAMESPACE || \ + (pos)->type == FS_TYPE_FLOW_TABLE)) {} else + +#define fs_for_each_ns_or_ft(pos, prio) \ + list_for_each_entry(pos, &(prio)->objs, list) \ + if (!((pos)->type == FS_TYPE_NAMESPACE || \ + (pos)->type == FS_TYPE_FLOW_TABLE)) {} else + +#define fs_for_each_ns_or_ft_continue_reverse(pos, prio) \ + list_for_each_entry_continue_reverse(pos, &(prio)->objs, list) \ + if (!((pos)->type == FS_TYPE_NAMESPACE || \ + (pos)->type == FS_TYPE_FLOW_TABLE)) {} else + +#define fs_for_each_ns_or_ft_continue(pos, prio) \ + list_for_each_entry_continue(pos, &(prio)->objs, list) \ + if (!((pos)->type == FS_TYPE_NAMESPACE || \ + (pos)->type == FS_TYPE_FLOW_TABLE)) {} else + +#define fs_for_each_prio(pos, ns) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_PRIO, \ + &(ns)->prios) + +#define fs_for_each_prio_reverse(pos, ns) \ + fs_list_for_each_entry_reverse(pos, (pos)->base.type == FS_TYPE_PRIO, \ + &(ns)->prios) + +#define fs_for_each_prio_continue(pos, ns) \ + fs_list_for_each_entry_continue(pos, (pos)->base.type == FS_TYPE_PRIO, \ + &(ns)->prios) + +#define fs_for_each_prio_continue_reverse(pos, ns) \ + fs_list_for_each_entry_continue_reverse(pos, \ + (pos)->base.type == FS_TYPE_PRIO, \ + &(ns)->prios) + +#define fs_for_each_fg(pos, ft) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_FLOW_GROUP, \ + &(ft)->fgs) + +#define fs_for_each_fte(pos, fg) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_FLOW_ENTRY, \ + &(fg)->ftes) +#define fs_for_each_dst(pos, fte) \ + fs_list_for_each_entry(pos, (pos)->base.type == FS_TYPE_FLOW_DEST, \ + &(fte)->dests) + +int mlx5_cmd_fs_create_ft(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int level, + unsigned int log_size, unsigned int *table_id); + +int mlx5_cmd_fs_destroy_ft(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int table_id); + +int mlx5_cmd_fs_create_fg(struct mlx5_core_dev *dev, + u32 *in, + u16 vport, + enum fs_ft_type type, unsigned int table_id, + unsigned int *group_id); + +int mlx5_cmd_fs_destroy_fg(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int table_id, + unsigned int group_id); + + +int mlx5_cmd_fs_set_fte(struct mlx5_core_dev *dev, + u16 vport, + enum fs_fte_status *fte_status, + u32 *match_val, + enum fs_ft_type type, unsigned int table_id, + unsigned int index, unsigned int group_id, + unsigned int flow_tag, + unsigned short action, int dest_size, + struct list_head *dests); /* mlx5_flow_desination */ + +int mlx5_cmd_fs_delete_fte(struct mlx5_core_dev *dev, + u16 vport, + enum fs_fte_status *fte_status, + enum fs_ft_type type, unsigned int table_id, + unsigned int index); + +int mlx5_cmd_update_root_ft(struct mlx5_core_dev *dev, + enum fs_ft_type type, + unsigned int id); + +int mlx5_init_fs(struct mlx5_core_dev *dev); +void mlx5_cleanup_fs(struct mlx5_core_dev *dev); +#endif Added: head/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c Fri Nov 10 09:49:08 2017 (r325638) @@ -0,0 +1,302 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 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$ + */ + +#include +#include +#include +#include +#include + +#include "fs_core.h" +#include "mlx5_core.h" + +int mlx5_cmd_update_root_ft(struct mlx5_core_dev *dev, + enum fs_ft_type type, + unsigned int id) +{ + u32 in[MLX5_ST_SZ_DW(set_flow_table_root_in)]; + u32 out[MLX5_ST_SZ_DW(set_flow_table_root_out)]; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + + MLX5_SET(set_flow_table_root_in, in, opcode, + MLX5_CMD_OP_SET_FLOW_TABLE_ROOT); + MLX5_SET(set_flow_table_root_in, in, table_type, type); + MLX5_SET(set_flow_table_root_in, in, table_id, id); + + memset(out, 0, sizeof(out)); + return mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, + sizeof(out)); +} + +int mlx5_cmd_fs_create_ft(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int level, + unsigned int log_size, unsigned int *table_id) +{ + u32 in[MLX5_ST_SZ_DW(create_flow_table_in)]; + u32 out[MLX5_ST_SZ_DW(create_flow_table_out)]; + int err; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + + MLX5_SET(create_flow_table_in, in, opcode, + MLX5_CMD_OP_CREATE_FLOW_TABLE); + + MLX5_SET(create_flow_table_in, in, table_type, type); + MLX5_SET(create_flow_table_in, in, flow_table_context.level, level); + MLX5_SET(create_flow_table_in, in, flow_table_context.log_size, + log_size); + if (vport) { + MLX5_SET(create_flow_table_in, in, vport_number, vport); + MLX5_SET(create_flow_table_in, in, other_vport, 1); + } + + memset(out, 0, sizeof(out)); + err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, + sizeof(out)); + if (err) + return err; + + *table_id = MLX5_GET(create_flow_table_out, out, table_id); + + return 0; +} + +int mlx5_cmd_fs_destroy_ft(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int table_id) +{ + u32 in[MLX5_ST_SZ_DW(destroy_flow_table_in)]; + u32 out[MLX5_ST_SZ_DW(destroy_flow_table_out)]; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(destroy_flow_table_in, in, opcode, + MLX5_CMD_OP_DESTROY_FLOW_TABLE); + MLX5_SET(destroy_flow_table_in, in, table_type, type); + MLX5_SET(destroy_flow_table_in, in, table_id, table_id); + if (vport) { + MLX5_SET(destroy_flow_table_in, in, vport_number, vport); + MLX5_SET(destroy_flow_table_in, in, other_vport, 1); + } + + return mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out)); +} + +int mlx5_cmd_fs_create_fg(struct mlx5_core_dev *dev, + u32 *in, + u16 vport, + enum fs_ft_type type, unsigned int table_id, + unsigned int *group_id) +{ + u32 out[MLX5_ST_SZ_DW(create_flow_group_out)]; + int err; + int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in); + if (!dev) + return -EINVAL; + memset(out, 0, sizeof(out)); + + MLX5_SET(create_flow_group_in, in, opcode, + MLX5_CMD_OP_CREATE_FLOW_GROUP); + MLX5_SET(create_flow_group_in, in, table_type, type); + MLX5_SET(create_flow_group_in, in, table_id, table_id); + if (vport) { + MLX5_SET(create_flow_group_in, in, vport_number, vport); + MLX5_SET(create_flow_group_in, in, other_vport, 1); + } + + err = mlx5_cmd_exec_check_status(dev, in, + inlen, out, + sizeof(out)); + if (!err) + *group_id = MLX5_GET(create_flow_group_out, out, group_id); + + return err; +} + +int mlx5_cmd_fs_destroy_fg(struct mlx5_core_dev *dev, + u16 vport, + enum fs_ft_type type, unsigned int table_id, + unsigned int group_id) +{ + u32 in[MLX5_ST_SZ_DW(destroy_flow_group_in)]; + u32 out[MLX5_ST_SZ_DW(destroy_flow_group_out)]; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(destroy_flow_group_in, in, opcode, + MLX5_CMD_OP_DESTROY_FLOW_GROUP); + MLX5_SET(destroy_flow_group_in, in, table_type, type); + MLX5_SET(destroy_flow_group_in, in, table_id, table_id); + MLX5_SET(destroy_flow_group_in, in, group_id, group_id); + if (vport) { + MLX5_SET(destroy_flow_group_in, in, vport_number, vport); + MLX5_SET(destroy_flow_group_in, in, other_vport, 1); + } + + return mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out)); +} + +int mlx5_cmd_fs_set_fte(struct mlx5_core_dev *dev, + u16 vport, + enum fs_fte_status *fte_status, + u32 *match_val, + enum fs_ft_type type, unsigned int table_id, + unsigned int index, unsigned int group_id, + unsigned int flow_tag, + unsigned short action, int dest_size, + struct list_head *dests) /* mlx5_flow_desination */ +{ + u32 out[MLX5_ST_SZ_DW(set_fte_out)]; + u32 *in; + unsigned int inlen; + struct mlx5_flow_rule *dst; + void *in_flow_context; + void *in_match_value; + void *in_dests; + int err; + int opmod = 0; + int modify_mask = 0; + int atomic_mod_cap; + + if (action != MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) + dest_size = 0; + + inlen = MLX5_ST_SZ_BYTES(set_fte_in) + + dest_size * MLX5_ST_SZ_BYTES(dest_format_struct); + + if (!dev) + return -EINVAL; + + if (*fte_status & FS_FTE_STATUS_EXISTING) { + atomic_mod_cap = MLX5_CAP_FLOWTABLE(dev, + flow_table_properties_nic_receive. + flow_modify_en); + if (!atomic_mod_cap) + return -ENOTSUPP; + opmod = 1; + modify_mask = 1 << + MLX5_SET_FTE_MODIFY_ENABLE_MASK_DESTINATION_LIST; + } + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_warn(dev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(set_fte_in, in, opcode, MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY); + MLX5_SET(set_fte_in, in, op_mod, opmod); + MLX5_SET(set_fte_in, in, modify_enable_mask, modify_mask); + MLX5_SET(set_fte_in, in, table_type, type); + MLX5_SET(set_fte_in, in, table_id, table_id); + MLX5_SET(set_fte_in, in, flow_index, index); + if (vport) { + MLX5_SET(set_fte_in, in, vport_number, vport); + MLX5_SET(set_fte_in, in, other_vport, 1); + } + + in_flow_context = MLX5_ADDR_OF(set_fte_in, in, flow_context); + MLX5_SET(flow_context, in_flow_context, group_id, group_id); + MLX5_SET(flow_context, in_flow_context, flow_tag, flow_tag); + MLX5_SET(flow_context, in_flow_context, action, action); + MLX5_SET(flow_context, in_flow_context, destination_list_size, + dest_size); + in_match_value = MLX5_ADDR_OF(flow_context, in_flow_context, + match_value); + memcpy(in_match_value, match_val, MLX5_ST_SZ_BYTES(fte_match_param)); + if (dest_size) { + in_dests = MLX5_ADDR_OF(flow_context, in_flow_context, destination); + list_for_each_entry(dst, dests, base.list) { + unsigned int id; + + MLX5_SET(dest_format_struct, in_dests, destination_type, + dst->dest_attr.type); + if (dst->dest_attr.type == + MLX5_FLOW_CONTEXT_DEST_TYPE_FLOW_TABLE) + id = dst->dest_attr.ft->id; + else + id = dst->dest_attr.tir_num; + MLX5_SET(dest_format_struct, in_dests, destination_id, id); + in_dests += MLX5_ST_SZ_BYTES(dest_format_struct); + } + } + memset(out, 0, sizeof(out)); + err = mlx5_cmd_exec_check_status(dev, in, inlen, out, + sizeof(out)); + if (!err) + *fte_status |= FS_FTE_STATUS_EXISTING; + + kvfree(in); + + return err; +} + +int mlx5_cmd_fs_delete_fte(struct mlx5_core_dev *dev, + u16 vport, + enum fs_fte_status *fte_status, + enum fs_ft_type type, unsigned int table_id, + unsigned int index) +{ + u32 in[MLX5_ST_SZ_DW(delete_fte_in)]; + u32 out[MLX5_ST_SZ_DW(delete_fte_out)]; + int err; + + if (!(*fte_status & FS_FTE_STATUS_EXISTING)) + return 0; + + if (!dev) + return -EINVAL; + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(delete_fte_in, in, opcode, MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY); + MLX5_SET(delete_fte_in, in, table_type, type); + MLX5_SET(delete_fte_in, in, table_id, table_id); + MLX5_SET(delete_fte_in, in, flow_index, index); + if (vport) { + MLX5_SET(delete_fte_in, in, vport_number, vport); + MLX5_SET(delete_fte_in, in, other_vport, 1); + } + + err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out)); + if (!err) + *fte_status = 0; + + return err; +} Added: head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c Fri Nov 10 09:49:08 2017 (r325638) @@ -0,0 +1,2721 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 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$ + */ + +#include +#include +#include "mlx5_core.h" +#include "fs_core.h" +#include +#include + +#define INIT_TREE_NODE_ARRAY_SIZE(...) (sizeof((struct init_tree_node[]){__VA_ARGS__}) /\ + sizeof(struct init_tree_node)) + +#define ADD_PRIO(name_val, flags_val, min_level_val, max_ft_val, caps_val, \ + ...) {.type = FS_TYPE_PRIO,\ + .name = name_val,\ + .min_ft_level = min_level_val,\ + .flags = flags_val,\ + .max_ft = max_ft_val,\ + .caps = caps_val,\ + .children = (struct init_tree_node[]) {__VA_ARGS__},\ + .ar_size = INIT_TREE_NODE_ARRAY_SIZE(__VA_ARGS__) \ +} + +#define ADD_FT_PRIO(name_val, flags_val, max_ft_val, ...)\ + ADD_PRIO(name_val, flags_val, 0, max_ft_val, {},\ + __VA_ARGS__)\ + +#define ADD_NS(name_val, ...) {.type = FS_TYPE_NAMESPACE,\ + .name = name_val,\ + .children = (struct init_tree_node[]) {__VA_ARGS__},\ + .ar_size = INIT_TREE_NODE_ARRAY_SIZE(__VA_ARGS__) \ +} + +#define INIT_CAPS_ARRAY_SIZE(...) (sizeof((long[]){__VA_ARGS__}) /\ + sizeof(long)) + +#define FS_CAP(cap) (__mlx5_bit_off(flow_table_nic_cap, cap)) + +#define FS_REQUIRED_CAPS(...) {.arr_sz = INIT_CAPS_ARRAY_SIZE(__VA_ARGS__), \ + .caps = (long[]) {__VA_ARGS__}} + +#define BYPASS_MAX_FT 5 +#define BYPASS_PRIO_MAX_FT 1 +#define KERNEL_MAX_FT 3 +#define LEFTOVER_MAX_FT 1 +#define KENREL_MIN_LEVEL 3 +#define LEFTOVER_MIN_LEVEL KENREL_MIN_LEVEL + 1 +#define BYPASS_MIN_LEVEL MLX5_NUM_BYPASS_FTS + LEFTOVER_MIN_LEVEL +struct node_caps { + size_t arr_sz; + long *caps; +}; + +struct init_tree_node { + enum fs_type type; + const char *name; + struct init_tree_node *children; + int ar_size; + struct node_caps caps; + u8 flags; + int min_ft_level; + int prio; + int max_ft; +} root_fs = { + .type = FS_TYPE_NAMESPACE, + .name = "root", + .ar_size = 3, + .children = (struct init_tree_node[]) { + ADD_PRIO("by_pass_prio", 0, BYPASS_MIN_LEVEL, 0, + FS_REQUIRED_CAPS(FS_CAP(flow_table_properties_nic_receive.flow_modify_en), + FS_CAP(flow_table_properties_nic_receive.modify_root)), + ADD_NS("by_pass_ns", + ADD_FT_PRIO("prio0", 0, + BYPASS_PRIO_MAX_FT), + ADD_FT_PRIO("prio1", 0, + BYPASS_PRIO_MAX_FT), + ADD_FT_PRIO("prio2", 0, + BYPASS_PRIO_MAX_FT), + ADD_FT_PRIO("prio3", 0, + BYPASS_PRIO_MAX_FT), + ADD_FT_PRIO("prio4", 0, + BYPASS_PRIO_MAX_FT), + ADD_FT_PRIO("prio5", 0, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Nov 10 11:19:34 2017 Return-Path: Delivered-To: svn-src-all@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 9B420E6AD28; Fri, 10 Nov 2017 11:19:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5C8CD6F1AC; Fri, 10 Nov 2017 11:19:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAABJX7R045458; Fri, 10 Nov 2017 11:19:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAABJXKs045457; Fri, 10 Nov 2017 11:19:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201711101119.vAABJXKs045457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 10 Nov 2017 11:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325639 - stable/11/sys/netipsec X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netipsec X-SVN-Commit-Revision: 325639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 11:19:34 -0000 Author: ae Date: Fri Nov 10 11:19:33 2017 New Revision: 325639 URL: https://svnweb.freebsd.org/changeset/base/325639 Log: MFC r325355: Use correct pointer in key_updateaddresses() when updating NAT-T config. key_updateaddresses() is used to update SA addresses and NAT-T configuration in SADB_UPDATE message. This is done using cloning SA content from old SA into new one. But addresses and NAT-T configuration are taking from SADB_UPDATE message. Use newsa pointer to set NAT-T properties into cloned SA. PR: 223382 Modified: stable/11/sys/netipsec/key.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/key.c ============================================================================== --- stable/11/sys/netipsec/key.c Fri Nov 10 09:49:08 2017 (r325638) +++ stable/11/sys/netipsec/key.c Fri Nov 10 11:19:33 2017 (r325639) @@ -5100,7 +5100,7 @@ key_updateaddresses(struct socket *so, struct mbuf *m, newsav->natt = NULL; newsav->sah = sah; newsav->state = SADB_SASTATE_MATURE; - error = key_setnatt(sav, mhp); + error = key_setnatt(newsav, mhp); if (error != 0) goto fail; From owner-svn-src-all@freebsd.org Fri Nov 10 11:19:48 2017 Return-Path: Delivered-To: svn-src-all@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 973E3E6AD7C; Fri, 10 Nov 2017 11:19:48 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 648FA6F2D1; Fri, 10 Nov 2017 11:19:48 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAABJllM045526; Fri, 10 Nov 2017 11:19:47 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAABJl1t045525; Fri, 10 Nov 2017 11:19:47 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201711101119.vAABJl1t045525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Fri, 10 Nov 2017 11:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325640 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 325640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 11:19:48 -0000 Author: tijl Date: Fri Nov 10 11:19:47 2017 New Revision: 325640 URL: https://svnweb.freebsd.org/changeset/base/325640 Log: Remove deprecated OVERRIDE_LINUX_BASE_PORT. It can be set via DEFAULT_VERSIONS now (e.g. DEFAULT_VERSIONS+=linux=c7). Noticed by: xmj MFC after: 2 weeks Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Fri Nov 10 11:19:33 2017 (r325639) +++ head/share/man/man7/ports.7 Fri Nov 10 11:19:47 2017 (r325640) @@ -494,7 +494,7 @@ More information on these and other related variables and the .Fx Porter's Handbook. -.Bl -tag -width ".Va OVERRIDE_LINUX_BASE_PORT" +.Bl -tag -width ".Va WITH_GHOSTSCRIPT_VER" .It Va WITH_OPENSSL_PORT .Pq Vt bool If set, causes ports that make use of OpenSSL to use the OpenSSL from @@ -514,8 +514,6 @@ If set, enables for most ports. .It Va WITH_GHOSTSCRIPT_VER If set, the version of ghostscript to be used by ports. -.It Va OVERRIDE_LINUX_BASE_PORT -The default linux base to use. .It Va WITH_CCACHE_BUILD .Pq Vt bool If set, enables the use of From owner-svn-src-all@freebsd.org Fri Nov 10 12:07:58 2017 Return-Path: Delivered-To: svn-src-all@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 61A56E6C3A3; Fri, 10 Nov 2017 12:07:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D56A70C63; Fri, 10 Nov 2017 12:07:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAAC7vpP067328; Fri, 10 Nov 2017 12:07:57 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAC7voR067326; Fri, 10 Nov 2017 12:07:57 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201711101207.vAAC7voR067326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 10 Nov 2017 12:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325641 - in head/sys/boot/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/sys/boot/efi: include libefi X-SVN-Commit-Revision: 325641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 12:07:58 -0000 Author: tsoome Date: Fri Nov 10 12:07:56 2017 New Revision: 325641 URL: https://svnweb.freebsd.org/changeset/base/325641 Log: loader.efi: efi_devpath_is_prefix should return bool efi_devpath_is_prefix() is currently returning values 0 or 1, which means it really should return bool. Additionally, use unsigned len, because we only get unsigned values from DevicePathNodeLength(). Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/devpath.c Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Fri Nov 10 11:19:47 2017 (r325640) +++ head/sys/boot/efi/include/efilib.h Fri Nov 10 12:07:56 2017 (r325641) @@ -82,7 +82,7 @@ EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *); EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *); bool efi_devpath_match(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); -int efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); +bool efi_devpath_is_prefix(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *); CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); void efi_free_devpath_name(CHAR16 *); Modified: head/sys/boot/efi/libefi/devpath.c ============================================================================== --- head/sys/boot/efi/libefi/devpath.c Fri Nov 10 11:19:47 2017 (r325640) +++ head/sys/boot/efi/libefi/devpath.c Fri Nov 10 12:07:56 2017 (r325641) @@ -167,13 +167,13 @@ efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVIC return (true); } -int +bool efi_devpath_is_prefix(EFI_DEVICE_PATH *prefix, EFI_DEVICE_PATH *path) { - int len; + size_t len; if (prefix == NULL || path == NULL) - return (0); + return (false); while (1) { if (IsDevicePathEnd(prefix)) @@ -181,17 +181,17 @@ efi_devpath_is_prefix(EFI_DEVICE_PATH *prefix, EFI_DEV if (DevicePathType(prefix) != DevicePathType(path) || DevicePathSubType(prefix) != DevicePathSubType(path)) - return (0); + return (false); len = DevicePathNodeLength(prefix); if (len != DevicePathNodeLength(path)) - return (0); + return (false); - if (memcmp(prefix, path, (size_t)len) != 0) - return (0); + if (memcmp(prefix, path, len) != 0) + return (false); prefix = NextDevicePathNode(prefix); path = NextDevicePathNode(path); } - return (1); + return (true); } From owner-svn-src-all@freebsd.org Fri Nov 10 12:28:45 2017 Return-Path: Delivered-To: svn-src-all@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 1D2B0E6CD32; Fri, 10 Nov 2017 12:28:45 +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 DBCF271565; Fri, 10 Nov 2017 12:28:44 +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 vAACShP4075477; Fri, 10 Nov 2017 12:28:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAACShgh075476; Fri, 10 Nov 2017 12:28:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711101228.vAACShgh075476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Nov 2017 12:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325642 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 325642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 12:28:45 -0000 Author: kib Date: Fri Nov 10 12:28:43 2017 New Revision: 325642 URL: https://svnweb.freebsd.org/changeset/base/325642 Log: MFC r325567: Zero whole struct ptrace_lwpinfo to not leak kernel stack data. Security: CVE-2017-1086 Modified: stable/11/sys/kern/sys_process.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/sys_process.c ============================================================================== --- stable/11/sys/kern/sys_process.c Fri Nov 10 12:07:56 2017 (r325641) +++ stable/11/sys/kern/sys_process.c Fri Nov 10 12:28:43 2017 (r325642) @@ -504,6 +504,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl, struct ptrace_lwpinfo32 *pl32) { + bzero(pl32, sizeof(*pl32)); pl32->pl_lwpid = pl->pl_lwpid; pl32->pl_event = pl->pl_event; pl32->pl_flags = pl->pl_flags; @@ -1316,6 +1317,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi } else #endif pl = addr; + bzero(pl, sizeof(*pl)); pl->pl_lwpid = td2->td_tid; pl->pl_event = PL_EVENT_NONE; pl->pl_flags = 0; @@ -1336,8 +1338,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi pl->pl_siginfo = td2->td_si; } } - if ((pl->pl_flags & PL_FLAG_SI) == 0) - bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo)); if (td2->td_dbgflags & TDB_SCE) pl->pl_flags |= PL_FLAG_SCE; else if (td2->td_dbgflags & TDB_SCX) From owner-svn-src-all@freebsd.org Fri Nov 10 12:31:59 2017 Return-Path: Delivered-To: svn-src-all@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 5771DE6CF2A; Fri, 10 Nov 2017 12:31:59 +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 2499971902; Fri, 10 Nov 2017 12:31:59 +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 vAACVwrp078584; Fri, 10 Nov 2017 12:31:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAACVwLx078583; Fri, 10 Nov 2017 12:31:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711101231.vAACVwLx078583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Nov 2017 12:31: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: r325643 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 325643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 12:31:59 -0000 Author: kib Date: Fri Nov 10 12:31:58 2017 New Revision: 325643 URL: https://svnweb.freebsd.org/changeset/base/325643 Log: MFC r325567: Zero whole struct ptrace_lwpinfo to not leak kernel stack data. Security: CVE-2017-1086 Modified: stable/10/sys/kern/sys_process.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sys_process.c ============================================================================== --- stable/10/sys/kern/sys_process.c Fri Nov 10 12:28:43 2017 (r325642) +++ stable/10/sys/kern/sys_process.c Fri Nov 10 12:31:58 2017 (r325643) @@ -474,6 +474,7 @@ ptrace_lwpinfo_to32(const struct ptrace_lwpinfo *pl, struct ptrace_lwpinfo32 *pl32) { + bzero(pl32, sizeof(*pl32)); pl32->pl_lwpid = pl->pl_lwpid; pl32->pl_event = pl->pl_event; pl32->pl_flags = pl->pl_flags; @@ -1276,6 +1277,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi } else #endif pl = addr; + bzero(pl, sizeof(*pl)); pl->pl_lwpid = td2->td_tid; pl->pl_event = PL_EVENT_NONE; pl->pl_flags = 0; @@ -1296,8 +1298,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi pl->pl_siginfo = td2->td_dbgksi.ksi_info; } } - if ((pl->pl_flags & PL_FLAG_SI) == 0) - bzero(&pl->pl_siginfo, sizeof(pl->pl_siginfo)); if (td2->td_dbgflags & TDB_SCE) pl->pl_flags |= PL_FLAG_SCE; else if (td2->td_dbgflags & TDB_SCX) From owner-svn-src-all@freebsd.org Fri Nov 10 12:42:52 2017 Return-Path: Delivered-To: svn-src-all@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 3634DE6D21F; Fri, 10 Nov 2017 12:42:52 +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 0D4BF71DF7; Fri, 10 Nov 2017 12:42:51 +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 vAACgpiT083731; Fri, 10 Nov 2017 12:42:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAACgpMD083730; Fri, 10 Nov 2017 12:42:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711101242.vAACgpMD083730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Nov 2017 12:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325644 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 325644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 12:42:52 -0000 Author: kib Date: Fri Nov 10 12:42:50 2017 New Revision: 325644 URL: https://svnweb.freebsd.org/changeset/base/325644 Log: MFC r324794: Do not overwrite clean blocks on pageout. Modified: stable/11/sys/vm/vnode_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vnode_pager.c ============================================================================== --- stable/11/sys/vm/vnode_pager.c Fri Nov 10 12:31:58 2017 (r325643) +++ stable/11/sys/vm/vnode_pager.c Fri Nov 10 12:42:50 2017 (r325644) @@ -1138,7 +1138,24 @@ vnode_pager_putpages(vm_object_t object, vm_page_t *m, VM_OBJECT_WLOCK(object); } +static int +vn_off2bidx(vm_ooffset_t offset) +{ + return ((offset & PAGE_MASK) / DEV_BSIZE); +} + +static bool +vn_dirty_blk(vm_page_t m, vm_ooffset_t offset) +{ + + KASSERT(IDX_TO_OFF(m->pindex) <= offset && + offset < IDX_TO_OFF(m->pindex + 1), + ("page %p pidx %ju offset %ju", m, (uintmax_t)m->pindex, + (uintmax_t)offset)); + return ((m->dirty & ((vm_page_bits_t)1 << vn_off2bidx(offset))) != 0); +} + /* * This is now called from local media FS's to operate against their * own vnodes if they fail to implement VOP_PUTPAGES. @@ -1154,10 +1171,12 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page { vm_object_t object; vm_page_t m; - vm_ooffset_t poffset; + vm_ooffset_t maxblksz, next_offset, poffset, prev_offset; struct uio auio; struct iovec aiov; + off_t prev_resid, wrsz; int count, error, i, maxsize, ncount, pgoff, ppscheck; + bool in_hole; static struct timeval lastfail; static int curfail; @@ -1219,34 +1238,102 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page for (i = ncount; i < count; i++) rtvals[i] = VM_PAGER_BAD; } - for (i = 0; i < ncount - ((btoc(maxsize) & PAGE_MASK) != 0); i++) - MPASS(ma[i]->dirty == VM_PAGE_BITS_ALL); - VM_OBJECT_WUNLOCK(object); - aiov.iov_base = NULL; - aiov.iov_len = maxsize; auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_offset = poffset; auio.uio_segflg = UIO_NOCOPY; auio.uio_rw = UIO_WRITE; - auio.uio_resid = maxsize; auio.uio_td = NULL; - error = VOP_WRITE(vp, &auio, vnode_pager_putpages_ioflags(flags), - curthread->td_ucred); - PCPU_INC(cnt.v_vnodeout); - PCPU_ADD(cnt.v_vnodepgsout, ncount); + maxblksz = roundup2(poffset + maxsize, DEV_BSIZE); - ppscheck = 0; - if (error != 0 && (ppscheck = ppsratecheck(&lastfail, &curfail, 1)) - != 0) - printf("vnode_pager_putpages: I/O error %d\n", error); - if (auio.uio_resid != 0 && (ppscheck != 0 || - ppsratecheck(&lastfail, &curfail, 1) != 0)) - printf("vnode_pager_putpages: residual I/O %zd at %ju\n", - auio.uio_resid, (uintmax_t)ma[0]->pindex); - for (i = 0; i < ncount; i++) + for (prev_offset = poffset; prev_offset < maxblksz;) { + /* Skip clean blocks. */ + for (in_hole = true; in_hole && prev_offset < maxblksz;) { + m = ma[OFF_TO_IDX(prev_offset - poffset)]; + for (i = vn_off2bidx(prev_offset); + i < sizeof(vm_page_bits_t) * NBBY && + prev_offset < maxblksz; i++) { + if (vn_dirty_blk(m, prev_offset)) { + in_hole = false; + break; + } + prev_offset += DEV_BSIZE; + } + } + if (in_hole) + goto write_done; + + /* Find longest run of dirty blocks. */ + for (next_offset = prev_offset; next_offset < maxblksz;) { + m = ma[OFF_TO_IDX(next_offset - poffset)]; + for (i = vn_off2bidx(next_offset); + i < sizeof(vm_page_bits_t) * NBBY && + next_offset < maxblksz; i++) { + if (!vn_dirty_blk(m, next_offset)) + goto start_write; + next_offset += DEV_BSIZE; + } + } +start_write: + if (next_offset > poffset + maxsize) + next_offset = poffset + maxsize; + + /* + * Getting here requires finding a dirty block in the + * 'skip clean blocks' loop. + */ + MPASS(prev_offset < next_offset); + + VM_OBJECT_WUNLOCK(object); + aiov.iov_base = NULL; + auio.uio_iovcnt = 1; + auio.uio_offset = prev_offset; + prev_resid = auio.uio_resid = aiov.iov_len = next_offset - + prev_offset; + error = VOP_WRITE(vp, &auio, + vnode_pager_putpages_ioflags(flags), curthread->td_ucred); + + wrsz = prev_resid - auio.uio_resid; + if (wrsz == 0) { + if (ppsratecheck(&lastfail, &curfail, 1) != 0) { + vn_printf(vp, "vnode_pager_putpages: " + "zero-length write at %ju resid %zd\n", + auio.uio_offset, auio.uio_resid); + } + VM_OBJECT_WLOCK(object); + break; + } + + /* Adjust the starting offset for next iteration. */ + prev_offset += wrsz; + MPASS(auio.uio_offset == prev_offset); + + ppscheck = 0; + if (error != 0 && (ppscheck = ppsratecheck(&lastfail, + &curfail, 1)) != 0) + vn_printf(vp, "vnode_pager_putpages: I/O error %d\n", + error); + if (auio.uio_resid != 0 && (ppscheck != 0 || + ppsratecheck(&lastfail, &curfail, 1) != 0)) + vn_printf(vp, "vnode_pager_putpages: residual I/O %zd " + "at %ju\n", auio.uio_resid, + (uintmax_t)ma[0]->pindex); + VM_OBJECT_WLOCK(object); + if (error != 0 || auio.uio_resid != 0) + break; + } +write_done: + /* Mark completely processed pages. */ + for (i = 0; i < OFF_TO_IDX(prev_offset - poffset); i++) rtvals[i] = VM_PAGER_OK; + /* Mark partial EOF page. */ + if (prev_offset == poffset + maxsize && (prev_offset & PAGE_MASK) != 0) + rtvals[i++] = VM_PAGER_OK; + /* Unwritten pages in range, free bonus if the page is clean. */ + for (; i < ncount; i++) + rtvals[i] = ma[i]->dirty == 0 ? VM_PAGER_OK : VM_PAGER_ERROR; + VM_OBJECT_WUNLOCK(object); + PCPU_ADD(cnt.v_vnodepgsout, i); + PCPU_INC(cnt.v_vnodeout); return (rtvals[0]); } From owner-svn-src-all@freebsd.org Fri Nov 10 12:45:10 2017 Return-Path: Delivered-To: svn-src-all@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 D760DE6D29D; Fri, 10 Nov 2017 12:45:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A40D371F40; Fri, 10 Nov 2017 12:45:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAACj9UZ083895; Fri, 10 Nov 2017 12:45:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAACj9Ls083894; Fri, 10 Nov 2017 12:45:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711101245.vAACj9Ls083894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Nov 2017 12:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325645 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 325645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 12:45:11 -0000 Author: kib Date: Fri Nov 10 12:45:09 2017 New Revision: 325645 URL: https://svnweb.freebsd.org/changeset/base/325645 Log: MFC r324807: Take the vm object lock in read mode in vnode_generic_putpages(). Modified: stable/11/sys/vm/vnode_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vnode_pager.c ============================================================================== --- stable/11/sys/vm/vnode_pager.c Fri Nov 10 12:42:50 2017 (r325644) +++ stable/11/sys/vm/vnode_pager.c Fri Nov 10 12:45:09 2017 (r325645) @@ -1211,8 +1211,14 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page * We do not under any circumstances truncate the valid bits, as * this will screw up bogus page replacement. */ - VM_OBJECT_WLOCK(object); + VM_OBJECT_RLOCK(object); if (maxsize + poffset > object->un_pager.vnp.vnp_size) { + if (!VM_OBJECT_TRYUPGRADE(object)) { + VM_OBJECT_RUNLOCK(object); + VM_OBJECT_WLOCK(object); + if (maxsize + poffset <= object->un_pager.vnp.vnp_size) + goto downgrade; + } if (object->un_pager.vnp.vnp_size > poffset) { maxsize = object->un_pager.vnp.vnp_size - poffset; ncount = btoc(maxsize); @@ -1237,6 +1243,8 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page } for (i = ncount; i < count; i++) rtvals[i] = VM_PAGER_BAD; +downgrade: + VM_OBJECT_LOCK_DOWNGRADE(object); } auio.uio_iov = &aiov; @@ -1283,7 +1291,7 @@ start_write: */ MPASS(prev_offset < next_offset); - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_RUNLOCK(object); aiov.iov_base = NULL; auio.uio_iovcnt = 1; auio.uio_offset = prev_offset; @@ -1299,7 +1307,7 @@ start_write: "zero-length write at %ju resid %zd\n", auio.uio_offset, auio.uio_resid); } - VM_OBJECT_WLOCK(object); + VM_OBJECT_RLOCK(object); break; } @@ -1317,7 +1325,7 @@ start_write: vn_printf(vp, "vnode_pager_putpages: residual I/O %zd " "at %ju\n", auio.uio_resid, (uintmax_t)ma[0]->pindex); - VM_OBJECT_WLOCK(object); + VM_OBJECT_RLOCK(object); if (error != 0 || auio.uio_resid != 0) break; } @@ -1331,7 +1339,7 @@ write_done: /* Unwritten pages in range, free bonus if the page is clean. */ for (; i < ncount; i++) rtvals[i] = ma[i]->dirty == 0 ? VM_PAGER_OK : VM_PAGER_ERROR; - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_RUNLOCK(object); PCPU_ADD(cnt.v_vnodepgsout, i); PCPU_INC(cnt.v_vnodeout); return (rtvals[0]); From owner-svn-src-all@freebsd.org Fri Nov 10 12:54:34 2017 Return-Path: Delivered-To: svn-src-all@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 EBB68E6D638; Fri, 10 Nov 2017 12:54:34 +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 B86C7724F4; Fri, 10 Nov 2017 12:54:34 +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 vAACsXVM088011; Fri, 10 Nov 2017 12:54:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAACsXaq088010; Fri, 10 Nov 2017 12:54:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711101254.vAACsXaq088010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Nov 2017 12:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325646 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 325646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 12:54:35 -0000 Author: kib Date: Fri Nov 10 12:54:33 2017 New Revision: 325646 URL: https://svnweb.freebsd.org/changeset/base/325646 Log: MFC r303627 (by alc): Restore the historical behavior of "sysctl vm.swap_idle_enabled=1". Modified: stable/11/sys/vm/vm_pageout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Fri Nov 10 12:45:09 2017 (r325645) +++ stable/11/sys/vm/vm_pageout.c Fri Nov 10 12:54:33 2017 (r325646) @@ -1670,9 +1670,10 @@ drop_page: vm_pagequeue_unlock(pq); #if !defined(NO_SWAPPING) /* - * Idle process swapout -- run once per second. + * Idle process swapout -- run once per second when we are reclaiming + * pages. */ - if (vm_swap_idle_enabled) { + if (vm_swap_idle_enabled && pass > 0) { static long lsec; if (time_second != lsec) { vm_req_vmdaemon(VM_SWAP_IDLE); From owner-svn-src-all@freebsd.org Fri Nov 10 13:17:42 2017 Return-Path: Delivered-To: svn-src-all@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 801B4E6DA66; Fri, 10 Nov 2017 13:17:42 +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 27AE172DA1; Fri, 10 Nov 2017 13:17:42 +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 vAADHf61096394; Fri, 10 Nov 2017 13:17:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADHfDL096388; Fri, 10 Nov 2017 13:17:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711101317.vAADHfDL096388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Nov 2017 13:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325647 - in stable/11/sys: conf sys vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: conf sys vm X-SVN-Commit-Revision: 325647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:17:42 -0000 Author: kib Date: Fri Nov 10 13:17:40 2017 New Revision: 325647 URL: https://svnweb.freebsd.org/changeset/base/325647 Log: MFC r324795: Move swapout code into vm/vm_swapout.c. Added: stable/11/sys/vm/vm_swapout.c - copied, changed from r324795, head/sys/vm/vm_swapout.c stable/11/sys/vm/vm_swapout_dummy.c - copied unchanged from r324795, head/sys/vm/vm_swapout_dummy.c Modified: stable/11/sys/conf/files stable/11/sys/sys/_kstack_cache.h stable/11/sys/vm/vm_extern.h stable/11/sys/vm/vm_glue.c stable/11/sys/vm/vm_pageout.c stable/11/sys/vm/vm_pageout.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Fri Nov 10 12:54:33 2017 (r325646) +++ stable/11/sys/conf/files Fri Nov 10 13:17:40 2017 (r325647) @@ -4608,6 +4608,7 @@ vm/swap_pager.c standard vm/uma_core.c standard vm/uma_dbg.c standard vm/memguard.c optional DEBUG_MEMGUARD +vm/vm_domain.c standard vm/vm_fault.c standard vm/vm_glue.c standard vm/vm_init.c standard @@ -4622,7 +4623,8 @@ vm/vm_pager.c standard vm/vm_phys.c standard vm/vm_radix.c standard vm/vm_reserv.c standard -vm/vm_domain.c standard +vm/vm_swapout.c optional !NO_SWAPPING +vm/vm_swapout_dummy.c optional NO_SWAPPING vm/vm_unix.c standard vm/vm_zeroidle.c standard vm/vnode_pager.c standard Modified: stable/11/sys/sys/_kstack_cache.h ============================================================================== --- stable/11/sys/sys/_kstack_cache.h Fri Nov 10 12:54:33 2017 (r325646) +++ stable/11/sys/sys/_kstack_cache.h Fri Nov 10 13:17:40 2017 (r325647) @@ -38,6 +38,10 @@ struct kstack_cache_entry { extern struct kstack_cache_entry *kstack_cache; +#ifndef KSTACK_MAX_PAGES +#define KSTACK_MAX_PAGES 32 +#endif + #endif Modified: stable/11/sys/vm/vm_extern.h ============================================================================== --- stable/11/sys/vm/vm_extern.h Fri Nov 10 12:54:33 2017 (r325646) +++ stable/11/sys/vm/vm_extern.h Fri Nov 10 13:17:40 2017 (r325647) @@ -71,7 +71,6 @@ void kmem_init(vm_offset_t, vm_offset_t); void kmem_init_zero_region(void); void kmeminit(void); -void swapout_procs(int); int kernacc(void *, int, int); int useracc(void *, int, int); int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int); Modified: stable/11/sys/vm/vm_glue.c ============================================================================== --- stable/11/sys/vm/vm_glue.c Fri Nov 10 12:54:33 2017 (r325646) +++ stable/11/sys/vm/vm_glue.c Fri Nov 10 13:17:40 2017 (r325647) @@ -101,13 +101,6 @@ __FBSDID("$FreeBSD$"); #include -#ifndef NO_SWAPPING -static int swapout(struct proc *); -static void swapclear(struct proc *); -static void vm_thread_swapin(struct thread *td); -static void vm_thread_swapout(struct thread *td); -#endif - /* * MPSAFE * @@ -308,10 +301,6 @@ SYSCTL_INT(_vm, OID_AUTO, kstack_cache_size, CTLFLAG_R SYSCTL_INT(_vm, OID_AUTO, kstacks, CTLFLAG_RD, &kstacks, 0, ""); -#ifndef KSTACK_MAX_PAGES -#define KSTACK_MAX_PAGES 32 -#endif - /* * Create the kernel stack (including pcb for i386) for a new thread. * This routine directly affects the fork perf for a process and @@ -527,80 +516,7 @@ intr_prof_stack_use(struct thread *td, struct trapfram } #endif /* KSTACK_USAGE_PROF */ -#ifndef NO_SWAPPING /* - * Allow a thread's kernel stack to be paged out. - */ -static void -vm_thread_swapout(struct thread *td) -{ - vm_object_t ksobj; - vm_page_t m; - int i, pages; - - cpu_thread_swapout(td); - pages = td->td_kstack_pages; - ksobj = td->td_kstack_obj; - pmap_qremove(td->td_kstack, pages); - VM_OBJECT_WLOCK(ksobj); - for (i = 0; i < pages; i++) { - m = vm_page_lookup(ksobj, i); - if (m == NULL) - panic("vm_thread_swapout: kstack already missing?"); - vm_page_dirty(m); - vm_page_lock(m); - vm_page_unwire(m, PQ_INACTIVE); - vm_page_unlock(m); - } - VM_OBJECT_WUNLOCK(ksobj); -} - -/* - * Bring the kernel stack for a specified thread back in. - */ -static void -vm_thread_swapin(struct thread *td) -{ - vm_object_t ksobj; - vm_page_t ma[KSTACK_MAX_PAGES]; - int pages; - - pages = td->td_kstack_pages; - ksobj = td->td_kstack_obj; - VM_OBJECT_WLOCK(ksobj); - (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma, - pages); - for (int i = 0; i < pages;) { - int j, a, count, rv; - - vm_page_assert_xbusied(ma[i]); - if (ma[i]->valid == VM_PAGE_BITS_ALL) { - vm_page_xunbusy(ma[i]); - i++; - continue; - } - vm_object_pip_add(ksobj, 1); - for (j = i + 1; j < pages; j++) - if (ma[j]->valid == VM_PAGE_BITS_ALL) - break; - rv = vm_pager_has_page(ksobj, ma[i]->pindex, NULL, &a); - KASSERT(rv == 1, ("%s: missing page %p", __func__, ma[i])); - count = min(a + 1, j - i); - rv = vm_pager_get_pages(ksobj, ma + i, count, NULL, NULL); - KASSERT(rv == VM_PAGER_OK, ("%s: cannot get kstack for proc %d", - __func__, td->td_proc->p_pid)); - vm_object_pip_wakeup(ksobj); - for (j = i; j < i + count; j++) - vm_page_xunbusy(ma[j]); - i += count; - } - VM_OBJECT_WUNLOCK(ksobj); - pmap_qenter(td->td_kstack, ma, pages); - cpu_thread_swapin(td); -} -#endif /* !NO_SWAPPING */ - -/* * Implement fork's actions on an address space. * Here we arrange for the address space to be copied or referenced, * allocate a user struct (pcb and kernel stack), then call the @@ -673,425 +589,8 @@ vm_waitproc(p) } void -faultin(p) - struct proc *p; -{ -#ifdef NO_SWAPPING - - PROC_LOCK_ASSERT(p, MA_OWNED); - if ((p->p_flag & P_INMEM) == 0) - panic("faultin: proc swapped out with NO_SWAPPING!"); -#else /* !NO_SWAPPING */ - struct thread *td; - - PROC_LOCK_ASSERT(p, MA_OWNED); - /* - * If another process is swapping in this process, - * just wait until it finishes. - */ - if (p->p_flag & P_SWAPPINGIN) { - while (p->p_flag & P_SWAPPINGIN) - msleep(&p->p_flag, &p->p_mtx, PVM, "faultin", 0); - return; - } - if ((p->p_flag & P_INMEM) == 0) { - /* - * Don't let another thread swap process p out while we are - * busy swapping it in. - */ - ++p->p_lock; - p->p_flag |= P_SWAPPINGIN; - PROC_UNLOCK(p); - - /* - * We hold no lock here because the list of threads - * can not change while all threads in the process are - * swapped out. - */ - FOREACH_THREAD_IN_PROC(p, td) - vm_thread_swapin(td); - PROC_LOCK(p); - swapclear(p); - p->p_swtick = ticks; - - wakeup(&p->p_flag); - - /* Allow other threads to swap p out now. */ - --p->p_lock; - } -#endif /* NO_SWAPPING */ -} - -/* - * This swapin algorithm attempts to swap-in processes only if there - * is enough space for them. Of course, if a process waits for a long - * time, it will be swapped in anyway. - */ -void -swapper(void) -{ - struct proc *p; - struct thread *td; - struct proc *pp; - int slptime; - int swtime; - int ppri; - int pri; - -loop: - if (vm_page_count_min()) { - VM_WAIT; - goto loop; - } - - pp = NULL; - ppri = INT_MIN; - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - if (p->p_state == PRS_NEW || - p->p_flag & (P_SWAPPINGOUT | P_SWAPPINGIN | P_INMEM)) { - PROC_UNLOCK(p); - continue; - } - swtime = (ticks - p->p_swtick) / hz; - FOREACH_THREAD_IN_PROC(p, td) { - /* - * An otherwise runnable thread of a process - * swapped out has only the TDI_SWAPPED bit set. - * - */ - thread_lock(td); - if (td->td_inhibitors == TDI_SWAPPED) { - slptime = (ticks - td->td_slptick) / hz; - pri = swtime + slptime; - if ((td->td_flags & TDF_SWAPINREQ) == 0) - pri -= p->p_nice * 8; - /* - * if this thread is higher priority - * and there is enough space, then select - * this process instead of the previous - * selection. - */ - if (pri > ppri) { - pp = p; - ppri = pri; - } - } - thread_unlock(td); - } - PROC_UNLOCK(p); - } - sx_sunlock(&allproc_lock); - - /* - * Nothing to do, back to sleep. - */ - if ((p = pp) == NULL) { - tsleep(&proc0, PVM, "swapin", MAXSLP * hz / 2); - goto loop; - } - PROC_LOCK(p); - - /* - * Another process may be bringing or may have already - * brought this process in while we traverse all threads. - * Or, this process may even be being swapped out again. - */ - if (p->p_flag & (P_INMEM | P_SWAPPINGOUT | P_SWAPPINGIN)) { - PROC_UNLOCK(p); - goto loop; - } - - /* - * We would like to bring someone in. (only if there is space). - * [What checks the space? ] - */ - faultin(p); - PROC_UNLOCK(p); - goto loop; -} - -void kick_proc0(void) { wakeup(&proc0); } - -#ifndef NO_SWAPPING - -/* - * Swap_idle_threshold1 is the guaranteed swapped in time for a process - */ -static int swap_idle_threshold1 = 2; -SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold1, CTLFLAG_RW, - &swap_idle_threshold1, 0, "Guaranteed swapped in time for a process"); - -/* - * Swap_idle_threshold2 is the time that a process can be idle before - * it will be swapped out, if idle swapping is enabled. - */ -static int swap_idle_threshold2 = 10; -SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold2, CTLFLAG_RW, - &swap_idle_threshold2, 0, "Time before a process will be swapped out"); - -/* - * First, if any processes have been sleeping or stopped for at least - * "swap_idle_threshold1" seconds, they are swapped out. If, however, - * no such processes exist, then the longest-sleeping or stopped - * process is swapped out. Finally, and only as a last resort, if - * there are no sleeping or stopped processes, the longest-resident - * process is swapped out. - */ -void -swapout_procs(action) -int action; -{ - struct proc *p; - struct thread *td; - int didswap = 0; - -retry: - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - struct vmspace *vm; - int minslptime = 100000; - int slptime; - - PROC_LOCK(p); - /* - * Watch out for a process in - * creation. It may have no - * address space or lock yet. - */ - if (p->p_state == PRS_NEW) { - PROC_UNLOCK(p); - continue; - } - /* - * An aio daemon switches its - * address space while running. - * Perform a quick check whether - * a process has P_SYSTEM. - * Filter out exiting processes. - */ - if ((p->p_flag & (P_SYSTEM | P_WEXIT)) != 0) { - PROC_UNLOCK(p); - continue; - } - _PHOLD_LITE(p); - PROC_UNLOCK(p); - sx_sunlock(&allproc_lock); - - /* - * Do not swapout a process that - * is waiting for VM data - * structures as there is a possible - * deadlock. Test this first as - * this may block. - * - * Lock the map until swapout - * finishes, or a thread of this - * process may attempt to alter - * the map. - */ - vm = vmspace_acquire_ref(p); - if (vm == NULL) - goto nextproc2; - if (!vm_map_trylock(&vm->vm_map)) - goto nextproc1; - - PROC_LOCK(p); - if (p->p_lock != 1 || (p->p_flag & (P_STOPPED_SINGLE | - P_TRACED | P_SYSTEM)) != 0) - goto nextproc; - - /* - * only aiod changes vmspace, however it will be - * skipped because of the if statement above checking - * for P_SYSTEM - */ - if ((p->p_flag & (P_INMEM|P_SWAPPINGOUT|P_SWAPPINGIN)) != P_INMEM) - goto nextproc; - - switch (p->p_state) { - default: - /* Don't swap out processes in any sort - * of 'special' state. */ - break; - - case PRS_NORMAL: - /* - * do not swapout a realtime process - * Check all the thread groups.. - */ - FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - if (PRI_IS_REALTIME(td->td_pri_class)) { - thread_unlock(td); - goto nextproc; - } - slptime = (ticks - td->td_slptick) / hz; - /* - * Guarantee swap_idle_threshold1 - * time in memory. - */ - if (slptime < swap_idle_threshold1) { - thread_unlock(td); - goto nextproc; - } - - /* - * Do not swapout a process if it is - * waiting on a critical event of some - * kind or there is a thread whose - * pageable memory may be accessed. - * - * This could be refined to support - * swapping out a thread. - */ - if (!thread_safetoswapout(td)) { - thread_unlock(td); - goto nextproc; - } - /* - * If the system is under memory stress, - * or if we are swapping - * idle processes >= swap_idle_threshold2, - * then swap the process out. - */ - if (((action & VM_SWAP_NORMAL) == 0) && - (((action & VM_SWAP_IDLE) == 0) || - (slptime < swap_idle_threshold2))) { - thread_unlock(td); - goto nextproc; - } - - if (minslptime > slptime) - minslptime = slptime; - thread_unlock(td); - } - - /* - * If the pageout daemon didn't free enough pages, - * or if this process is idle and the system is - * configured to swap proactively, swap it out. - */ - if ((action & VM_SWAP_NORMAL) || - ((action & VM_SWAP_IDLE) && - (minslptime > swap_idle_threshold2))) { - _PRELE(p); - if (swapout(p) == 0) - didswap++; - PROC_UNLOCK(p); - vm_map_unlock(&vm->vm_map); - vmspace_free(vm); - goto retry; - } - } -nextproc: - PROC_UNLOCK(p); - vm_map_unlock(&vm->vm_map); -nextproc1: - vmspace_free(vm); -nextproc2: - sx_slock(&allproc_lock); - PRELE(p); - } - sx_sunlock(&allproc_lock); - /* - * If we swapped something out, and another process needed memory, - * then wakeup the sched process. - */ - if (didswap) - wakeup(&proc0); -} - -static void -swapclear(p) - struct proc *p; -{ - struct thread *td; - - PROC_LOCK_ASSERT(p, MA_OWNED); - - FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - td->td_flags |= TDF_INMEM; - td->td_flags &= ~TDF_SWAPINREQ; - TD_CLR_SWAPPED(td); - if (TD_CAN_RUN(td)) - if (setrunnable(td)) { -#ifdef INVARIANTS - /* - * XXX: We just cleared TDI_SWAPPED - * above and set TDF_INMEM, so this - * should never happen. - */ - panic("not waking up swapper"); -#endif - } - thread_unlock(td); - } - p->p_flag &= ~(P_SWAPPINGIN|P_SWAPPINGOUT); - p->p_flag |= P_INMEM; -} - -static int -swapout(p) - struct proc *p; -{ - struct thread *td; - - PROC_LOCK_ASSERT(p, MA_OWNED); -#if defined(SWAP_DEBUG) - printf("swapping out %d\n", p->p_pid); -#endif - - /* - * The states of this process and its threads may have changed - * by now. Assuming that there is only one pageout daemon thread, - * this process should still be in memory. - */ - KASSERT((p->p_flag & (P_INMEM|P_SWAPPINGOUT|P_SWAPPINGIN)) == P_INMEM, - ("swapout: lost a swapout race?")); - - /* - * remember the process resident count - */ - p->p_vmspace->vm_swrss = vmspace_resident_count(p->p_vmspace); - /* - * Check and mark all threads before we proceed. - */ - p->p_flag &= ~P_INMEM; - p->p_flag |= P_SWAPPINGOUT; - FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - if (!thread_safetoswapout(td)) { - thread_unlock(td); - swapclear(p); - return (EBUSY); - } - td->td_flags &= ~TDF_INMEM; - TD_SET_SWAPPED(td); - thread_unlock(td); - } - td = FIRST_THREAD_IN_PROC(p); - ++td->td_ru.ru_nswap; - PROC_UNLOCK(p); - - /* - * This list is stable because all threads are now prevented from - * running. The list is only modified in the context of a running - * thread in this process. - */ - FOREACH_THREAD_IN_PROC(p, td) - vm_thread_swapout(td); - - PROC_LOCK(p); - p->p_flag &= ~P_SWAPPINGOUT; - p->p_swtick = ticks; - return (0); -} -#endif /* !NO_SWAPPING */ Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Fri Nov 10 12:54:33 2017 (r325646) +++ stable/11/sys/vm/vm_pageout.c Fri Nov 10 13:17:40 2017 (r325647) @@ -141,19 +141,6 @@ SYSINIT(pagedaemon, SI_SUB_KTHREAD_PAGE, SI_ORDER_SECO SDT_PROVIDER_DEFINE(vm); SDT_PROBE_DEFINE(vm, , , vm__lowmem_scan); -#if !defined(NO_SWAPPING) -/* the kernel process "vm_daemon"*/ -static void vm_daemon(void); -static struct proc *vmproc; - -static struct kproc_desc vm_kp = { - "vmdaemon", - vm_daemon, - &vmproc -}; -SYSINIT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ORDER_FIRST, kproc_start, &vm_kp); -#endif - /* Pagedaemon activity rates, in subdivisions of one second. */ #define VM_LAUNDER_RATE 10 #define VM_INACT_SCAN_RATE 2 @@ -171,26 +158,11 @@ static enum { VM_LAUNDRY_SHORTFALL } vm_laundry_request = VM_LAUNDRY_IDLE; -#if !defined(NO_SWAPPING) -static int vm_pageout_req_swapout; /* XXX */ -static int vm_daemon_needed; -static struct mtx vm_daemon_mtx; -/* Allow for use by vm_pageout before vm_daemon is initialized. */ -MTX_SYSINIT(vm_daemon, &vm_daemon_mtx, "vm daemon", MTX_DEF); -#endif static int vm_pageout_update_period; static int disable_swap_pageouts; static int lowmem_period = 10; static time_t lowmem_uptime; -#if defined(NO_SWAPPING) -static int vm_swap_enabled = 0; -static int vm_swap_idle_enabled = 0; -#else -static int vm_swap_enabled = 1; -static int vm_swap_idle_enabled = 0; -#endif - static int vm_panic_on_oom = 0; SYSCTL_INT(_vm, OID_AUTO, panic_on_oom, @@ -208,18 +180,6 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_update_period, SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RW, &lowmem_period, 0, "Low memory callback period"); -#if defined(NO_SWAPPING) -SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled, - CTLFLAG_RD, &vm_swap_enabled, 0, "Enable entire process swapout"); -SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled, - CTLFLAG_RD, &vm_swap_idle_enabled, 0, "Allow swapout on idle criteria"); -#else -SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled, - CTLFLAG_RW, &vm_swap_enabled, 0, "Enable entire process swapout"); -SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled, - CTLFLAG_RW, &vm_swap_idle_enabled, 0, "Allow swapout on idle criteria"); -#endif - SYSCTL_INT(_vm, OID_AUTO, disable_swapspace_pageouts, CTLFLAG_RW, &disable_swap_pageouts, 0, "Disallow swapout of dirty pages"); @@ -261,11 +221,6 @@ static boolean_t vm_pageout_fallback_object_lock(vm_pa static int vm_pageout_launder(struct vm_domain *vmd, int launder, bool in_shortfall); static void vm_pageout_laundry_worker(void *arg); -#if !defined(NO_SWAPPING) -static void vm_pageout_map_deactivate_pages(vm_map_t, long); -static void vm_pageout_object_deactivate_pages(pmap_t, vm_object_t, long); -static void vm_req_vmdaemon(int req); -#endif static boolean_t vm_pageout_page_lock(vm_page_t, vm_page_t *); /* @@ -604,172 +559,7 @@ vm_pageout_flush(vm_page_t *mc, int count, int flags, return (numpagedout); } -#if !defined(NO_SWAPPING) /* - * vm_pageout_object_deactivate_pages - * - * Deactivate enough pages to satisfy the inactive target - * requirements. - * - * The object and map must be locked. - */ -static void -vm_pageout_object_deactivate_pages(pmap_t pmap, vm_object_t first_object, - long desired) -{ - vm_object_t backing_object, object; - vm_page_t p; - int act_delta, remove_mode; - - VM_OBJECT_ASSERT_LOCKED(first_object); - if ((first_object->flags & OBJ_FICTITIOUS) != 0) - return; - for (object = first_object;; object = backing_object) { - if (pmap_resident_count(pmap) <= desired) - goto unlock_return; - VM_OBJECT_ASSERT_LOCKED(object); - if ((object->flags & OBJ_UNMANAGED) != 0 || - object->paging_in_progress != 0) - goto unlock_return; - - remove_mode = 0; - if (object->shadow_count > 1) - remove_mode = 1; - /* - * Scan the object's entire memory queue. - */ - TAILQ_FOREACH(p, &object->memq, listq) { - if (pmap_resident_count(pmap) <= desired) - goto unlock_return; - if (vm_page_busied(p)) - continue; - PCPU_INC(cnt.v_pdpages); - vm_page_lock(p); - if (p->wire_count != 0 || p->hold_count != 0 || - !pmap_page_exists_quick(pmap, p)) { - vm_page_unlock(p); - continue; - } - act_delta = pmap_ts_referenced(p); - if ((p->aflags & PGA_REFERENCED) != 0) { - if (act_delta == 0) - act_delta = 1; - vm_page_aflag_clear(p, PGA_REFERENCED); - } - if (!vm_page_active(p) && act_delta != 0) { - vm_page_activate(p); - p->act_count += act_delta; - } else if (vm_page_active(p)) { - if (act_delta == 0) { - p->act_count -= min(p->act_count, - ACT_DECLINE); - if (!remove_mode && p->act_count == 0) { - pmap_remove_all(p); - vm_page_deactivate(p); - } else - vm_page_requeue(p); - } else { - vm_page_activate(p); - if (p->act_count < ACT_MAX - - ACT_ADVANCE) - p->act_count += ACT_ADVANCE; - vm_page_requeue(p); - } - } else if (vm_page_inactive(p)) - pmap_remove_all(p); - vm_page_unlock(p); - } - if ((backing_object = object->backing_object) == NULL) - goto unlock_return; - VM_OBJECT_RLOCK(backing_object); - if (object != first_object) - VM_OBJECT_RUNLOCK(object); - } -unlock_return: - if (object != first_object) - VM_OBJECT_RUNLOCK(object); -} - -/* - * deactivate some number of pages in a map, try to do it fairly, but - * that is really hard to do. - */ -static void -vm_pageout_map_deactivate_pages(map, desired) - vm_map_t map; - long desired; -{ - vm_map_entry_t tmpe; - vm_object_t obj, bigobj; - int nothingwired; - - if (!vm_map_trylock(map)) - return; - - bigobj = NULL; - nothingwired = TRUE; - - /* - * first, search out the biggest object, and try to free pages from - * that. - */ - tmpe = map->header.next; - while (tmpe != &map->header) { - if ((tmpe->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { - obj = tmpe->object.vm_object; - if (obj != NULL && VM_OBJECT_TRYRLOCK(obj)) { - if (obj->shadow_count <= 1 && - (bigobj == NULL || - bigobj->resident_page_count < obj->resident_page_count)) { - if (bigobj != NULL) - VM_OBJECT_RUNLOCK(bigobj); - bigobj = obj; - } else - VM_OBJECT_RUNLOCK(obj); - } - } - if (tmpe->wired_count > 0) - nothingwired = FALSE; - tmpe = tmpe->next; - } - - if (bigobj != NULL) { - vm_pageout_object_deactivate_pages(map->pmap, bigobj, desired); - VM_OBJECT_RUNLOCK(bigobj); - } - /* - * Next, hunt around for other pages to deactivate. We actually - * do this search sort of wrong -- .text first is not the best idea. - */ - tmpe = map->header.next; - while (tmpe != &map->header) { - if (pmap_resident_count(vm_map_pmap(map)) <= desired) - break; - if ((tmpe->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { - obj = tmpe->object.vm_object; - if (obj != NULL) { - VM_OBJECT_RLOCK(obj); - vm_pageout_object_deactivate_pages(map->pmap, obj, desired); - VM_OBJECT_RUNLOCK(obj); - } - } - tmpe = tmpe->next; - } - - /* - * Remove all mappings if a process is swapped out, this will free page - * table pages. - */ - if (desired == 0 && nothingwired) { - pmap_remove(vm_map_pmap(map), vm_map_min(map), - vm_map_max(map)); - } - - vm_map_unlock(map); -} -#endif /* !defined(NO_SWAPPING) */ - -/* * Attempt to acquire all of the necessary locks to launder a page and * then call through the clustering layer to PUTPAGES. Wait a short * time for a vnode lock. @@ -1511,14 +1301,12 @@ drop_page: vm_pagequeue_unlock(pq); } -#if !defined(NO_SWAPPING) /* * Wakeup the swapout daemon if we didn't free the targeted number of * pages. */ - if (vm_swap_enabled && page_shortage > 0) - vm_req_vmdaemon(VM_SWAP_NORMAL); -#endif + if (page_shortage > 0) + vm_swapout_run(); /* * If the inactive queue scan fails repeatedly to meet its @@ -1668,19 +1456,8 @@ drop_page: vm_page_unlock(m); } vm_pagequeue_unlock(pq); -#if !defined(NO_SWAPPING) - /* - * Idle process swapout -- run once per second when we are reclaiming - * pages. - */ - if (vm_swap_idle_enabled && pass > 0) { - static long lsec; - if (time_second != lsec) { - vm_req_vmdaemon(VM_SWAP_IDLE); - lsec = time_second; - } - } -#endif + if (pass > 0) + vm_swapout_run_idle(); return (page_shortage <= 0); } @@ -2106,167 +1883,3 @@ pagedaemon_wakeup(void) wakeup(&vm_pageout_wanted); } } - -#if !defined(NO_SWAPPING) -static void -vm_req_vmdaemon(int req) -{ - static int lastrun = 0; - - mtx_lock(&vm_daemon_mtx); - vm_pageout_req_swapout |= req; - if ((ticks > (lastrun + hz)) || (ticks < lastrun)) { - wakeup(&vm_daemon_needed); - lastrun = ticks; - } - mtx_unlock(&vm_daemon_mtx); -} - -static void -vm_daemon(void) -{ - struct rlimit rsslim; - struct proc *p; - struct thread *td; - struct vmspace *vm; - int breakout, swapout_flags, tryagain, attempts; -#ifdef RACCT - uint64_t rsize, ravailable; -#endif - - while (TRUE) { - mtx_lock(&vm_daemon_mtx); - msleep(&vm_daemon_needed, &vm_daemon_mtx, PPAUSE, "psleep", -#ifdef RACCT - racct_enable ? hz : 0 -#else - 0 -#endif - ); - swapout_flags = vm_pageout_req_swapout; - vm_pageout_req_swapout = 0; - mtx_unlock(&vm_daemon_mtx); - if (swapout_flags) - swapout_procs(swapout_flags); - - /* - * scan the processes for exceeding their rlimits or if - * process is swapped out -- deactivate pages - */ - tryagain = 0; - attempts = 0; -again: - attempts++; - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - vm_pindex_t limit, size; - - /* - * if this is a system process or if we have already - * looked at this process, skip it. - */ - PROC_LOCK(p); - if (p->p_state != PRS_NORMAL || - p->p_flag & (P_INEXEC | P_SYSTEM | P_WEXIT)) { - PROC_UNLOCK(p); - continue; - } - /* - * if the process is in a non-running type state, - * don't touch it. - */ - breakout = 0; - FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - if (!TD_ON_RUNQ(td) && - !TD_IS_RUNNING(td) && - !TD_IS_SLEEPING(td) && - !TD_IS_SUSPENDED(td)) { - thread_unlock(td); - breakout = 1; - break; - } - thread_unlock(td); - } - if (breakout) { - PROC_UNLOCK(p); - continue; - } - /* - * get a limit - */ - lim_rlimit_proc(p, RLIMIT_RSS, &rsslim); - limit = OFF_TO_IDX( - qmin(rsslim.rlim_cur, rsslim.rlim_max)); - - /* - * let processes that are swapped out really be - * swapped out set the limit to nothing (will force a - * swap-out.) - */ - if ((p->p_flag & P_INMEM) == 0) - limit = 0; /* XXX */ - vm = vmspace_acquire_ref(p); - _PHOLD_LITE(p); - PROC_UNLOCK(p); - if (vm == NULL) { - PRELE(p); - continue; - } - sx_sunlock(&allproc_lock); - - size = vmspace_resident_count(vm); - if (size >= limit) { - vm_pageout_map_deactivate_pages( - &vm->vm_map, limit); - size = vmspace_resident_count(vm); - } -#ifdef RACCT - if (racct_enable) { - rsize = IDX_TO_OFF(size); - PROC_LOCK(p); - if (p->p_state == PRS_NORMAL) - racct_set(p, RACCT_RSS, rsize); - ravailable = racct_get_available(p, RACCT_RSS); - PROC_UNLOCK(p); - if (rsize > ravailable) { - /* - * Don't be overly aggressive; this - * might be an innocent process, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Nov 10 13:25:31 2017 Return-Path: Delivered-To: svn-src-all@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 242D7E6DC85; Fri, 10 Nov 2017 13:25:31 +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 EC452731ED; Fri, 10 Nov 2017 13:25:30 +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 vAADPUmd000793; Fri, 10 Nov 2017 13:25:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADPUJo000791; Fri, 10 Nov 2017 13:25:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101325.vAADPUJo000791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325648 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 325648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:25:31 -0000 Author: hselasky Date: Fri Nov 10 13:25:29 2017 New Revision: 325648 URL: https://svnweb.freebsd.org/changeset/base/325648 Log: Implement support for decoding general port notification event in the mlx5 core module. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Fri Nov 10 13:17:40 2017 (r325647) +++ head/sys/dev/mlx5/device.h Fri Nov 10 13:25:29 2017 (r325648) @@ -486,6 +486,11 @@ struct mlx5_eqe_port_module_event { u8 error_type; }; +struct mlx5_eqe_general_notification_event { + u32 rq_user_index_delay_drop; + u32 rsvd0[6]; +}; + union ev_data { __be32 raw[7]; struct mlx5_eqe_cmd cmd; @@ -499,6 +504,7 @@ union ev_data { struct mlx5_eqe_page_req req_pages; struct mlx5_eqe_port_module_event port_module_event; struct mlx5_eqe_vport_change vport_change; + struct mlx5_eqe_general_notification_event general_notifications; } __packed; struct mlx5_eqe { @@ -1386,6 +1392,10 @@ static inline int mlx5_get_cqe_format(const struct mlx { return (cqe->op_own & MLX5E_CQE_FORMAT_MASK) >> 2; } + +enum { + MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT = 0x1, +}; /* 8 regular priorities + 1 for multicast */ #define MLX5_NUM_BYPASS_FTS 9 Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Nov 10 13:17:40 2017 (r325647) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Nov 10 13:25:29 2017 (r325648) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -80,6 +80,8 @@ struct cre_des_eq { /*Function prototype*/ static void mlx5_port_module_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe); +static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev, + struct mlx5_eqe *eqe); static int mlx5_cmd_destroy_eq(struct mlx5_core_dev *dev, u8 eqn) { @@ -157,6 +159,8 @@ static const char *eqe_type_str(u8 type) return "MLX5_EVENT_TYPE_NIC_VPORT_CHANGE"; case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT: return "MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT"; + case MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT: + return "MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT"; default: return "Unrecognized event"; } @@ -296,6 +300,10 @@ static int mlx5_eq_int(struct mlx5_core_dev *dev, stru } break; + case MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT: + mlx5_port_general_notification_event(dev, eqe); + break; + case MLX5_EVENT_TYPE_CQ_ERROR: cqn = be32_to_cpu(eqe->data.cq_err.cqn) & 0xffffff; mlx5_core_warn(dev, "CQ error on CQN 0x%x, syndrom 0x%x\n", @@ -665,5 +673,26 @@ static void mlx5_port_module_event(struct mlx5_core_de /* store module status */ if (module_num < MLX5_MAX_PORTS) dev->module_status[module_num] = module_status; +} + +static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev, + struct mlx5_eqe *eqe) +{ + u8 port = (eqe->data.port.port >> 4) & 0xf; + u32 rqn = 0; + struct mlx5_eqe_general_notification_event *general_event = NULL; + + switch (eqe->sub_type) { + case MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT: + general_event = &eqe->data.general_notifications; + rqn = be32_to_cpu(general_event->rq_user_index_delay_drop) & + 0xffffff; + break; + default: + mlx5_core_warn(dev, + "general event with unrecognized subtype: port %d, sub_type %d\n", + port, eqe->sub_type); + break; + } } From owner-svn-src-all@freebsd.org Fri Nov 10 13:28:24 2017 Return-Path: Delivered-To: svn-src-all@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 60EC7E6DD05; Fri, 10 Nov 2017 13:28: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 26EEB73359; Fri, 10 Nov 2017 13:28:24 +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 vAADSNxK000957; Fri, 10 Nov 2017 13:28:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADSNFP000956; Fri, 10 Nov 2017 13:28:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101328.vAADSNFP000956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325649 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 325649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:28:24 -0000 Author: hselasky Date: Fri Nov 10 13:28:23 2017 New Revision: 325649 URL: https://svnweb.freebsd.org/changeset/base/325649 Log: Make local variable 64-bits to avoid masking away bits in mlx5 core. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Nov 10 13:25:29 2017 (r325648) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Nov 10 13:28:23 2017 (r325649) @@ -510,7 +510,7 @@ void mlx5_eq_cleanup(struct mlx5_core_dev *dev) int mlx5_start_eqs(struct mlx5_core_dev *dev) { struct mlx5_eq_table *table = &dev->priv.eq_table; - u32 async_event_mask = MLX5_ASYNC_EVENT_MASK; + u64 async_event_mask = MLX5_ASYNC_EVENT_MASK; int err; if (MLX5_CAP_GEN(dev, port_module_event)) From owner-svn-src-all@freebsd.org Fri Nov 10 13:30:16 2017 Return-Path: Delivered-To: svn-src-all@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 17BE9E6DFCB; Fri, 10 Nov 2017 13:30:16 +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 D8161735A8; Fri, 10 Nov 2017 13:30:15 +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 vAADUEW4001100; Fri, 10 Nov 2017 13:30:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADUEI7001098; Fri, 10 Nov 2017 13:30:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101330.vAADUEI7001098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325650 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 325650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:30:16 -0000 Author: hselasky Date: Fri Nov 10 13:30:14 2017 New Revision: 325650 URL: https://svnweb.freebsd.org/changeset/base/325650 Log: Add const keyword to input-only argument in mlx5 core. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_mad.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Fri Nov 10 13:28:23 2017 (r325649) +++ head/sys/dev/mlx5/driver.h Fri Nov 10 13:30:14 2017 (r325650) @@ -862,7 +862,7 @@ int mlx5_core_dump_fill_mkey(struct mlx5_core_dev *dev u32 *mkey); int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn); int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn); -int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, +int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb, u16 opmod, u8 port); void mlx5_fwp_flush(struct mlx5_fw_page *fwp); void mlx5_fwp_invalidate(struct mlx5_fw_page *fwp); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_mad.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_mad.c Fri Nov 10 13:28:23 2017 (r325649) +++ head/sys/dev/mlx5/mlx5_core/mlx5_mad.c Fri Nov 10 13:30:14 2017 (r325650) @@ -30,7 +30,7 @@ #include #include "mlx5_core.h" -int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb, +int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb, u16 opmod, u8 port) { struct mlx5_mad_ifc_mbox_in *in = NULL; From owner-svn-src-all@freebsd.org Fri Nov 10 13:38:45 2017 Return-Path: Delivered-To: svn-src-all@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 2F061E6E347; Fri, 10 Nov 2017 13:38:45 +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 08B6973A2E; Fri, 10 Nov 2017 13:38:44 +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 vAADciA0005342; Fri, 10 Nov 2017 13:38:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADciwg005340; Fri, 10 Nov 2017 13:38:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101338.vAADciwg005340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325651 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 325651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:38:45 -0000 Author: hselasky Date: Fri Nov 10 13:38:43 2017 New Revision: 325651 URL: https://svnweb.freebsd.org/changeset/base/325651 Log: Set ATOMIC endian mode in mlx5 core. The hardware is capable of 2 requestor endianness modes for standard 8 byte atomics: BE (0x0) and host endianness (0x1). Read the supported modes from hca atomic capabilities and configure HW to host endianness mode if supported. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Fri Nov 10 13:30:14 2017 (r325650) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Fri Nov 10 13:38:43 2017 (r325651) @@ -74,6 +74,11 @@ struct mlx5_device_context { void *context; }; +enum { + MLX5_ATOMIC_REQ_MODE_BE = 0x0, + MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS = 0x1, +}; + static struct mlx5_profile profiles[] = { [0] = { .mask = 0, @@ -393,6 +398,53 @@ query_ex: return err; } +static int handle_hca_cap_atomic(struct mlx5_core_dev *dev) +{ + void *set_ctx; + void *set_hca_cap; + int set_sz = MLX5_ST_SZ_BYTES(set_hca_cap_in); + int req_endianness; + int err; + + if (MLX5_CAP_GEN(dev, atomic)) { + err = mlx5_core_get_caps(dev, MLX5_CAP_ATOMIC, + HCA_CAP_OPMOD_GET_MAX); + if (err) + return err; + + err = mlx5_core_get_caps(dev, MLX5_CAP_ATOMIC, + HCA_CAP_OPMOD_GET_CUR); + if (err) + return err; + } else { + return 0; + } + + req_endianness = + MLX5_CAP_ATOMIC(dev, + supported_atomic_req_8B_endianess_mode_1); + + if (req_endianness != MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS) + return 0; + + set_ctx = kzalloc(set_sz, GFP_KERNEL); + if (!set_ctx) + return -ENOMEM; + + MLX5_SET(set_hca_cap_in, set_ctx, op_mod, + MLX5_SET_HCA_CAP_OP_MOD_ATOMIC << 1); + set_hca_cap = MLX5_ADDR_OF(set_hca_cap_in, set_ctx, capability); + + /* Set requestor to host endianness */ + MLX5_SET(atomic_caps, set_hca_cap, atomic_req_8B_endianess_mode, + MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS); + + err = set_caps(dev, set_ctx, set_sz); + + kfree(set_ctx); + return err; +} + static int set_hca_ctrl(struct mlx5_core_dev *dev) { struct mlx5_reg_host_endianess he_in; @@ -717,15 +769,21 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st goto err_pagealloc_stop; } + err = set_hca_ctrl(dev); + if (err) { + device_printf((&pdev->dev)->bsddev, "ERR: ""set_hca_ctrl failed\n"); + goto reclaim_boot_pages; + } + err = handle_hca_cap(dev); if (err) { device_printf((&pdev->dev)->bsddev, "ERR: ""handle_hca_cap failed\n"); goto reclaim_boot_pages; } - err = set_hca_ctrl(dev); + err = handle_hca_cap_atomic(dev); if (err) { - device_printf((&pdev->dev)->bsddev, "ERR: ""set_hca_ctrl failed\n"); + device_printf((&pdev->dev)->bsddev, "ERR: ""handle_hca_cap_atomic failed\n"); goto reclaim_boot_pages; } Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Fri Nov 10 13:30:14 2017 (r325650) +++ head/sys/dev/mlx5/mlx5_ifc.h Fri Nov 10 13:38:43 2017 (r325651) @@ -74,6 +74,11 @@ enum { }; enum { + MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE = 0x0, + MLX5_SET_HCA_CAP_OP_MOD_ATOMIC = 0x3, +}; + +enum { MLX5_CMD_OP_QUERY_HCA_CAP = 0x100, MLX5_CMD_OP_QUERY_ADAPTER = 0x101, MLX5_CMD_OP_INIT_HCA = 0x102, From owner-svn-src-all@freebsd.org Fri Nov 10 13:40:28 2017 Return-Path: Delivered-To: svn-src-all@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 D2430E6E3EB; Fri, 10 Nov 2017 13:40:28 +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 9F48D73B9C; Fri, 10 Nov 2017 13:40:28 +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 vAADeR8A005537; Fri, 10 Nov 2017 13:40:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADeRjI005536; Fri, 10 Nov 2017 13:40:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101340.vAADeRjI005536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325652 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 325652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:40:28 -0000 Author: hselasky Date: Fri Nov 10 13:40:27 2017 New Revision: 325652 URL: https://svnweb.freebsd.org/changeset/base/325652 Log: Prevent mlx5 core from accessing host memory after shutdown by disabling PCI busmaster. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Fri Nov 10 13:38:43 2017 (r325651) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Fri Nov 10 13:40:27 2017 (r325652) @@ -1134,6 +1134,12 @@ static void remove_one(struct pci_dev *pdev) kfree(dev); } +static void shutdown_one(struct pci_dev *pdev) +{ + /* prevent device from accessing host memory after shutdown */ + pci_clear_master(pdev); +} + static const struct pci_device_id mlx5_core_pci_table[] = { { PCI_VDEVICE(MELLANOX, 4113) }, /* Connect-IB */ { PCI_VDEVICE(MELLANOX, 4114) }, /* Connect-IB VF */ @@ -1175,6 +1181,7 @@ MODULE_DEVICE_TABLE(pci, mlx5_core_pci_table); static struct pci_driver mlx5_core_driver = { .name = DRIVER_NAME, .id_table = mlx5_core_pci_table, + .shutdown = shutdown_one, .probe = init_one, .remove = remove_one }; From owner-svn-src-all@freebsd.org Fri Nov 10 13:44:14 2017 Return-Path: Delivered-To: svn-src-all@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 298A1E6E5F4; Fri, 10 Nov 2017 13:44:14 +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 0421873FAE; Fri, 10 Nov 2017 13:44:13 +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 vAADiDDK009373; Fri, 10 Nov 2017 13:44:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADiDuL009371; Fri, 10 Nov 2017 13:44:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101344.vAADiDuL009371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325653 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 325653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:44:14 -0000 Author: hselasky Date: Fri Nov 10 13:44:12 2017 New Revision: 325653 URL: https://svnweb.freebsd.org/changeset/base/325653 Log: Add API functions to set and query dropless port mode in mlx5 core. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_port.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Fri Nov 10 13:40:27 2017 (r325652) +++ head/sys/dev/mlx5/driver.h Fri Nov 10 13:44:12 2017 (r325653) @@ -966,6 +966,8 @@ int mlx5_core_destroy_psv(struct mlx5_core_dev *dev, i void mlx5_core_put_rsc(struct mlx5_core_rsc_common *common); u8 mlx5_is_wol_supported(struct mlx5_core_dev *dev); int mlx5_set_wol(struct mlx5_core_dev *dev, u8 wol_mode); +int mlx5_set_dropless_mode(struct mlx5_core_dev *dev, u16 timeout); +int mlx5_query_dropless_mode(struct mlx5_core_dev *dev, u16 *timeout); int mlx5_query_wol(struct mlx5_core_dev *dev, u8 *wol_mode); int mlx5_core_access_pvlc(struct mlx5_core_dev *dev, struct mlx5_pvlc_reg *pvlc, int write); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Fri Nov 10 13:40:27 2017 (r325652) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Fri Nov 10 13:44:12 2017 (r325653) @@ -459,6 +459,46 @@ int mlx5_set_wol(struct mlx5_core_dev *dev, u8 wol_mod } EXPORT_SYMBOL_GPL(mlx5_set_wol); +int mlx5_query_dropless_mode(struct mlx5_core_dev *dev, u16 *timeout) +{ + u32 in[MLX5_ST_SZ_DW(query_delay_drop_params_in)]; + u32 out[MLX5_ST_SZ_DW(query_delay_drop_params_out)]; + int err = 0; + + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(query_delay_drop_params_in, in, opcode, + MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS); + + err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out)); + if (err) + return err; + + *timeout = MLX5_GET(query_delay_drop_params_out, out, + delay_drop_timeout); + + return 0; +} +EXPORT_SYMBOL_GPL(mlx5_query_dropless_mode); + +int mlx5_set_dropless_mode(struct mlx5_core_dev *dev, u16 timeout) +{ + u32 in[MLX5_ST_SZ_DW(set_delay_drop_params_in)]; + u32 out[MLX5_ST_SZ_DW(set_delay_drop_params_out)]; + + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(set_delay_drop_params_in, in, opcode, + MLX5_CMD_OP_SET_DELAY_DROP_PARAMS); + MLX5_SET(set_delay_drop_params_in, in, delay_drop_timeout, timeout); + + return mlx5_cmd_exec_check_status(dev, in, sizeof(in), + out, sizeof(out)); +} +EXPORT_SYMBOL_GPL(mlx5_set_dropless_mode); + int mlx5_core_access_pvlc(struct mlx5_core_dev *dev, struct mlx5_pvlc_reg *pvlc, int write) { From owner-svn-src-all@freebsd.org Fri Nov 10 13:50:10 2017 Return-Path: Delivered-To: svn-src-all@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 2C086E6E764; Fri, 10 Nov 2017 13:50: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 04B7D7427C; Fri, 10 Nov 2017 13:50: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 vAADo9sN009859; Fri, 10 Nov 2017 13:50:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADo8m4009857; Fri, 10 Nov 2017 13:50:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101350.vAADo8m4009857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325654 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 325654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:50:10 -0000 Author: hselasky Date: Fri Nov 10 13:50:08 2017 New Revision: 325654 URL: https://svnweb.freebsd.org/changeset/base/325654 Log: Add API functions to modify the transport interface send object, TIS, in mlx5 core. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_transobj.c head/sys/dev/mlx5/mlx5_core/transobj.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_transobj.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_transobj.c Fri Nov 10 13:44:12 2017 (r325653) +++ head/sys/dev/mlx5/mlx5_core/mlx5_transobj.c Fri Nov 10 13:50:08 2017 (r325654) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -208,6 +208,17 @@ int mlx5_core_create_tis(struct mlx5_core_dev *dev, u3 *tisn = MLX5_GET(create_tis_out, out, tisn); return err; +} + +int mlx5_core_modify_tis(struct mlx5_core_dev *dev, u32 tisn, u32 *in, + int inlen) +{ + u32 out[MLX5_ST_SZ_DW(modify_tis_out)] = {0}; + + MLX5_SET(modify_tis_in, in, tisn, tisn); + MLX5_SET(modify_tis_in, in, opcode, MLX5_CMD_OP_MODIFY_TIS); + + return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out)); } void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn) Modified: head/sys/dev/mlx5/mlx5_core/transobj.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/transobj.h Fri Nov 10 13:44:12 2017 (r325653) +++ head/sys/dev/mlx5/mlx5_core/transobj.h Fri Nov 10 13:50:08 2017 (r325654) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -45,6 +45,8 @@ int mlx5_core_create_tir(struct mlx5_core_dev *dev, u3 void mlx5_core_destroy_tir(struct mlx5_core_dev *dev, u32 tirn); int mlx5_core_create_tis(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *tisn); +int mlx5_core_modify_tis(struct mlx5_core_dev *dev, u32 tisn, u32 *in, + int inlen); void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn); int mlx5_core_create_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 *rmpn); int mlx5_core_modify_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen); From owner-svn-src-all@freebsd.org Fri Nov 10 13:53:54 2017 Return-Path: Delivered-To: svn-src-all@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 D89B3E6E987; Fri, 10 Nov 2017 13:53:54 +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 B23E174767; Fri, 10 Nov 2017 13:53:54 +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 vAADrrKO014173; Fri, 10 Nov 2017 13:53:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADrr1F014171; Fri, 10 Nov 2017 13:53:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101353.vAADrr1F014171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325655 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 325655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:53:55 -0000 Author: hselasky Date: Fri Nov 10 13:53:53 2017 New Revision: 325655 URL: https://svnweb.freebsd.org/changeset/base/325655 Log: Add API function to query virtual port counters in mlx5 core. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c head/sys/dev/mlx5/vport.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Fri Nov 10 13:50:08 2017 (r325654) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Fri Nov 10 13:53:53 2017 (r325655) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -965,6 +965,43 @@ int mlx5_nic_vport_disable_roce(struct mlx5_core_dev * return mlx5_nic_vport_enable_disable_roce(mdev, 0); } EXPORT_SYMBOL_GPL(mlx5_nic_vport_disable_roce); + +int mlx5_core_query_vport_counter(struct mlx5_core_dev *dev, u8 other_vport, + int vf, u8 port_num, void *out, + size_t out_sz) +{ + int in_sz = MLX5_ST_SZ_BYTES(query_vport_counter_in); + int is_group_manager; + void *in; + int err; + + is_group_manager = MLX5_CAP_GEN(dev, vport_group_manager); + in = mlx5_vzalloc(in_sz); + if (!in) { + err = -ENOMEM; + return err; + } + + MLX5_SET(query_vport_counter_in, in, opcode, + MLX5_CMD_OP_QUERY_VPORT_COUNTER); + if (other_vport) { + if (is_group_manager) { + MLX5_SET(query_vport_counter_in, in, other_vport, 1); + MLX5_SET(query_vport_counter_in, in, vport_number, vf + 1); + } else { + err = -EPERM; + goto free; + } + } + if (MLX5_CAP_GEN(dev, num_ports) == 2) + MLX5_SET(query_vport_counter_in, in, port_num, port_num); + + err = mlx5_cmd_exec(dev, in, in_sz, out, out_sz); +free: + kvfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_core_query_vport_counter); int mlx5_query_hca_vport_context(struct mlx5_core_dev *mdev, u8 port_num, u8 vport_num, u32 *out, Modified: head/sys/dev/mlx5/vport.h ============================================================================== --- head/sys/dev/mlx5/vport.h Fri Nov 10 13:50:08 2017 (r325654) +++ head/sys/dev/mlx5/vport.h Fri Nov 10 13:53:53 2017 (r325655) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -101,6 +101,9 @@ int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_ u8 *addr); int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev); int mlx5_nic_vport_disable_roce(struct mlx5_core_dev *mdev); +int mlx5_core_query_vport_counter(struct mlx5_core_dev *dev, u8 other_vport, + int vf, u8 port_num, void *out, + size_t out_sz); int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev, u64 *system_image_guid); int mlx5_query_vport_system_image_guid(struct mlx5_core_dev *dev, From owner-svn-src-all@freebsd.org Fri Nov 10 13:56:12 2017 Return-Path: Delivered-To: svn-src-all@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 64DAFE6EA74; Fri, 10 Nov 2017 13:56:12 +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 3F7557491C; Fri, 10 Nov 2017 13:56:12 +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 vAADuBiq014331; Fri, 10 Nov 2017 13:56:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADuBwh014329; Fri, 10 Nov 2017 13:56:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101356.vAADuBwh014329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325656 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 325656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:56:12 -0000 Author: hselasky Date: Fri Nov 10 13:56:11 2017 New Revision: 325656 URL: https://svnweb.freebsd.org/changeset/base/325656 Log: Add API functions to query and modify local loopback of multicast and unicast traffic in mlx5 core. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c head/sys/dev/mlx5/vport.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Fri Nov 10 13:53:53 2017 (r325655) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Fri Nov 10 13:56:11 2017 (r325656) @@ -1485,6 +1485,72 @@ int mlx5_modify_nic_vport_promisc(struct mlx5_core_dev } EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_promisc); +int mlx5_nic_vport_modify_local_lb(struct mlx5_core_dev *mdev, + enum mlx5_local_lb_selection selection, + u8 value) +{ + void *in; + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in); + int err; + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_warn(mdev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(modify_nic_vport_context_in, in, vport_number, 0); + + if (selection == MLX5_LOCAL_MC_LB) { + MLX5_SET(modify_nic_vport_context_in, in, + field_select.disable_mc_local_lb, 1); + MLX5_SET(modify_nic_vport_context_in, in, + nic_vport_context.disable_mc_local_lb, + value); + } else { + MLX5_SET(modify_nic_vport_context_in, in, + field_select.disable_uc_local_lb, 1); + MLX5_SET(modify_nic_vport_context_in, in, + nic_vport_context.disable_uc_local_lb, + value); + } + + err = mlx5_modify_nic_vport_context(mdev, in, inlen); + + kvfree(in); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_nic_vport_modify_local_lb); + +int mlx5_nic_vport_query_local_lb(struct mlx5_core_dev *mdev, + enum mlx5_local_lb_selection selection, + u8 *value) +{ + void *out; + int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out); + int err; + + out = kzalloc(outlen, GFP_KERNEL); + if (!out) + return -ENOMEM; + + err = mlx5_query_nic_vport_context(mdev, 0, out, outlen); + if (err) + goto done; + + if (selection == MLX5_LOCAL_MC_LB) + *value = MLX5_GET(query_nic_vport_context_out, out, + nic_vport_context.disable_mc_local_lb); + else + *value = MLX5_GET(query_nic_vport_context_out, out, + nic_vport_context.disable_uc_local_lb); + +done: + kfree(out); + return err; +} +EXPORT_SYMBOL_GPL(mlx5_nic_vport_query_local_lb); + int mlx5_query_vport_counter(struct mlx5_core_dev *dev, u8 port_num, u16 vport_num, void *out, int out_size) Modified: head/sys/dev/mlx5/vport.h ============================================================================== --- head/sys/dev/mlx5/vport.h Fri Nov 10 13:53:53 2017 (r325655) +++ head/sys/dev/mlx5/vport.h Fri Nov 10 13:56:11 2017 (r325656) @@ -41,7 +41,17 @@ int mlx5_vport_query_q_counter(struct mlx5_core_dev *m int mlx5_vport_query_out_of_rx_buffer(struct mlx5_core_dev *mdev, u16 counter_set_id, u32 *out_of_rx_buffer); +enum mlx5_local_lb_selection { + MLX5_LOCAL_MC_LB, + MLX5_LOCAL_UC_LB +}; +int mlx5_nic_vport_query_local_lb(struct mlx5_core_dev *mdev, + enum mlx5_local_lb_selection selection, + u8 *value); +int mlx5_nic_vport_modify_local_lb(struct mlx5_core_dev *mdev, + enum mlx5_local_lb_selection selection, + u8 value); u8 mlx5_query_vport_state(struct mlx5_core_dev *mdev, u8 opmod, u16 vport); u8 mlx5_query_vport_admin_state(struct mlx5_core_dev *mdev, u8 opmod, u16 vport); From owner-svn-src-all@freebsd.org Fri Nov 10 13:58:50 2017 Return-Path: Delivered-To: svn-src-all@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 B4C50E6EB09; Fri, 10 Nov 2017 13:58:50 +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 81AD574A90; Fri, 10 Nov 2017 13:58:50 +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 vAADwnAa014454; Fri, 10 Nov 2017 13:58:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAADwnb4014452; Fri, 10 Nov 2017 13:58:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101358.vAADwnb4014452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 13:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325657 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 325657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 13:58:50 -0000 Author: hselasky Date: Fri Nov 10 13:58:49 2017 New Revision: 325657 URL: https://svnweb.freebsd.org/changeset/base/325657 Log: Add API function to query port performance counters for infiniband and RoCE traffic in mlx5 core. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c head/sys/dev/mlx5/vport.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Fri Nov 10 13:56:11 2017 (r325656) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Fri Nov 10 13:58:49 2017 (r325657) @@ -1757,3 +1757,25 @@ out: return err; } EXPORT_SYMBOL_GPL(mlx5_query_hca_vport_state); + +int mlx5_core_query_ib_ppcnt(struct mlx5_core_dev *dev, + u8 port_num, void *out, size_t sz) +{ + u32 *in; + int err; + + in = mlx5_vzalloc(sz); + if (!in) { + err = -ENOMEM; + return err; + } + + MLX5_SET(ppcnt_reg, in, local_port, port_num); + + MLX5_SET(ppcnt_reg, in, grp, MLX5_INFINIBAND_PORT_COUNTERS_GROUP); + err = mlx5_core_access_reg(dev, in, sz, out, + sz, MLX5_REG_PPCNT, 0, 0); + + kvfree(in); + return err; +} Modified: head/sys/dev/mlx5/vport.h ============================================================================== --- head/sys/dev/mlx5/vport.h Fri Nov 10 13:56:11 2017 (r325656) +++ head/sys/dev/mlx5/vport.h Fri Nov 10 13:58:49 2017 (r325657) @@ -143,4 +143,6 @@ int mlx5_query_vport_counter(struct mlx5_core_dev *dev void *out, int out_size); int mlx5_get_vport_counters(struct mlx5_core_dev *dev, u8 port_num, struct mlx5_vport_counters *vc); +int mlx5_core_query_ib_ppcnt(struct mlx5_core_dev *dev, + u8 port_num, void *out, size_t sz); #endif /* __MLX5_VPORT_H__ */ From owner-svn-src-all@freebsd.org Fri Nov 10 14:02:13 2017 Return-Path: Delivered-To: svn-src-all@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 D5ECDE6ECDF; Fri, 10 Nov 2017 14:02:13 +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 A2CBB74E2C; Fri, 10 Nov 2017 14:02:13 +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 vAAE2CaH017511; Fri, 10 Nov 2017 14:02:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAE2COG017509; Fri, 10 Nov 2017 14:02:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101402.vAAE2COG017509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 14:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325658 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 325658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 14:02:13 -0000 Author: hselasky Date: Fri Nov 10 14:02:12 2017 New Revision: 325658 URL: https://svnweb.freebsd.org/changeset/base/325658 Log: Make physical address of init segment available in the priv of mlx5 core. This change is needed by mlx5ib(4). Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Fri Nov 10 13:58:49 2017 (r325657) +++ head/sys/dev/mlx5/driver.h Fri Nov 10 14:02:12 2017 (r325658) @@ -590,6 +590,7 @@ struct mlx5_core_dev { struct mlx5_port_caps port_caps[MLX5_MAX_PORTS]; u32 hca_caps_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; u32 hca_caps_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)]; + phys_addr_t iseg_base; struct mlx5_init_seg __iomem *iseg; enum mlx5_device_state state; void (*event) (struct mlx5_core_dev *dev, Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Fri Nov 10 13:58:49 2017 (r325657) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Fri Nov 10 14:02:12 2017 (r325658) @@ -716,8 +716,8 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st goto err_clr_master; } - dev->iseg = ioremap(pci_resource_start(dev->pdev, 0), - sizeof(*dev->iseg)); + dev->iseg_base = pci_resource_start(dev->pdev, 0); + dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg)); if (!dev->iseg) { err = -ENOMEM; device_printf((&pdev->dev)->bsddev, "ERR: ""Failed mapping initialization segment, aborting\n"); From owner-svn-src-all@freebsd.org Fri Nov 10 14:10:43 2017 Return-Path: Delivered-To: svn-src-all@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 F3BF3E6EDB0; Fri, 10 Nov 2017 14:10:42 +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 B28DF75069; Fri, 10 Nov 2017 14:10:42 +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 vAAEAfhB020897; Fri, 10 Nov 2017 14:10:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAEAfJp020894; Fri, 10 Nov 2017 14:10:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101410.vAAEAfJp020894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 14:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325659 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 325659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 14:10:43 -0000 Author: hselasky Date: Fri Nov 10 14:10:41 2017 New Revision: 325659 URL: https://svnweb.freebsd.org/changeset/base/325659 Log: Add support for disabling and enabling RX and TX DMA rings in mlx5en(4). This is useful for supporting setups similar to Netmap. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Nov 10 14:02:12 2017 (r325658) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Nov 10 14:10:41 2017 (r325659) @@ -408,6 +408,8 @@ struct mlx5e_params { m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") \ + m(+1, u64 modify_tx_dma, "modify_tx_dma", "0: Enable TX 1: Disable TX") \ + m(+1, u64 modify_rx_dma, "modify_rx_dma", "0: Enable RX 1: Disable RX") \ m(+1, u64 diag_pci_enable, "diag_pci_enable", "0: Disabled 1: Enabled") \ m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") @@ -837,5 +839,8 @@ int mlx5e_enable_sq(struct mlx5e_sq *, struct mlx5e_sq int mlx5e_modify_sq(struct mlx5e_sq *, int curr_state, int next_state); void mlx5e_disable_sq(struct mlx5e_sq *); void mlx5e_drain_sq(struct mlx5e_sq *); +void mlx5e_modify_tx_dma(struct mlx5e_priv *priv, uint8_t value); +void mlx5e_modify_rx_dma(struct mlx5e_priv *priv, uint8_t value); +void mlx5e_resume_sq(struct mlx5e_sq *sq); #endif /* _MLX5_EN_H_ */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Nov 10 14:02:12 2017 (r325658) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Nov 10 14:10:41 2017 (r325659) @@ -377,6 +377,32 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(modify_tx_dma): + /* check if network interface is opened */ + if (was_opened) { + priv->params_ethtool.modify_tx_dma = + priv->params_ethtool.modify_tx_dma ? 1 : 0; + /* modify tx according to value */ + mlx5e_modify_tx_dma(priv, value != 0); + } else { + /* if closed force enable tx */ + priv->params_ethtool.modify_tx_dma = 0; + } + break; + + case MLX5_PARAM_OFFSET(modify_rx_dma): + /* check if network interface is opened */ + if (was_opened) { + priv->params_ethtool.modify_rx_dma = + priv->params_ethtool.modify_rx_dma ? 1 : 0; + /* modify rx according to value */ + mlx5e_modify_rx_dma(priv, value != 0); + } else { + /* if closed force enable rx */ + priv->params_ethtool.modify_rx_dma = 0; + } + break; + case MLX5_PARAM_OFFSET(diag_pci_enable): priv->params_ethtool.diag_pci_enable = priv->params_ethtool.diag_pci_enable ? 1 : 0; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Nov 10 14:02:12 2017 (r325658) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Nov 10 14:10:41 2017 (r325659) @@ -2928,6 +2928,164 @@ sysctl_firmware(SYSCTL_HANDLER_ARGS) } static void +mlx5e_disable_tx_dma(struct mlx5e_channel *ch) +{ + int i; + + for (i = 0; i < ch->num_tc; i++) + mlx5e_drain_sq(&ch->sq[i]); +} + +static void +mlx5e_reset_sq_doorbell_record(struct mlx5e_sq *sq) +{ + + sq->doorbell.d32[0] = cpu_to_be32(MLX5_OPCODE_NOP); + sq->doorbell.d32[1] = cpu_to_be32(sq->sqn << 8); + mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); + sq->doorbell.d64 = 0; +} + +void +mlx5e_resume_sq(struct mlx5e_sq *sq) +{ + int err; + + /* check if already enabled */ + if (sq->stopped == 0) + return; + + err = mlx5e_modify_sq(sq, MLX5_SQC_STATE_ERR, + MLX5_SQC_STATE_RST); + if (err != 0) { + if_printf(sq->ifp, + "mlx5e_modify_sq() from ERR to RST failed: %d\n", err); + } + + sq->cc = 0; + sq->pc = 0; + + /* reset doorbell prior to moving from RST to RDY */ + mlx5e_reset_sq_doorbell_record(sq); + + err = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RST, + MLX5_SQC_STATE_RDY); + if (err != 0) { + if_printf(sq->ifp, + "mlx5e_modify_sq() from RST to RDY failed: %d\n", err); + } + + mtx_lock(&sq->lock); + sq->cev_next_state = MLX5E_CEV_STATE_INITIAL; + sq->stopped = 0; + mtx_unlock(&sq->lock); + +} + +static void +mlx5e_enable_tx_dma(struct mlx5e_channel *ch) +{ + int i; + + for (i = 0; i < ch->num_tc; i++) + mlx5e_resume_sq(&ch->sq[i]); +} + +static void +mlx5e_disable_rx_dma(struct mlx5e_channel *ch) +{ + struct mlx5e_rq *rq = &ch->rq; + int err; + + mtx_lock(&rq->mtx); + rq->enabled = 0; + callout_stop(&rq->watchdog); + mtx_unlock(&rq->mtx); + + callout_drain(&rq->watchdog); + + err = mlx5e_modify_rq(rq, MLX5_RQC_STATE_RDY, MLX5_RQC_STATE_ERR); + if (err != 0) { + if_printf(rq->ifp, + "mlx5e_modify_rq() from RDY to RST failed: %d\n", err); + } + + while (!mlx5_wq_ll_is_empty(&rq->wq)) { + msleep(1); + rq->cq.mcq.comp(&rq->cq.mcq); + } + + /* + * Transitioning into RST state will allow the FW to track less ERR state queues, + * thus reducing the recv queue flushing time + */ + err = mlx5e_modify_rq(rq, MLX5_RQC_STATE_ERR, MLX5_RQC_STATE_RST); + if (err != 0) { + if_printf(rq->ifp, + "mlx5e_modify_rq() from ERR to RST failed: %d\n", err); + } +} + +static void +mlx5e_enable_rx_dma(struct mlx5e_channel *ch) +{ + struct mlx5e_rq *rq = &ch->rq; + int err; + + rq->wq.wqe_ctr = 0; + mlx5_wq_ll_update_db_record(&rq->wq); + err = mlx5e_modify_rq(rq, MLX5_RQC_STATE_RST, MLX5_RQC_STATE_RDY); + if (err != 0) { + if_printf(rq->ifp, + "mlx5e_modify_rq() from RST to RDY failed: %d\n", err); + } + + rq->enabled = 1; + + rq->cq.mcq.comp(&rq->cq.mcq); +} + +void +mlx5e_modify_tx_dma(struct mlx5e_priv *priv, uint8_t value) +{ + int i; + + if (priv->channel == NULL) + return; + + for (i = 0; i < priv->params.num_channels; i++) { + + if (!priv->channel[i]) + continue; + + if (value) + mlx5e_disable_tx_dma(priv->channel[i]); + else + mlx5e_enable_tx_dma(priv->channel[i]); + } +} + +void +mlx5e_modify_rx_dma(struct mlx5e_priv *priv, uint8_t value) +{ + int i; + + if (priv->channel == NULL) + return; + + for (i = 0; i < priv->params.num_channels; i++) { + + if (!priv->channel[i]) + continue; + + if (value) + mlx5e_disable_rx_dma(priv->channel[i]); + else + mlx5e_enable_rx_dma(priv->channel[i]); + } +} + +static void mlx5e_add_hw_stats(struct mlx5e_priv *priv) { SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_hw), From owner-svn-src-all@freebsd.org Fri Nov 10 14:14:56 2017 Return-Path: Delivered-To: svn-src-all@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 34D72E6EF67; Fri, 10 Nov 2017 14:14:56 +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 0E8E775433; Fri, 10 Nov 2017 14:14:55 +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 vAAEEtlE022561; Fri, 10 Nov 2017 14:14:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAEEsOk022559; Fri, 10 Nov 2017 14:14:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101414.vAAEEsOk022559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 14:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325660 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 325660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 14:14:56 -0000 Author: hselasky Date: Fri Nov 10 14:14:54 2017 New Revision: 325660 URL: https://svnweb.freebsd.org/changeset/base/325660 Log: Add support for configuring local multicast and unicast data traffic loopback in mlx5en(4) driver via the sysctl interface. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Nov 10 14:10:41 2017 (r325659) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Nov 10 14:14:54 2017 (r325660) @@ -411,7 +411,9 @@ struct mlx5e_params { m(+1, u64 modify_tx_dma, "modify_tx_dma", "0: Enable TX 1: Disable TX") \ m(+1, u64 modify_rx_dma, "modify_rx_dma", "0: Enable RX 1: Disable RX") \ m(+1, u64 diag_pci_enable, "diag_pci_enable", "0: Disabled 1: Enabled") \ - m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") + m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") \ + m(+1, u64 mc_local_lb, "mc_local_lb", "0: Local multicast loopback enabled 1: Disabled") \ + m(+1, u64 uc_local_lb, "uc_local_lb", "0: Local unicast loopback enabled 1: Disabled") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Nov 10 14:10:41 2017 (r325659) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Nov 10 14:14:54 2017 (r325660) @@ -421,6 +421,30 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.diag_general_enable); break; + case MLX5_PARAM_OFFSET(mc_local_lb): + priv->params_ethtool.mc_local_lb = + priv->params_ethtool.mc_local_lb ? 1 : 0; + + if (MLX5_CAP_GEN(priv->mdev, disable_local_lb)) { + error = mlx5_nic_vport_modify_local_lb(priv->mdev, + MLX5_LOCAL_MC_LB, priv->params_ethtool.mc_local_lb); + } else { + error = EOPNOTSUPP; + } + break; + + case MLX5_PARAM_OFFSET(uc_local_lb): + priv->params_ethtool.uc_local_lb = + priv->params_ethtool.uc_local_lb ? 1 : 0; + + if (MLX5_CAP_GEN(priv->mdev, disable_local_lb)) { + error = mlx5_nic_vport_modify_local_lb(priv->mdev, + MLX5_LOCAL_UC_LB, priv->params_ethtool.uc_local_lb); + } else { + error = EOPNOTSUPP; + } + break; + default: break; } @@ -731,6 +755,20 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) priv->params_ethtool.hw_lro = priv->params.hw_lro_en; priv->params_ethtool.cqe_zipping = priv->params.cqe_zipping_en; mlx5e_ethtool_sync_tx_completion_fact(priv); + + /* get default values for local loopback, if any */ + if (MLX5_CAP_GEN(priv->mdev, disable_local_lb)) { + int err; + u8 val; + + err = mlx5_nic_vport_query_local_lb(priv->mdev, MLX5_LOCAL_MC_LB, &val); + if (err == 0) + priv->params_ethtool.mc_local_lb = val; + + err = mlx5_nic_vport_query_local_lb(priv->mdev, MLX5_LOCAL_UC_LB, &val); + if (err == 0) + priv->params_ethtool.uc_local_lb = val; + } /* create root node */ node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, From owner-svn-src-all@freebsd.org Fri Nov 10 14:19:24 2017 Return-Path: Delivered-To: svn-src-all@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 13975E6F08A; Fri, 10 Nov 2017 14:19: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 E1F9875638; Fri, 10 Nov 2017 14:19: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 vAAEJM2D022843; Fri, 10 Nov 2017 14:19:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAEJMTQ022840; Fri, 10 Nov 2017 14:19:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101419.vAAEJMTQ022840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 14:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325661 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 325661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 14:19:24 -0000 Author: hselasky Date: Fri Nov 10 14:19:22 2017 New Revision: 325661 URL: https://svnweb.freebsd.org/changeset/base/325661 Log: Expose the current hardware MTU in mlx5en(4) as a separate entry in the sysctl tree. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Nov 10 14:14:54 2017 (r325660) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Nov 10 14:19:22 2017 (r325661) @@ -412,6 +412,7 @@ struct mlx5e_params { m(+1, u64 modify_rx_dma, "modify_rx_dma", "0: Enable RX 1: Disable RX") \ m(+1, u64 diag_pci_enable, "diag_pci_enable", "0: Disabled 1: Enabled") \ m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") \ + m(+1, u64 hw_mtu, "hw_mtu", "Current hardware MTU value") \ m(+1, u64 mc_local_lb, "mc_local_lb", "0: Local multicast loopback enabled 1: Disabled") \ m(+1, u64 uc_local_lb, "uc_local_lb", "0: Local unicast loopback enabled 1: Disabled") Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Nov 10 14:14:54 2017 (r325660) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Nov 10 14:19:22 2017 (r325661) @@ -778,7 +778,8 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) return; for (x = 0; x != MLX5E_PARAMS_NUM; x++) { /* check for read-only parameter */ - if (strstr(mlx5e_params_desc[2 * x], "_max") != NULL) { + if (strstr(mlx5e_params_desc[2 * x], "_max") != NULL || + strstr(mlx5e_params_desc[2 * x], "_mtu") != NULL) { SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, mlx5e_params_desc[2 * x], CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, priv, x, &mlx5e_ethtool_handler, "QU", Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Nov 10 14:14:54 2017 (r325660) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Nov 10 14:19:22 2017 (r325661) @@ -2298,10 +2298,13 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) __func__, sw_mtu, err); return (err); } + + ifp->if_mtu = sw_mtu; err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); if (err) { if_printf(ifp, "Query port MTU, after setting new " "MTU value, failed\n"); + return (err); } else if (MLX5E_HW2SW_MTU(hw_mtu) < sw_mtu) { err = -E2BIG, if_printf(ifp, "Port MTU %d is smaller than " @@ -2311,7 +2314,8 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) if_printf(ifp, "Port MTU %d is bigger than " "ifp mtu %d\n", hw_mtu, sw_mtu); } - ifp->if_mtu = sw_mtu; + priv->params_ethtool.hw_mtu = hw_mtu; + return (err); } From owner-svn-src-all@freebsd.org Fri Nov 10 14:39:04 2017 Return-Path: Delivered-To: svn-src-all@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 D3756E6F5C3; Fri, 10 Nov 2017 14:39:04 +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 9D55675E97; Fri, 10 Nov 2017 14:39:04 +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 vAAEd3WY031479; Fri, 10 Nov 2017 14:39:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAEd3vL031473; Fri, 10 Nov 2017 14:39:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711101439.vAAEd3vL031473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 10 Nov 2017 14:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325662 - in head/sys/dev/mlx5: . mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_ib X-SVN-Commit-Revision: 325662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 14:39:04 -0000 Author: hselasky Date: Fri Nov 10 14:39:03 2017 New Revision: 325662 URL: https://svnweb.freebsd.org/changeset/base/325662 Log: Add more and update existing mlx5 core firmware structure definitions and bits. This change is part of coming ibcore and mlx5ib updates. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/dev/mlx5/qp.h Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Fri Nov 10 14:19:22 2017 (r325661) +++ head/sys/dev/mlx5/device.h Fri Nov 10 14:39:03 2017 (r325662) @@ -100,6 +100,35 @@ __mlx5_mask(typ, fld)) #define MLX5_GET64(typ, p, fld) be64_to_cpu(*((__be64 *)(p) + __mlx5_64_off(typ, fld))) +#define MLX5_GET64_BE(typ, p, fld) (*((__be64 *)(p) +\ + __mlx5_64_off(typ, fld))) + +#define MLX5_GET_BE(type_t, typ, p, fld) ({ \ + type_t tmp; \ + switch (sizeof(tmp)) { \ + case sizeof(u8): \ + tmp = (__force type_t)MLX5_GET(typ, p, fld); \ + break; \ + case sizeof(u16): \ + tmp = (__force type_t)cpu_to_be16(MLX5_GET(typ, p, fld)); \ + break; \ + case sizeof(u32): \ + tmp = (__force type_t)cpu_to_be32(MLX5_GET(typ, p, fld)); \ + break; \ + case sizeof(u64): \ + tmp = (__force type_t)MLX5_GET64_BE(typ, p, fld); \ + break; \ + } \ + tmp; \ + }) + +#define MLX5_BY_PASS_NUM_REGULAR_PRIOS 8 +#define MLX5_BY_PASS_NUM_DONT_TRAP_PRIOS 8 +#define MLX5_BY_PASS_NUM_MULTICAST_PRIOS 1 +#define MLX5_BY_PASS_NUM_PRIOS (MLX5_BY_PASS_NUM_REGULAR_PRIOS +\ + MLX5_BY_PASS_NUM_DONT_TRAP_PRIOS +\ + MLX5_BY_PASS_NUM_MULTICAST_PRIOS) + enum { MLX5_MAX_COMMANDS = 32, MLX5_CMD_DATA_BLOCK_SIZE = 512, @@ -326,6 +355,17 @@ enum { MLX5_CAP_OFF_CMDIF_CSUM = 46, }; +enum { + /* + * Max wqe size for rdma read is 512 bytes, so this + * limits our max_sge_rd as the wqe needs to fit: + * - ctrl segment (16 bytes) + * - rdma segment (16 bytes) + * - scatter elements (16 bytes each) + */ + MLX5_MAX_SGE_RD = (512 - 16 - 16) / 16 +}; + struct mlx5_inbox_hdr { __be16 opcode; u8 rsvd[4]; @@ -648,9 +688,9 @@ enum { }; enum { - CQE_ROCE_L3_HEADER_TYPE_GRH = 0x0, - CQE_ROCE_L3_HEADER_TYPE_IPV6 = 0x1, - CQE_ROCE_L3_HEADER_TYPE_IPV4 = 0x2, + MLX5_CQE_ROCE_L3_HEADER_TYPE_GRH = 0x0, + MLX5_CQE_ROCE_L3_HEADER_TYPE_IPV6 = 0x1, + MLX5_CQE_ROCE_L3_HEADER_TYPE_IPV4 = 0x2, }; enum { @@ -1288,6 +1328,7 @@ enum { MLX5_PER_PRIORITY_COUNTERS_GROUP = 0x10, MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11, MLX5_PHYSICAL_LAYER_COUNTERS_GROUP = 0x12, + MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP = 0x16, MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20, }; Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Fri Nov 10 14:19:22 2017 (r325661) +++ head/sys/dev/mlx5/driver.h Fri Nov 10 14:39:03 2017 (r325662) @@ -306,6 +306,11 @@ struct cmd_msg_cache { }; +struct mlx5_traffic_counter { + u64 packets; + u64 octets; +}; + struct mlx5_cmd_stats { u64 sum; u64 n; @@ -743,6 +748,13 @@ struct mlx5_pas { u8 log_sz; }; +enum port_state_policy { + MLX5_POLICY_DOWN = 0, + MLX5_POLICY_UP = 1, + MLX5_POLICY_FOLLOW = 2, + MLX5_POLICY_INVALID = 0xffffffff +}; + static inline void * mlx5_buf_offset(struct mlx5_buf *buf, int offset) { @@ -809,6 +821,11 @@ static inline void *mlx5_vmalloc(unsigned long size) if (!rtn) rtn = vmalloc(size); return rtn; +} + +static inline u32 mlx5_base_mkey(const u32 key) +{ + return key & 0xffffff00u; } void mlx5_enter_error_state(struct mlx5_core_dev *dev); Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Fri Nov 10 14:19:22 2017 (r325661) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Fri Nov 10 14:39:03 2017 (r325662) @@ -59,13 +59,6 @@ enum { MLX5_IB_CACHE_LINE_SIZE = 64, }; -enum { - MLX5_RQ_NUM_STATE = MLX5_RQC_STATE_ERR + 1, - MLX5_SQ_NUM_STATE = MLX5_SQC_STATE_ERR + 1, - MLX5_QP_STATE = MLX5_QP_NUM_STATE + 1, - MLX5_QP_STATE_BAD = MLX5_QP_STATE + 1, -}; - static const u32 mlx5_ib_opcode[] = { [IB_WR_SEND] = MLX5_OPCODE_SEND, [IB_WR_SEND_WITH_IMM] = MLX5_OPCODE_SEND_IMM, Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Fri Nov 10 14:19:22 2017 (r325661) +++ head/sys/dev/mlx5/mlx5_ifc.h Fri Nov 10 14:39:03 2017 (r325662) @@ -761,7 +761,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_b u8 multi_pkt_send_wqe[0x2]; u8 wqe_inline_mode[0x2]; u8 rss_ind_tbl_cap[0x4]; - u8 reserved_1[0x3]; + u8 scatter_fcs[0x1]; + u8 reserved_1[0x2]; u8 tunnel_lso_const_out_ip_id[0x1]; u8 tunnel_lro_gre[0x1]; u8 tunnel_lro_vxlan[0x1]; @@ -1050,10 +1051,12 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 cd[0x1]; u8 atm[0x1]; u8 apm[0x1]; - u8 reserved_32[0x7]; + u8 imaicl[0x1]; + u8 reserved_32[0x6]; u8 qkv[0x1]; u8 pkv[0x1]; - u8 reserved_33[0x4]; + u8 set_deth_sqpn[0x1]; + u8 reserved_33[0x3]; u8 xrc[0x1]; u8 ud[0x1]; u8 uc[0x1]; @@ -1805,7 +1808,7 @@ enum { struct mlx5_ifc_qpc_bits { u8 state[0x4]; - u8 reserved_0[0x4]; + u8 lag_tx_port_affinity[0x4]; u8 st[0x8]; u8 reserved_1[0x3]; u8 pm_state[0x2]; @@ -1867,8 +1870,11 @@ struct mlx5_ifc_qpc_bits { u8 reserved_16[0x8]; u8 cqn_snd[0x18]; - u8 reserved_17[0x40]; + u8 reserved_at_400[0x8]; + u8 deth_sqpn[0x18]; + u8 reserved_17[0x20]; + u8 reserved_18[0x8]; u8 last_acked_psn[0x18]; @@ -2065,7 +2071,11 @@ struct mlx5_ifc_traffic_counter_bits { }; struct mlx5_ifc_tisc_bits { - u8 reserved_0[0xc]; + u8 strict_lag_tx_port_affinity[0x1]; + u8 reserved_at_1[0x3]; + u8 lag_tx_port_affinity[0x04]; + + u8 reserved_at_8[0x4]; u8 prio[0x4]; u8 reserved_1[0x10]; @@ -4662,30 +4672,29 @@ struct mlx5_ifc_query_flow_group_in_bits { struct mlx5_ifc_query_flow_counter_out_bits { u8 status[0x8]; - u8 reserved_0[0x18]; + u8 reserved_at_8[0x18]; u8 syndrome[0x20]; - u8 reserved_1[0x40]; + u8 reserved_at_40[0x40]; - struct mlx5_ifc_traffic_counter_bits flow_statistics; - - u8 reserved_2[0x700]; + struct mlx5_ifc_traffic_counter_bits flow_statistics[0]; }; struct mlx5_ifc_query_flow_counter_in_bits { u8 opcode[0x10]; - u8 reserved_0[0x10]; + u8 reserved_at_10[0x10]; - u8 reserved_1[0x10]; + u8 reserved_at_20[0x10]; u8 op_mod[0x10]; - u8 reserved_2[0x80]; + u8 reserved_at_40[0x80]; u8 clear[0x1]; - u8 reserved_3[0x1f]; + u8 reserved_at_c1[0xf]; + u8 num_of_counters[0x10]; - u8 reserved_4[0x10]; + u8 reserved_at_e0[0x10]; u8 flow_counter_id[0x10]; }; @@ -5111,6 +5120,15 @@ struct mlx5_ifc_modify_tis_out_bits { u8 reserved_1[0x40]; }; +struct mlx5_ifc_modify_tis_bitmask_bits { + u8 reserved_at_0[0x20]; + + u8 reserved_at_20[0x1d]; + u8 lag_tx_port_affinity[0x1]; + u8 strict_lag_tx_port_affinity[0x1]; + u8 prio[0x1]; +}; + struct mlx5_ifc_modify_tis_in_bits { u8 opcode[0x10]; u8 reserved_0[0x10]; @@ -5123,7 +5141,7 @@ struct mlx5_ifc_modify_tis_in_bits { u8 reserved_3[0x20]; - u8 modify_bitmask[0x40]; + struct mlx5_ifc_modify_tis_bitmask_bits bitmask; u8 reserved_4[0x40]; @@ -5271,12 +5289,9 @@ struct mlx5_ifc_modify_rq_out_bits { u8 reserved_1[0x40]; }; -struct mlx5_ifc_rq_bitmask_bits { - u8 reserved[0x20]; - - u8 reserved1[0x1e]; - u8 vlan_strip_disable[0x1]; - u8 reserved2[0x1]; +enum { + MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_VSD = 1ULL << 1, + MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_MODIFY_RQ_COUNTER_SET_ID = 1ULL << 3, }; struct mlx5_ifc_modify_rq_in_bits { @@ -5292,7 +5307,7 @@ struct mlx5_ifc_modify_rq_in_bits { u8 reserved_3[0x20]; - struct mlx5_ifc_rq_bitmask_bits bitmask; + u8 modify_bitmask[0x40]; u8 reserved_4[0x40]; @@ -8131,6 +8146,36 @@ struct mlx5_ifc_phys_layer_cntrs_bits { u8 successful_recovery_events[0x20]; u8 reserved_0[0x180]; +}; + +struct mlx5_ifc_ib_port_cntrs_grp_data_layout_bits { + u8 symbol_error_counter[0x10]; + + u8 link_error_recovery_counter[0x8]; + + u8 link_downed_counter[0x8]; + + u8 port_rcv_errors[0x10]; + + u8 port_rcv_remote_physical_errors[0x10]; + + u8 port_rcv_switch_relay_errors[0x10]; + + u8 port_xmit_discards[0x10]; + + u8 port_xmit_constraint_errors[0x8]; + + u8 port_rcv_constraint_errors[0x8]; + + u8 reserved_at_70[0x8]; + + u8 link_overrun_errors[0x8]; + + u8 reserved_at_80[0x10]; + + u8 vl_15_dropped[0x10]; + + u8 reserved_at_a0[0xa0]; }; struct mlx5_ifc_phys_layer_statistical_cntrs_bits { Modified: head/sys/dev/mlx5/qp.h ============================================================================== --- head/sys/dev/mlx5/qp.h Fri Nov 10 14:19:22 2017 (r325661) +++ head/sys/dev/mlx5/qp.h Fri Nov 10 14:39:03 2017 (r325662) @@ -28,9 +28,7 @@ #ifndef MLX5_QP_H #define MLX5_QP_H -#include #include -#include #define MLX5_INVALID_LKEY 0x100 #define MLX5_SIG_WQE_SIZE (MLX5_SEND_WQE_BB * 5) @@ -45,6 +43,7 @@ #define MLX5_BSF_REPEAT_BLOCK (1 << 7) #define MLX5_BSF_APPTAG_ESCAPE 0x1 #define MLX5_BSF_APPREF_ESCAPE 0x2 +#define MLX5_WQE_DS_UNITS 16 enum mlx5_qp_optpar { MLX5_QP_OPTPAR_ALT_ADDR_PATH = 1 << 0, @@ -78,10 +77,19 @@ enum mlx5_qp_state { MLX5_QP_STATE_ERR = 6, MLX5_QP_STATE_SQ_DRAINING = 7, MLX5_QP_STATE_SUSPENDED = 9, - MLX5_QP_NUM_STATE + MLX5_QP_NUM_STATE, + MLX5_QP_STATE, + MLX5_QP_STATE_BAD, }; enum { + MLX5_SQ_STATE_NA = MLX5_SQC_STATE_ERR + 1, + MLX5_SQ_NUM_STATE = MLX5_SQ_STATE_NA + 1, + MLX5_RQ_STATE_NA = MLX5_RQC_STATE_ERR + 1, + MLX5_RQ_NUM_STATE = MLX5_RQ_STATE_NA + 1, +}; + +enum { MLX5_QP_ST_RC = 0x0, MLX5_QP_ST_UC = 0x1, MLX5_QP_ST_UD = 0x2, @@ -157,6 +165,7 @@ enum { enum { MLX5_FENCE_MODE_NONE = 0 << 5, MLX5_FENCE_MODE_INITIATOR_SMALL = 1 << 5, + MLX5_FENCE_MODE_FENCE = 2 << 5, MLX5_FENCE_MODE_STRONG_ORDERING = 3 << 5, MLX5_FENCE_MODE_SMALL_AND_FENCE = 4 << 5, }; @@ -198,6 +207,8 @@ struct mlx5_wqe_ctrl_seg { __be32 imm; }; +#define MLX5_WQE_CTRL_DS_MASK 0x3f + enum { MLX5_MLX_FLAG_MASK_VL15 = 0x40, MLX5_MLX_FLAG_MASK_SLR = 0x20, @@ -221,10 +232,10 @@ enum { }; enum { - MLX5_ETH_WQE_SWP_OUTER_L3_TYPE = 1 << 0, - MLX5_ETH_WQE_SWP_OUTER_L4_TYPE = 1 << 1, - MLX5_ETH_WQE_SWP_INNER_L3_TYPE = 1 << 4, - MLX5_ETH_WQE_SWP_INNER_L4_TYPE = 1 << 5, + MLX5_ETH_WQE_SWP_INNER_L3_TYPE = 1 << 0, + MLX5_ETH_WQE_SWP_INNER_L4_TYPE = 1 << 1, + MLX5_ETH_WQE_SWP_OUTER_L3_TYPE = 1 << 4, + MLX5_ETH_WQE_SWP_OUTER_L4_TYPE = 1 << 5, }; struct mlx5_wqe_eth_seg { @@ -415,6 +426,42 @@ struct mlx5_stride_block_ctrl_seg { __be16 num_entries; }; +enum mlx5_pagefault_flags { + MLX5_PFAULT_REQUESTOR = 1 << 0, + MLX5_PFAULT_WRITE = 1 << 1, + MLX5_PFAULT_RDMA = 1 << 2, +}; + +/* Contains the details of a pagefault. */ +struct mlx5_pagefault { + u32 bytes_committed; + u8 event_subtype; + enum mlx5_pagefault_flags flags; + union { + /* Initiator or send message responder pagefault details. */ + struct { + /* Received packet size, only valid for responders. */ + u32 packet_size; + /* + * WQE index. Refers to either the send queue or + * receive queue, according to event_subtype. + */ + u16 wqe_index; + } wqe; + /* RDMA responder pagefault details */ + struct { + u32 r_key; + /* + * Received packet size, minimal size page fault + * resolution required for forward progress. + */ + u32 packet_size; + u32 rdma_op_len; + u64 rdma_va; + } rdma; + }; +}; + struct mlx5_core_qp { struct mlx5_core_rsc_common common; /* must be first */ void (*event) (struct mlx5_core_qp *, int); @@ -462,7 +509,8 @@ struct mlx5_qp_context { u8 reserved2[4]; __be32 next_send_psn; __be32 cqn_send; - u8 reserved3[8]; + __be32 deth_sqpn; + u8 reserved3[4]; __be32 last_acked_psn; __be32 ssn; __be32 params2; From owner-svn-src-all@freebsd.org Fri Nov 10 14:53:17 2017 Return-Path: Delivered-To: svn-src-all@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 CB647E6FC79; Fri, 10 Nov 2017 14:53:17 +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 A356576960; Fri, 10 Nov 2017 14:53:17 +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 vAAErGIW039653; Fri, 10 Nov 2017 14:53:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAErGEN039649; Fri, 10 Nov 2017 14:53:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711101453.vAAErGEN039649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 10 Nov 2017 14:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325664 - in head/usr.sbin: jail jexec X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/usr.sbin: jail jexec X-SVN-Commit-Revision: 325664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 14:53:17 -0000 Author: emaste Date: Fri Nov 10 14:53:16 2017 New Revision: 325664 URL: https://svnweb.freebsd.org/changeset/base/325664 Log: Strip EOL whitespace in usr.sbin/{jail,jexec} Modified: head/usr.sbin/jail/command.c head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.c head/usr.sbin/jexec/jexec.c Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Fri Nov 10 14:46:50 2017 (r325663) +++ head/usr.sbin/jail/command.c Fri Nov 10 14:53:16 2017 (r325664) @@ -432,7 +432,7 @@ run_command(struct cfjail *j) argv[argc] = down ? "-alias" : "alias"; argv[argc + 1] = NULL; - break; + break; #endif case IP_VNET_INTERFACE: @@ -603,13 +603,13 @@ run_command(struct cfjail *j) bg = 1; } comcs = alloca(comstring->len + 1); - strcpy(comcs, comstring->s); + strcpy(comcs, comstring->s); argc = 0; for (cs = strtok(comcs, " \t\f\v\r\n"); cs; cs = strtok(NULL, " \t\f\v\r\n")) argc++; argv = alloca((argc + 1) * sizeof(char *)); - strcpy(comcs, comstring->s); + strcpy(comcs, comstring->s); argc = 0; for (cs = strtok(comcs, " \t\f\v\r\n"); cs; cs = strtok(NULL, " \t\f\v\r\n")) Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Fri Nov 10 14:46:50 2017 (r325663) +++ head/usr.sbin/jail/jail.8 Fri Nov 10 14:53:16 2017 (r325664) @@ -483,7 +483,7 @@ and uname -K. Some restrictions of the jail environment may be set on a per-jail basis. With the exception of -.Va allow.set_hostname +.Va allow.set_hostname and .Va allow.reserved_ports , these boolean parameters are off by default. @@ -614,7 +614,7 @@ Sockets within a jail are normally restricted to IPv4, (UNIX), and route. This allows access to other protocol stacks that have not had jail functionality added to them. .It Va allow.reserved_ports -The jail root may bind to ports lower than 1024. +The jail root may bind to ports lower than 1024. .El .El .Pp Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Fri Nov 10 14:46:50 2017 (r325663) +++ head/usr.sbin/jail/jail.c Fri Nov 10 14:53:16 2017 (r325664) @@ -94,7 +94,7 @@ static const enum intparam startcommands[] = { IP_MOUNT_DEVFS, IP_MOUNT_FDESCFS, IP_MOUNT_PROCFS, - IP_EXEC_PRESTART, + IP_EXEC_PRESTART, IP__OP, IP_VNET_INTERFACE, IP_EXEC_START, @@ -269,7 +269,7 @@ main(int argc, char **argv) &sysval, &sysvallen, NULL, 0) == 0) add_param(NULL, NULL, perm_sysctl[pi].ipnum, - (sysval ? 1 : 0) ^ + (sysval ? 1 : 0) ^ perm_sysctl[pi].rev ? NULL : "false"); } Modified: head/usr.sbin/jexec/jexec.c ============================================================================== --- head/usr.sbin/jexec/jexec.c Fri Nov 10 14:46:50 2017 (r325663) +++ head/usr.sbin/jexec/jexec.c Fri Nov 10 14:53:16 2017 (r325664) @@ -187,5 +187,5 @@ usage(void) fprintf(stderr, "%s\n", "usage: jexec [-l] [-u username | -U username] jail [command ...]"); - exit(1); + exit(1); } From owner-svn-src-all@freebsd.org Fri Nov 10 17:01:52 2017 Return-Path: Delivered-To: svn-src-all@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 9CA59E721DF; Fri, 10 Nov 2017 17:01:52 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 69AF17AD86; Fri, 10 Nov 2017 17:01:52 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAAH1pNk093936; Fri, 10 Nov 2017 17:01:51 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAH1pZK093932; Fri, 10 Nov 2017 17:01:51 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201711101701.vAAH1pZK093932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 10 Nov 2017 17:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325667 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 325667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 17:01:52 -0000 Author: scottl Date: Fri Nov 10 17:01:51 2017 New Revision: 325667 URL: https://svnweb.freebsd.org/changeset/base/325667 Log: Refactoring the interrupt setup code introduced a bug where the drivers would attempt to re-allocate interrupts during a chip reset without first de-allocating them. Doing that right is going to be tricky, so just band-aid it for now so that a re-init doesn't guarantee a failure due to resource re-use. Reported by: gallatin Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mps/mps.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Fri Nov 10 15:28:17 2017 (r325666) +++ head/sys/dev/mpr/mpr.c Fri Nov 10 17:01:51 2017 (r325667) @@ -677,7 +677,11 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at return (error); } - if ((error = mpr_pci_setup_interrupts(sc)) != 0) { + /* + * XXX If the number of MSI-X vectors changes during re-init, this + * won't see it and adjust. + */ + if (attaching && (error = mpr_pci_setup_interrupts(sc)) != 0) { mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Failed to setup interrupts\n"); mpr_free(sc); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Nov 10 15:28:17 2017 (r325666) +++ head/sys/dev/mps/mps.c Fri Nov 10 17:01:51 2017 (r325667) @@ -665,7 +665,11 @@ mps_iocfacts_allocate(struct mps_softc *sc, uint8_t at return (error); } - if ((error = mps_pci_setup_interrupts(sc)) != 0) { + /* + * XXX If the number of MSI-X vectors changes during re-init, this + * won't see it and adjust. + */ + if (attaching && (error = mps_pci_setup_interrupts(sc)) != 0) { mps_dprint(sc, MPS_INIT|MPS_FAULT, "Failed to setup " "interrupts\n"); mps_free(sc); From owner-svn-src-all@freebsd.org Fri Nov 10 17:54:41 2017 Return-Path: Delivered-To: svn-src-all@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 BD137E7310D; Fri, 10 Nov 2017 17:54:41 +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 434D67C78E; Fri, 10 Nov 2017 17:54:41 +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 vAAHsexI017967; Fri, 10 Nov 2017 17:54:40 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAHscOs017947; Fri, 10 Nov 2017 17:54:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201711101754.vAAHscOs017947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 10 Nov 2017 17:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r325668 - in vendor-sys/acpica/dist: . generate/unix generate/unix/acpiexec source/common source/compiler source/components/debugger source/components/dispatcher source/components/event... X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-sys/acpica/dist: . generate/unix generate/unix/acpiexec source/common source/compiler source/components/debugger source/components/dispatcher source/components/events source/components/names... X-SVN-Commit-Revision: 325668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 17:54:41 -0000 Author: jkim Date: Fri Nov 10 17:54:38 2017 New Revision: 325668 URL: https://svnweb.freebsd.org/changeset/base/325668 Log: Import ACPICA 20171110. Added: vendor-sys/acpica/dist/source/tools/acpiexec/aeinstall.c (contents, props changed) vendor-sys/acpica/dist/source/tools/acpiexec/aetests.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/Makefile.config vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/dttable2.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/components/debugger/dbexec.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/namespace/nsconvert.c vendor-sys/acpica/dist/source/components/namespace/nsnames.c vendor-sys/acpica/dist/source/components/parser/psargs.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/uterror.c vendor-sys/acpica/dist/source/components/utilities/utmutex.c vendor-sys/acpica/dist/source/components/utilities/utstrsuppt.c vendor-sys/acpica/dist/source/components/utilities/uttrack.c vendor-sys/acpica/dist/source/components/utilities/utxferror.c vendor-sys/acpica/dist/source/include/acdebug.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/source/tools/acpixtract/acpixtract.h vendor-sys/acpica/dist/source/tools/acpixtract/axmain.c vendor-sys/acpica/dist/source/tools/acpixtract/axutils.c vendor-sys/acpica/dist/source/tools/examples/examples.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/changes.txt Fri Nov 10 17:54:38 2017 (r325668) @@ -1,4 +1,57 @@ ---------------------------------------- +10 November 2017. Summary of changes for version 20171110: + + +1) ACPICA kernel-resident subsystem: + +This release implements full support for ACPI 6.2A: + NFIT - Added a new subtable, "Platform Capabilities Structure" +No other changes to ACPICA were required, since ACPI 6.2A is primarily an +errata release of the specification. + +Other ACPI table changes: + IORT: Added the SMMUv3 Device ID mapping index. Hanjun Guo + PPTT: Added cache attribute flag definitions to actbl1.h. Jeremy +Linton + +Utilities: Modified the string/integer conversion functions to use +internal 64-bit divide support instead of a native divide. On 32-bit +platforms, a 64-bit divide typically requires a library function which +may not be present in the build (kernel or otherwise). + +Implemented a targeted error message for timeouts returned from the +Embedded Controller device driver. This is seen frequently enough to +special-case an AE_TIME returned from an EC operation region access: + "Timeout from EC hardware or EC device driver" + +Changed the "ACPI Exception" message prefix to "ACPI Error" so that all +runtime error messages have the identical prefix. + + +2) iASL Compiler/Disassembler and Tools: + +AcpiXtract: Fixed a problem with table header detection within the +acpidump file. Processing a table could be ended early if a 0x40 (@) +appears in the original binary table, resulting in the @ symbol appearing +in the decoded ASCII field at the end of the acpidump text line. The +symbol caused acpixtract to incorrectly think it had reached the end of +the current table and the beginning of a new table. + +AcpiXtract: Added an option (-f) to ignore some errors during table +extraction. This initial implementation ignores non-ASCII and non- +printable characters found in the acpidump text file. + +TestSuite(ASLTS)/AcpiExec: Fixed and restored the memory usage statistics +for ASLTS. This feature is used to track memory allocations from +different memory caches within the ACPICA code. At the end of an ASLTS +run, these memory statistics are recorded and stored in a log file. + +Debugger (user-space version): Implemented a simple "Background" command. +Creates a new thread to execute a control method in the background, while +control returns to the debugger prompt to allow additional commands. + Syntax: Background [Arguments] + +---------------------------------------- 29 September 2017. Summary of changes for version 20170929: Modified: vendor-sys/acpica/dist/generate/unix/Makefile.config ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.config Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/generate/unix/Makefile.config Fri Nov 10 17:54:38 2017 (r325668) @@ -35,7 +35,7 @@ .SUFFIXES : PROGS = acpibin acpidump acpiexamples acpiexec acpihelp acpinames acpisrc acpixtract iasl HOST ?= _CYGWIN -CC = gcc +CC ?= gcc # # Common defines Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Fri Nov 10 17:54:38 2017 (r325668) @@ -45,9 +45,11 @@ OBJECTS = \ $(OBJDIR)/aeexception.o\ $(OBJDIR)/aehandlers.o\ $(OBJDIR)/aeinitfile.o\ + $(OBJDIR)/aeinstall.o\ $(OBJDIR)/aemain.o\ $(OBJDIR)/aeregion.o\ $(OBJDIR)/aetables.o\ + $(OBJDIR)/aetests.o\ $(OBJDIR)/ahids.o\ $(OBJDIR)/ahuuids.o\ $(OBJDIR)/cmfsize.o\ Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/common/dmtable.c Fri Nov 10 17:54:38 2017 (r325668) @@ -356,6 +356,7 @@ static const char *AcpiDmNfitSubnames[] = "NVDIMM Control Region", /* ACPI_NFIT_TYPE_CONTROL_REGION */ "NVDIMM Block Data Window Region", /* ACPI_NFIT_TYPE_DATA_REGION */ "Flush Hint Address", /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */ + "Platform Capabilities", /* ACPI_NFIT_TYPE_CAPABILITIES */ "Unknown Subtable Type" /* Reserved */ }; Modified: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Fri Nov 10 17:54:38 2017 (r325668) @@ -3061,6 +3061,11 @@ AcpiDmDumpNfit ( FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64); break; + case ACPI_NFIT_TYPE_CAPABILITIES: /* ACPI 6.0A */ + + InfoTable = AcpiDmTableInfoNfit7; + break; + default: AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n", Subtable->Type); Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Fri Nov 10 17:54:38 2017 (r325668) @@ -336,6 +336,7 @@ #define ACPI_NFIT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CONTROL_REGION,f) #define ACPI_NFIT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_DATA_REGION,f) #define ACPI_NFIT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_FLUSH_ADDRESS,f) +#define ACPI_NFIT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CAPABILITIES,f) #define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) #define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f) #define ACPI_PCCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f) @@ -419,6 +420,7 @@ #define ACPI_NFIT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_SYSTEM_ADDRESS,f,o) #define ACPI_NFIT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_MEMORY_MAP,f,o) #define ACPI_NFIT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CONTROL_REGION,f,o) +#define ACPI_NFIT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CAPABILITIES,f,o) #define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o) #define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o) #define ACPI_PCCT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f,o) @@ -1861,6 +1863,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] = {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0}, {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_IORT4_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (IdMappingIndex), "Device ID Mapping Index", 0}, ACPI_DMT_TERMINATOR }; @@ -2561,6 +2564,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6[] = ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[] = { {ACPI_DMT_UINT64, 0, "Hint Address", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoNfit7[] = +{ + {ACPI_DMT_UINT8, ACPI_NFIT7_OFFSET (HighestCapability), "Highest Capability", 0}, + {ACPI_DMT_UINT24, ACPI_NFIT7_OFFSET (Reserved[0]), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Capabilities), "Capabilities (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Cache Flush to NVDIMM", 0}, + {ACPI_DMT_FLAG1, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Flush to MVDIMM", 0}, + {ACPI_DMT_FLAG2, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Mirroring", 0}, + {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; Modified: vendor-sys/acpica/dist/source/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asldefine.h Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/compiler/asldefine.h Fri Nov 10 17:54:38 2017 (r325668) @@ -162,7 +162,7 @@ #define ASL_CREATOR_ID "INTL" #define ASL_DEFINE "__IASL__" #define ASL_PREFIX "iASL: " -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.2" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.2A" /* Configuration constants */ Modified: vendor-sys/acpica/dist/source/compiler/dttable2.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dttable2.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/compiler/dttable2.c Fri Nov 10 17:54:38 2017 (r325668) @@ -697,6 +697,11 @@ DtCompileNfit ( InfoTable = AcpiDmTableInfoNfit6; break; + case ACPI_NFIT_TYPE_CAPABILITIES: + + InfoTable = AcpiDmTableInfoNfit7; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT"); @@ -740,7 +745,6 @@ DtCompileNfit ( } Interleave->LineCount = Count; - DtPopSubtable (); break; case ACPI_NFIT_TYPE_SMBIOS: @@ -786,7 +790,6 @@ DtCompileNfit ( } Hint->HintCount = (UINT16) Count; - DtPopSubtable (); break; default: Modified: vendor-sys/acpica/dist/source/compiler/dttemplate.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/dttemplate.h Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/compiler/dttemplate.h Fri Nov 10 17:54:38 2017 (r325668) @@ -696,53 +696,56 @@ const unsigned char TemplateHpet[] = const unsigned char TemplateIort[] = { - 0x49,0x4F,0x52,0x54,0x74,0x01,0x00,0x00, /* 00000000 "IORTt..." */ - 0x00,0xD2,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ - 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x49,0x4F,0x52,0x54,0x90,0x01,0x00,0x00, /* 00000000 "IORT...." */ + 0x00,0x5F,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "._INTEL " */ + 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x19,0x01,0x17,0x20,0x05,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x31,0x08,0x17,0x20,0x05,0x00,0x00,0x00, /* 00000020 "1.. ...." */ 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "4......." */ 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */ - 0x00,0x00,0x00,0x00,0x01,0x44,0x00,0x00, /* 00000048 ".....D.." */ + 0x00,0x00,0x00,0x00,0x01,0x58,0x00,0x00, /* 00000048 ".....X.." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000050 "........" */ - 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "0......." */ + 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "D......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x5C,0x5F,0x53,0x42,0x2E,0x50,0x43, /* 00000068 ".\_SB.PC" */ 0x49,0x30,0x2E,0x44,0x45,0x56,0x30,0x00, /* 00000070 "I0.DEV0." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ - 0x02,0x34,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 ".4......" */ - 0x01,0x00,0x00,0x00,0x20,0x00,0x00,0x00, /* 00000098 ".... ..." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x00,0x00,0x00,0x00,0x02,0x34,0x00,0x00, /* 000000A0 ".....4.." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000A8 "........" */ + 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 " ......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ - 0x00,0x00,0x00,0x00,0x03,0x60,0x00,0x00, /* 000000C0 ".....`.." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000C8 "........" */ - 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "L......." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ - 0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00, /* 000000E8 "....<..." */ - 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000F0 "....L..." */ - 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000F8 "....L..." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */ + 0x03,0x60,0x00,0x01,0x00,0x00,0x00,0x00, /* 000000D8 ".`......" */ + 0x01,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000E0 "....L..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ + 0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "<......." */ + 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "L......." */ + 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "L......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ - 0x00,0x00,0x00,0x00,0x04,0x50,0x00,0x00, /* 00000120 ".....P.." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000128 "........" */ - 0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "<......." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ + 0x04,0x58,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000138 ".X......" */ + 0x01,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 00000140 "....D..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */ - 0x00,0x00,0x00,0x00 /* 00000170 "...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000170 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000188 "........" */ }; const unsigned char TemplateIvrs[] = @@ -939,11 +942,11 @@ const unsigned char TemplateMsct[] = const unsigned char TemplateNfit[] = { - 0x4E,0x46,0x49,0x54,0x70,0x01,0x00,0x00, /* 00000000 "NFITp..." */ - 0x01,0x53,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".SINTEL " */ + 0x4E,0x46,0x49,0x54,0x80,0x01,0x00,0x00, /* 00000000 "NFIT...." */ + 0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x29,0x09,0x17,0x20,0x00,0x00,0x00,0x00, /* 00000020 ").. ...." */ 0x00,0x00,0x38,0x00,0x01,0x00,0x00,0x00, /* 00000028 "..8....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x30,0x05,0xAF,0x91,0x86,0x5D,0x0E,0x47, /* 00000038 "0....].G" */ @@ -984,7 +987,9 @@ const unsigned char TemplateNfit[] = 0x06,0x00,0x20,0x00,0x01,0x00,0x00,0x00, /* 00000150 ".. ....." */ 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x18,0x04,0x00,0x00,0x00, /* 00000160 "........" */ - 0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00 /* 00000168 "........" */ + 0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00, /* 00000168 "........" */ + 0x07,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000170 "........" */ + 0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000178 "........" */ }; const unsigned char TemplateMtmr[] = Modified: vendor-sys/acpica/dist/source/components/debugger/dbexec.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbexec.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/debugger/dbexec.c Fri Nov 10 17:54:38 2017 (r325668) @@ -187,7 +187,11 @@ AcpiDbExecutionWalk ( void *Context, void **ReturnValue); +static void ACPI_SYSTEM_XFACE +AcpiDbSingleExecutionThread ( + void *Context); + /******************************************************************************* * * FUNCTION: AcpiDbDeleteObjects @@ -366,7 +370,7 @@ AcpiDbExecuteSetup ( ACPI_FUNCTION_NAME (DbExecuteSetup); - /* Catenate the current scope to the supplied name */ + /* Concatenate the current scope to the supplied name */ Info->Pathname[0] = 0; if ((Info->Name[0] != '\\') && @@ -786,6 +790,124 @@ AcpiDbMethodThread ( AcpiFormatException (Status)); } } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbSingleExecutionThread + * + * PARAMETERS: Context - Method info struct + * + * RETURN: None + * + * DESCRIPTION: Create one thread and execute a method + * + ******************************************************************************/ + +static void ACPI_SYSTEM_XFACE +AcpiDbSingleExecutionThread ( + void *Context) +{ + ACPI_DB_METHOD_INFO *Info = Context; + ACPI_STATUS Status; + ACPI_BUFFER ReturnObj; + + + AcpiOsPrintf ("\n"); + + Status = AcpiDbExecuteMethod (Info, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("%s During evaluation of %s\n", + AcpiFormatException (Status), Info->Pathname); + return; + } + + /* Display a return object, if any */ + + if (ReturnObj.Length) + { + AcpiOsPrintf ("Evaluation of %s returned object %p, " + "external buffer length %X\n", + AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer, + (UINT32) ReturnObj.Length); + + AcpiDbDumpExternalObject (ReturnObj.Pointer, 1); + } + + AcpiOsPrintf ("\nBackground thread completed\n%c ", + ACPI_DEBUGGER_COMMAND_PROMPT); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbCreateExecutionThread + * + * PARAMETERS: MethodNameArg - Control method to execute + * Arguments - Array of arguments to the method + * Types - Corresponding array of object types + * + * RETURN: None + * + * DESCRIPTION: Create a single thread to evaluate a namespace object. Handles + * arguments passed on command line for control methods. + * + ******************************************************************************/ + +void +AcpiDbCreateExecutionThread ( + char *MethodNameArg, + char **Arguments, + ACPI_OBJECT_TYPE *Types) +{ + ACPI_STATUS Status; + UINT32 i; + + + memset (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); + AcpiGbl_DbMethodInfo.Name = MethodNameArg; + AcpiGbl_DbMethodInfo.InitArgs = 1; + AcpiGbl_DbMethodInfo.Args = AcpiGbl_DbMethodInfo.Arguments; + AcpiGbl_DbMethodInfo.Types = AcpiGbl_DbMethodInfo.ArgTypes; + + /* Setup method arguments, up to 7 (0-6) */ + + for (i = 0; (i < ACPI_METHOD_NUM_ARGS) && *Arguments; i++) + { + AcpiGbl_DbMethodInfo.Arguments[i] = *Arguments; + Arguments++; + + AcpiGbl_DbMethodInfo.ArgTypes[i] = *Types; + Types++; + } + + Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Get the NS node, determines existence also */ + + Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname, + &AcpiGbl_DbMethodInfo.Method); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("%s Could not get handle for %s\n", + AcpiFormatException (Status), AcpiGbl_DbMethodInfo.Pathname); + return; + } + + Status = AcpiOsExecute (OSL_DEBUGGER_EXEC_THREAD, + AcpiDbSingleExecutionThread, &AcpiGbl_DbMethodInfo); + if (ACPI_FAILURE (Status)) + { + return; + } + + AcpiOsPrintf ("\nBackground thread started\n"); } Modified: vendor-sys/acpica/dist/source/components/debugger/dbinput.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Nov 10 17:54:38 2017 (r325668) @@ -258,6 +258,7 @@ enum AcpiExDebuggerCommands CMD_UNLOAD, CMD_TERMINATE, + CMD_BACKGROUND, CMD_THREADS, CMD_TEST, @@ -336,6 +337,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands {"UNLOAD", 1}, {"TERMINATE", 0}, + {"BACKGROUND", 1}, {"THREADS", 3}, {"TEST", 1}, @@ -346,102 +348,113 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands /* * Help for all debugger commands. First argument is the number of lines * of help to output for the command. + * + * Note: Some commands are not supported by the kernel-level version of + * the debugger. */ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = { - {0, "\nGeneral-Purpose Commands:", "\n"}, - {1, " Allocations", "Display list of current memory allocations\n"}, - {2, " Dump

|", "\n"}, - {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"}, - {1, " Handlers", "Info about global handlers\n"}, - {1, " Help [Command]", "This help screen or individual command\n"}, - {1, " History", "Display command history buffer\n"}, - {1, " Level ] [console]", "Get/Set debug level for file or console\n"}, - {1, " Locks", "Current status of internal mutexes\n"}, - {1, " Osi [Install|Remove ]", "Display or modify global _OSI list\n"}, - {1, " Quit or Exit", "Exit this command\n"}, - {8, " Stats ", "Display namespace and memory statistics\n"}, - {1, " Allocations", "Display list of current memory allocations\n"}, - {1, " Memory", "Dump internal memory lists\n"}, - {1, " Misc", "Namespace search and mutex stats\n"}, - {1, " Objects", "Summary of namespace objects\n"}, - {1, " Sizes", "Sizes for each of the internal objects\n"}, - {1, " Stack", "Display CPU stack usage\n"}, - {1, " Tables", "Info about current ACPI table(s)\n"}, - {1, " Tables", "Display info about loaded ACPI tables\n"}, - {1, " ! ", "Execute command from history buffer\n"}, - {1, " !!", "Execute last command again\n"}, + {0, "\nNamespace Access:", "\n"}, + {1, " Businfo", "Display system bus info\n"}, + {1, " Disassemble ", "Disassemble a control method\n"}, + {1, " Find (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, + {1, " Integrity", "Validate namespace integrity\n"}, + {1, " Methods", "Display list of loaded control methods\n"}, + {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, + {1, " Notify ", "Send a notification on Object\n"}, + {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"}, + {1, " Owner [Depth]", "Display loaded namespace by object owner\n"}, + {1, " Paths", "Display full pathnames of namespace objects\n"}, + {1, " Predefined", "Check all predefined names\n"}, + {1, " Prefix []", "Set or Get current execution prefix\n"}, + {1, " References ", "Find all references to object at addr\n"}, + {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"}, + {1, " Set N ", "Set value for named integer\n"}, + {1, " Template ", "Format/dump a Buffer/ResourceTemplate\n"}, + {1, " Type ", "Display object type\n"}, - {0, "\nNamespace Access Commands:", "\n"}, - {1, " Businfo", "Display system bus info\n"}, - {1, " Disassemble ", "Disassemble a control method\n"}, - {1, " Find (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, - {1, " Integrity", "Validate namespace integrity\n"}, - {1, " Methods", "Display list of loaded control methods\n"}, - {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, - {1, " Notify ", "Send a notification on Object\n"}, - {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"}, - {1, " Owner [Depth]", "Display loaded namespace by object owner\n"}, - {1, " Paths", "Display full pathnames of namespace objects\n"}, - {1, " Predefined", "Check all predefined names\n"}, - {1, " Prefix []", "Set or Get current execution prefix\n"}, - {1, " References ", "Find all references to object at addr\n"}, - {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"}, - {1, " Set N ", "Set value for named integer\n"}, - {1, " Template ", "Format/dump a Buffer/ResourceTemplate\n"}, - {1, " Type ", "Display object type\n"}, + {0, "\nControl Method Execution:", "\n"}, + {1, " Evaluate [Arguments]", "Evaluate object or control method\n"}, + {1, " Execute [Arguments]", "Synonym for Evaluate\n"}, +#ifdef ACPI_APPLICATION + {1, " Background [Arguments]", "Evaluate object/method in a separate thread\n"}, + {1, " Thread ", "Spawn threads to execute method(s)\n"}, +#endif + {1, " Debug [Arguments]", "Single-Step a control method\n"}, + {7, " [Arguments] formats:", "Control method argument formats\n"}, + {1, " Hex Integer", "Integer\n"}, + {1, " \"Ascii String\"", "String\n"}, + {1, " (Hex Byte List)", "Buffer\n"}, + {1, " (01 42 7A BF)", "Buffer example (4 bytes)\n"}, + {1, " [Package Element List]", "Package\n"}, + {1, " [0x01 0x1234 \"string\"]", "Package example (3 elements)\n"}, - {0, "\nControl Method Execution Commands:","\n"}, - {1, " Arguments (or Args)", "Display method arguments\n"}, - {1, " Breakpoint ", "Set an AML execution breakpoint\n"}, - {1, " Call", "Run to next control method invocation\n"}, - {1, " Debug [Arguments]", "Single Step a control method\n"}, - {6, " Evaluate", "Synonym for Execute\n"}, - {5, " Execute [Arguments]", "Execute control method\n"}, - {1, " Hex Integer", "Integer method argument\n"}, - {1, " \"Ascii String\"", "String method argument\n"}, - {1, " (Hex Byte List)", "Buffer method argument\n"}, - {1, " [Package Element List]", "Package method argument\n"}, - {5, " Execute predefined", "Execute all predefined (public) methods\n"}, - {1, " Go", "Allow method to run to completion\n"}, - {1, " Information", "Display info about the current method\n"}, - {1, " Into", "Step into (not over) a method call\n"}, - {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"}, - {1, " Locals", "Display method local variables\n"}, - {1, " Results", "Display method result stack\n"}, - {1, " Set <#> ", "Set method data (Arguments/Locals)\n"}, - {1, " Stop", "Terminate control method\n"}, - {5, " Trace [] [Once]", "Trace control method execution\n"}, - {1, " Enable", "Enable all messages\n"}, - {1, " Disable", "Disable tracing\n"}, - {1, " Method", "Enable method execution messages\n"}, - {1, " Opcode", "Enable opcode execution messages\n"}, - {1, " Tree", "Display control method calling tree\n"}, - {1, " ", "Single step next AML opcode (over calls)\n"}, - + {0, "\nMiscellaneous:", "\n"}, + {1, " Allocations", "Display list of current memory allocations\n"}, + {2, " Dump
|", "\n"}, + {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"}, + {1, " Handlers", "Info about global handlers\n"}, + {1, " Help [Command]", "This help screen or individual command\n"}, + {1, " History", "Display command history buffer\n"}, + {1, " Level ] [console]", "Get/Set debug level for file or console\n"}, + {1, " Locks", "Current status of internal mutexes\n"}, + {1, " Osi [Install|Remove ]", "Display or modify global _OSI list\n"}, + {1, " Quit or Exit", "Exit this command\n"}, + {8, " Stats ", "Display namespace and memory statistics\n"}, + {1, " Allocations", "Display list of current memory allocations\n"}, + {1, " Memory", "Dump internal memory lists\n"}, + {1, " Misc", "Namespace search and mutex stats\n"}, + {1, " Objects", "Summary of namespace objects\n"}, + {1, " Sizes", "Sizes for each of the internal objects\n"}, + {1, " Stack", "Display CPU stack usage\n"}, + {1, " Tables", "Info about current ACPI table(s)\n"}, + {1, " Tables", "Display info about loaded ACPI tables\n"}, #ifdef ACPI_APPLICATION - {0, "\nHardware Simulation Commands:", "\n"}, - {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"}, - {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, - {1, " Gpe [GpeBlockDevice]", "Simulate a GPE\n"}, - {1, " Gpes", "Display info on all GPE devices\n"}, - {1, " Sci", "Generate an SCI\n"}, - {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, + {1, " Terminate", "Delete namespace and all internal objects\n"}, +#endif + {1, " ! ", "Execute command from history buffer\n"}, + {1, " !!", "Execute last command again\n"}, - {0, "\nFile I/O Commands:", "\n"}, - {1, " Close", "Close debug output file\n"}, - {1, " Load ", "Load ACPI table from a file\n"}, - {1, " Open ", "Open a file for debug output\n"}, - {1, " Unload ", "Unload an ACPI table via namespace object\n"}, + {0, "\nMethod and Namespace Debugging:", "\n"}, + {5, " Trace [] [Once]", "Trace control method execution\n"}, + {1, " Enable", "Enable all messages\n"}, + {1, " Disable", "Disable tracing\n"}, + {1, " Method", "Enable method execution messages\n"}, + {1, " Opcode", "Enable opcode execution messages\n"}, + {3, " Test ", "Invoke a debug test\n"}, + {1, " Objects", "Read/write/compare all namespace data objects\n"}, + {1, " Predefined", "Validate all ACPI predefined names (_STA, etc.)\n"}, + {1, " Execute predefined", "Execute all predefined (public) methods\n"}, - {0, "\nUser Space Commands:", "\n"}, - {1, " Terminate", "Delete namespace and all internal objects\n"}, - {1, " Thread ", "Spawn threads to execute method(s)\n"}, + {0, "\nControl Method Single-Step Execution:","\n"}, + {1, " Arguments (or Args)", "Display method arguments\n"}, + {1, " Breakpoint ", "Set an AML execution breakpoint\n"}, + {1, " Call", "Run to next control method invocation\n"}, + {1, " Go", "Allow method to run to completion\n"}, + {1, " Information", "Display info about the current method\n"}, + {1, " Into", "Step into (not over) a method call\n"}, + {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"}, + {1, " Locals", "Display method local variables\n"}, + {1, " Results", "Display method result stack\n"}, + {1, " Set <#> ", "Set method data (Arguments/Locals)\n"}, + {1, " Stop", "Terminate control method\n"}, + {1, " Tree", "Display control method calling tree\n"}, + {1, " ", "Single step next AML opcode (over calls)\n"}, - {0, "\nDebug Test Commands:", "\n"}, - {3, " Test ", "Invoke a debug test\n"}, - {1, " Objects", "Read/write/compare all namespace data objects\n"}, - {1, " Predefined", "Execute all ACPI predefined names (_STA, etc.)\n"}, +#ifdef ACPI_APPLICATION + {0, "\nFile Operations:", "\n"}, + {1, " Close", "Close debug output file\n"}, + {1, " Load ", "Load ACPI table from a file\n"}, + {1, " Open ", "Open a file for debug output\n"}, + {1, " Unload ", "Unload an ACPI table via namespace object\n"}, + + {0, "\nHardware Simulation:", "\n"}, + {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"}, + {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, + {1, " Gpe [GpeBlockDevice]", "Simulate a GPE\n"}, + {1, " Gpes", "Display info on all GPE devices\n"}, + {1, " Sci", "Generate an SCI\n"}, + {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, #endif {0, NULL, NULL} }; @@ -571,11 +584,15 @@ AcpiDbDisplayHelp ( { /* No argument to help, display help for all commands */ + AcpiOsPrintf ("\nSummary of AML Debugger Commands\n\n"); + while (Next->Invocation) { AcpiOsPrintf ("%-38s%s", Next->Invocation, Next->Description); Next++; } + AcpiOsPrintf ("\n"); + } else { @@ -1256,6 +1273,12 @@ AcpiDbCommandDispatch ( AcpiGbl_DbTerminateLoop = TRUE; /* AcpiInitialize (NULL); */ + break; + + case CMD_BACKGROUND: + + AcpiDbCreateExecutionThread (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], + &AcpiGbl_DbArgTypes[2]); break; case CMD_THREADS: Modified: vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c Fri Nov 10 17:54:38 2017 (r325668) @@ -340,7 +340,8 @@ AcpiDsCreateBufferField ( ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } } @@ -524,7 +525,8 @@ AcpiDsGetFieldNames ( WalkState, &Info->ConnectionNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Child->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -540,7 +542,8 @@ AcpiDsGetFieldNames ( WalkState, &Info->FieldNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + (char *) &Arg->Named.Name, Status); return_ACPI_STATUS (Status); } else @@ -639,7 +642,8 @@ AcpiDsCreateField ( #endif if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -769,7 +773,8 @@ AcpiDsInitFieldObjects ( Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + (char *) &Arg->Named.Name, Status); if (Status != AE_ALREADY_EXISTS) { return_ACPI_STATUS (Status); @@ -834,7 +839,8 @@ AcpiDsCreateBankField ( #endif if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -847,7 +853,8 @@ AcpiDsCreateBankField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -920,7 +927,8 @@ AcpiDsCreateIndexField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -932,7 +940,8 @@ AcpiDsCreateIndexField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } Modified: vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c Fri Nov 10 17:54:38 2017 (r325668) @@ -223,7 +223,8 @@ AcpiDsBuildInternalObject ( ACPI_NAMESPACE_NODE, &(Op->Common.Node))); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Op->Common.Value.String, Status); return_ACPI_STATUS (Status); } } Modified: vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c Fri Nov 10 17:54:38 2017 (r325668) @@ -732,7 +732,8 @@ AcpiDsCreateOperand ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (NameString, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + NameString, Status); } } Modified: vendor-sys/acpica/dist/source/components/dispatcher/dswload.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dswload.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/dispatcher/dswload.c Fri Nov 10 17:54:38 2017 (r325668) @@ -325,7 +325,7 @@ AcpiDsLoad1BeginOp ( #endif if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Path, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status); return_ACPI_STATUS (Status); } @@ -495,7 +495,7 @@ AcpiDsLoad1BeginOp ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Path, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status); return_ACPI_STATUS (Status); } } Modified: vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c Fri Nov 10 17:54:38 2017 (r325668) @@ -304,10 +304,12 @@ AcpiDsLoad2BeginOp ( } else { - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + BufferPtr, Status); } #else - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + BufferPtr, Status); #endif return_ACPI_STATUS (Status); } @@ -462,7 +464,8 @@ AcpiDsLoad2BeginOp ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + BufferPtr, Status); return_ACPI_STATUS (Status); } @@ -844,7 +847,8 @@ AcpiDsLoad2EndOp ( } else { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); } break; Modified: vendor-sys/acpica/dist/source/components/events/evregion.c ============================================================================== --- vendor-sys/acpica/dist/source/components/events/evregion.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/events/evregion.c Fri Nov 10 17:54:38 2017 (r325668) @@ -423,6 +423,17 @@ AcpiEvAddressSpaceDispatch ( { ACPI_EXCEPTION ((AE_INFO, Status, "Returned by Handler for [%s]", AcpiUtGetRegionName (RegionObj->Region.SpaceId))); + + /* + * Special case for an EC timeout. These are seen so frequently + * that an additional error message is helpful + */ + if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) && + (Status == AE_TIME)) + { + ACPI_ERROR ((AE_INFO, + "Timeout from EC hardware or EC device driver")); + } } if (!(HandlerDesc->AddressSpace.HandlerFlags & Modified: vendor-sys/acpica/dist/source/components/namespace/nsconvert.c ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nsconvert.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/namespace/nsconvert.c Fri Nov 10 17:54:38 2017 (r325668) @@ -644,7 +644,8 @@ AcpiNsConvertToReference ( { /* Check if we are resolving a named reference within a package */ - ACPI_ERROR_NAMESPACE (OriginalObject->String.Pointer, Status); + ACPI_ERROR_NAMESPACE (&ScopeInfo, + OriginalObject->String.Pointer, Status); goto ErrorExit; } Modified: vendor-sys/acpica/dist/source/components/namespace/nsnames.c ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nsnames.c Fri Nov 10 17:01:51 2017 (r325667) +++ vendor-sys/acpica/dist/source/components/namespace/nsnames.c Fri Nov 10 17:54:38 2017 (r325668) @@ -158,7 +158,13 @@ #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsnames") +/* Local Prototypes */ +static void +AcpiNsNormalizePathname ( + char *OriginalPath); + + /******************************************************************************* * * FUNCTION: AcpiNsGetExternalPathname @@ -506,4 +512,170 @@ AcpiNsGetNormalizedPathname ( (void) AcpiNsBuildNormalizedPath (Node, NameBuffer, Size, NoTrailing); return_PTR (NameBuffer); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsBuildPrefixedPathname + * + * PARAMETERS: PrefixScope - Scope/Path that prefixes the internal path + * InternalPath - Name or path of the namespace node + * + * RETURN: None + * + * DESCRIPTION: Construct a fully qualified pathname from a concatenation of: + * 1) Path associated with the PrefixScope namespace node + * 2) External path representation of the Internal path + * + ******************************************************************************/ + +char * +AcpiNsBuildPrefixedPathname ( + ACPI_GENERIC_STATE *PrefixScope, + const char *InternalPath) +{ + ACPI_STATUS Status; + char *FullPath = NULL; + char *ExternalPath = NULL; + char *PrefixPath = NULL; + UINT32 PrefixPathLength = 0; + + + /* If there is a prefix, get the pathname to it */ + + if (PrefixScope && PrefixScope->Scope.Node) + { + PrefixPath = AcpiNsGetNormalizedPathname (PrefixScope->Scope.Node, TRUE); + if (PrefixPath) + { + PrefixPathLength = strlen (PrefixPath); + } + } + + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, + NULL, &ExternalPath); + if (ACPI_FAILURE (Status)) + { + goto Cleanup; + } + + /* Merge the prefix path and the path. 2 is for one dot and trailing null */ + + FullPath = ACPI_ALLOCATE_ZEROED ( + PrefixPathLength + strlen (ExternalPath) + 2); + if (!FullPath) + { + goto Cleanup; + } + + /* Don't merge if the External path is already fully qualified */ + + if (PrefixPath && + (*ExternalPath != '\\') && + (*ExternalPath != '^')) + { + strcat (FullPath, PrefixPath); + if (PrefixPath[1]) + { + strcat (FullPath, "."); + } + } + + AcpiNsNormalizePathname (ExternalPath); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Nov 10 17:55:45 2017 Return-Path: Delivered-To: svn-src-all@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 EB653E73166; Fri, 10 Nov 2017 17:55:45 +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 B8A957C8C4; Fri, 10 Nov 2017 17:55:45 +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 vAAHtibV018081; Fri, 10 Nov 2017 17:55:44 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAHti85018080; Fri, 10 Nov 2017 17:55:44 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201711101755.vAAHti85018080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 10 Nov 2017 17:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r325669 - vendor-sys/acpica/20171110 X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-sys/acpica/20171110 X-SVN-Commit-Revision: 325669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 17:55:46 -0000 Author: jkim Date: Fri Nov 10 17:55:44 2017 New Revision: 325669 URL: https://svnweb.freebsd.org/changeset/base/325669 Log: Tag ACPICA 20171110. Added: vendor-sys/acpica/20171110/ - copied from r325668, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Fri Nov 10 18:43:14 2017 Return-Path: Delivered-To: svn-src-all@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 2A64EE73C1D; Fri, 10 Nov 2017 18:43:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.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 0A1EE7DB16; Fri, 10 Nov 2017 18:43:14 +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 mail.baldwin.cx (Postfix) with ESMTPSA id 7DBC310A7DB; Fri, 10 Nov 2017 13:43:12 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325624 - head/libexec/rtld-elf/mips Date: Fri, 10 Nov 2017 10:15:54 -0800 Message-ID: <6482881.6CZu26arCe@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201711100117.vAA1HQqT094112@repo.freebsd.org> References: <201711100117.vAA1HQqT094112@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.4.3 (mail.baldwin.cx); Fri, 10 Nov 2017 13:43:12 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 18:43:14 -0000 On Friday, November 10, 2017 01:17:26 AM John Baldwin wrote: > Author: jhb > Date: Fri Nov 10 01:17:26 2017 > New Revision: 325624 > URL: https://svnweb.freebsd.org/changeset/base/325624 > > Log: > Some fixups to the CFI directives for PLT stub entry points. > > The directives I added in r323466 and r323501 did not define a valid > CFA until several instructions into the associated functions. This > triggers an assertion in GDB when generating a stack trace while > stopped at the first instruction of PLT stub entry point since there > is no valid CFA rule for the first instruction. > > This is probably just wrong on my part as the non-simple .cfi_startproc > would have defined a valid CFA. Instead, define a valid CFA as sp + 0 > at the start of the functions and then use .cfa_def_offset to change the > offset when sp is adjusted later in the function. > > Sponsored by: DARPA / AFRL Forgot to note: also explicitly set .cfi_sections to only include unwind info in .debug_frame as none of these functions catch exceptions. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Nov 10 18:46:37 2017 Return-Path: Delivered-To: svn-src-all@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 B4359E73D5B; Fri, 10 Nov 2017 18:46:37 +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 44CDE7DDFA; Fri, 10 Nov 2017 18:46:37 +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 vAAIkafQ039697; Fri, 10 Nov 2017 18:46:36 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAIkYGo039679; Fri, 10 Nov 2017 18:46:34 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201711101846.vAAIkYGo039679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 10 Nov 2017 18:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325670 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/events components/namespace components/parser components/utilities include X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/events components/namespace components/parser components/utilities include X-SVN-Commit-Revision: 325670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 18:46:37 -0000 Author: jkim Date: Fri Nov 10 18:46:34 2017 New Revision: 325670 URL: https://svnweb.freebsd.org/changeset/base/325670 Log: MFV: r325668 Merge ACPICA 20171110. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/namespace/nsconvert.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/components/utilities/utmutex.c head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/acutils.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/changes.txt Fri Nov 10 18:46:34 2017 (r325670) @@ -1,4 +1,57 @@ ---------------------------------------- +10 November 2017. Summary of changes for version 20171110: + + +1) ACPICA kernel-resident subsystem: + +This release implements full support for ACPI 6.2A: + NFIT - Added a new subtable, "Platform Capabilities Structure" +No other changes to ACPICA were required, since ACPI 6.2A is primarily an +errata release of the specification. + +Other ACPI table changes: + IORT: Added the SMMUv3 Device ID mapping index. Hanjun Guo + PPTT: Added cache attribute flag definitions to actbl1.h. Jeremy +Linton + +Utilities: Modified the string/integer conversion functions to use +internal 64-bit divide support instead of a native divide. On 32-bit +platforms, a 64-bit divide typically requires a library function which +may not be present in the build (kernel or otherwise). + +Implemented a targeted error message for timeouts returned from the +Embedded Controller device driver. This is seen frequently enough to +special-case an AE_TIME returned from an EC operation region access: + "Timeout from EC hardware or EC device driver" + +Changed the "ACPI Exception" message prefix to "ACPI Error" so that all +runtime error messages have the identical prefix. + + +2) iASL Compiler/Disassembler and Tools: + +AcpiXtract: Fixed a problem with table header detection within the +acpidump file. Processing a table could be ended early if a 0x40 (@) +appears in the original binary table, resulting in the @ symbol appearing +in the decoded ASCII field at the end of the acpidump text line. The +symbol caused acpixtract to incorrectly think it had reached the end of +the current table and the beginning of a new table. + +AcpiXtract: Added an option (-f) to ignore some errors during table +extraction. This initial implementation ignores non-ASCII and non- +printable characters found in the acpidump text file. + +TestSuite(ASLTS)/AcpiExec: Fixed and restored the memory usage statistics +for ASLTS. This feature is used to track memory allocations from +different memory caches within the ACPICA code. At the end of an ASLTS +run, these memory statistics are recorded and stored in a log file. + +Debugger (user-space version): Implemented a simple "Background" command. +Creates a new thread to execute a control method in the background, while +control returns to the debugger prompt to allow additional commands. + Syntax: Background [Arguments] + +---------------------------------------- 29 September 2017. Summary of changes for version 20170929: Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/common/dmtable.c Fri Nov 10 18:46:34 2017 (r325670) @@ -356,6 +356,7 @@ static const char *AcpiDmNfitSubnames[] = "NVDIMM Control Region", /* ACPI_NFIT_TYPE_CONTROL_REGION */ "NVDIMM Block Data Window Region", /* ACPI_NFIT_TYPE_DATA_REGION */ "Flush Hint Address", /* ACPI_NFIT_TYPE_FLUSH_ADDRESS */ + "Platform Capabilities", /* ACPI_NFIT_TYPE_CAPABILITIES */ "Unknown Subtable Type" /* Reserved */ }; Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Fri Nov 10 18:46:34 2017 (r325670) @@ -3061,6 +3061,11 @@ AcpiDmDumpNfit ( FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64); break; + case ACPI_NFIT_TYPE_CAPABILITIES: /* ACPI 6.0A */ + + InfoTable = AcpiDmTableInfoNfit7; + break; + default: AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n", Subtable->Type); Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Fri Nov 10 18:46:34 2017 (r325670) @@ -336,6 +336,7 @@ #define ACPI_NFIT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CONTROL_REGION,f) #define ACPI_NFIT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_DATA_REGION,f) #define ACPI_NFIT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_FLUSH_ADDRESS,f) +#define ACPI_NFIT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CAPABILITIES,f) #define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) #define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f) #define ACPI_PCCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f) @@ -419,6 +420,7 @@ #define ACPI_NFIT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_SYSTEM_ADDRESS,f,o) #define ACPI_NFIT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_MEMORY_MAP,f,o) #define ACPI_NFIT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CONTROL_REGION,f,o) +#define ACPI_NFIT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CAPABILITIES,f,o) #define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o) #define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o) #define ACPI_PCCT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f,o) @@ -1861,6 +1863,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[] = {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Pxm), "Proximity Domain", 0}, {ACPI_DMT_UINT8, ACPI_IORT4_OFFSET (Reserved1), "Reserved", 0}, {ACPI_DMT_UINT16, ACPI_IORT4_OFFSET (Reserved2), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_IORT4_OFFSET (IdMappingIndex), "Device ID Mapping Index", 0}, ACPI_DMT_TERMINATOR }; @@ -2561,6 +2564,18 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6[] = ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[] = { {ACPI_DMT_UINT64, 0, "Hint Address", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + +ACPI_DMTABLE_INFO AcpiDmTableInfoNfit7[] = +{ + {ACPI_DMT_UINT8, ACPI_NFIT7_OFFSET (HighestCapability), "Highest Capability", 0}, + {ACPI_DMT_UINT24, ACPI_NFIT7_OFFSET (Reserved[0]), "Reserved", 0}, + {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Capabilities), "Capabilities (decoded below)", DT_FLAG}, + {ACPI_DMT_FLAG0, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Cache Flush to NVDIMM", 0}, + {ACPI_DMT_FLAG1, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Flush to MVDIMM", 0}, + {ACPI_DMT_FLAG2, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Mirroring", 0}, + {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR }; Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Fri Nov 10 18:46:34 2017 (r325670) @@ -162,7 +162,7 @@ #define ASL_CREATOR_ID "INTL" #define ASL_DEFINE "__IASL__" #define ASL_PREFIX "iASL: " -#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.2" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 6.2A" /* Configuration constants */ Modified: head/sys/contrib/dev/acpica/compiler/dttable2.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttable2.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/compiler/dttable2.c Fri Nov 10 18:46:34 2017 (r325670) @@ -697,6 +697,11 @@ DtCompileNfit ( InfoTable = AcpiDmTableInfoNfit6; break; + case ACPI_NFIT_TYPE_CAPABILITIES: + + InfoTable = AcpiDmTableInfoNfit7; + break; + default: DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT"); @@ -740,7 +745,6 @@ DtCompileNfit ( } Interleave->LineCount = Count; - DtPopSubtable (); break; case ACPI_NFIT_TYPE_SMBIOS: @@ -786,7 +790,6 @@ DtCompileNfit ( } Hint->HintCount = (UINT16) Count; - DtPopSubtable (); break; default: Modified: head/sys/contrib/dev/acpica/compiler/dttemplate.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/dttemplate.h Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/compiler/dttemplate.h Fri Nov 10 18:46:34 2017 (r325670) @@ -696,53 +696,56 @@ const unsigned char TemplateHpet[] = const unsigned char TemplateIort[] = { - 0x49,0x4F,0x52,0x54,0x74,0x01,0x00,0x00, /* 00000000 "IORTt..." */ - 0x00,0xD2,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ - 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */ + 0x49,0x4F,0x52,0x54,0x90,0x01,0x00,0x00, /* 00000000 "IORT...." */ + 0x00,0x5F,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "._INTEL " */ + 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x19,0x01,0x17,0x20,0x05,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x31,0x08,0x17,0x20,0x05,0x00,0x00,0x00, /* 00000020 "1.. ...." */ 0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000028 "4......." */ 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00, /* 00000030 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000040 "........" */ - 0x00,0x00,0x00,0x00,0x01,0x44,0x00,0x00, /* 00000048 ".....D.." */ + 0x00,0x00,0x00,0x00,0x01,0x58,0x00,0x00, /* 00000048 ".....X.." */ 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000050 "........" */ - 0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "0......." */ + 0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "D......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */ 0x00,0x5C,0x5F,0x53,0x42,0x2E,0x50,0x43, /* 00000068 ".\_SB.PC" */ 0x49,0x30,0x2E,0x44,0x45,0x56,0x30,0x00, /* 00000070 "I0.DEV0." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */ - 0x02,0x34,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 ".4......" */ - 0x01,0x00,0x00,0x00,0x20,0x00,0x00,0x00, /* 00000098 ".... ..." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */ + 0x00,0x00,0x00,0x00,0x02,0x34,0x00,0x00, /* 000000A0 ".....4.." */ + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000A8 "........" */ + 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 " ......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */ - 0x00,0x00,0x00,0x00,0x03,0x60,0x00,0x00, /* 000000C0 ".....`.." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 000000C8 "........" */ - 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "L......." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D8 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E0 "........" */ - 0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00, /* 000000E8 "....<..." */ - 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000F0 "....L..." */ - 0x00,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000F8 "....L..." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000C8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000D0 "........" */ + 0x03,0x60,0x00,0x01,0x00,0x00,0x00,0x00, /* 000000D8 ".`......" */ + 0x01,0x00,0x00,0x00,0x4C,0x00,0x00,0x00, /* 000000E0 "....L..." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */ + 0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "<......." */ + 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "L......." */ + 0x4C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "L......." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */ - 0x00,0x00,0x00,0x00,0x04,0x50,0x00,0x00, /* 00000120 ".....P.." */ - 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, /* 00000128 "........" */ - 0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "<......." */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */ + 0x04,0x58,0x00,0x01,0x00,0x00,0x00,0x00, /* 00000138 ".X......" */ + 0x01,0x00,0x00,0x00,0x44,0x00,0x00,0x00, /* 00000140 "....D..." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */ - 0x00,0x00,0x00,0x00 /* 00000170 "...." */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000170 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000178 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000180 "........" */ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000188 "........" */ }; const unsigned char TemplateIvrs[] = @@ -939,11 +942,11 @@ const unsigned char TemplateMsct[] = const unsigned char TemplateNfit[] = { - 0x4E,0x46,0x49,0x54,0x70,0x01,0x00,0x00, /* 00000000 "NFITp..." */ - 0x01,0x53,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 ".SINTEL " */ + 0x4E,0x46,0x49,0x54,0x80,0x01,0x00,0x00, /* 00000000 "NFIT...." */ + 0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */ 0x54,0x65,0x6D,0x70,0x6C,0x61,0x74,0x65, /* 00000010 "Template" */ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */ - 0x10,0x04,0x15,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */ + 0x29,0x09,0x17,0x20,0x00,0x00,0x00,0x00, /* 00000020 ").. ...." */ 0x00,0x00,0x38,0x00,0x01,0x00,0x00,0x00, /* 00000028 "..8....." */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000030 "........" */ 0x30,0x05,0xAF,0x91,0x86,0x5D,0x0E,0x47, /* 00000038 "0....].G" */ @@ -984,7 +987,9 @@ const unsigned char TemplateNfit[] = 0x06,0x00,0x20,0x00,0x01,0x00,0x00,0x00, /* 00000150 ".. ....." */ 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */ 0x00,0x00,0x00,0x18,0x04,0x00,0x00,0x00, /* 00000160 "........" */ - 0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00 /* 00000168 "........" */ + 0x00,0x00,0x00,0x18,0x06,0x00,0x00,0x00, /* 00000168 "........" */ + 0x07,0x00,0x10,0x00,0x00,0x00,0x00,0x00, /* 00000170 "........" */ + 0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000178 "........" */ }; const unsigned char TemplateMtmr[] = Modified: head/sys/contrib/dev/acpica/components/debugger/dbexec.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbexec.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/debugger/dbexec.c Fri Nov 10 18:46:34 2017 (r325670) @@ -187,7 +187,11 @@ AcpiDbExecutionWalk ( void *Context, void **ReturnValue); +static void ACPI_SYSTEM_XFACE +AcpiDbSingleExecutionThread ( + void *Context); + /******************************************************************************* * * FUNCTION: AcpiDbDeleteObjects @@ -366,7 +370,7 @@ AcpiDbExecuteSetup ( ACPI_FUNCTION_NAME (DbExecuteSetup); - /* Catenate the current scope to the supplied name */ + /* Concatenate the current scope to the supplied name */ Info->Pathname[0] = 0; if ((Info->Name[0] != '\\') && @@ -786,6 +790,124 @@ AcpiDbMethodThread ( AcpiFormatException (Status)); } } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbSingleExecutionThread + * + * PARAMETERS: Context - Method info struct + * + * RETURN: None + * + * DESCRIPTION: Create one thread and execute a method + * + ******************************************************************************/ + +static void ACPI_SYSTEM_XFACE +AcpiDbSingleExecutionThread ( + void *Context) +{ + ACPI_DB_METHOD_INFO *Info = Context; + ACPI_STATUS Status; + ACPI_BUFFER ReturnObj; + + + AcpiOsPrintf ("\n"); + + Status = AcpiDbExecuteMethod (Info, &ReturnObj); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("%s During evaluation of %s\n", + AcpiFormatException (Status), Info->Pathname); + return; + } + + /* Display a return object, if any */ + + if (ReturnObj.Length) + { + AcpiOsPrintf ("Evaluation of %s returned object %p, " + "external buffer length %X\n", + AcpiGbl_DbMethodInfo.Pathname, ReturnObj.Pointer, + (UINT32) ReturnObj.Length); + + AcpiDbDumpExternalObject (ReturnObj.Pointer, 1); + } + + AcpiOsPrintf ("\nBackground thread completed\n%c ", + ACPI_DEBUGGER_COMMAND_PROMPT); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbCreateExecutionThread + * + * PARAMETERS: MethodNameArg - Control method to execute + * Arguments - Array of arguments to the method + * Types - Corresponding array of object types + * + * RETURN: None + * + * DESCRIPTION: Create a single thread to evaluate a namespace object. Handles + * arguments passed on command line for control methods. + * + ******************************************************************************/ + +void +AcpiDbCreateExecutionThread ( + char *MethodNameArg, + char **Arguments, + ACPI_OBJECT_TYPE *Types) +{ + ACPI_STATUS Status; + UINT32 i; + + + memset (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO)); + AcpiGbl_DbMethodInfo.Name = MethodNameArg; + AcpiGbl_DbMethodInfo.InitArgs = 1; + AcpiGbl_DbMethodInfo.Args = AcpiGbl_DbMethodInfo.Arguments; + AcpiGbl_DbMethodInfo.Types = AcpiGbl_DbMethodInfo.ArgTypes; + + /* Setup method arguments, up to 7 (0-6) */ + + for (i = 0; (i < ACPI_METHOD_NUM_ARGS) && *Arguments; i++) + { + AcpiGbl_DbMethodInfo.Arguments[i] = *Arguments; + Arguments++; + + AcpiGbl_DbMethodInfo.ArgTypes[i] = *Types; + Types++; + } + + Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Get the NS node, determines existence also */ + + Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname, + &AcpiGbl_DbMethodInfo.Method); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("%s Could not get handle for %s\n", + AcpiFormatException (Status), AcpiGbl_DbMethodInfo.Pathname); + return; + } + + Status = AcpiOsExecute (OSL_DEBUGGER_EXEC_THREAD, + AcpiDbSingleExecutionThread, &AcpiGbl_DbMethodInfo); + if (ACPI_FAILURE (Status)) + { + return; + } + + AcpiOsPrintf ("\nBackground thread started\n"); } Modified: head/sys/contrib/dev/acpica/components/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbinput.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/debugger/dbinput.c Fri Nov 10 18:46:34 2017 (r325670) @@ -258,6 +258,7 @@ enum AcpiExDebuggerCommands CMD_UNLOAD, CMD_TERMINATE, + CMD_BACKGROUND, CMD_THREADS, CMD_TEST, @@ -336,6 +337,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands {"UNLOAD", 1}, {"TERMINATE", 0}, + {"BACKGROUND", 1}, {"THREADS", 3}, {"TEST", 1}, @@ -346,102 +348,113 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands /* * Help for all debugger commands. First argument is the number of lines * of help to output for the command. + * + * Note: Some commands are not supported by the kernel-level version of + * the debugger. */ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandHelp[] = { - {0, "\nGeneral-Purpose Commands:", "\n"}, - {1, " Allocations", "Display list of current memory allocations\n"}, - {2, " Dump
|", "\n"}, - {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"}, - {1, " Handlers", "Info about global handlers\n"}, - {1, " Help [Command]", "This help screen or individual command\n"}, - {1, " History", "Display command history buffer\n"}, - {1, " Level ] [console]", "Get/Set debug level for file or console\n"}, - {1, " Locks", "Current status of internal mutexes\n"}, - {1, " Osi [Install|Remove ]", "Display or modify global _OSI list\n"}, - {1, " Quit or Exit", "Exit this command\n"}, - {8, " Stats ", "Display namespace and memory statistics\n"}, - {1, " Allocations", "Display list of current memory allocations\n"}, - {1, " Memory", "Dump internal memory lists\n"}, - {1, " Misc", "Namespace search and mutex stats\n"}, - {1, " Objects", "Summary of namespace objects\n"}, - {1, " Sizes", "Sizes for each of the internal objects\n"}, - {1, " Stack", "Display CPU stack usage\n"}, - {1, " Tables", "Info about current ACPI table(s)\n"}, - {1, " Tables", "Display info about loaded ACPI tables\n"}, - {1, " ! ", "Execute command from history buffer\n"}, - {1, " !!", "Execute last command again\n"}, + {0, "\nNamespace Access:", "\n"}, + {1, " Businfo", "Display system bus info\n"}, + {1, " Disassemble ", "Disassemble a control method\n"}, + {1, " Find (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, + {1, " Integrity", "Validate namespace integrity\n"}, + {1, " Methods", "Display list of loaded control methods\n"}, + {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, + {1, " Notify ", "Send a notification on Object\n"}, + {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"}, + {1, " Owner [Depth]", "Display loaded namespace by object owner\n"}, + {1, " Paths", "Display full pathnames of namespace objects\n"}, + {1, " Predefined", "Check all predefined names\n"}, + {1, " Prefix []", "Set or Get current execution prefix\n"}, + {1, " References ", "Find all references to object at addr\n"}, + {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"}, + {1, " Set N ", "Set value for named integer\n"}, + {1, " Template ", "Format/dump a Buffer/ResourceTemplate\n"}, + {1, " Type ", "Display object type\n"}, - {0, "\nNamespace Access Commands:", "\n"}, - {1, " Businfo", "Display system bus info\n"}, - {1, " Disassemble ", "Disassemble a control method\n"}, - {1, " Find (? is wildcard)", "Find ACPI name(s) with wildcards\n"}, - {1, " Integrity", "Validate namespace integrity\n"}, - {1, " Methods", "Display list of loaded control methods\n"}, - {1, " Namespace [Object] [Depth]", "Display loaded namespace tree/subtree\n"}, - {1, " Notify ", "Send a notification on Object\n"}, - {1, " Objects [ObjectType]", "Display summary of all objects or just given type\n"}, - {1, " Owner [Depth]", "Display loaded namespace by object owner\n"}, - {1, " Paths", "Display full pathnames of namespace objects\n"}, - {1, " Predefined", "Check all predefined names\n"}, - {1, " Prefix []", "Set or Get current execution prefix\n"}, - {1, " References ", "Find all references to object at addr\n"}, - {1, " Resources [DeviceName]", "Display Device resources (no arg = all devices)\n"}, - {1, " Set N ", "Set value for named integer\n"}, - {1, " Template ", "Format/dump a Buffer/ResourceTemplate\n"}, - {1, " Type ", "Display object type\n"}, + {0, "\nControl Method Execution:", "\n"}, + {1, " Evaluate [Arguments]", "Evaluate object or control method\n"}, + {1, " Execute [Arguments]", "Synonym for Evaluate\n"}, +#ifdef ACPI_APPLICATION + {1, " Background [Arguments]", "Evaluate object/method in a separate thread\n"}, + {1, " Thread ", "Spawn threads to execute method(s)\n"}, +#endif + {1, " Debug [Arguments]", "Single-Step a control method\n"}, + {7, " [Arguments] formats:", "Control method argument formats\n"}, + {1, " Hex Integer", "Integer\n"}, + {1, " \"Ascii String\"", "String\n"}, + {1, " (Hex Byte List)", "Buffer\n"}, + {1, " (01 42 7A BF)", "Buffer example (4 bytes)\n"}, + {1, " [Package Element List]", "Package\n"}, + {1, " [0x01 0x1234 \"string\"]", "Package example (3 elements)\n"}, - {0, "\nControl Method Execution Commands:","\n"}, - {1, " Arguments (or Args)", "Display method arguments\n"}, - {1, " Breakpoint ", "Set an AML execution breakpoint\n"}, - {1, " Call", "Run to next control method invocation\n"}, - {1, " Debug [Arguments]", "Single Step a control method\n"}, - {6, " Evaluate", "Synonym for Execute\n"}, - {5, " Execute [Arguments]", "Execute control method\n"}, - {1, " Hex Integer", "Integer method argument\n"}, - {1, " \"Ascii String\"", "String method argument\n"}, - {1, " (Hex Byte List)", "Buffer method argument\n"}, - {1, " [Package Element List]", "Package method argument\n"}, - {5, " Execute predefined", "Execute all predefined (public) methods\n"}, - {1, " Go", "Allow method to run to completion\n"}, - {1, " Information", "Display info about the current method\n"}, - {1, " Into", "Step into (not over) a method call\n"}, - {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"}, - {1, " Locals", "Display method local variables\n"}, - {1, " Results", "Display method result stack\n"}, - {1, " Set <#> ", "Set method data (Arguments/Locals)\n"}, - {1, " Stop", "Terminate control method\n"}, - {5, " Trace [] [Once]", "Trace control method execution\n"}, - {1, " Enable", "Enable all messages\n"}, - {1, " Disable", "Disable tracing\n"}, - {1, " Method", "Enable method execution messages\n"}, - {1, " Opcode", "Enable opcode execution messages\n"}, - {1, " Tree", "Display control method calling tree\n"}, - {1, " ", "Single step next AML opcode (over calls)\n"}, - + {0, "\nMiscellaneous:", "\n"}, + {1, " Allocations", "Display list of current memory allocations\n"}, + {2, " Dump
|", "\n"}, + {0, " [Byte|Word|Dword|Qword]", "Display ACPI objects or memory\n"}, + {1, " Handlers", "Info about global handlers\n"}, + {1, " Help [Command]", "This help screen or individual command\n"}, + {1, " History", "Display command history buffer\n"}, + {1, " Level ] [console]", "Get/Set debug level for file or console\n"}, + {1, " Locks", "Current status of internal mutexes\n"}, + {1, " Osi [Install|Remove ]", "Display or modify global _OSI list\n"}, + {1, " Quit or Exit", "Exit this command\n"}, + {8, " Stats ", "Display namespace and memory statistics\n"}, + {1, " Allocations", "Display list of current memory allocations\n"}, + {1, " Memory", "Dump internal memory lists\n"}, + {1, " Misc", "Namespace search and mutex stats\n"}, + {1, " Objects", "Summary of namespace objects\n"}, + {1, " Sizes", "Sizes for each of the internal objects\n"}, + {1, " Stack", "Display CPU stack usage\n"}, + {1, " Tables", "Info about current ACPI table(s)\n"}, + {1, " Tables", "Display info about loaded ACPI tables\n"}, #ifdef ACPI_APPLICATION - {0, "\nHardware Simulation Commands:", "\n"}, - {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"}, - {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, - {1, " Gpe [GpeBlockDevice]", "Simulate a GPE\n"}, - {1, " Gpes", "Display info on all GPE devices\n"}, - {1, " Sci", "Generate an SCI\n"}, - {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, + {1, " Terminate", "Delete namespace and all internal objects\n"}, +#endif + {1, " ! ", "Execute command from history buffer\n"}, + {1, " !!", "Execute last command again\n"}, - {0, "\nFile I/O Commands:", "\n"}, - {1, " Close", "Close debug output file\n"}, - {1, " Load ", "Load ACPI table from a file\n"}, - {1, " Open ", "Open a file for debug output\n"}, - {1, " Unload ", "Unload an ACPI table via namespace object\n"}, + {0, "\nMethod and Namespace Debugging:", "\n"}, + {5, " Trace [] [Once]", "Trace control method execution\n"}, + {1, " Enable", "Enable all messages\n"}, + {1, " Disable", "Disable tracing\n"}, + {1, " Method", "Enable method execution messages\n"}, + {1, " Opcode", "Enable opcode execution messages\n"}, + {3, " Test ", "Invoke a debug test\n"}, + {1, " Objects", "Read/write/compare all namespace data objects\n"}, + {1, " Predefined", "Validate all ACPI predefined names (_STA, etc.)\n"}, + {1, " Execute predefined", "Execute all predefined (public) methods\n"}, - {0, "\nUser Space Commands:", "\n"}, - {1, " Terminate", "Delete namespace and all internal objects\n"}, - {1, " Thread ", "Spawn threads to execute method(s)\n"}, + {0, "\nControl Method Single-Step Execution:","\n"}, + {1, " Arguments (or Args)", "Display method arguments\n"}, + {1, " Breakpoint ", "Set an AML execution breakpoint\n"}, + {1, " Call", "Run to next control method invocation\n"}, + {1, " Go", "Allow method to run to completion\n"}, + {1, " Information", "Display info about the current method\n"}, + {1, " Into", "Step into (not over) a method call\n"}, + {1, " List [# of Aml Opcodes]", "Display method ASL statements\n"}, + {1, " Locals", "Display method local variables\n"}, + {1, " Results", "Display method result stack\n"}, + {1, " Set <#> ", "Set method data (Arguments/Locals)\n"}, + {1, " Stop", "Terminate control method\n"}, + {1, " Tree", "Display control method calling tree\n"}, + {1, " ", "Single step next AML opcode (over calls)\n"}, - {0, "\nDebug Test Commands:", "\n"}, - {3, " Test ", "Invoke a debug test\n"}, - {1, " Objects", "Read/write/compare all namespace data objects\n"}, - {1, " Predefined", "Execute all ACPI predefined names (_STA, etc.)\n"}, +#ifdef ACPI_APPLICATION + {0, "\nFile Operations:", "\n"}, + {1, " Close", "Close debug output file\n"}, + {1, " Load ", "Load ACPI table from a file\n"}, + {1, " Open ", "Open a file for debug output\n"}, + {1, " Unload ", "Unload an ACPI table via namespace object\n"}, + + {0, "\nHardware Simulation:", "\n"}, + {1, " EnableAcpi", "Enable ACPI (hardware) mode\n"}, + {1, " Event ", "Generate AcpiEvent (Fixed/GPE)\n"}, + {1, " Gpe [GpeBlockDevice]", "Simulate a GPE\n"}, + {1, " Gpes", "Display info on all GPE devices\n"}, + {1, " Sci", "Generate an SCI\n"}, + {1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"}, #endif {0, NULL, NULL} }; @@ -571,11 +584,15 @@ AcpiDbDisplayHelp ( { /* No argument to help, display help for all commands */ + AcpiOsPrintf ("\nSummary of AML Debugger Commands\n\n"); + while (Next->Invocation) { AcpiOsPrintf ("%-38s%s", Next->Invocation, Next->Description); Next++; } + AcpiOsPrintf ("\n"); + } else { @@ -1256,6 +1273,12 @@ AcpiDbCommandDispatch ( AcpiGbl_DbTerminateLoop = TRUE; /* AcpiInitialize (NULL); */ + break; + + case CMD_BACKGROUND: + + AcpiDbCreateExecutionThread (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], + &AcpiGbl_DbArgTypes[2]); break; case CMD_THREADS: Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c Fri Nov 10 18:46:34 2017 (r325670) @@ -340,7 +340,8 @@ AcpiDsCreateBufferField ( ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } } @@ -524,7 +525,8 @@ AcpiDsGetFieldNames ( WalkState, &Info->ConnectionNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Child->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -540,7 +542,8 @@ AcpiDsGetFieldNames ( WalkState, &Info->FieldNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + (char *) &Arg->Named.Name, Status); return_ACPI_STATUS (Status); } else @@ -639,7 +642,8 @@ AcpiDsCreateField ( #endif if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -769,7 +773,8 @@ AcpiDsInitFieldObjects ( Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE ((char *) &Arg->Named.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + (char *) &Arg->Named.Name, Status); if (Status != AE_ALREADY_EXISTS) { return_ACPI_STATUS (Status); @@ -834,7 +839,8 @@ AcpiDsCreateBankField ( #endif if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.Name, Status); return_ACPI_STATUS (Status); } } @@ -847,7 +853,8 @@ AcpiDsCreateBankField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -920,7 +927,8 @@ AcpiDsCreateIndexField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.RegisterNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } @@ -932,7 +940,8 @@ AcpiDsCreateIndexField ( ACPI_NS_SEARCH_PARENT, WalkState, &Info.DataRegisterNode); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); return_ACPI_STATUS (Status); } Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c Fri Nov 10 18:46:34 2017 (r325670) @@ -223,7 +223,8 @@ AcpiDsBuildInternalObject ( ACPI_NAMESPACE_NODE, &(Op->Common.Node))); if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Op->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Op->Common.Value.String, Status); return_ACPI_STATUS (Status); } } Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c Fri Nov 10 18:46:34 2017 (r325670) @@ -732,7 +732,8 @@ AcpiDsCreateOperand ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (NameString, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + NameString, Status); } } Modified: head/sys/contrib/dev/acpica/components/dispatcher/dswload.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dswload.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/dispatcher/dswload.c Fri Nov 10 18:46:34 2017 (r325670) @@ -325,7 +325,7 @@ AcpiDsLoad1BeginOp ( #endif if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Path, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status); return_ACPI_STATUS (Status); } @@ -495,7 +495,7 @@ AcpiDsLoad1BeginOp ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (Path, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, Path, Status); return_ACPI_STATUS (Status); } } Modified: head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c ============================================================================== --- head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c Fri Nov 10 18:46:34 2017 (r325670) @@ -304,10 +304,12 @@ AcpiDsLoad2BeginOp ( } else { - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + BufferPtr, Status); } #else - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + BufferPtr, Status); #endif return_ACPI_STATUS (Status); } @@ -462,7 +464,8 @@ AcpiDsLoad2BeginOp ( if (ACPI_FAILURE (Status)) { - ACPI_ERROR_NAMESPACE (BufferPtr, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + BufferPtr, Status); return_ACPI_STATUS (Status); } @@ -844,7 +847,8 @@ AcpiDsLoad2EndOp ( } else { - ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status); + ACPI_ERROR_NAMESPACE (WalkState->ScopeInfo, + Arg->Common.Value.String, Status); } break; Modified: head/sys/contrib/dev/acpica/components/events/evregion.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evregion.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/events/evregion.c Fri Nov 10 18:46:34 2017 (r325670) @@ -423,6 +423,17 @@ AcpiEvAddressSpaceDispatch ( { ACPI_EXCEPTION ((AE_INFO, Status, "Returned by Handler for [%s]", AcpiUtGetRegionName (RegionObj->Region.SpaceId))); + + /* + * Special case for an EC timeout. These are seen so frequently + * that an additional error message is helpful + */ + if ((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) && + (Status == AE_TIME)) + { + ACPI_ERROR ((AE_INFO, + "Timeout from EC hardware or EC device driver")); + } } if (!(HandlerDesc->AddressSpace.HandlerFlags & Modified: head/sys/contrib/dev/acpica/components/namespace/nsconvert.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsconvert.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/namespace/nsconvert.c Fri Nov 10 18:46:34 2017 (r325670) @@ -644,7 +644,8 @@ AcpiNsConvertToReference ( { /* Check if we are resolving a named reference within a package */ - ACPI_ERROR_NAMESPACE (OriginalObject->String.Pointer, Status); + ACPI_ERROR_NAMESPACE (&ScopeInfo, + OriginalObject->String.Pointer, Status); goto ErrorExit; } Modified: head/sys/contrib/dev/acpica/components/namespace/nsnames.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsnames.c Fri Nov 10 17:55:44 2017 (r325669) +++ head/sys/contrib/dev/acpica/components/namespace/nsnames.c Fri Nov 10 18:46:34 2017 (r325670) @@ -158,7 +158,13 @@ #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsnames") +/* Local Prototypes */ +static void +AcpiNsNormalizePathname ( + char *OriginalPath); + + /******************************************************************************* * * FUNCTION: AcpiNsGetExternalPathname @@ -506,4 +512,170 @@ AcpiNsGetNormalizedPathname ( (void) AcpiNsBuildNormalizedPath (Node, NameBuffer, Size, NoTrailing); return_PTR (NameBuffer); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsBuildPrefixedPathname + * + * PARAMETERS: PrefixScope - Scope/Path that prefixes the internal path + * InternalPath - Name or path of the namespace node + * + * RETURN: None + * + * DESCRIPTION: Construct a fully qualified pathname from a concatenation of: + * 1) Path associated with the PrefixScope namespace node + * 2) External path representation of the Internal path + * + ******************************************************************************/ + +char * +AcpiNsBuildPrefixedPathname ( + ACPI_GENERIC_STATE *PrefixScope, + const char *InternalPath) +{ + ACPI_STATUS Status; + char *FullPath = NULL; + char *ExternalPath = NULL; + char *PrefixPath = NULL; + UINT32 PrefixPathLength = 0; + + + /* If there is a prefix, get the pathname to it */ + + if (PrefixScope && PrefixScope->Scope.Node) + { + PrefixPath = AcpiNsGetNormalizedPathname (PrefixScope->Scope.Node, TRUE); + if (PrefixPath) + { + PrefixPathLength = strlen (PrefixPath); + } + } + + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, + NULL, &ExternalPath); + if (ACPI_FAILURE (Status)) + { + goto Cleanup; + } + + /* Merge the prefix path and the path. 2 is for one dot and trailing null */ + + FullPath = ACPI_ALLOCATE_ZEROED ( + PrefixPathLength + strlen (ExternalPath) + 2); + if (!FullPath) + { + goto Cleanup; + } + + /* Don't merge if the External path is already fully qualified */ + + if (PrefixPath && + (*ExternalPath != '\\') && + (*ExternalPath != '^')) + { + strcat (FullPath, PrefixPath); + if (PrefixPath[1]) + { + strcat (FullPath, "."); + } + } + + AcpiNsNormalizePathname (ExternalPath); + strcat (FullPath, ExternalPath); + +Cleanup: + if (PrefixPath) + { + ACPI_FREE (PrefixPath); + } + if (ExternalPath) + { + ACPI_FREE (ExternalPath); + } + + return (FullPath); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsNormalizePathname + * + * PARAMETERS: OriginalPath - Path to be normalized, in External format + * + * RETURN: The original path is processed in-place + * + * DESCRIPTION: Remove trailing underscores from each element of a path. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Nov 10 19:10:15 2017 Return-Path: Delivered-To: svn-src-all@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 F233CE03864; Fri, 10 Nov 2017 19:10:15 +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 BDFC27F2B7; Fri, 10 Nov 2017 19:10:15 +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 vAAJAEIm049963; Fri, 10 Nov 2017 19:10:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAJAE3q049962; Fri, 10 Nov 2017 19:10:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711101910.vAAJAE3q049962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 10 Nov 2017 19:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325671 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 325671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 19:10:16 -0000 Author: kib Date: Fri Nov 10 19:10:14 2017 New Revision: 325671 URL: https://svnweb.freebsd.org/changeset/base/325671 Log: Check that the pmc index is less than the number of hardware PMCs, instead of asserting the condition. The row index is directly supplied by userspace, the kernel must handle invalid values. Submitted by: pho MFC after: 3 days Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Fri Nov 10 18:46:34 2017 (r325670) +++ head/sys/dev/hwpmc/hwpmc_mod.c Fri Nov 10 19:10:14 2017 (r325671) @@ -2578,10 +2578,9 @@ pmc_find_pmc(pmc_id_t pmcid, struct pmc **pmc) struct pmc_owner *po; struct pmc_process *pp; - KASSERT(PMC_ID_TO_ROWINDEX(pmcid) < md->pmd_npmc, - ("[pmc,%d] Illegal pmc index %d (max %d)", __LINE__, - PMC_ID_TO_ROWINDEX(pmcid), md->pmd_npmc)); PMCDBG1(PMC,FND,1, "find-pmc id=%d", pmcid); + if (PMC_ID_TO_ROWINDEX(pmcid) >= md->pmd_npmc) + return (EINVAL); if ((po = pmc_find_owner_descriptor(curthread->td_proc)) == NULL) { /* From owner-svn-src-all@freebsd.org Fri Nov 10 19:52:32 2017 Return-Path: Delivered-To: svn-src-all@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 5B220E4EA3F; Fri, 10 Nov 2017 19:52:32 +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 27DA180C3F; Fri, 10 Nov 2017 19:52:32 +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 vAAJqVU1071311; Fri, 10 Nov 2017 19:52:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAJqVLI071310; Fri, 10 Nov 2017 19:52:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711101952.vAAJqVLI071310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 19:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325672 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 19:52:32 -0000 Author: bdrewery Date: Fri Nov 10 19:52:31 2017 New Revision: 325672 URL: https://svnweb.freebsd.org/changeset/base/325672 Log: Don't append TARGET.TARGET_ARCH if OBJTOP is already set. This avoids flipping the expected TARGET.TARGET_ARCH suffix / OBJTOP when it is already set by a parent make which wants to control it more such as in something like 'make native-xtools'. Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Fri Nov 10 19:10:14 2017 (r325671) +++ head/share/mk/src.sys.obj.mk Fri Nov 10 19:52:31 2017 (r325672) @@ -70,6 +70,7 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T} .export OBJROOT SRCTOP .endif +.if empty(OBJTOP) # SRCTOP == OBJROOT only happens with clever MAKEOBJDIRPREFIX=/. Don't # append TARGET.TARGET_ARCH for that case since the user wants to build # in the source tree. @@ -79,6 +80,7 @@ OBJTOP:= ${OBJROOT}${TARGET:D${TARGET}.${TARGET_ARCH}: # TARGET.TARGET_ARCH handled in OBJROOT already. OBJTOP:= ${OBJROOT:H} .endif # ${MK_UNIFIED_OBJDIR} == "yes" +.endif # Fixup OBJROOT/OBJTOP if using MAKEOBJDIRPREFIX but leave it alone # for DIRDEPS_BUILD which really wants to know the absolute top at From owner-svn-src-all@freebsd.org Fri Nov 10 19:53:09 2017 Return-Path: Delivered-To: svn-src-all@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 07CEFE4EADE; Fri, 10 Nov 2017 19:53:09 +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 D5B2280DC6; Fri, 10 Nov 2017 19:53:08 +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 vAAJr8xZ071379; Fri, 10 Nov 2017 19:53:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAJr7Hm071377; Fri, 10 Nov 2017 19:53:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711101953.vAAJr7Hm071377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 19:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325673 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 19:53:09 -0000 Author: bdrewery Date: Fri Nov 10 19:53:07 2017 New Revision: 325673 URL: https://svnweb.freebsd.org/changeset/base/325673 Log: native-xtools: Fix for GCC archs. - This also adds in a _cleanobj step as needed. - This redirects TARGET/TARGET_ARCH to NXB_TARGET/NXB_TARGET_ARCH in Makefile.inc1 as the main build needs to be for MACHINE rather than TARGET. First build the toolchain and then use that as an external toolchain to build the needed directories and NXB_TARGET-toolchain, all as MACHINE files though via TARGET_TRIPLE=MACHINE_TRIPLE. The NXBDIRS is evaluated in the 'everything' submake as it needs to be based on TARGET's src.opts.mk values, such as MK_GCC=yes when building on a MK_CLANG=yes MACHINE. This can likely be changed to a specific _native-xtools-everything target later and the funky late evaluation of SUBDIR_OVERRIDE removed. X-MFC-With: r325001 Pointyhat to: bdrewery MFC after: 2 months Sponsored by: Dell EMC Isilon Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Fri Nov 10 19:52:31 2017 (r325672) +++ head/Makefile Fri Nov 10 19:53:07 2017 (r325673) @@ -290,6 +290,15 @@ ${XTGTS}: _assert_target _TARGET?= ${MACHINE} _TARGET_ARCH?= ${MACHINE_ARCH} +.if make(native-xtools*) +NXB_TARGET:= ${_TARGET} +NXB_TARGET_ARCH:= ${_TARGET_ARCH} +_TARGET= ${MACHINE} +_TARGET_ARCH= ${MACHINE_ARCH} +_MAKE+= NXB_TARGET=${NXB_TARGET} \ + NXB_TARGET_ARCH=${NXB_TARGET_ARCH} +.endif + .if make(print-dir) .SILENT: .endif Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 10 19:52:31 2017 (r325672) +++ head/Makefile.inc1 Fri Nov 10 19:53:07 2017 (r325673) @@ -2110,7 +2110,7 @@ cross-tools: .MAKE .PHONY # to pickup. # NXBOBJROOT= ${OBJROOT}${MACHINE}.${MACHINE_ARCH}/nxb/ -NXBOBJTOP= ${NXBOBJROOT}${TARGET}.${TARGET_ARCH} +NXBOBJTOP= ${NXBOBJROOT}${NXB_TARGET}.${NXB_TARGET_ARCH} NXTP?= /nxb-bin .if ${NXTP:N/*} .error NXTP variable should be an absolute path @@ -2180,20 +2180,27 @@ NXBDIRS+= \ usr.bin/yacc \ usr.sbin/chown +SUBDIR_DEPEND_usr.bin/clang= lib/clang .if ${MK_CLANG} != "no" NXBDIRS+= lib/clang -SUBDIR_DEPEND_usr.bin/clang= lib/clang NXBDIRS+= usr.bin/clang -.elif ${MK_GCC} != "no" +.endif +.if ${MK_GCC} != "no" NXBDIRS+= gnu/usr.bin/cc .endif .if ${MK_BINUTILS} != "no" NXBDIRS+= gnu/usr.bin/binutils .endif +# XXX: native-xtools passes along ${NXBDIRS} in SUBDIR_OVERRIDE that needs +# to be evaluated after NXBDIRS is set. +.if make(install) && !empty(SUBDIR_OVERRIDE) +SUBDIR= ${SUBDIR_OVERRIDE} +.endif NXBMAKEARGS+= \ OBJTOP=${NXBOBJTOP:Q} \ OBJROOT=${NXBOBJROOT:Q} \ + MAKEOBJDIRPREFIX= \ -DNO_SHARED \ -DNO_CPU_CFLAGS \ -DNO_PIC \ @@ -2216,7 +2223,10 @@ NXBMAKEARGS+= \ MK_WARNS=no \ MK_ZFS=no - +.if make(native-xtools*) && \ + (!defined(NXB_TARGET) || !defined(NXB_TARGET_ARCH)) +.error Missing NXB_TARGET / NXB_TARGET_ARCH +.endif # For 'toolchain' we want to produce native binaries that themselves generate # native binaries. NXBTMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS:N-DNO_PIC:N-DNO_SHARED} \ @@ -2224,11 +2234,32 @@ NXBTMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS:N-DNO_PI # For 'everything' we want to produce native binaries (hence -target to # be MACHINE) that themselves generate TARGET.TARGET_ARCH binaries. # TARGET/TARGET_ARCH are still passed along from user. -NXBMAKE= ${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS} \ +# +# Use the toolchain we create as an external toolchain. +.if ${USING_SYSTEM_COMPILER} == "yes" || ${XCC:N${CCACHE_BIN}:M/*} +NXBMAKE+= XCC="${XCC}" \ + XCXX="${XCXX}" \ + XCPP="${XCPP}" +.else +NXBMAKE+= XCC="${NXBOBJTOP}/tmp/usr/bin/cc" \ + XCXX="${NXBOBJTOP}/tmp/usr/bin/c++" \ + XCPP="${NXBOBJTOP}/tmp/usr/bin/cpp" +.endif +NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \ + TARGET=${NXB_TARGET} TARGET_ARCH=${NXB_TARGET_ARCH} \ TARGET_TRIPLE=${MACHINE_TRIPLE:Q} +# NXBDIRS is improperly based on MACHINE rather than NXB_TARGET. Need to +# invoke a sub-make to reevaluate MK_GCC, etc, for NXBDIRS. +NXBMAKE+= SUBDIR_OVERRIDE='$${NXBDIRS:M*}' +# Need to avoid the -isystem logic when using clang as an external toolchain +# even if the TARGET being built for wants GCC. +NXBMAKE+= WANT_COMPILER_TYPE='$${X_COMPILER_TYPE}' native-xtools: .PHONY + ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _cleanobj # Build the bootstrap/host/cross tools that produce native binaries - ${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain + # Pass along MK_GCC=yes to ensure GCC-needed build tools are built. + # We don't quite know what the NXB_TARGET wants so just build it. + ${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain MK_GCC=yes # Populate includes/libraries sysroot that produce native binaries. # This is split out from 'toolchain' above mostly so that target LLVM # libraries have a proper LLVM_DEFAULT_TARGET_TRIPLE without @@ -2238,10 +2269,9 @@ native-xtools: .PHONY ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes MK_CLANG=no MK_GCC=no ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries MK_CLANG=no MK_GCC=no .if !defined(NO_OBJWALK) - ${_+_}cd ${.CURDIR}; ${NXBMAKE} SUBDIR_OVERRIDE="${NXBDIRS:M*}" _obj + ${_+_}cd ${.CURDIR}; ${NXBMAKE} _obj .endif - ${_+_}cd ${.CURDIR}; ${NXBMAKE} SUBDIR_OVERRIDE="${NXBDIRS:M*}" \ - everything + ${_+_}cd ${.CURDIR}; ${NXBMAKE} everything @echo ">> native-xtools done. Use 'make native-xtools-install' to install to a given DESTDIR" native-xtools-install: .PHONY @@ -2250,9 +2280,8 @@ native-xtools-install: .PHONY -p ${NXBDESTDIR}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${NXBDESTDIR}/usr/include >/dev/null - ${_+_}cd ${.CURDIR}; ${NXBMAKE} -f Makefile.inc1 \ + ${_+_}cd ${.CURDIR}; ${NXBMAKE} \ DESTDIR=${NXBDESTDIR} \ - SUBDIR_OVERRIDE="${NXBDIRS:M*}" \ -DNO_ROOT \ install From owner-svn-src-all@freebsd.org Fri Nov 10 19:53:12 2017 Return-Path: Delivered-To: svn-src-all@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 694C2E4EB08; Fri, 10 Nov 2017 19:53:12 +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 3345180DCB; Fri, 10 Nov 2017 19:53:12 +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 vAAJrBTt071427; Fri, 10 Nov 2017 19:53:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAJrB7u071426; Fri, 10 Nov 2017 19:53:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711101953.vAAJrB7u071426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 19:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325674 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 19:53:12 -0000 Author: bdrewery Date: Fri Nov 10 19:53:11 2017 New Revision: 325674 URL: https://svnweb.freebsd.org/changeset/base/325674 Log: Pass down any PROG-specific buildopts for forwarded targets. This currently has no impact. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Fri Nov 10 19:53:07 2017 (r325673) +++ head/share/mk/bsd.crunchgen.mk Fri Nov 10 19:53:11 2017 (r325674) @@ -161,7 +161,8 @@ ${__target}_crunchdir_${P}: .PHONY .MAKE ${_+_}cd ${CRUNCH_SRCDIR_${P}} && \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ ${CRUNCHARGS} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} + DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} \ + ${CRUNCH_BUILDOPTS_${P}} ${__target} ${__target}: ${__target}_crunchdir_${P} .endfor .endfor From owner-svn-src-all@freebsd.org Fri Nov 10 19:53:15 2017 Return-Path: Delivered-To: svn-src-all@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 C2244E4EB3F; Fri, 10 Nov 2017 19:53:15 +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 89DBE80E0E; Fri, 10 Nov 2017 19:53:15 +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 vAAJrEvJ071474; Fri, 10 Nov 2017 19:53:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAJrEK3071473; Fri, 10 Nov 2017 19:53:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711101953.vAAJrEK3071473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 19:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325675 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 19:53:15 -0000 Author: bdrewery Date: Fri Nov 10 19:53:14 2017 New Revision: 325675 URL: https://svnweb.freebsd.org/changeset/base/325675 Log: AUTO_OBJ: No need to tree-walk with 'make obj' here. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Fri Nov 10 19:53:11 2017 (r325674) +++ head/share/mk/bsd.crunchgen.mk Fri Nov 10 19:53:14 2017 (r325675) @@ -154,7 +154,10 @@ build-tools: build-tools-${_tool} # Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't # get that to cooperate with bsd.prog.mk. Besides, many of the standard # targets should NOT be propagated into the components. -.for __target in clean cleandepend cleandir obj objlink +.if ${MK_AUTO_OBJ} == "no" +_obj= obj +.endif +.for __target in clean cleandepend cleandir ${_obj} objlink .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} ${__target}_crunchdir_${P}: .PHONY .MAKE From owner-svn-src-all@freebsd.org Fri Nov 10 19:53:20 2017 Return-Path: Delivered-To: svn-src-all@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 4E1F1E4EB6F; Fri, 10 Nov 2017 19:53:20 +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 67B4E80EA5; Fri, 10 Nov 2017 19:53:18 +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 vAAJrHDo071521; Fri, 10 Nov 2017 19:53:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAJrHNR071520; Fri, 10 Nov 2017 19:53:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711101953.vAAJrHNR071520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 19:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325676 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 19:53:21 -0000 Author: bdrewery Date: Fri Nov 10 19:53:17 2017 New Revision: 325676 URL: https://svnweb.freebsd.org/changeset/base/325676 Log: No need to run 'make depend' with FAST_DEPEND logic in-tree. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Fri Nov 10 19:53:14 2017 (r325675) +++ head/share/mk/bsd.crunchgen.mk Fri Nov 10 19:53:17 2017 (r325676) @@ -122,7 +122,11 @@ ${OUTPUTS}: ${CONF} ${CRUNCHGEN} -fq -m ${OUTMK} -c ${OUTC} ${CONF} # Avoid redundantly calling 'make objs' which we've done by our # own dependencies. - sed -i '' -e "s/^\(${PROG}:.*\) \$$(SUBMAKE_TARGETS)/\1/" ${OUTMK} + # Also avoid unneeded 'make depend' call. + sed -i '' \ + -e "s/^\(${PROG}:.*\) \$$(SUBMAKE_TARGETS)/\1/" \ + -e '/$$(CRUNCHMAKE) $$(BUILDOPTS).* \ &&.*/d' \ + ${OUTMK} # These 2 targets cannot use .MAKE since they depend on the generated # ${OUTMK} above. From owner-svn-src-all@freebsd.org Fri Nov 10 20:09:12 2017 Return-Path: Delivered-To: svn-src-all@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 91E79E4F085; Fri, 10 Nov 2017 20:09:12 +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 5179B1932; Fri, 10 Nov 2017 20:09:12 +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 vAAK9B0S076031; Fri, 10 Nov 2017 20:09:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAK9BNl076030; Fri, 10 Nov 2017 20:09:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711102009.vAAK9BNl076030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 20:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325677 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 20:09:12 -0000 Author: bdrewery Date: Fri Nov 10 20:09:11 2017 New Revision: 325677 URL: https://svnweb.freebsd.org/changeset/base/325677 Log: Allow consuming Makefiles to add to DEPENDFILES. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Fri Nov 10 19:53:17 2017 (r325676) +++ head/share/mk/bsd.dep.mk Fri Nov 10 20:09:11 2017 (r325677) @@ -182,7 +182,7 @@ DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*. .if !empty(DEPENDSRCS) DEPENDOBJS+= ${DEPENDSRCS:${OBJS_SRCS_FILTER:ts:}:S,$,.o,} .endif -DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} +DEPENDFILES+= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} .if defined(_SKIP_DEPEND) # Don't bother statting any .meta files for .depend* ${DEPENDOBJS}: .NOMETA @@ -190,7 +190,7 @@ ${DEPENDFILE}: .NOMETA # Unset these to avoid looping/statting on them later. .undef DEPENDSRCS .undef DEPENDOBJS -.undef DEPENDFILES_OBJS +.undef DEPENDFILES .endif # defined(_SKIP_DEPEND) DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} @@ -201,7 +201,7 @@ DEPEND_CFLAGS+= -MT${.TARGET} DEPEND_CFLAGS_CONDITION= "${DEPENDOBJS:${DEPEND_FILTER}:M${.TARGET:${DEPEND_FILTER}}}" != "" CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:} .endif -.for __depend_obj in ${DEPENDFILES_OBJS} +.for __depend_obj in ${DEPENDFILES} .if ${MAKE_VERSION} < 20160220 .sinclude "${.OBJDIR}/${__depend_obj}" .else @@ -273,7 +273,7 @@ beforebuild: depend depend: beforedepend ${DEPENDFILE} afterdepend # Tell bmake not to look for generated files via .PATH -.NOPATH: ${DEPENDFILE} ${DEPENDFILES_OBJS} +.NOPATH: ${DEPENDFILE} ${DEPENDFILES} DPSRCS+= ${SRCS} # A .depend file will only be generated if there are commands in From owner-svn-src-all@freebsd.org Fri Nov 10 20:09:16 2017 Return-Path: Delivered-To: svn-src-all@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 CFE6CE4F0A6; Fri, 10 Nov 2017 20:09:16 +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 9B153194F; Fri, 10 Nov 2017 20:09:16 +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 vAAK9FCS076083; Fri, 10 Nov 2017 20:09:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAK9FHA076080; Fri, 10 Nov 2017 20:09:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711102009.vAAK9FHA076080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 20:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325678 - in head/lib/clang: libclang libllvm X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head/lib/clang: libclang libllvm X-SVN-Commit-Revision: 325678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 20:09:17 -0000 Author: bdrewery Date: Fri Nov 10 20:09:15 2017 New Revision: 325678 URL: https://svnweb.freebsd.org/changeset/base/325678 Log: Tell bsd.dep.mk which depend files to dinclude. This allows the _SKIP_DEPEND optimization to work, avoiding reading the files when not needed. It also fixes META_MODE incorrectly reading these files when not needed. Sponsored by: Dell EMC Isilon Modified: head/lib/clang/libclang/Makefile head/lib/clang/libllvm/Makefile Modified: head/lib/clang/libclang/Makefile ============================================================================== --- head/lib/clang/libclang/Makefile Fri Nov 10 20:09:11 2017 (r325677) +++ head/lib/clang/libclang/Makefile Fri Nov 10 20:09:15 2017 (r325678) @@ -790,16 +790,7 @@ clang/StaticAnalyzer/Checkers/Checkers.inc: \ ${CLANG_SRCS}/include/clang/StaticAnalyzer/Checkers/Checkers.td TGHDRS+= clang/StaticAnalyzer/Checkers/Checkers.inc -.for dep in ${TGHDRS:C/$/.d/} -. if ${MAKE_VERSION} < 20160220 -. if !make(depend) -. sinclude "${dep}" -. endif -. else -. dinclude "${dep}" -. endif -.endfor - +DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Fri Nov 10 20:09:11 2017 (r325677) +++ head/lib/clang/libllvm/Makefile Fri Nov 10 20:09:15 2017 (r325678) @@ -1412,16 +1412,7 @@ TGHDRS+= X86GenRegisterBank.inc TGHDRS+= X86GenRegisterInfo.inc TGHDRS+= X86GenSubtargetInfo.inc -.for dep in ${TGHDRS:C/$/.d/} -. if ${MAKE_VERSION} < 20160220 -. if !make(depend) -. sinclude "${dep}" -. endif -. else -. dinclude "${dep}" -. endif -.endfor - +DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} From owner-svn-src-all@freebsd.org Fri Nov 10 20:10:06 2017 Return-Path: Delivered-To: svn-src-all@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 BE129E4F191; Fri, 10 Nov 2017 20:10:06 +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 8B2661C49; Fri, 10 Nov 2017 20:10:06 +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 vAAKA52n076184; Fri, 10 Nov 2017 20:10:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAKA597076183; Fri, 10 Nov 2017 20:10:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711102010.vAAKA597076183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 20:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325679 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 20:10:06 -0000 Author: bdrewery Date: Fri Nov 10 20:10:05 2017 New Revision: 325679 URL: https://svnweb.freebsd.org/changeset/base/325679 Log: AUTO_OBJ: Don't create .OBJDIR with 'make -n'. Sponsored by: Dell EMC Isilon Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Nov 10 20:09:15 2017 (r325678) +++ head/share/mk/sys.mk Fri Nov 10 20:10:05 2017 (r325679) @@ -118,7 +118,7 @@ NO_META_IGNORE_HOST_HEADERS= 1 # This needs to be done early - before .PATH is computed # Don't do this for 'make showconfig' as it enables all options where meta mode # is not expected. -.if !make(showconfig) && !make(print-dir) +.if !make(showconfig) && !make(print-dir) && empty(.MAKEFLAGS:M-[nN]) .sinclude .endif .endif # ${MK_AUTO_OBJ} == "yes" From owner-svn-src-all@freebsd.org Fri Nov 10 20:30:12 2017 Return-Path: Delivered-To: svn-src-all@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 579C0E4F914; Fri, 10 Nov 2017 20:30:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 20BFB27CD; Fri, 10 Nov 2017 20:30:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAAKUBn5084646; Fri, 10 Nov 2017 20:30:11 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAKUBfN084645; Fri, 10 Nov 2017 20:30:11 GMT (envelope-from np@FreeBSD.org) Message-Id: <201711102030.vAAKUBfN084645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 10 Nov 2017 20:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325680 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 325680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 20:30:12 -0000 Author: np Date: Fri Nov 10 20:30:10 2017 New Revision: 325680 URL: https://svnweb.freebsd.org/changeset/base/325680 Log: cxgbe(4): Excluce mdi from the check against port capabilities. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Nov 10 20:10:05 2017 (r325679) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Nov 10 20:30:10 2017 (r325680) @@ -3727,12 +3727,13 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED); } - rcap = aneg | speed | fc | fec | mdi; + rcap = aneg | speed | fc | fec; if ((rcap | lc->supported) != lc->supported) { CH_WARN(adap, "rcap 0x%08x, pcap 0x%08x\n", rcap, lc->supported); rcap &= lc->supported; } + rcap |= mdi; memset(&c, 0, sizeof(c)); c.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | From owner-svn-src-all@freebsd.org Fri Nov 10 21:26:45 2017 Return-Path: Delivered-To: svn-src-all@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 ACF7FE50EB0; Fri, 10 Nov 2017 21:26:45 +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 7651963A1C; Fri, 10 Nov 2017 21:26:45 +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 vAALQiOf009911; Fri, 10 Nov 2017 21:26:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAALQi7w009910; Fri, 10 Nov 2017 21:26:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711102126.vAALQi7w009910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 10 Nov 2017 21:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325681 - head/sys/boot/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/boot/efi/boot1 X-SVN-Commit-Revision: 325681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 21:26:45 -0000 Author: emaste Date: Fri Nov 10 21:26:44 2017 New Revision: 325681 URL: https://svnweb.freebsd.org/changeset/base/325681 Log: boot1: avoid using NULL device path As of r323063 boot1 printed out the path & device from which it was loaded, but uboot's EFI implementation lacked some support, resulting in a NULL pointer and a crash. Check for a NULL pointer and avoid reporting (and storing in the environment) the device and path in this case. Submitted by: Zakary Nafziger MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13038 Modified: head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Fri Nov 10 20:30:10 2017 (r325680) +++ head/sys/boot/efi/boot1/boot1.c Fri Nov 10 21:26:44 2017 (r325681) @@ -460,22 +460,23 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) imgpath = NULL; if (status == EFI_SUCCESS) { text = efi_devpath_name(img->FilePath); - printf(" Load Path: %S\n", text); - efi_setenv_freebsd_wcs("Boot1Path", text); - efi_free_devpath_name(text); - - status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, - (void **)&imgpath); - if (status != EFI_SUCCESS) { - DPRINTF("Failed to get image DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - } else { - text = efi_devpath_name(imgpath); - printf(" Load Device: %S\n", text); - efi_setenv_freebsd_wcs("Boot1Dev", text); + if (text != NULL) { + printf(" Load Path: %S\n", text); + efi_setenv_freebsd_wcs("Boot1Path", text); efi_free_devpath_name(text); - } + status = BS->HandleProtocol(img->DeviceHandle, + &DevicePathGUID, (void **)&imgpath); + if (status != EFI_SUCCESS) { + DPRINTF("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + } else { + text = efi_devpath_name(imgpath); + printf(" Load Device: %S\n", text); + efi_setenv_freebsd_wcs("Boot1Dev", text); + efi_free_devpath_name(text); + } + } } /* Get all the device handles */ From owner-svn-src-all@freebsd.org Fri Nov 10 21:42:06 2017 Return-Path: Delivered-To: svn-src-all@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 CDC06E51476; Fri, 10 Nov 2017 21:42:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4316640E1; Fri, 10 Nov 2017 21:42:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vAALfvll030945; Fri, 10 Nov 2017 13:41:57 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vAALfvfh030944; Fri, 10 Nov 2017 13:41:57 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201711102141.vAALfvfh030944@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r325568 - head In-Reply-To: <201711082341.vA8NfRUL041330@repo.freebsd.org> To: Bryan Drewery Date: Fri, 10 Nov 2017 13:41:57 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 21:42:06 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: bdrewery > Date: Wed Nov 8 23:41:27 2017 > New Revision: 325568 > URL: https://svnweb.freebsd.org/changeset/base/325568 > > Log: > universe: Fix creating LINT files with AUTO_OBJ. > > These are expected to be created in .CURDIR. > Doesn't that fly in the face of a readonly src tree? > Reported by: kib > Sponsored by: Dell EMC Isilon > > Modified: > head/Makefile > > Modified: head/Makefile > ============================================================================== > --- head/Makefile Wed Nov 8 23:32:56 2017 (r325567) > +++ head/Makefile Wed Nov 8 23:41:27 2017 (r325568) > @@ -553,7 +553,8 @@ universe_${target}_kernels: universe_${target}_worlds > universe_${target}_kernels: universe_${target}_prologue .MAKE .PHONY > .if exists(${KERNSRCDIR}/${target}/conf/NOTES) > @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ > - ${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ > + ${SUB_MAKE} -DNO_OBJ LINT \ > + > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ > (echo "${target} 'make LINT' failed," \ > "check _.${target}.makeLINT for details"| ${MAKEFAIL})) > .endif > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Nov 10 21:43:59 2017 Return-Path: Delivered-To: svn-src-all@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 C66E5E51736; Fri, 10 Nov 2017 21:43:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9667B64451; Fri, 10 Nov 2017 21:43:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id AE594302; Fri, 10 Nov 2017 21:43:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id BC34A77AD; Fri, 10 Nov 2017 21:43:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id o-f-sTZZoWjM; Fri, 10 Nov 2017 21:43:55 +0000 (UTC) Subject: Re: svn commit: r325568 - head DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com CE3D177A8 To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711102141.vAALfvfh030944@pdx.rh.CN85.dnsmgr.net> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Fri, 10 Nov 2017 13:43:41 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201711102141.vAALfvfh030944@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pF6k5xw0TuOJIkQElQOlPxc8c2aCnATdn" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 21:43:59 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pF6k5xw0TuOJIkQElQOlPxc8c2aCnATdn Content-Type: multipart/mixed; boundary="xpWbdcxfSfgNnKDWE8w8rwDw8GqBR73pp"; protected-headers="v1" From: Bryan Drewery To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r325568 - head References: <201711102141.vAALfvfh030944@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201711102141.vAALfvfh030944@pdx.rh.CN85.dnsmgr.net> --xpWbdcxfSfgNnKDWE8w8rwDw8GqBR73pp Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/10/2017 1:41 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: bdrewery >> Date: Wed Nov 8 23:41:27 2017 >> New Revision: 325568 >> URL: https://svnweb.freebsd.org/changeset/base/325568 >> >> Log: >> universe: Fix creating LINT files with AUTO_OBJ. >> =20 >> These are expected to be created in .CURDIR. >> =20 >=20 > Doesn't that fly in the face of a readonly src tree? Yes, it's the wrong behavior IMO but it's how it was working before. I have this on my list to come back to later to see if I can avoid it. It was simpler to disable the new feature for now in this case. >=20 >> Reported by: kib >> Sponsored by: Dell EMC Isilon >> >> Modified: >> head/Makefile >> >> Modified: head/Makefile >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/Makefile Wed Nov 8 23:32:56 2017 (r325567) >> +++ head/Makefile Wed Nov 8 23:41:27 2017 (r325568) >> @@ -553,7 +553,8 @@ universe_${target}_kernels: universe_${target}_wor= lds=20 >> universe_${target}_kernels: universe_${target}_prologue .MAKE .PHONY >> .if exists(${KERNSRCDIR}/${target}/conf/NOTES) >> @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=3D/dev/null \ >> - ${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ >> + ${SUB_MAKE} -DNO_OBJ LINT \ >> + > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ >> (echo "${target} 'make LINT' failed," \ >> "check _.${target}.makeLINT for details"| ${MAKEFAIL})) >> .endif >> >> >=20 --=20 Regards, Bryan Drewery --xpWbdcxfSfgNnKDWE8w8rwDw8GqBR73pp-- --pF6k5xw0TuOJIkQElQOlPxc8c2aCnATdn 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 iQEcBAEBAgAGBQJaBh2NAAoJEDXXcbtuRpfPxWoIAN9OfIMipAO38LsKuJILgwy8 azYrNQtohZCQzmUiXj/gaf1a0se0GhA5hGpd1+fu+nkLwWyOE2v5c7v6NOfFqsie 0qOiMaoXf4jA7AFt4xJb5aZW7Zx3B+5dehbuSoKC8u0LNe2n3CLTy6v7JzFZ/IYZ K/rvzb0yNU7oSUV+yAeaCoCd8D8dDx7IOnn7eQwVYgfRkWAj5IOSA+1kErNdR4IO euFANmHIGUFElMWH6xhddcpbnbu9qjtdVOpDe0e24yx1BC0jf4VBZREmnI+9Debg dSkaIJNQfqjFwvz3Zy+ZX0FF90BioEY+c4OmpY9KDkWEfGIy3QvD55ir9SfnQ5k= =C+In -----END PGP SIGNATURE----- --pF6k5xw0TuOJIkQElQOlPxc8c2aCnATdn-- From owner-svn-src-all@freebsd.org Fri Nov 10 21:49:13 2017 Return-Path: Delivered-To: svn-src-all@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 CA4ADE519ED; Fri, 10 Nov 2017 21:49:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A169C64778; Fri, 10 Nov 2017 21:49:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vAALnClO031003; Fri, 10 Nov 2017 13:49:12 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vAALnCiY031002; Fri, 10 Nov 2017 13:49:12 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201711102149.vAALnCiY031002@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r325594 - head/sys/ddb In-Reply-To: <201711091338.vA9DcOgZ093324@repo.freebsd.org> To: Gavin Atkinson Date: Fri, 10 Nov 2017 13:49:12 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 21:49:13 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: gavin > Date: Thu Nov 9 13:38:24 2017 > New Revision: 325594 > URL: https://svnweb.freebsd.org/changeset/base/325594 > > Log: > Point people towards our https web site for documentation, http accesses are > just redirected anyway. > > MFC after: 1 week Why are we not sending them to man 4 ddb???? > Modified: > head/sys/ddb/db_command.c > > Modified: head/sys/ddb/db_command.c > ============================================================================== > --- head/sys/ddb/db_command.c Thu Nov 9 13:38:17 2017 (r325593) > +++ head/sys/ddb/db_command.c Thu Nov 9 13:38:24 2017 (r325594) > @@ -398,7 +398,7 @@ db_command(struct command **last_cmdp, struct command_ > case CMD_HELP: > if (cmd_table == &db_cmd_table) { > db_printf("This is ddb(4), the kernel debugger; " > - "see http://man.freebsd.org/ddb/4 for help.\n"); > + "see https://man.FreeBSD.org/ddb/4 for help.\n"); > db_printf("Use \"bt\" for backtrace, \"dump\" for " > "kernel core dump, \"reset\" to reboot.\n"); > db_printf("Available commands:\n"); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Nov 10 21:52:34 2017 Return-Path: Delivered-To: svn-src-all@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 A9E43E51C7C; Fri, 10 Nov 2017 21:52:34 +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 748DF64C6D; Fri, 10 Nov 2017 21:52:34 +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 vAALqXrW022694; Fri, 10 Nov 2017 21:52:33 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAALqXVE022693; Fri, 10 Nov 2017 21:52:33 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711102152.vAALqXVE022693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 10 Nov 2017 21:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325682 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 21:52:34 -0000 Author: bdrewery Date: Fri Nov 10 21:52:33 2017 New Revision: 325682 URL: https://svnweb.freebsd.org/changeset/base/325682 Log: Remove rerelease target that was added in r38978. I'm not sure what this target is but it doesn't exist now and doesn't seem to have existed before. Sponsored by: Dell EMC Isilon Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Fri Nov 10 21:26:44 2017 (r325681) +++ head/Makefile Fri Nov 10 21:52:33 2017 (r325682) @@ -130,7 +130,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel bu installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries lint maninstall \ - obj objlink rerelease showconfig tags toolchain update \ + obj objlink showconfig tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _build-metadata _cross-tools _includes _libraries \ build32 distribute32 install32 buildsoft distributesoft installsoft \ From owner-svn-src-all@freebsd.org Fri Nov 10 22:17:31 2017 Return-Path: Delivered-To: svn-src-all@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 932A5E524DD; Fri, 10 Nov 2017 22:17:31 +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 5DE6865D00; Fri, 10 Nov 2017 22:17:31 +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 vAAMHU7D032153; Fri, 10 Nov 2017 22:17:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAAMHUJB032152; Fri, 10 Nov 2017 22:17:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711102217.vAAMHUJB032152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 10 Nov 2017 22:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325683 - head/sys/dev/vnic X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/vnic X-SVN-Commit-Revision: 325683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 22:17:31 -0000 Author: emaste Date: Fri Nov 10 22:17:30 2017 New Revision: 325683 URL: https://svnweb.freebsd.org/changeset/base/325683 Log: vnic: apply BPF tap before passing packet to hardware Previously we passed tx packets to hardware via nicvf_tx_mbuf_locked and then to the BPF tap, with a possibly invalid mbuf which would result in a panic. PR: 223600 Discussed with: bz MFC after: 1 week Sponsored by: The FreeBSD Foundation, Packet.net (hardware) Modified: head/sys/dev/vnic/nicvf_queues.c Modified: head/sys/dev/vnic/nicvf_queues.c ============================================================================== --- head/sys/dev/vnic/nicvf_queues.c Fri Nov 10 21:52:33 2017 (r325682) +++ head/sys/dev/vnic/nicvf_queues.c Fri Nov 10 22:17:30 2017 (r325683) @@ -992,6 +992,9 @@ nicvf_xmit_locked(struct snd_queue *sq) err = 0; while ((next = drbr_peek(ifp, sq->br)) != NULL) { + /* Send a copy of the frame to the BPF listener */ + ETHER_BPF_MTAP(ifp, next); + err = nicvf_tx_mbuf_locked(sq, &next); if (err != 0) { if (next == NULL) @@ -1002,8 +1005,6 @@ nicvf_xmit_locked(struct snd_queue *sq) break; } drbr_advance(ifp, sq->br); - /* Send a copy of the frame to the BPF listener */ - ETHER_BPF_MTAP(ifp, next); } return (err); } From owner-svn-src-all@freebsd.org Fri Nov 10 22:37:03 2017 Return-Path: Delivered-To: svn-src-all@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 A87A1E52AEB; Fri, 10 Nov 2017 22:37:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.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 7CC7966705; Fri, 10 Nov 2017 22:37:03 +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 mail.baldwin.cx (Postfix) with ESMTPSA id 0745E10A8BA; Fri, 10 Nov 2017 17:37:02 -0500 (EST) From: John Baldwin To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325681 - head/sys/boot/efi/boot1 Date: Fri, 10 Nov 2017 14:23:23 -0800 Message-ID: <1873424.jIhDDOsQTz@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201711102126.vAALQi7w009910@repo.freebsd.org> References: <201711102126.vAALQi7w009910@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.4.3 (mail.baldwin.cx); Fri, 10 Nov 2017 17:37:02 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 22:37:03 -0000 On Friday, November 10, 2017 09:26:44 PM Ed Maste wrote: > Author: emaste > Date: Fri Nov 10 21:26:44 2017 > New Revision: 325681 > URL: https://svnweb.freebsd.org/changeset/base/325681 > > Log: > boot1: avoid using NULL device path > > As of r323063 boot1 printed out the path & device from which it was > loaded, but uboot's EFI implementation lacked some support, resulting in > a NULL pointer and a crash. Check for a NULL pointer and avoid > reporting (and storing in the environment) the device and path in this > case. > > Submitted by: Zakary Nafziger > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D13038 > > Modified: > head/sys/boot/efi/boot1/boot1.c > > Modified: head/sys/boot/efi/boot1/boot1.c > ============================================================================== > --- head/sys/boot/efi/boot1/boot1.c Fri Nov 10 20:30:10 2017 (r325680) > +++ head/sys/boot/efi/boot1/boot1.c Fri Nov 10 21:26:44 2017 (r325681) > @@ -460,22 +460,23 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) > imgpath = NULL; > if (status == EFI_SUCCESS) { > text = efi_devpath_name(img->FilePath); > - printf(" Load Path: %S\n", text); > - efi_setenv_freebsd_wcs("Boot1Path", text); > - efi_free_devpath_name(text); > - > - status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, > - (void **)&imgpath); > - if (status != EFI_SUCCESS) { > - DPRINTF("Failed to get image DevicePath (%lu)\n", > - EFI_ERROR_CODE(status)); > - } else { > - text = efi_devpath_name(imgpath); > - printf(" Load Device: %S\n", text); > - efi_setenv_freebsd_wcs("Boot1Dev", text); > + if (text != NULL) { > + printf(" Load Path: %S\n", text); > + efi_setenv_freebsd_wcs("Boot1Path", text); > efi_free_devpath_name(text); > - } > > + status = BS->HandleProtocol(img->DeviceHandle, > + &DevicePathGUID, (void **)&imgpath); > + if (status != EFI_SUCCESS) { > + DPRINTF("Failed to get image DevicePath (%lu)\n", > + EFI_ERROR_CODE(status)); > + } else { > + text = efi_devpath_name(imgpath); Shouldn't you check this for NULL as well then? -- John Baldwin From owner-svn-src-all@freebsd.org Fri Nov 10 22:58:20 2017 Return-Path: Delivered-To: svn-src-all@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 5D636E53318; Fri, 10 Nov 2017 22:58:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BE8267312; Fri, 10 Nov 2017 22:58:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 498B61C9F; Fri, 10 Nov 2017 22:58:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 4EB0E7949; Fri, 10 Nov 2017 22:58:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Lx_O08_Rr3Jx; Fri, 10 Nov 2017 22:58:15 +0000 (UTC) Subject: Re: svn commit: r325594 - head/sys/ddb DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 5626B7944 To: rgrimes@freebsd.org, Gavin Atkinson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711102149.vAALnCiY031002@pdx.rh.CN85.dnsmgr.net> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <8d3366d3-f51c-4693-ffaa-4003b8822ace@FreeBSD.org> Date: Fri, 10 Nov 2017 14:57:56 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201711102149.vAALnCiY031002@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vvacH1xMoU3Wht8FgMcXQO1Fta3A10mHE" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 22:58:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vvacH1xMoU3Wht8FgMcXQO1Fta3A10mHE Content-Type: multipart/mixed; boundary="S37Vi87OK0h2gHCNatKrh5hPU3pm70bIo"; protected-headers="v1" From: Bryan Drewery To: rgrimes@freebsd.org, Gavin Atkinson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <8d3366d3-f51c-4693-ffaa-4003b8822ace@FreeBSD.org> Subject: Re: svn commit: r325594 - head/sys/ddb References: <201711102149.vAALnCiY031002@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201711102149.vAALnCiY031002@pdx.rh.CN85.dnsmgr.net> --S37Vi87OK0h2gHCNatKrh5hPU3pm70bIo Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/10/2017 1:49 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: gavin >> Date: Thu Nov 9 13:38:24 2017 >> New Revision: 325594 >> URL: https://svnweb.freebsd.org/changeset/base/325594 >> >> Log: >> Point people towards our https web site for documentation, http acce= sses are >> just redirected anyway. >> =20 >> MFC after: 1 week >=20 > Why are we not sending them to man 4 ddb???? >=20 >> Modified: >> head/sys/ddb/db_command.c >> >> Modified: head/sys/ddb/db_command.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/ddb/db_command.c Thu Nov 9 13:38:17 2017 (r325593) >> +++ head/sys/ddb/db_command.c Thu Nov 9 13:38:24 2017 (r325594) >> @@ -398,7 +398,7 @@ db_command(struct command **last_cmdp, struct comm= and_ >> case CMD_HELP: >> if (cmd_table =3D=3D &db_cmd_table) { >> db_printf("This is ddb(4), the kernel debugger; " We sort of do here ^ >> - "see http://man.freebsd.org/ddb/4 for help.\n"); >> + "see https://man.FreeBSD.org/ddb/4 for help.\n"); But I think more importantly they may be stuck in a debugger and not be able to run 'man'. The same could be said for opening a browser but it's more likely they're going to have another system that can load a website but not as assured it will be FreeBSD with the ddb manpage. >> db_printf("Use \"bt\" for backtrace, \"dump\" for " >> "kernel core dump, \"reset\" to reboot.\n"); >> db_printf("Available commands:\n"); >> >> >=20 --=20 Regards, Bryan Drewery --S37Vi87OK0h2gHCNatKrh5hPU3pm70bIo-- --vvacH1xMoU3Wht8FgMcXQO1Fta3A10mHE 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 iQEcBAEBAgAGBQJaBi70AAoJEDXXcbtuRpfPQZQH/184g3BzS89M7yncUXk1RImd I/Kd9rInKcce3TejoLnD2c9FWL/0rSKedm6WnE+mTSV77MtdL7g94KRE7yDo+dYz gzWxtsxFehtjSHhJHXkXWoc3356LZNwBSD7Ce7SE5TL3NPcmpIUNDAkPTYb/cl2y Ep0YrucZ2CrtlLPsRaTFYEAbkAQ+qZEbS3moStr9NWSHqgeDBOxcBf3cTJun30SW kwtQS6QLJVT7U9Wc5qgPWbySfI19NAKulS7mjPf31t9VsNn88f7UutEwupYbicya Oh5J/TT96TsDmDXO8nZdMu0X0RXxZcwYEMJGlveissJd2vc2GuY/jrd86oRLPNk= =QJOB -----END PGP SIGNATURE----- --vvacH1xMoU3Wht8FgMcXQO1Fta3A10mHE-- From owner-svn-src-all@freebsd.org Fri Nov 10 23:30:24 2017 Return-Path: Delivered-To: svn-src-all@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 7F074E53A26; Fri, 10 Nov 2017 23:30:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58C006800F; Fri, 10 Nov 2017 23:30:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANUNY2062398; Fri, 10 Nov 2017 23:30:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANUNM9062394; Fri, 10 Nov 2017 23:30:23 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102330.vAANUNM9062394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325684 - in head: lib/libefivar usr.sbin/efivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: lib/libefivar usr.sbin/efivar X-SVN-Commit-Revision: 325684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:30:24 -0000 Author: imp Date: Fri Nov 10 23:30:23 2017 New Revision: 325684 URL: https://svnweb.freebsd.org/changeset/base/325684 Log: Simplify the efivar interface a little. We started out having Linux compatible libefivar interfaces. This was in anticipation of porting the GPL'd efibootmgr to FreeBSD via a port. However, since we need that functionality in the base, that port isn't going to happened. It also appears that efivar is a private library that's not used much outside a command line util and efibootmgr. Reduce compatibility with the Linux version a little by removing the mode parameter to efi_set_variable (which was unused on FreeBSD, and not set to something useful in the code we'd written). Also remove some efi error routines that were never implemented and existed only to placate early GPL efibootmgr porting experiments. Suggested by: Matt Williams Sponsored by: Netflix Modified: head/lib/libefivar/efivar.c head/lib/libefivar/efivar.h head/usr.sbin/efivar/efivar.c Modified: head/lib/libefivar/efivar.c ============================================================================== --- head/lib/libefivar/efivar.c Fri Nov 10 22:17:30 2017 (r325683) +++ head/lib/libefivar/efivar.c Fri Nov 10 23:30:23 2017 (r325684) @@ -150,7 +150,7 @@ efi_append_variable(efi_guid_t guid, const char *name, { return efi_set_variable(guid, name, data, data_size, - attributes | EFI_VARIABLE_APPEND_WRITE, 0); + attributes | EFI_VARIABLE_APPEND_WRITE); } int @@ -158,7 +158,7 @@ efi_del_variable(efi_guid_t guid, const char *name) { /* data_size of 0 deletes the variable */ - return efi_set_variable(guid, name, NULL, 0, 0, 0); + return efi_set_variable(guid, name, NULL, 0, 0); } int @@ -358,7 +358,7 @@ efi_name_to_guid(const char *name, efi_guid_t *guid) int efi_set_variable(efi_guid_t guid, const char *name, - uint8_t *data, size_t data_size, uint32_t attributes, mode_t mode __unused) + uint8_t *data, size_t data_size, uint32_t attributes) { struct efi_var_ioc var; int rv; Modified: head/lib/libefivar/efivar.h ============================================================================== --- head/lib/libefivar/efivar.h Fri Nov 10 22:17:30 2017 (r325683) +++ head/lib/libefivar/efivar.h Fri Nov 10 23:30:23 2017 (r325684) @@ -83,7 +83,7 @@ int efi_guid_to_symbol(efi_guid_t *guid, char **symbol int efi_guid_to_str(const efi_guid_t *guid, char **sp); int efi_name_to_guid(const char *name, efi_guid_t *guid); int efi_set_variable(efi_guid_t guid, const char *name, - uint8_t *data, size_t data_size, uint32_t attributes, mode_t mode); + uint8_t *data, size_t data_size, uint32_t attributes); int efi_str_to_guid(const char *s, efi_guid_t *guid); int efi_variables_supported(void); @@ -98,38 +98,5 @@ struct uuid_table int efi_known_guid(struct uuid_table **); extern const efi_guid_t efi_guid_empty; - -/* Stubs that are expected, but aren't really used */ -static inline int -efi_error_get(unsigned int n __unused, char ** const fn __unused, - char ** const func __unused, int *line __unused, - char ** const msg __unused, int *err __unused) -{ - return 0; -} - -static inline int -efi_error_set(const char *fn __unused, const char *func __unused, - int line __unused, int err __unused, const char *fmt __unused, ...) -{ - return 0; -} - -static inline void -efi_error_clear(void) -{ -} - -static inline int -efi_error(const char *fmt __unused, ...) -{ - return 0; -} - -static inline int -efi_error_val(int val __unused, const char *fmt __unused, ...) -{ - return 0; -} #endif /* _EFIVAR_H_ */ Modified: head/usr.sbin/efivar/efivar.c ============================================================================== --- head/usr.sbin/efivar/efivar.c Fri Nov 10 22:17:30 2017 (r325683) +++ head/usr.sbin/efivar/efivar.c Fri Nov 10 23:30:23 2017 (r325684) @@ -147,7 +147,7 @@ write_variable(char *name, char *val) breakdown_name(name, &guid, &vname); data = get_value(val, &datalen); - if (efi_set_variable(guid, vname, data, datalen, attrib, 0) < 0) + if (efi_set_variable(guid, vname, data, datalen, attrib) < 0) err(1, "efi_set_variable"); } From owner-svn-src-all@freebsd.org Fri Nov 10 23:54:04 2017 Return-Path: Delivered-To: svn-src-all@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 D4277E5402E; Fri, 10 Nov 2017 23:54:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0C03689DD; Fri, 10 Nov 2017 23:54:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANs3NI074735; Fri, 10 Nov 2017 23:54:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANs3Ve074734; Fri, 10 Nov 2017 23:54:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANs3Ve074734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325685 - head/sys/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot X-SVN-Commit-Revision: 325685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:05 -0000 Author: imp Date: Fri Nov 10 23:54:03 2017 New Revision: 325685 URL: https://svnweb.freebsd.org/changeset/base/325685 Log: libsa32 isn't needed for i386. It's already a 32-bit platform and libfoo32 is only needed when compiling 32-bit libraries on native 64-bit architectures, and only when that 64-bit architecture needs mixed 32-bit and 64-bit binaries. Sponsored by: Netflix Modified: head/sys/boot/Makefile.i386 Modified: head/sys/boot/Makefile.i386 ============================================================================== --- head/sys/boot/Makefile.i386 Fri Nov 10 23:30:23 2017 (r325684) +++ head/sys/boot/Makefile.i386 Fri Nov 10 23:54:03 2017 (r325685) @@ -1,6 +1,5 @@ # $FreeBSD$ -SUBDIR+= libsa32 .if ${LOADER_GELI_SUPPORT:Uyes} == "yes" SUBDIR+= geli .endif From owner-svn-src-all@freebsd.org Fri Nov 10 23:54:10 2017 Return-Path: Delivered-To: svn-src-all@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 64878E54053; Fri, 10 Nov 2017 23:54:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3144E68A01; Fri, 10 Nov 2017 23:54:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANs9td074790; Fri, 10 Nov 2017 23:54:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANs99T074789; Fri, 10 Nov 2017 23:54:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANs99T074789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325686 - head/sys/boot/uboot/lib X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/uboot/lib X-SVN-Commit-Revision: 325686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:10 -0000 Author: imp Date: Fri Nov 10 23:54:09 2017 New Revision: 325686 URL: https://svnweb.freebsd.org/changeset/base/325686 Log: Simplify this if to a direct assignment. Sponsored by: Netflix Modified: head/sys/boot/uboot/lib/Makefile Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Fri Nov 10 23:54:03 2017 (r325685) +++ head/sys/boot/uboot/lib/Makefile Fri Nov 10 23:54:09 2017 (r325686) @@ -17,11 +17,7 @@ CFLAGS+= -ffreestanding -msoft-float SRCS+= disk.c .endif -.if ${MK_FDT} != "no" -LOADER_FDT_SUPPORT= yes -.else -LOADER_FDT_SUPPORT= no -.endif +LOADER_FDT_SUPPORT= ${MK_FDT} .if ${LOADER_FDT_SUPPORT} == "yes" CFLAGS+= -DLOADER_FDT_SUPPORT -I${FDTSRC} From owner-svn-src-all@freebsd.org Fri Nov 10 23:54:16 2017 Return-Path: Delivered-To: svn-src-all@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 C1731E54089; Fri, 10 Nov 2017 23:54:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FD5368AE4; Fri, 10 Nov 2017 23:54:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANsEB7074849; Fri, 10 Nov 2017 23:54:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANsEBF074845; Fri, 10 Nov 2017 23:54:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANsEBF074845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325687 - in head/sys/boot/powerpc: kboot ofw ps3 uboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/powerpc: kboot ofw ps3 uboot X-SVN-Commit-Revision: 325687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:17 -0000 Author: imp Date: Fri Nov 10 23:54:13 2017 New Revision: 325687 URL: https://svnweb.freebsd.org/changeset/base/325687 Log: Remove all the empty help files from the powerpc build. Sponsored by: Netflix Deleted: head/sys/boot/powerpc/kboot/help.kboot head/sys/boot/powerpc/ofw/help.ofw head/sys/boot/powerpc/ps3/help.ps3 head/sys/boot/powerpc/uboot/help.uboot Modified: head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Fri Nov 10 23:54:09 2017 (r325686) +++ head/sys/boot/powerpc/kboot/Makefile Fri Nov 10 23:54:13 2017 (r325687) @@ -54,7 +54,7 @@ CFLAGS+= -Wa,-mppc64bridge DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} -loader.help: help.common help.kboot ${FDTSRC}/help.fdt +loader.help: help.common ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Fri Nov 10 23:54:09 2017 (r325686) +++ head/sys/boot/powerpc/ofw/Makefile Fri Nov 10 23:54:13 2017 (r325687) @@ -58,7 +58,7 @@ CFLAGS+= -I${BOOTSRC}/ofw/libofw DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} -loader.help: help.common help.ofw ${FDTSRC}/help.fdt +loader.help: help.common ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Fri Nov 10 23:54:09 2017 (r325686) +++ head/sys/boot/powerpc/ps3/Makefile Fri Nov 10 23:54:13 2017 (r325687) @@ -55,7 +55,7 @@ SC_DFLT_FONT=cp437 font.h: uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h -loader.help: help.common help.ps3 ${FDTSRC}/help.fdt +loader.help: help.common ${FDTSRC}/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Fri Nov 10 23:54:09 2017 (r325686) +++ head/sys/boot/powerpc/uboot/Makefile Fri Nov 10 23:54:13 2017 (r325687) @@ -38,7 +38,7 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} -loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt +loader.help: help.common ${BOOTSRC}/fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} From owner-svn-src-all@freebsd.org Fri Nov 10 23:54:28 2017 Return-Path: Delivered-To: svn-src-all@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 A31BCE54103; Fri, 10 Nov 2017 23:54:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F94C68C63; Fri, 10 Nov 2017 23:54:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANsPI8074967; Fri, 10 Nov 2017 23:54:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANsOvC074955; Fri, 10 Nov 2017 23:54:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANsOvC074955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325689 - in head/sys/boot: . arm/uboot efi/loader efi/loader/arch/arm efi/loader/arch/arm64 mips/uboot powerpc powerpc/kboot powerpc/ofw powerpc/uboot uboot/lib X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot efi/loader efi/loader/arch/arm efi/loader/arch/arm64 mips/uboot powerpc powerpc/kboot powerpc/ofw powerpc/uboot uboot/lib X-SVN-Commit-Revision: 325689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:29 -0000 Author: imp Date: Fri Nov 10 23:54:24 2017 New Revision: 325689 URL: https://svnweb.freebsd.org/changeset/base/325689 Log: Remove LOADER_FDT_SUPPORT as a Makefile variable. LOADER_FDT_SUPPORT was used inconsistently in the tree. In some places, it was used to control whether or not the user wanted FDT included, and in other places it was a command to include support. Remove it entirely. The former is now enabled -DWITH_FDT, while the latter is controlled by Makefiles defining HAVE_FDT. Supported by: Netflix Added: head/sys/boot/fdt.mk (contents, props changed) Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/arch/arm/Makefile.inc head/sys/boot/efi/loader/arch/arm64/Makefile.inc head/sys/boot/mips/uboot/Makefile head/sys/boot/powerpc/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/uboot.mk head/sys/boot/uboot/lib/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/arm/uboot/Makefile Fri Nov 10 23:54:24 2017 (r325689) @@ -9,7 +9,6 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} .include Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/efi/loader/Makefile Fri Nov 10 23:54:24 2017 (r325689) @@ -71,13 +71,9 @@ CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID .endif .endif -LOADER_FDT_SUPPORT?= no -.if ${MK_FDT} != "no" && ${LOADER_FDT_SUPPORT} != "no" -CFLAGS+= -I${BOOTSRC}/fdt -CFLAGS+= -I${BOOTSRC}/fdt -CFLAGS+= -DLOADER_FDT_SUPPORT +.if defined(HAVE_FDT) && ${MK_FDT} != "no" +.include "${BOOTSRC}/fdt.mk" LIBEFI_FDT= ${BOOTOBJ}/efi/fdt/libefi_fdt.a -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif # Include bcache code. Modified: head/sys/boot/efi/loader/arch/arm/Makefile.inc ============================================================================== --- head/sys/boot/efi/loader/arch/arm/Makefile.inc Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/efi/loader/arch/arm/Makefile.inc Fri Nov 10 23:54:24 2017 (r325689) @@ -3,4 +3,4 @@ SRCS+= exec.c \ start.S -LOADER_FDT_SUPPORT=yes +HAVE_FDT=yes Modified: head/sys/boot/efi/loader/arch/arm64/Makefile.inc ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/Makefile.inc Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/efi/loader/arch/arm64/Makefile.inc Fri Nov 10 23:54:24 2017 (r325689) @@ -1,6 +1,7 @@ # $FreeBSD$ -LOADER_FDT_SUPPORT=yes +HAVE_FDT=yes + SRCS+= exec.c \ start.S Added: head/sys/boot/fdt.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt.mk Fri Nov 10 23:54:24 2017 (r325689) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.if ${MK_FDT} == "yes" +CFLAGS+= -I${FDTSRC} +CFLAGS+= -I${BOOTOBJ}/fdt +CFLAGS+= -I${SYSDIR}/contrib/libfdt +CFLAGS+= -DLOADER_FDT_SUPPORT +LIBFDT= ${BOOTOBJ}/fdt/libfdt.a +.endif Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/mips/uboot/Makefile Fri Nov 10 23:54:24 2017 (r325689) @@ -9,7 +9,6 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} .include Modified: head/sys/boot/powerpc/Makefile ============================================================================== --- head/sys/boot/powerpc/Makefile Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/powerpc/Makefile Fri Nov 10 23:54:24 2017 (r325689) @@ -1,8 +1,13 @@ # $FreeBSD$ -SUBDIR= boot1.chrp kboot ofw uboot +.include + +SUBDIR= boot1.chrp ofw uboot .if ${MACHINE_ARCH} != "powerpcspe" SUBDIR+= ps3 +.endif +.if ${MK_FDT} == "yes" +SUBDIR+= kboot .endif .include Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/powerpc/kboot/Makefile Fri Nov 10 23:54:24 2017 (r325689) @@ -8,7 +8,6 @@ LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes -LOADER_FDT_SUPPORT= yes LOADER_BZIP2_SUPPORT?= no .include @@ -24,12 +23,7 @@ SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freeb SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${FDTSRC} -CFLAGS+= -I${SYSDIR}/contrib/libfdt -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a -.endif +.include "${BOOTSRC}/fdt.mk" CFLAGS+= -mcpu=powerpc64 Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/powerpc/ofw/Makefile Fri Nov 10 23:54:24 2017 (r325689) @@ -9,7 +9,6 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT?= yes .include MK_SSP= no @@ -23,12 +22,9 @@ INSTALLFLAGS= -b SRCS= conf.c metadata.c vers.c start.c SRCS+= ucmpdi2.c -.if ${LOADER_FDT_SUPPORT} == "yes" +.include "${BOOTSRC}/fdt.mk" +.if ${MK_FDT} == "yes" SRCS+= ofwfdt.c -CFLAGS+= -I${FDTSRC} -CFLAGS+= -I${SYSDIR}/contrib/libfdt -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif # Always add MI sources Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/powerpc/uboot/Makefile Fri Nov 10 23:54:24 2017 (r325689) @@ -8,7 +8,6 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -LOADER_FDT_SUPPORT= ${MK_FDT} .include Modified: head/sys/boot/uboot.mk ============================================================================== --- head/sys/boot/uboot.mk Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/uboot.mk Fri Nov 10 23:54:24 2017 (r325689) @@ -11,10 +11,8 @@ LIBUBOOT= ${BOOTOBJ}/uboot/lib/libuboot.a CFLAGS+= -I${UBOOTSRC}/lib CFLAGS+= -I${BOOTOBJ}/uboot/lib -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${FDTSRC} -CFLAGS+= -I${BOOTOBJ}/fdt -CFLAGS+= -DLOADER_FDT_SUPPORT +.include "${BOOTSRC}/fdt.mk" + +.if ${MK_FDT} == "yes" LIBUBOOT_FDT= ${BOOTOBJ}/uboot/fdt/libuboot_fdt.a -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a .endif Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Fri Nov 10 23:54:18 2017 (r325688) +++ head/sys/boot/uboot/lib/Makefile Fri Nov 10 23:54:24 2017 (r325689) @@ -17,14 +17,7 @@ CFLAGS+= -ffreestanding -msoft-float SRCS+= disk.c .endif -LOADER_FDT_SUPPORT= ${MK_FDT} - -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -DLOADER_FDT_SUPPORT -I${FDTSRC} -.endif - -# Pick up FDT includes -CFLAGS+= -I${SYSDIR}/contrib/libfdt/ +.include "${BOOTSRC}/fdt.mk" # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. From owner-svn-src-all@freebsd.org Fri Nov 10 23:54:35 2017 Return-Path: Delivered-To: svn-src-all@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 23236E54151; Fri, 10 Nov 2017 23:54:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AD0868D80; Fri, 10 Nov 2017 23:54:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANsWgQ075029; Fri, 10 Nov 2017 23:54:32 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANsVDi075020; Fri, 10 Nov 2017 23:54:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANsVDi075020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325690 - in head/sys/boot: . i386/loader i386/zfsloader sparc64 sparc64/loader sparc64/zfsloader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . i386/loader i386/zfsloader sparc64 sparc64/loader sparc64/zfsloader X-SVN-Commit-Revision: 325690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:37 -0000 Author: imp Date: Fri Nov 10 23:54:31 2017 New Revision: 325690 URL: https://svnweb.freebsd.org/changeset/base/325690 Log: Remove LOADER_ZFS_SUPPORT as a Makefile variable LOADER_ZFS_SUPPORT is entirely used to select whether or not to support ZFS in the loader. But it's not a user-servicable part (MK_ZFS is what's used for that) Change it to the more conventional HAVE_ZFS and move the ZFS support code into loader.mk. In addition, only build ZFS libraries and boot loaders when ZFS is enabled. Sponsored by: Netflix Modified: head/sys/boot/Makefile.amd64 head/sys/boot/Makefile.i386 head/sys/boot/Makefile.sparc64 head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsloader/Makefile head/sys/boot/loader.mk head/sys/boot/sparc64/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/sparc64/zfsloader/Makefile Modified: head/sys/boot/Makefile.amd64 ============================================================================== --- head/sys/boot/Makefile.amd64 Fri Nov 10 23:54:24 2017 (r325689) +++ head/sys/boot/Makefile.amd64 Fri Nov 10 23:54:31 2017 (r325690) @@ -1,7 +1,9 @@ # $FreeBSD$ SUBDIR+= libsa32 +.if ${MK_ZFS} != "no" SUBDIR+= zfs zfs32 +.endif .if ${MK_FORTH} != "no" SUBDIR+= ficl32 .endif Modified: head/sys/boot/Makefile.i386 ============================================================================== --- head/sys/boot/Makefile.i386 Fri Nov 10 23:54:24 2017 (r325689) +++ head/sys/boot/Makefile.i386 Fri Nov 10 23:54:31 2017 (r325690) @@ -3,6 +3,8 @@ .if ${LOADER_GELI_SUPPORT:Uyes} == "yes" SUBDIR+= geli .endif +.if ${MK_ZFS} != "no" SUBDIR+= zfs +.endif SUBDIR+= efi Modified: head/sys/boot/Makefile.sparc64 ============================================================================== --- head/sys/boot/Makefile.sparc64 Fri Nov 10 23:54:24 2017 (r325689) +++ head/sys/boot/Makefile.sparc64 Fri Nov 10 23:54:31 2017 (r325690) @@ -1,4 +1,6 @@ # $FreeBSD$ SUBDIR+= ofw +.if ${MK_ZFS} != "no" SUBDIR+= zfs +.endif Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Fri Nov 10 23:54:24 2017 (r325689) +++ head/sys/boot/i386/loader/Makefile Fri Nov 10 23:54:31 2017 (r325690) @@ -21,6 +21,8 @@ INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 VERSION_FILE= ${.CURDIR}/../loader/version +.PATH: ${BOOTSRC}/i386/loader + # architecture-specific loader code SRCS= main.c conf.c vers.c chain.c @@ -28,16 +30,6 @@ SRCS= main.c conf.c vers.c chain.c .if defined(LOADER_FIREWIRE_SUPPORT) CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a -.endif - -# Set by zfsloader Makefile -.if defined(LOADER_ZFS_SUPPORT) -CFLAGS+= -DLOADER_ZFS_SUPPORT -.if ${MACHINE} == "amd64" -LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a -.else -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a -.endif .endif # Include bcache code. Modified: head/sys/boot/i386/zfsloader/Makefile ============================================================================== --- head/sys/boot/i386/zfsloader/Makefile Fri Nov 10 23:54:24 2017 (r325689) +++ head/sys/boot/i386/zfsloader/Makefile Fri Nov 10 23:54:31 2017 (r325690) @@ -1,15 +1,10 @@ # $FreeBSD$ -LOADER_ZFS_SUPPORT=yes - -.include - -.PATH: ${BOOTSRC}/i386/loader - LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 LOADER_ONLY= yes -MAN= +HAVE_ZFS= yes +.include .include "${BOOTSRC}/i386/loader/Makefile" Modified: head/sys/boot/loader.mk ============================================================================== --- head/sys/boot/loader.mk Fri Nov 10 23:54:24 2017 (r325689) +++ head/sys/boot/loader.mk Fri Nov 10 23:54:31 2017 (r325690) @@ -69,6 +69,19 @@ CFLAGS+= -DBOOT_PROMPT_123 SRCS+= install.c .endif +.if defined(HAVE_ZFS) +CFLAGS+= -DLOADER_ZFS_SUPPORT +CFLAGS+= -I${ZFSSRC} +CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +.if ${MACHINE} == "amd64" +# Have to override to use 32-bit version of zfs library... +# kinda lame to select that there XXX +LIBZFSBOOT= ${BOOTOBJ}/zfs32/libzfsboot.a +.else +LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a +.endif +.endif + CLEANFILES+= vers.c VERSION_FILE?= ${.CURDIR}/version .if ${MK_REPRODUCIBLE_BUILD} != no Modified: head/sys/boot/sparc64/Makefile ============================================================================== --- head/sys/boot/sparc64/Makefile Fri Nov 10 23:54:24 2017 (r325689) +++ head/sys/boot/sparc64/Makefile Fri Nov 10 23:54:31 2017 (r325690) @@ -1,5 +1,10 @@ # $FreeBSD$ -SUBDIR= boot1 loader zfsboot zfsloader +.include + +SUBDIR= boot1 loader +.if ${MK_ZFS} != "no" +SUBDIR+=zfsboot zfsloader +.endif .include Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Fri Nov 10 23:54:24 2017 (r325689) +++ head/sys/boot/sparc64/loader/Makefile Fri Nov 10 23:54:31 2017 (r325690) @@ -5,7 +5,6 @@ LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= no LOADER_MSDOS_SUPPORT?= no -LOADER_ZFS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes @@ -27,12 +26,6 @@ SRCS= locore.S main.c metadata.c vers.c .if ${LOADER_DEBUG} == "yes" CFLAGS+= -DLOADER_DEBUG -.endif -.if ${LOADER_ZFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_ZFS_SUPPORT -CFLAGS+= -I${ZFSSRC} -CFLAGS+= -I${SYSDIR}/cddl/boot/zfs -LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Always add MI sources Modified: head/sys/boot/sparc64/zfsloader/Makefile ============================================================================== --- head/sys/boot/sparc64/zfsloader/Makefile Fri Nov 10 23:54:24 2017 (r325689) +++ head/sys/boot/sparc64/zfsloader/Makefile Fri Nov 10 23:54:31 2017 (r325690) @@ -4,6 +4,6 @@ PROG= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" sparc64 -LOADER_ZFS_SUPPORT=yes +HAVE_ZFS= yes .include "${.CURDIR}/../loader/Makefile" From owner-svn-src-all@freebsd.org Fri Nov 10 23:54:39 2017 Return-Path: Delivered-To: svn-src-all@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 9F7D6E54176; Fri, 10 Nov 2017 23:54:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FDC868E2B; Fri, 10 Nov 2017 23:54:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANsaPL075084; Fri, 10 Nov 2017 23:54:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANsajC075083; Fri, 10 Nov 2017 23:54:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANsajC075083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325691 - head/sys/boot/ficl X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/ficl X-SVN-Commit-Revision: 325691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:40 -0000 Author: imp Date: Fri Nov 10 23:54:36 2017 New Revision: 325691 URL: https://svnweb.freebsd.org/changeset/base/325691 Log: Remove useless PNP define here. We never use HAVE_PNP for anything, so don't define it on the command line. Sponsored by: Netflix Modified: head/sys/boot/ficl/Makefile Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Fri Nov 10 23:54:31 2017 (r325690) +++ head/sys/boot/ficl/Makefile Fri Nov 10 23:54:36 2017 (r325691) @@ -10,9 +10,6 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o -.if defined(HAVE_PNP) -CFLAGS+= -DHAVE_PNP -.endif .include .ifmake testmain CFLAGS+= -DTESTMAIN -D_TESTMAIN From owner-svn-src-all@freebsd.org Fri Nov 10 23:54:43 2017 Return-Path: Delivered-To: svn-src-all@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 B70B2E541A9; Fri, 10 Nov 2017 23:54:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6941D68EFB; Fri, 10 Nov 2017 23:54:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANsgsR075142; Fri, 10 Nov 2017 23:54:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANsf83075135; Fri, 10 Nov 2017 23:54:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANsf83075135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325692 - in head: . share/mk sys/boot/i386 sys/boot/i386/loader tools/boot tools/build/options X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . share/mk sys/boot/i386 sys/boot/i386/loader tools/boot tools/build/options X-SVN-Commit-Revision: 325692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:44 -0000 Author: imp Date: Fri Nov 10 23:54:41 2017 New Revision: 325692 URL: https://svnweb.freebsd.org/changeset/base/325692 Log: Replace LOADER_FIREWIRE_SUPPORT variable Rename LOADER_FIREWIRE_SUPPORT to MK_LOADER_FIREWIRE. Only build libfirewire when this is "yes". Add note to updating. Fix build script to build this for x86 so the option doesn't decay. sparc64 supports ZFS, so also build it MK_ZFS=no. Sponsored by: Netflix Added: head/tools/build/options/WITH_LOADER_FIREWIRE (contents, props changed) Modified: head/UPDATING head/share/mk/src.opts.mk head/sys/boot/i386/Makefile head/sys/boot/i386/Makefile.inc head/sys/boot/i386/loader/Makefile head/tools/boot/universe.sh Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Nov 10 23:54:36 2017 (r325691) +++ head/UPDATING Fri Nov 10 23:54:41 2017 (r325692) @@ -51,6 +51,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +201711xx: + The LOADER_FIREWIRE_SUPPORT build variable as been renamed to + WITH_LOADER_FIREWIRE (or WITHOUT_LOADER_FIREWIRE). + 20171106: The naive and non-compliant support of posix_fallocate(2) in ZFS has been removed as of r325320. The system call now returns EINVAL Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Nov 10 23:54:36 2017 (r325691) +++ head/share/mk/src.opts.mk Fri Nov 10 23:54:41 2017 (r325692) @@ -180,6 +180,7 @@ __DEFAULT_NO_OPTIONS = \ GNU_GREP_COMPAT \ HESIOD \ LIBSOFT \ + LOADER_FIREWIRE \ LOADER_FORCE_LE \ NAND \ OFED \ Modified: head/sys/boot/i386/Makefile ============================================================================== --- head/sys/boot/i386/Makefile Fri Nov 10 23:54:36 2017 (r325691) +++ head/sys/boot/i386/Makefile Fri Nov 10 23:54:41 2017 (r325692) @@ -3,7 +3,13 @@ .include SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ - libi386 libfirewire loader + libi386 + +.if ${MK_LOADER_FIREWIRE} == "yes" +SUBDIR+= libfirewire +.endif + +SUBDIR+= loader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Fri Nov 10 23:54:36 2017 (r325691) +++ head/sys/boot/i386/Makefile.inc Fri Nov 10 23:54:41 2017 (r325692) @@ -28,4 +28,9 @@ LD_FLAGS_BIN=-static -N --gc-sections DO32=1 .endif +.if defined(LOADER_FIREWIRE_SUPPORT) +MK_LOADER_FIREWIRE=yes +.warning "LOADER_FIREWIRE_SUPPORT deprecated, please move to WITH_LOADER_FIREWIRE" +.endif + .include "../Makefile.inc" Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Fri Nov 10 23:54:36 2017 (r325691) +++ head/sys/boot/i386/loader/Makefile Fri Nov 10 23:54:41 2017 (r325692) @@ -26,18 +26,17 @@ VERSION_FILE= ${.CURDIR}/../loader/version # architecture-specific loader code SRCS= main.c conf.c vers.c chain.c -# Put LOADER_FIREWIRE_SUPPORT=yes in /etc/make.conf for FireWire/dcons support -.if defined(LOADER_FIREWIRE_SUPPORT) -CFLAGS+= -DLOADER_FIREWIRE_SUPPORT -LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a -.endif - # Include bcache code. HAVE_BCACHE= yes # Enable PnP and ISA-PnP code. HAVE_PNP= yes HAVE_ISABUS= yes + +.if ${MK_LOADER_FIREWIRE} == "yes" +CFLAGS+= -DLOADER_FIREWIRE_SUPPORT +LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a +.endif .if ${LOADER_GELI_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_GELI_SUPPORT Modified: head/tools/boot/universe.sh ============================================================================== --- head/tools/boot/universe.sh Fri Nov 10 23:54:36 2017 (r325691) +++ head/tools/boot/universe.sh Fri Nov 10 23:54:41 2017 (r325692) @@ -19,9 +19,30 @@ # Output is put into _.boot.$TARGET_ARCH.log in sys.boot. # +dobuild() +{ + local ta=$1 + local lf=$2 + local opt=$3 + + echo -n "Building $ta ${opt} ... " + if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \ + > $lf 2>&1; then + echo "Fail (cleanup)" + continue + fi + if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make ${opt} -j 20 all" \ + >> $lf 2>&1; then + echo "Fail (build)" + continue + fi + echo "Success" +} + top=$(make -V SRCTOP) cd $top/sys/boot +# Default build for a goodly selection of architectures for i in \ amd64/amd64 \ arm/arm arm/armeb arm/armv7 \ @@ -32,34 +53,24 @@ for i in \ sparc64/sparc64 \ ; do ta=${i##*/} - echo -n "Building $ta..." - if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \ - > _.boot.${ta}.log 2>&1; then - echo "Fail (cleanup)" - continue - fi - if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -j 20 all" \ - >> _.boot.${ta}.log 2>&1; then - echo "Fail (build)" - continue - fi - echo "Success" + dobuild $ta _.boot.${ta}.log "" done + +# Build w/o ZFS for i in \ amd64/amd64 \ i386/i386 \ + sparc64/sparc64 \ ; do ta=${i##*/} - echo -n "Building $ta MK_ZFS=no..." - if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \ - > _.boot.${ta}.noZFS.log 2>&1; then - echo "Fail (cleanup)" - continue - fi - if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make MK_ZFS=no -j 20 all" \ - >> _.boot.${ta}.noZFS.log 2>&1; then - echo "Fail (build)" - continue - fi - echo "Success" + dobuild $ta _.boot.${ta}.noZFS.log "MK_ZFS=no" +done + +# Build with firewire +for i in \ + amd64/amd64 \ + i386/i386 \ + ; do + ta=${i##*/} + dobuild $ta _.boot.${ta}.firewire.log "MK_LOADER_FIREWIRE=yes" done Added: head/tools/build/options/WITH_LOADER_FIREWIRE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LOADER_FIREWIRE Fri Nov 10 23:54:41 2017 (r325692) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Enable firewire support in /boot/loader and /boot/zfsloader on x86. +This option is a nop on all other platforms. From owner-svn-src-all@freebsd.org Fri Nov 10 23:54:53 2017 Return-Path: Delivered-To: svn-src-all@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 20219E5421C; Fri, 10 Nov 2017 23:54:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AEE869064; Fri, 10 Nov 2017 23:54:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANsnBe075209; Fri, 10 Nov 2017 23:54:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANsmPJ075195; Fri, 10 Nov 2017 23:54:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANsmPJ075195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325693 - in head: . share/mk sys/boot sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/gptzfsboot sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/i386/zfsboot sys/boot/i386/zfsloa... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . share/mk sys/boot sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/gptzfsboot sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/i386/zfsboot sys/boot/i386/zfsloader sys/boot/sparc64/load... X-SVN-Commit-Revision: 325693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:53 -0000 Author: imp Date: Fri Nov 10 23:54:48 2017 New Revision: 325693 URL: https://svnweb.freebsd.org/changeset/base/325693 Log: Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI in the boot loaders. Add HAVE_GELI so components can flag they need support (since it's too large to include everywhere). Add temporary warnings for the old forms to ease transition. Also, update test script to build without GELI on x86. Sponsored by: Netflix Added: head/tools/build/options/WITHOUT_LOADER_GEIL (contents, props changed) Modified: head/UPDATING head/share/mk/src.opts.mk head/sys/boot/defs.mk head/sys/boot/geli/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/i386/zfsloader/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/sparc64/zfsloader/Makefile head/tools/boot/universe.sh Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Nov 10 23:54:41 2017 (r325692) +++ head/UPDATING Fri Nov 10 23:54:48 2017 (r325693) @@ -53,7 +53,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: 201711xx: The LOADER_FIREWIRE_SUPPORT build variable as been renamed to - WITH_LOADER_FIREWIRE (or WITHOUT_LOADER_FIREWIRE). + WITH/OUT_LOADER_FIREWIRE. LOADER_{NO_,}GELI_SUPPORT has been renamed + to WITH/OUT_LOADER_GELI. 20171106: The naive and non-compliant support of posix_fallocate(2) in ZFS Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Nov 10 23:54:41 2017 (r325692) +++ head/share/mk/src.opts.mk Fri Nov 10 23:54:48 2017 (r325693) @@ -119,6 +119,7 @@ __DEFAULT_YES_OPTIONS = \ LIB32 \ LIBPTHREAD \ LIBTHR \ + LOADER_GELI \ LOCALES \ LOCATE \ LPR \ Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/defs.mk Fri Nov 10 23:54:48 2017 (r325693) @@ -85,10 +85,26 @@ CFLAGS+= -DLOADER_GPT_SUPPORT .if ${LOADER_MBR_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_MBR_SUPPORT .endif -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GELI_SUPPORT + +# GELI Support, with backward compat hooks +.if defined(HAVE_GELI) +.if defined(LOADER_NO_GELI_SUPPORT) +MK_LOADER_GELI=no +.warning "Please move from LOADER_NO_GELI_SUPPORT to WITHOUT_LOADER_GELI" .endif +.if defined(LOADER_GELI_SUPPORT) +MK_LOADER_GELI=yes +.warning "Please move from LOADER_GELI_SUPPORT to WITH_LOADER_GELI" .endif +.if ${MK_LOADER_GELI} == "yes" +CFLAGS+= -DLOADER_GELI_SUPPORT +CFLAGS+= -I${BOOTSRC}/geli +LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a +.endif +.endif +.endif + +CFLAGS+= -I${SYSDIR} # All PowerPC builds are 32 bit. We have no 64-bit loaders on powerpc # or powerpc64. Modified: head/sys/boot/geli/Makefile ============================================================================== --- head/sys/boot/geli/Makefile Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/geli/Makefile Fri Nov 10 23:54:48 2017 (r325693) @@ -49,5 +49,9 @@ SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael CFLAGS+= -D_STAND SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_eli_key_cache.c pkcs5v2.c +# aes +.PATH: ${SYSDIR}/opencrypto +SRCS+= xform_aes_xts.c + .include .include Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/i386/gptboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) @@ -1,5 +1,7 @@ # $FreeBSD$ +HAVE_GELI= yes + .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC} @@ -41,14 +43,6 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ CFLAGS.gcc+= --param max-inline-insns-single=100 -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli -LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a -.PATH: ${SYSDIR}/opencrypto -OPENCRYPTO_XTS= xform_aes_xts.o -.endif - LD_FLAGS+=${LD_FLAGS_BIN} CLEANFILES= gptboot @@ -66,12 +60,12 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o crc32.o drv.o \ - cons.o util.o ${OPENCRYPTO_XTS} + cons.o ${OPENCRYPTO_XTS} gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} -gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} +gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} gptboot.o: ${SASRC}/ufsread.c Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/i386/gptzfsboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) @@ -1,5 +1,7 @@ # $FreeBSD$ +HAVE_GPT= yes + .include .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ @@ -48,14 +50,6 @@ CFLAGS+= -Wno-tentative-definition-incomplete-type LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a .else LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a -.endif - -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli -LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a -.PATH: ${SYSDIR}/opencrypto -OPENCRYPTO_XTS= xform_aes_xts.o .endif CFLAGS.gcc+= --param max-inline-insns-single=100 Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/i386/libi386/Makefile Fri Nov 10 23:54:48 2017 (r325693) @@ -1,5 +1,8 @@ # $FreeBSD$ +HAVE_GPT= yes +HAVE_GELI= yes + .include LIB= i386 @@ -23,12 +26,6 @@ CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} .ifdef(BOOT_BIOSDISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG -.endif - -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -# Decrypt encrypted drives -CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli .endif .if !defined(BOOT_HIDE_SERIAL_NUMBERS) Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/i386/loader/Makefile Fri Nov 10 23:54:48 2017 (r325693) @@ -1,5 +1,7 @@ # $FreeBSD$ +HAVE_GELI= yes + LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes @@ -36,15 +38,6 @@ HAVE_ISABUS= yes .if ${MK_LOADER_FIREWIRE} == "yes" CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a -.endif - -.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" -CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli -LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a -.PATH: ${SYSDIR}/opencrypto -SRCS+= xform_aes_xts.c -CFLAGS+= -I${SYSDIR} -D_STAND .endif # Always add MI sources Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/i386/zfsboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) @@ -1,6 +1,6 @@ # $FreeBSD$ -LOADER_GELI_SUPPORT=no +HAVE_GELI=yes .include @@ -60,7 +60,7 @@ zfsldr.out: zfsldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ - zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o + zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o # We currently allow 128k bytes for zfsboot - in practice it could be # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. @@ -82,8 +82,8 @@ zfsboot.ldr: zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} -zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32} +zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBGELIBOOT} ${LIBSA32} SRCS= zfsboot.c Modified: head/sys/boot/i386/zfsloader/Makefile ============================================================================== --- head/sys/boot/i386/zfsloader/Makefile Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/i386/zfsloader/Makefile Fri Nov 10 23:54:48 2017 (r325693) @@ -5,6 +5,5 @@ NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 LOADER_ONLY= yes HAVE_ZFS= yes -.include -.include "${BOOTSRC}/i386/loader/Makefile" +.include "${.CURDIR}/../loader/Makefile" Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/sparc64/loader/Makefile Fri Nov 10 23:54:48 2017 (r325693) @@ -22,6 +22,7 @@ VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b # Architecture-specific loader code +.PATH: ${BOOTSRC}/sparc64/loader SRCS= locore.S main.c metadata.c vers.c .if ${LOADER_DEBUG} == "yes" Modified: head/sys/boot/sparc64/zfsloader/Makefile ============================================================================== --- head/sys/boot/sparc64/zfsloader/Makefile Fri Nov 10 23:54:41 2017 (r325692) +++ head/sys/boot/sparc64/zfsloader/Makefile Fri Nov 10 23:54:48 2017 (r325693) @@ -1,7 +1,5 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../loader - PROG= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" sparc64 HAVE_ZFS= yes Modified: head/tools/boot/universe.sh ============================================================================== --- head/tools/boot/universe.sh Fri Nov 10 23:54:41 2017 (r325692) +++ head/tools/boot/universe.sh Fri Nov 10 23:54:48 2017 (r325693) @@ -63,7 +63,7 @@ for i in \ sparc64/sparc64 \ ; do ta=${i##*/} - dobuild $ta _.boot.${ta}.noZFS.log "MK_ZFS=no" + dobuild $ta _.boot.${ta}.no_zfs.log "MK_ZFS=no" done # Build with firewire @@ -73,4 +73,13 @@ for i in \ ; do ta=${i##*/} dobuild $ta _.boot.${ta}.firewire.log "MK_LOADER_FIREWIRE=yes" +done + +# Build without GELI +for i in \ + amd64/amd64 \ + i386/i386 \ + ; do + ta=${i##*/} + dobuild $ta _.boot.${ta}.no_geli.log "MK_LOADER_GELI=no" done Added: head/tools/build/options/WITHOUT_LOADER_GEIL ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LOADER_GEIL Fri Nov 10 23:54:48 2017 (r325693) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Disable inclusion of GELI crypto support in the boot chain binaries. From owner-svn-src-all@freebsd.org Fri Nov 10 23:54:20 2017 Return-Path: Delivered-To: svn-src-all@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 2F777E540B9; Fri, 10 Nov 2017 23:54:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE2C568B36; Fri, 10 Nov 2017 23:54:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANsJWi074903; Fri, 10 Nov 2017 23:54:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANsJDk074902; Fri, 10 Nov 2017 23:54:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANsJDk074902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325688 - head/sys/boot/powerpc/ps3 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/powerpc/ps3 X-SVN-Commit-Revision: 325688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:20 -0000 Author: imp Date: Fri Nov 10 23:54:18 2017 New Revision: 325688 URL: https://svnweb.freebsd.org/changeset/base/325688 Log: FDT support doesn't make sense for ps3. There's no support in the ps3 port for FDT, and it's unlikely to grow support for that anytime soon. When it does, support can be added back easily enough. Supported by: Netflix Modified: head/sys/boot/powerpc/ps3/Makefile Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Fri Nov 10 23:54:13 2017 (r325687) +++ head/sys/boot/powerpc/ps3/Makefile Fri Nov 10 23:54:18 2017 (r325688) @@ -7,7 +7,6 @@ LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= yes -LOADER_FDT_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no .include @@ -24,12 +23,6 @@ SRCS+= lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c p ps3stor.c ps3disk.c ps3cdrom.c SRCS+= ucmpdi2.c -.if ${LOADER_FDT_SUPPORT} == "yes" -CFLAGS+= -I${FDTSRC} -CFLAGS+= -DLOADER_FDT_SUPPORT -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a -.endif - CFLAGS+= -mcpu=powerpc64 # Always add MI sources @@ -55,7 +48,7 @@ SC_DFLT_FONT=cp437 font.h: uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h -loader.help: help.common ${FDTSRC}/help.fdt +loader.help: help.common cat ${.ALLSRC} | \ awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} From owner-svn-src-all@freebsd.org Fri Nov 10 23:55:06 2017 Return-Path: Delivered-To: svn-src-all@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 D2D5DE542D6; Fri, 10 Nov 2017 23:55:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 446436928B; Fri, 10 Nov 2017 23:55:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAANt2IQ075331; Fri, 10 Nov 2017 23:55:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAANswm3075262; Fri, 10 Nov 2017 23:54:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711102354.vAANswm3075262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 10 Nov 2017 23:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325694 - in head/sys/boot: . arm/uboot efi/boot1 efi/fdt efi/libefi efi/loader efi/loader/arch/arm64 ficl forth geli i386/boot2 i386/gptboot i386/gptzfsboot i386/libfirewire i386/libi3... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot efi/boot1 efi/fdt efi/libefi efi/loader efi/loader/arch/arm64 ficl forth geli i386/boot2 i386/gptboot i386/gptzfsboot i386/libfirewire i386/libi386 i386/loader i386/pxeld... X-SVN-Commit-Revision: 325694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:55:07 -0000 Author: imp Date: Fri Nov 10 23:54:58 2017 New Revision: 325694 URL: https://svnweb.freebsd.org/changeset/base/325694 Log: Install the 4th files in sys/boot/forth instead of each loader Also, move generation of loader.help into loader.mk. Set HELP_FILES= to disable this (so we only install one help file, for now). At the same time remove some duplicate -I lines. Fix several FILES= and CLEANFILES= into the += form since we're touching both of those in the .mk files. Make sure we only build one loader.help file per platform in a unified way (we were building many on some, with the last to install winning, though often they were the same text). Also, we're now installing loader.rc and menu.rc everywhere. arm and mips uboot installed these as menu.rc.sample, but there's no need since the loader.rc for those platforms doesn't do menu.rc processing by default. pcibios.4th is now installed everywhere, but will failsafe on non x86 platforms (it isn't loaded by default anywhere). These changes are too intertwined to do separately since aspects of each are required to have a bug-free commit. Sponsored by: Netflix Deleted: head/sys/boot/forth/Makefile.inc Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/defs.mk head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/arch/arm64/Makefile.inc head/sys/boot/ficl/Makefile head/sys/boot/forth/Makefile head/sys/boot/geli/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/libfirewire/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/pxeldr/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/i386/zfsloader/Makefile head/sys/boot/libsa/Makefile head/sys/boot/libsa32/Makefile head/sys/boot/loader.mk head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/ofw/libofw/Makefile head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/boot1/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/uboot/fdt/Makefile head/sys/boot/uboot/lib/Makefile head/sys/boot/userboot/test/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/arm/uboot/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -12,7 +12,7 @@ LOADER_BZIP2_SUPPORT?= no .include -FILES= ubldr ubldr.bin +FILES+= ubldr ubldr.bin NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b @@ -28,12 +28,11 @@ SRCS= start.S conf.c self_reloc.c vers.c CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif +HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. -CLEANFILES+= loader.help - CFLAGS+= -ffreestanding -msoft-float LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} @@ -49,10 +48,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FD OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} @@ -71,16 +66,5 @@ ubldr.bin: ubldr.pie ${OBJCOPY} -S -O binary ubldr.pie ${.TARGET} CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin - -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -# Install loader.rc. -FILES+= loader.rc -# Put sample menu.rc on disk but don't enable it by default. -FILES+= menu.rc -FILESNAME_menu.rc= menu.rc.sample -.endif .include Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/defs.mk Fri Nov 10 23:54:58 2017 (r325694) @@ -122,6 +122,9 @@ LD_FLAGS+= -m elf_i386_fbsd AFLAGS+= --32 .endif +# Make sure we use the machine link we're about to create +CFLAGS+=-I. + _ILINKS=machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" _ILINKS+=${MACHINE_CPUARCH} @@ -160,5 +163,9 @@ ${_ILINKS}: path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fhs $$path ${.TARGET:T} + +# For loader implementations, we generate a loader.help file. This can be suppressed by +# setting HELP_FILES to nothing. +HELP_FILES= ${LDRSRC}/help.common .endif # __BOOT_DEFS_MK__ Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/efi/boot1/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -41,11 +41,9 @@ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -CFLAGS+= -I. CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include -CFLAGS+= -I${SYSDIR} CFLAGS+= -DEFI_UFS_BOOT .ifdef(EFI_DEBUG) CFLAGS+= -DEFI_DEBUG @@ -126,6 +124,6 @@ boot1.efifat: boot1.efi xz -d -c ${.CURDIR}/fat-${MACHINE}.tmpl.xz > ${.TARGET} ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc -CLEANFILES= boot1.efi boot1.efifat +CLEANFILES+= boot1.efi boot1.efifat .include Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/efi/fdt/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -25,6 +25,6 @@ CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} .include Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/efi/libefi/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -34,7 +34,6 @@ CFLAGS+= -mgeneral-regs-only .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif -CFLAGS+= -I${SYSDIR} CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} .if ${MK_ZFS} != "no" Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/efi/loader/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -55,7 +55,6 @@ CFLAGS+= -I${.CURDIR}/arch/${MACHINE} CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include -CFLAGS+= -I${SYSDIR} CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -DNO_PCI -DEFI @@ -84,6 +83,7 @@ CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif # Always add MI sources +HELP_FILES= .include "${BOOTSRC}/loader.mk" FILES+= loader.efi Modified: head/sys/boot/efi/loader/arch/arm64/Makefile.inc ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/Makefile.inc Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/efi/loader/arch/arm64/Makefile.inc Fri Nov 10 23:54:58 2017 (r325694) @@ -10,16 +10,3 @@ CFLAGS+=-I${BOOTSRC}/arm64/libarm64 SRCS+= cache.c CFLAGS+= -mgeneral-regs-only - -CLEANFILES+= loader.help - -loader.help: help.common - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc -.endif Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/ficl/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -8,7 +8,7 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c prefix.c search.c stack.c tools.c vm.c words.c SRCS= ${BASE_SRCS} sysdep.c softcore.c -CLEANFILES= softcore.c testmain testmain.o +CLEANFILES+= softcore.c testmain testmain.o .include .ifmake testmain Modified: head/sys/boot/forth/Makefile ============================================================================== --- head/sys/boot/forth/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/forth/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -11,4 +11,33 @@ MAN+= beastie.4th.8 \ menusets.4th.8 \ version.4th.8 +FILES+= beastie.4th +FILES+= brand.4th +FILES+= brand-fbsd.4th +FILES+= check-password.4th +FILES+= color.4th +FILES+= delay.4th +FILES+= efi.4th +FILES+= frames.4th +FILES+= loader.4th +FILES+= loader.conf +FILES+= logo-beastie.4th +FILES+= logo-beastiebw.4th +FILES+= logo-fbsdbw.4th +FILES+= logo-orb.4th +FILES+= logo-orbbw.4th +FILES+= menu.4th +FILES+= menu-commands.4th +FILES+= menusets.4th +FILES+= pcibios.4th +FILES+= screen.4th +FILES+= shortcuts.4th +FILES+= support.4th +FILES+= version.4th +FILESDIR_loader.conf= /boot/defaults + +# Everybody has these, but you can override +.PATH: ${BOOTSRC}/${MACHINE:C/amd64/i386/}/common ${BOOTSRC}/forth +FILES+= loader.rc menu.rc + .include Modified: head/sys/boot/geli/Makefile ============================================================================== --- head/sys/boot/geli/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/geli/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -38,7 +38,6 @@ SRCS+= md5c.c # AES implementation from sys/crypto .PATH: ${SYSDIR}/crypto/rijndael -CFLAGS+= -I${SYSDIR} CFLAGS+= -I${LDRSRC} # Remove asserts CFLAGS+= -DNDEBUG Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/i386/boot2/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -31,7 +31,7 @@ CFLAGS+=-fomit-frame-pointer \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ - -I${BTXLIB} -I. \ + -I${BTXLIB} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -48,7 +48,7 @@ CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= boot +CLEANFILES+= boot boot: boot1 boot2 cat boot1 boot2 > boot Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/i386/gptboot/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -33,9 +33,8 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ -I${BOOTSRC}/i386/common \ - -I${BTXLIB} -I. \ + -I${BTXLIB} \ -I${BOOTSRC}/i386/boot2 \ - -I${SYSDIR} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -45,7 +44,7 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= gptboot +CLEANFILES+= gptboot gptboot: gptldr.bin gptboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/i386/gptzfsboot/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -31,9 +31,8 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -I${BOOTSRC}/i386/common \ -I${ZFSSRC} \ -I${SYSDIR}/cddl/boot/zfs \ - -I${BOOTSRC}/i386/btx/lib -I. \ + -I${BOOTSRC}/i386/btx/lib \ -I${BOOTSRC}/i386/boot2 \ - -I${SYSDIR} \ -Wall -Waggregate-return -Wbad-function-cast \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -56,7 +55,7 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= gptzfsboot +CLEANFILES+= gptzfsboot gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ Modified: head/sys/boot/i386/libfirewire/Makefile ============================================================================== --- head/sys/boot/i386/libfirewire/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/i386/libfirewire/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -11,7 +11,7 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} CFLAGS+= -I${BTXLIB} CFLAGS+= -I${BOOTSRC}/i386/libi386 Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/i386/libi386/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -49,8 +49,7 @@ CFLAGS+= -Dalloca=__builtin_alloca CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ -I${LDRSRC} -I${BOOTSRC}/i386/common \ -I${BTXLIB} \ - -I${SYSDIR}/contrib/dev/acpica/include \ - -I${SYSDIR} -I. + -I${SYSDIR}/contrib/dev/acpica/include # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/i386/loader/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -40,11 +40,16 @@ CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a .endif +.if exists(${.CURDIR}/help.i386) +HELP_FILES+= help.i386 +.else +HELP_FILES= +.endif + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. -CLEANFILES= ${LOADER} ${LOADER}.bin loader.help +CLEANFILES+= ${LOADER} ${LOADER}.bin CFLAGS+= -Wall LDFLAGS+= -static -Ttext 0x0 @@ -67,20 +72,9 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} -loader.help: help.common help.i386 - cat ${.ALLSRC} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -FILES= ${LOADER} +FILES+= ${LOADER} # XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b - -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" -FILES+= pcibios.4th - -FILES+= loader.rc menu.rc -.endif # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} Modified: head/sys/boot/i386/pxeldr/Makefile ============================================================================== --- head/sys/boot/i386/pxeldr/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/i386/pxeldr/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -7,7 +7,7 @@ INTERNALPROG= FILES= ${BOOT} MAN= ${BOOT}.8 SRCS= ${LDR}.S -CLEANFILES= ${BOOT} +CLEANFILES+= ${BOOT} BOOT= pxeboot LDR= pxeldr Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/i386/zfsboot/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -30,7 +30,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -I${BOOTSRC}/i386 \ -I${ZFSSRC} \ -I${SYSDIR}/cddl/boot/zfs \ - -I${BTXLIB} -I. \ + -I${BTXLIB} \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ @@ -46,7 +46,7 @@ LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a LD_FLAGS+=${LD_FLAGS_BIN} -CLEANFILES= zfsboot +CLEANFILES+= zfsboot zfsboot: zfsboot1 zfsboot2 cat zfsboot1 zfsboot2 > zfsboot Modified: head/sys/boot/i386/zfsloader/Makefile ============================================================================== --- head/sys/boot/i386/zfsloader/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/i386/zfsloader/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -2,8 +2,6 @@ LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 -LOADER_ONLY= yes HAVE_ZFS= yes .include "${.CURDIR}/../loader/Makefile" - Modified: head/sys/boot/libsa/Makefile ============================================================================== --- head/sys/boot/libsa/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/libsa/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -19,7 +19,7 @@ LIB?= sa NO_PIC= WARNS?= 0 -CFLAGS+= -I${SASRC} -I${SYSDIR} +CFLAGS+= -I${SASRC} # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ Modified: head/sys/boot/libsa32/Makefile ============================================================================== --- head/sys/boot/libsa32/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/libsa32/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -7,7 +7,5 @@ DO32=1 LIB=sa32 LIBSA_CPUARCH=${MACHINE_CPUARCH:C/amd64/i386/} -CFLAGS+= -I. - .PATH: ${SASRC} .include "${SASRC}/Makefile" Modified: head/sys/boot/loader.mk ============================================================================== --- head/sys/boot/loader.mk Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/loader.mk Fri Nov 10 23:54:58 2017 (r325694) @@ -90,3 +90,11 @@ REPRO_FLAG= -r vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE} sh ${LDRSRC}/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \ ${NEWVERSWHAT} + +.if !empty(HELP_FILES) +CLEANFILES+= loader.help +FILES+= loader.help + +loader.help: ${HELP_FILES} + cat ${HELP_FILES} | awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} +.endif Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/mips/beri/boot2/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -51,7 +51,6 @@ CFLAGS= -ffreestanding \ -I${.CURDIR} \ -I${SASRC} \ -I${LDRSRC} \ - -I${SYSDIR} \ -D_KERNEL \ -Wall \ -G0 \ Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/mips/beri/loader/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -67,6 +67,8 @@ SRCS+= altera_jtag_uart.c \ # Since we don't have a backward compatibility issue, default to this on BERI. CFLAGS+= -DBOOT_PROMPT_123 +HELP_FILES+= help.mips + # Always add MI sources .include "${BOOTSRC}/loader.mk" @@ -77,8 +79,6 @@ CFLAGS+= -I${BOOTSRC}/mips/beri/common # Loader-specific MD headers CFLAGS+= -I${.CURDIR} -CLEANFILES+= loader.help - # Generate code appropriate for the loader environment CFLAGS+= -G0 \ -fno-pic \ @@ -94,15 +94,6 @@ LDFLAGS= -nostdlib \ DPADD= ${LIBFICL} ${LIBSA} LDADD= ${LIBFICL} ${LIBSA} - -loader.help: help.common help.mips - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc .if defined(LOADER_USB_SUPPORT) # Do garbage collection Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/mips/uboot/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -12,7 +12,7 @@ LOADER_BZIP2_SUPPORT?= no .include -FILES= ubldr +FILES+= ubldr NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b @@ -24,12 +24,11 @@ UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c +HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. -CLEANFILES+= loader.help - CFLAGS+= -ffreestanding -msoft-float -g LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} @@ -41,10 +40,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FD OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -loader.help: help.common help.uboot ${BOOTSRC}/fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} @@ -57,17 +52,6 @@ ubldr: ${OBJS} ldscript.abs ${.CURDIR}/ldscript.${MACH ${OBJCOPY} -S -O binary ubldr ubldr.bin CLEANFILES+= ldscript.abs ldscript.pie ubldr ubldr.pie ubldr.bin - -.if !defined(LOADER_ONLY) -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -# Install loader.rc. -FILES+= loader.rc -# Put sample menu.rc on disk but don't enable it by default. -FILES+= menu.rc -FILESNAME_menu.rc= menu.rc.sample -.endif .include .include Modified: head/sys/boot/ofw/libofw/Makefile ============================================================================== --- head/sys/boot/ofw/libofw/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/ofw/libofw/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -12,7 +12,7 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_cop SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "powerpc" Modified: head/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/powerpc/boot1.chrp/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -34,7 +34,7 @@ boot1.hfs: boot1.elf bootinfo.txt ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ conv=notrunc -CLEANFILES= boot1.hfs +CLEANFILES+= boot1.hfs boot1.o: ${SASRC}/ufsread.c Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/powerpc/kboot/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -28,13 +28,10 @@ SRCS+= ucmpdi2.c CFLAGS+= -mcpu=powerpc64 # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. -CLEANFILES+= loader.help - CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script RELOC?= 0x0 @@ -48,13 +45,6 @@ CFLAGS+= -Wa,-mppc64bridge DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} -loader.help: help.common ${FDTSRC}/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc +HELP_FILES+= ${FDTSRC}/help.fdt .include Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/powerpc/ofw/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -27,15 +27,13 @@ SRCS+= ucmpdi2.c SRCS+= ofwfdt.c .endif +HELP_FILES+= ${FDTSRC}/help.fdt + # Always add MI sources .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. -CLEANFILES+= loader.help - CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script RELOC?= 0x1C00000 @@ -53,14 +51,5 @@ CFLAGS+= -I${BOOTSRC}/ofw/libofw DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} - -loader.help: help.common ${FDTSRC}/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc .include Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/powerpc/ps3/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -26,13 +26,10 @@ SRCS+= ucmpdi2.c CFLAGS+= -mcpu=powerpc64 # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. -CLEANFILES+= loader.help - CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script RELOC?= 0x0 @@ -47,14 +44,5 @@ SC_DFLT_FONT=cp437 font.h: uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h - -loader.help: help.common - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc .include Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/powerpc/uboot/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -21,13 +21,10 @@ SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -I${SYSDIR} -CFLAGS+= -I. -CLEANFILES+= ${PROG}.help - CFLAGS+= -ffreestanding LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc @@ -36,12 +33,5 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} - -loader.help: help.common ${BOOTSRC}/fdt/help.fdt - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -FILES= loader.help .include Modified: head/sys/boot/sparc64/boot1/Makefile ============================================================================== --- head/sys/boot/sparc64/boot1/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/sparc64/boot1/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -7,7 +7,7 @@ INTERNALPROG= MAN= FILES?= boot1 SRCS= _start.s boot1.c -CLEANFILES=${FILES} boot1.aout +CLEANFILES+=${FILES} boot1.aout BOOTBLOCKBASE= 0x4000 Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/sparc64/loader/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -29,31 +29,22 @@ SRCS= locore.S main.c metadata.c vers.c CFLAGS+= -DLOADER_DEBUG .endif +.if exists(${.CURDIR}/help.sparc64) +HELP_FILES+= help.sparc64 +.else +HELP_FILES= +.endif + # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -I. -CLEANFILES+= loader.help - LDFLAGS+= -static # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/ofw/libofw/libofw.a CFLAGS+= -I${BOOTSRC}/ofw/libofw/ -# Need sys/ for crypto/intake.h -CFLAGS+= -I${SRCTOP}/sys - DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} - -loader.help: help.common help.sparc64 - cat ${.ALLSRC} | \ - awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} - -.PATH: ${BOOTSRC}/forth -.include "${BOOTSRC}/forth/Makefile.inc" - -FILES+= loader.rc menu.rc .include Modified: head/sys/boot/uboot/fdt/Makefile ============================================================================== --- head/sys/boot/uboot/fdt/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/uboot/fdt/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -19,7 +19,7 @@ CFLAGS+= -I${UBOOTSRC}/lib CFLAGS+= -I${FDTSRC} # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} .include .include Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/uboot/lib/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -20,7 +20,7 @@ SRCS+= disk.c .include "${BOOTSRC}/fdt.mk" # Pick up the bootstrap header for some interface items -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} .ifdef(BOOT_DISK_DEBUG) # Make the disk code more talkative Modified: head/sys/boot/userboot/test/Makefile ============================================================================== --- head/sys/boot/userboot/test/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/userboot/test/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -10,6 +10,5 @@ PROG= test INTERNALPROG= CFLAGS+= -I${BOOTSRC}/userboot -CFLAGS+= -I${SYSDIR} .include Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/userboot/userboot/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -36,8 +36,7 @@ SRCS+= vers.c CFLAGS+= -Wall CFLAGS+= -I${BOOTSRC}/userboot -CFLAGS+= -I${SYSDIR} -CFLAGS+= -ffreestanding -I. +CFLAGS+= -ffreestanding CWARNFLAGS.main.c += -Wno-implicit-function-declaration @@ -51,6 +50,7 @@ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Always add MI sources +HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Fri Nov 10 23:54:48 2017 (r325693) +++ head/sys/boot/zfs/Makefile Fri Nov 10 23:54:58 2017 (r325694) @@ -12,7 +12,7 @@ CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${SYSDIR}/crypto/skein CFLAGS+= -DBOOTPROG=\"zfsloader\" -CFLAGS+= -I${LDRSRC} -I${SYSDIR} -I. +CFLAGS+= -I${LDRSRC} CFLAGS+= -I${SYSDIR}/cddl/boot/zfs CFLAGS+= -I${SYSDIR}/crypto/skein From owner-svn-src-all@freebsd.org Sat Nov 11 01:10:09 2017 Return-Path: Delivered-To: svn-src-all@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 CE2B8E55BA4; Sat, 11 Nov 2017 01:10:09 +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 9906C6B57F; Sat, 11 Nov 2017 01:10:09 +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 vAB1A8FT005944; Sat, 11 Nov 2017 01:10:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB1A8If005943; Sat, 11 Nov 2017 01:10:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711110110.vAB1A8If005943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 11 Nov 2017 01:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325695 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 01:10:09 -0000 Author: bdrewery Date: Sat Nov 11 01:10:08 2017 New Revision: 325695 URL: https://svnweb.freebsd.org/changeset/base/325695 Log: cleanworld only needs a tree walk if the expected .OBJDIR is .CURDIR. Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 10 23:54:58 2017 (r325694) +++ head/Makefile.inc1 Sat Nov 11 01:10:08 2017 (r325695) @@ -2814,7 +2814,8 @@ cleanworld cleanuniverse: .PHONY -chflags -R 0 ${BW_CANONICALOBJDIR} rm -rf ${BW_CANONICALOBJDIR}* .endif -.if make(cleanworld) && ${MK_AUTO_OBJ} == "no" +.if make(cleanworld) && ${MK_AUTO_OBJ} == "no" && \ + (empty(BW_CANONICALOBJDIR) || ${.CURDIR:tA} == ${BW_CANONICALOBJDIR:tA}) .if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} # To be safe in this case, fall back to a 'make cleandir' ${_+_}@cd ${.CURDIR}; ${MAKE} cleandir From owner-svn-src-all@freebsd.org Sat Nov 11 01:10:43 2017 Return-Path: Delivered-To: svn-src-all@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 26295E55C71; Sat, 11 Nov 2017 01:10:43 +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 E4AF06B6E8; Sat, 11 Nov 2017 01:10:42 +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 vAB1Afi0006690; Sat, 11 Nov 2017 01:10:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB1AfMx006689; Sat, 11 Nov 2017 01:10:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711110110.vAB1AfMx006689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 11 Nov 2017 01:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325696 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 01:10:43 -0000 Author: bdrewery Date: Sat Nov 11 01:10:41 2017 New Revision: 325696 URL: https://svnweb.freebsd.org/changeset/base/325696 Log: Handle MAKEOBJDIRPREFIX when already inside of .OBJDIR. This can happen in obscure cases with things like the kernel build. Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Sat Nov 11 01:10:08 2017 (r325695) +++ head/share/mk/src.sys.obj.mk Sat Nov 11 01:10:41 2017 (r325696) @@ -102,7 +102,12 @@ OBJROOT:= ${OBJTOP}/ # __objdir is the expected .OBJDIR we want to use and that auto.obj.mk will # try to create. .if !empty(MAKEOBJDIRPREFIX) +.if ${.CURDIR:M${MAKEOBJDIRPREFIX}/*} != "" +# we are already in obj tree! +__objdir= ${.CURDIR} +.else __objdir:= ${MAKEOBJDIRPREFIX}${.CURDIR} +.endif .elif !empty(MAKEOBJDIR) __objdir:= ${MAKEOBJDIR} .endif From owner-svn-src-all@freebsd.org Sat Nov 11 01:10:47 2017 Return-Path: Delivered-To: svn-src-all@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 89BDFE55CB3; Sat, 11 Nov 2017 01:10:47 +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 52A646B709; Sat, 11 Nov 2017 01:10:47 +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 vAB1AkvQ007499; Sat, 11 Nov 2017 01:10:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB1AkiT007498; Sat, 11 Nov 2017 01:10:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711110110.vAB1AkiT007498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 11 Nov 2017 01:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325697 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 01:10:47 -0000 Author: bdrewery Date: Sat Nov 11 01:10:46 2017 New Revision: 325697 URL: https://svnweb.freebsd.org/changeset/base/325697 Log: AUTO_OBJ: Disable in non-build targets. There's no reason to create object directories for targets like 'installworld' or 'distributeworld', and the others in this list. Specifying MK_AUTO_OBJ as a make argument allows circumventing this if needed for some reason. This fixes mergemaster creating a full object tree due to doing a 'make installconfig' tree walk. Reported by: Mark Millard Sponsored by: Dell EMC Isilon Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Nov 11 01:10:41 2017 (r325696) +++ head/Makefile Sat Nov 11 01:10:46 2017 (r325697) @@ -167,6 +167,18 @@ META_TGT_WHITELIST+= \ tinderbox toolchain \ toolchains universe world worlds xdev xdev-build +# Likewise for AUTO_OBJ. Many targets do not need object directories created +# for each visited directory. Only when things are being built are they +# needed. Having AUTO_OBJ disabled in a build target is fine as it should +# fallback to running 'make obj' as needed. If a target is not in this list +# then it is ran with MK_AUTO_OBJ=no in environment. +# 'showconfig' is in the list to avoid forcing MK_AUTO_OBJ=no for it. +AUTO_OBJ_TGT_WHITELIST+= \ + _* all all-man build* depend everything *toolchain* includes \ + libraries obj objlink showconfig tags xdev xdev-build native-xtools \ + stage* create-packages* real-packages sign-packages package-pkg \ + tinderbox universe* kernel kernels world worlds bmake + .ORDER: buildworld installworld .ORDER: buildworld distrib-dirs .ORDER: buildworld distribution @@ -255,6 +267,21 @@ _MAKE+= MK_META_MODE=no ${.newline}ERROR: 'kldload filemon' or pass -DNO_FILEMON to suppress this error. .endif # !exists(/dev/filemon) && !defined(NO_FILEMON) .endif # !defined(_CAN_USE_META_MODE) + +# Only allow AUTO_OBJ for the whitelisted targets. See AUTO_OBJ_TGT_WHITELIST +# above. MK_AUTO_OBJ not checked here for "yes" as it may not yet be enabled +# since it is opportunistic. +.if empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) +.for _tgt in ${AUTO_OBJ_TGT_WHITELIST} +.if make(${_tgt}) +_CAN_USE_AUTO_OBJ?= yes +.endif +.endfor +.if !defined(_CAN_USE_AUTO_OBJ) +_MAKE+= MK_AUTO_OBJ=no +MK_AUTO_OBJ= no +.endif +.endif # empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) # Guess target architecture from target type, and vice versa, based on # historic FreeBSD practice of tending to have TARGET == TARGET_ARCH From owner-svn-src-all@freebsd.org Sat Nov 11 01:10:52 2017 Return-Path: Delivered-To: svn-src-all@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 78844E55CE8; Sat, 11 Nov 2017 01:10:52 +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 DCA606B78A; Sat, 11 Nov 2017 01:10:51 +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 vAB1AoKW007545; Sat, 11 Nov 2017 01:10:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB1Aor0007544; Sat, 11 Nov 2017 01:10:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711110110.vAB1Aor0007544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 11 Nov 2017 01:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325698 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 325698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 01:10:53 -0000 Author: bdrewery Date: Sat Nov 11 01:10:50 2017 New Revision: 325698 URL: https://svnweb.freebsd.org/changeset/base/325698 Log: META_MODE: Avoid some logic if disabled and allow enabling with make argument. Sponsored by: Dell EMC Isilon Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Nov 11 01:10:46 2017 (r325697) +++ head/Makefile Sat Nov 11 01:10:50 2017 (r325698) @@ -247,8 +247,11 @@ SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk _MAKE= PATH=${PATH} MAKE_CMD="${MAKE}" ${SUB_MAKE} -f Makefile.inc1 \ TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" # Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST -# above. +# above. If overridden as a make argument then don't bother trying to +# disable it. +.if empty(.MAKEOVERRIDES:MMK_META_MODE) .for _tgt in ${META_TGT_WHITELIST} .if make(${_tgt}) _CAN_USE_META_MODE?= yes @@ -256,17 +259,22 @@ _CAN_USE_META_MODE?= yes .endfor .if !defined(_CAN_USE_META_MODE) _MAKE+= MK_META_MODE=no +MK_META_MODE= no .if defined(.PARSEDIR) .unexport META_MODE .endif -.elif defined(MK_META_MODE) && ${MK_META_MODE} == "yes" +.endif # !defined(_CAN_USE_META_MODE) +.endif # empty(.MAKEOVERRIDES:MMK_META_MODE) + +.if ${MK_META_MODE} == "yes" .if !exists(/dev/filemon) && !defined(NO_FILEMON) && !make(showconfig) # Require filemon be loaded to provide a working incremental build .error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. \ ${.newline}ERROR: WITH_META_MODE is enabled but requires filemon for an incremental build. \ ${.newline}ERROR: 'kldload filemon' or pass -DNO_FILEMON to suppress this error. .endif # !exists(/dev/filemon) && !defined(NO_FILEMON) -.endif # !defined(_CAN_USE_META_MODE) +.endif # ${MK_META_MODE} == yes +.endif # defined(MK_META_MODE) && ${MK_META_MODE} == yes # Only allow AUTO_OBJ for the whitelisted targets. See AUTO_OBJ_TGT_WHITELIST # above. MK_AUTO_OBJ not checked here for "yes" as it may not yet be enabled From owner-svn-src-all@freebsd.org Sat Nov 11 01:10:58 2017 Return-Path: Delivered-To: svn-src-all@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 27696E55D10; Sat, 11 Nov 2017 01:10:58 +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 10A616B875; Sat, 11 Nov 2017 01:10:56 +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 vAB1At3t007592; Sat, 11 Nov 2017 01:10:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB1AtWp007591; Sat, 11 Nov 2017 01:10:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711110110.vAB1AtWp007591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 11 Nov 2017 01:10:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325699 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 01:10:58 -0000 Author: bdrewery Date: Sat Nov 11 01:10:55 2017 New Revision: 325699 URL: https://svnweb.freebsd.org/changeset/base/325699 Log: Don't work out of a TARGET. directory if TARGET_ARCH is not defined. This fixes 'TARGET= make universe_kernels' creating an empty TARGET. directory and showing it in SIGINFO. Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Sat Nov 11 01:10:50 2017 (r325698) +++ head/share/mk/src.sys.obj.mk Sat Nov 11 01:10:55 2017 (r325699) @@ -75,12 +75,20 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T} # append TARGET.TARGET_ARCH for that case since the user wants to build # in the source tree. .if ${MK_UNIFIED_OBJDIR} == "yes" && ${SRCTOP} != ${OBJROOT:tA} -OBJTOP:= ${OBJROOT}${TARGET:D${TARGET}.${TARGET_ARCH}:U${MACHINE}.${MACHINE_ARCH}} +.if defined(TARGET) && defined(TARGET_ARCH) +OBJTOP:= ${OBJROOT}${TARGET}.${TARGET_ARCH} +.elif defined(TARGET) && ${.CURDIR} == ${SRCTOP} +# Not enough information, just use basic OBJDIR. This can happen with some +# 'make universe' targets or if TARGET is not being used as expected. +OBJTOP:= ${OBJROOT:H} .else +OBJTOP:= ${OBJROOT}${MACHINE}.${MACHINE_ARCH} +.endif +.else # TARGET.TARGET_ARCH handled in OBJROOT already. OBJTOP:= ${OBJROOT:H} .endif # ${MK_UNIFIED_OBJDIR} == "yes" -.endif +.endif # empty(OBJTOP) # Fixup OBJROOT/OBJTOP if using MAKEOBJDIRPREFIX but leave it alone # for DIRDEPS_BUILD which really wants to know the absolute top at From owner-svn-src-all@freebsd.org Sat Nov 11 01:11:07 2017 Return-Path: Delivered-To: svn-src-all@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 46424E55D71; Sat, 11 Nov 2017 01:11:07 +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 A87466B92D; Sat, 11 Nov 2017 01:11:02 +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 vAB1B0RC007667; Sat, 11 Nov 2017 01:11:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB1B02S007666; Sat, 11 Nov 2017 01:11:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201711110111.vAB1B02S007666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 11 Nov 2017 01:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325700 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 325700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 01:11:07 -0000 Author: bdrewery Date: Sat Nov 11 01:11:00 2017 New Revision: 325700 URL: https://svnweb.freebsd.org/changeset/base/325700 Log: DIRDEPS_BUILD: Fix after r325417. DIRDEPS_BUILD works just fine without defining __objdir or dealing with any of this logic. It handles its own TARGET_SPEC in local.meta.sys.mk as well. Just let it do its own thing. Sponsored by: Dell EMC Isilon Modified: head/share/mk/src.sys.obj.mk Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Sat Nov 11 01:10:55 2017 (r325699) +++ head/share/mk/src.sys.obj.mk Sat Nov 11 01:11:00 2017 (r325700) @@ -26,7 +26,7 @@ _default_makeobjdir= $${.CURDIR:S,^$${SRCTOP},$${OBJTO .include .if ${.MAKE.LEVEL} == 0 || empty(OBJROOT) -.if ${MK_UNIFIED_OBJDIR} == "no" +.if ${MK_UNIFIED_OBJDIR} == "no" && ${MK_DIRDEPS_BUILD} == "no" # Fall back to historical behavior. # We always want to set a default MAKEOBJDIRPREFIX... MAKEOBJDIRPREFIX?= ${_default_makeobjdirprefix} @@ -70,6 +70,7 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T} .export OBJROOT SRCTOP .endif +.if ${MK_DIRDEPS_BUILD} == "no" .if empty(OBJTOP) # SRCTOP == OBJROOT only happens with clever MAKEOBJDIRPREFIX=/. Don't # append TARGET.TARGET_ARCH for that case since the user wants to build @@ -90,12 +91,11 @@ OBJTOP:= ${OBJROOT:H} .endif # ${MK_UNIFIED_OBJDIR} == "yes" .endif # empty(OBJTOP) -# Fixup OBJROOT/OBJTOP if using MAKEOBJDIRPREFIX but leave it alone -# for DIRDEPS_BUILD which really wants to know the absolute top at -# all times. This intenionally comes after adding TARGET.TARGET_ARCH -# so that is truncated away for nested objdirs. This logic also -# will not trigger if the OBJROOT block above unsets MAKEOBJDIRPREFIX. -.if !empty(MAKEOBJDIRPREFIX) && ${MK_DIRDEPS_BUILD} == "no" +# Fixup OBJROOT/OBJTOP if using MAKEOBJDIRPREFIX. +# This intenionally comes after adding TARGET.TARGET_ARCH so that is truncated +# away for nested objdirs. This logic also will not trigger if the OBJROOT +# block above unsets MAKEOBJDIRPREFIX. +.if !empty(MAKEOBJDIRPREFIX) OBJTOP:= ${MAKEOBJDIRPREFIX}${SRCTOP} OBJROOT:= ${OBJTOP}/ .endif @@ -211,3 +211,5 @@ OBJROOT= ${SRCTOP}/ .OBJDIR: ${.CURDIR} .endif .endif # defined(NO_OBJ) + +.endif # ${MK_DIRDEPS_BUILD} == "no" From owner-svn-src-all@freebsd.org Sat Nov 11 06:15:01 2017 Return-Path: Delivered-To: svn-src-all@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 13532E61BA8; Sat, 11 Nov 2017 06:15:01 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDAEC7501D; Sat, 11 Nov 2017 06:15:00 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (cpe-23-243-163-238.socal.res.rr.com [23.243.163.238]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id vAB6EvpP003204 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 10 Nov 2017 22:14:58 -0800 Subject: Re: svn commit: r325688 - head/sys/boot/powerpc/ps3 To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711102354.vAANsJDk074902@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <35853e0e-a315-6f76-5431-b922e0f5700d@freebsd.org> Date: Fri, 10 Nov 2017 22:14:57 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201711102354.vAANsJDk074902@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZUmBf9UDNw5r9nojzKA4rxKCJwVc4tAA7gkOgBxz5NSC1cDPV5kt3VWRBwW3+LQlMlmTKSC/yX4lQyQCDmeaFIk0x/g3Nv62U= X-Sonic-ID: C;VFNDpKfG5xGYIIKfRUfeDw== M;xHSYpKfG5xGYIIKfRUfeDw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 06:15:01 -0000 The PS3 port *does* support FDT, though not through this loader. On a related note, I'm planning to just svn rm loader.ps3 in the next few weeks. -Nathan On 11/10/17 15:54, Warner Losh wrote: > Author: imp > Date: Fri Nov 10 23:54:18 2017 > New Revision: 325688 > URL: https://svnweb.freebsd.org/changeset/base/325688 > > Log: > FDT support doesn't make sense for ps3. There's no support in the ps3 > port for FDT, and it's unlikely to grow support for that anytime soon. > When it does, support can be added back easily enough. > > Supported by: Netflix > > Modified: > head/sys/boot/powerpc/ps3/Makefile > > Modified: head/sys/boot/powerpc/ps3/Makefile > ============================================================================== > --- head/sys/boot/powerpc/ps3/Makefile Fri Nov 10 23:54:13 2017 (r325687) > +++ head/sys/boot/powerpc/ps3/Makefile Fri Nov 10 23:54:18 2017 (r325688) > @@ -7,7 +7,6 @@ LOADER_NET_SUPPORT?= yes > LOADER_NFS_SUPPORT?= yes > LOADER_TFTP_SUPPORT?= no > LOADER_GZIP_SUPPORT?= yes > -LOADER_FDT_SUPPORT?= no > LOADER_BZIP2_SUPPORT?= no > > .include > @@ -24,12 +23,6 @@ SRCS+= lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c p > ps3stor.c ps3disk.c ps3cdrom.c > SRCS+= ucmpdi2.c > > -.if ${LOADER_FDT_SUPPORT} == "yes" > -CFLAGS+= -I${FDTSRC} > -CFLAGS+= -DLOADER_FDT_SUPPORT > -LIBFDT= ${BOOTOBJ}/fdt/libfdt.a > -.endif > - > CFLAGS+= -mcpu=powerpc64 > > # Always add MI sources > @@ -55,7 +48,7 @@ SC_DFLT_FONT=cp437 > font.h: > uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h > > -loader.help: help.common ${FDTSRC}/help.fdt > +loader.help: help.common > cat ${.ALLSRC} | \ > awk -f ${LDRSRC}/merge_help.awk > ${.TARGET} > > From owner-svn-src-all@freebsd.org Sat Nov 11 07:00:41 2017 Return-Path: Delivered-To: svn-src-all@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 AB6A8E627C1; Sat, 11 Nov 2017 07:00:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 854617601F; Sat, 11 Nov 2017 07:00:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAB70eEx052018; Sat, 11 Nov 2017 07:00:40 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB70e9P052013; Sat, 11 Nov 2017 07:00:40 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201711110700.vAB70e9P052013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 11 Nov 2017 07:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325702 - in head: . share/man/man5 share/man/man7 usr.bin/mail X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: . share/man/man5 share/man/man7 usr.bin/mail X-SVN-Commit-Revision: 325702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 07:00:41 -0000 Author: eadler Date: Sat Nov 11 07:00:40 2017 New Revision: 325702 URL: https://svnweb.freebsd.org/changeset/base/325702 Log: mailaddr(7): wave goodbye The information here is somewhere between ancient to obsolete. It refers to a time in the internet's history when manual routing was still useful, talks about UUCP as if its modern, and refers to documents which I had trouble tracking down. It seems unlikely that a manual page in this form would be useful, so just remove it. Reviewed By: imp, tsoome, bdrewery(?) Differential Revision: https://reviews.freebsd.org/D12924 Deleted: head/share/man/man7/mailaddr.7 Modified: head/ObsoleteFiles.inc head/share/man/man5/forward.5 head/share/man/man7/Makefile head/share/man/man7/hostname.7 head/usr.bin/mail/mail.1 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Nov 11 03:01:47 2017 (r325701) +++ head/ObsoleteFiles.inc Sat Nov 11 07:00:40 2017 (r325702) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20171110: Removal of mailaddr man page +OLD_FILES+=usr/share/man/man7/mailaddr.7.gz # 20171108: badsect(8) removal OLD_FILES+=sbin/badsect OLD_FILES+=rescue/badsect @@ -71,7 +73,7 @@ OLD_FILES+=usr/lib/libcap_random.a OLD_FILES+=usr/lib/libcap_random_p.a OLD_FILES+=usr/lib/libcap_sysctl.a OLD_FILES+=usr/lib/libcap_sysctl_p.a -# 20171031: Removal of obsolete man files +# 20171031: Removal of adding_user man page OLD_FILES+=usr/share/man/man7/adding_user.7.gz # 20171031: Disconnected libpathconv tests OLD_DIRS+=usr/tests/lib/libpathconv Modified: head/share/man/man5/forward.5 ============================================================================== --- head/share/man/man5/forward.5 Sat Nov 11 03:01:47 2017 (r325701) +++ head/share/man/man5/forward.5 Sat Nov 11 07:00:40 2017 (r325702) @@ -93,5 +93,4 @@ The user's forwarding instructions. .El .Sh SEE ALSO .Xr aliases 5 , -.Xr mailaddr 7 , .Xr sendmail 8 Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Sat Nov 11 03:01:47 2017 (r325701) +++ head/share/man/man7/Makefile Sat Nov 11 07:00:40 2017 (r325702) @@ -22,7 +22,6 @@ MAN= arch.7 \ hostname.7 \ intro.7 \ maclabel.7 \ - mailaddr.7 \ operator.7 \ ports.7 \ release.7 \ Modified: head/share/man/man7/hostname.7 ============================================================================== --- head/share/man/man7/hostname.7 Sat Nov 11 03:01:47 2017 (r325701) +++ head/share/man/man7/hostname.7 Sat Nov 11 07:00:40 2017 (r325702) @@ -82,7 +82,6 @@ by a system-wide configuration file (see .Sh SEE ALSO .Xr gethostbyname 3 , .Xr resolver 5 , -.Xr mailaddr 7 .Sh HISTORY .Nm Hostname appeared in Modified: head/usr.bin/mail/mail.1 ============================================================================== --- head/usr.bin/mail/mail.1 Sat Nov 11 03:01:47 2017 (r325701) +++ head/usr.bin/mail/mail.1 Sat Nov 11 07:00:40 2017 (r325702) @@ -327,9 +327,6 @@ but any reply returned to the machine will have the sy alias expanded as all mail goes through .Xr sendmail 8 . .Ss "Network Mail (ARPA, UUCP, Berknet)" -See -.Xr mailaddr 7 -for a description of network addresses. .Pp The .Nm @@ -1245,11 +1242,7 @@ if it exists. .Xr newaliases 1 , .Xr vacation 1 , .Xr aliases 5 , -.Xr mailaddr 7 , .Xr sendmail 8 -.Rs -.%T "The Mail Reference Manual" -.Re .Sh HISTORY A .Nm From owner-svn-src-all@freebsd.org Sat Nov 11 07:14:21 2017 Return-Path: Delivered-To: svn-src-all@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 12558E62D21; Sat, 11 Nov 2017 07:14:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D2C977690A; Sat, 11 Nov 2017 07:14:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAB7EK2E060584; Sat, 11 Nov 2017 07:14:20 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB7EKNN060583; Sat, 11 Nov 2017 07:14:20 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201711110714.vAB7EKNN060583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 11 Nov 2017 07:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325703 - head/targets/pseudo/userland X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/targets/pseudo/userland X-SVN-Commit-Revision: 325703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 07:14:21 -0000 Author: eadler Date: Sat Nov 11 07:14:19 2017 New Revision: 325703 URL: https://svnweb.freebsd.org/changeset/base/325703 Log: badsect(8): case remaining element r325452 removed badsect(8) - remove pseudo-target for it Modified: head/targets/pseudo/userland/Makefile.depend Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Sat Nov 11 07:00:40 2017 (r325702) +++ head/targets/pseudo/userland/Makefile.depend Sat Nov 11 07:14:19 2017 (r325703) @@ -48,7 +48,6 @@ DIRDEPS+= \ sbin/adjkerntz \ sbin/atacontrol \ sbin/atm/atmconfig \ - sbin/badsect \ sbin/camcontrol \ sbin/ccdconfig \ sbin/clri \ From owner-svn-src-all@freebsd.org Sat Nov 11 07:20:16 2017 Return-Path: Delivered-To: svn-src-all@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 44650E62F85; Sat, 11 Nov 2017 07:20:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1101076BE4; Sat, 11 Nov 2017 07:20:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAB7KFmV061027; Sat, 11 Nov 2017 07:20:15 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB7KFlG061026; Sat, 11 Nov 2017 07:20:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201711110720.vAB7KFlG061026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 11 Nov 2017 07:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325704 - head/targets/pseudo/userland X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/targets/pseudo/userland X-SVN-Commit-Revision: 325704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 07:20:16 -0000 Author: eadler Date: Sat Nov 11 07:20:14 2017 New Revision: 325704 URL: https://svnweb.freebsd.org/changeset/base/325704 Log: Chase removal of pkg_* commands Modified: head/targets/pseudo/userland/Makefile.depend Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Sat Nov 11 07:14:19 2017 (r325703) +++ head/targets/pseudo/userland/Makefile.depend Sat Nov 11 07:20:14 2017 (r325704) @@ -685,13 +685,6 @@ DIRDEPS+= \ usr.sbin/pciconf \ usr.sbin/periodic \ usr.sbin/pkg \ - usr.sbin/pkg_install/add \ - usr.sbin/pkg_install/create \ - usr.sbin/pkg_install/delete \ - usr.sbin/pkg_install/info \ - usr.sbin/pkg_install/lib \ - usr.sbin/pkg_install/updating \ - usr.sbin/pkg_install/version \ usr.sbin/pmcannotate \ usr.sbin/pmccontrol \ usr.sbin/pmcstat \ From owner-svn-src-all@freebsd.org Sat Nov 11 07:21:50 2017 Return-Path: Delivered-To: svn-src-all@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 B4E48E631E3; Sat, 11 Nov 2017 07:21:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 821CC76F2D; Sat, 11 Nov 2017 07:21:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAB7LnYX064725; Sat, 11 Nov 2017 07:21:49 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB7Lnun064724; Sat, 11 Nov 2017 07:21:49 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201711110721.vAB7Lnun064724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 11 Nov 2017 07:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325705 - head/secure X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/secure X-SVN-Commit-Revision: 325705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 07:21:50 -0000 Author: eadler Date: Sat Nov 11 07:21:49 2017 New Revision: 325705 URL: https://svnweb.freebsd.org/changeset/base/325705 Log: secure: chase removal of pkg_install Modified: head/secure/Makefile Modified: head/secure/Makefile ============================================================================== --- head/secure/Makefile Sat Nov 11 07:20:14 2017 (r325704) +++ head/secure/Makefile Sat Nov 11 07:21:49 2017 (r325705) @@ -11,7 +11,7 @@ SUBDIR.${MK_TESTS}+= tests # These are the programs which depend on crypto, but not Kerberos. SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ bin/ed libexec/telnetd usr.bin/fetch usr.bin/telnet \ - usr.sbin/pkg_install usr.sbin/ppp usr.sbin/tcpdump/tcpdump + usr.sbin/ppp usr.sbin/tcpdump/tcpdump .if ${MK_SENDMAIL} != "no" SPROGS+=usr.sbin/sendmail .endif From owner-svn-src-all@freebsd.org Sat Nov 11 09:34:13 2017 Return-Path: Delivered-To: svn-src-all@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 2D2C0E6658A; Sat, 11 Nov 2017 09:34:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1F877AF2D; Sat, 11 Nov 2017 09:34:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAB9YCGR021098; Sat, 11 Nov 2017 09:34:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAB9YCdE021097; Sat, 11 Nov 2017 09:34:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711110934.vAB9YCdE021097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Nov 2017 09:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325706 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 09:34:13 -0000 Author: mjg Date: Sat Nov 11 09:34:11 2017 New Revision: 325706 URL: https://svnweb.freebsd.org/changeset/base/325706 Log: rwlock: use fcmpset for setting RW_LOCK_WRITE_SPINNER Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Nov 11 07:21:49 2017 (r325705) +++ head/sys/kern/kern_rwlock.c Sat Nov 11 09:34:11 2017 (r325706) @@ -929,9 +929,8 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui if ((v & RW_LOCK_READ) && RW_READERS(v) && spintries < rowner_retries) { if (!(v & RW_LOCK_WRITE_SPINNER)) { - if (!atomic_cmpset_ptr(&rw->rw_lock, v, + if (!atomic_fcmpset_ptr(&rw->rw_lock, &v, v | RW_LOCK_WRITE_SPINNER)) { - v = RW_READ_VALUE(rw); continue; } } From owner-svn-src-all@freebsd.org Sat Nov 11 10:46:13 2017 Return-Path: Delivered-To: svn-src-all@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 D666BE67AD8; Sat, 11 Nov 2017 10:46:13 +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 93AC27CCC3; Sat, 11 Nov 2017 10:46:13 +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 vABAkCp9050321; Sat, 11 Nov 2017 10:46:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABAkC5Q050320; Sat, 11 Nov 2017 10:46:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711111046.vABAkC5Q050320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 11 Nov 2017 10:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325707 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 325707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 10:46:14 -0000 Author: hselasky Date: Sat Nov 11 10:46:12 2017 New Revision: 325707 URL: https://svnweb.freebsd.org/changeset/base/325707 Log: Mask away return codes from del_timer() and del_timer_sync() because they are not the same like in Linux. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/timer.h Sat Nov 11 09:34:11 2017 (r325706) +++ head/sys/compat/linuxkpi/common/include/linux/timer.h Sat Nov 11 10:46:12 2017 (r325707) @@ -69,8 +69,8 @@ extern void mod_timer(struct timer_list *, int); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); -#define del_timer(timer) callout_stop(&(timer)->timer_callout) -#define del_timer_sync(timer) callout_drain(&(timer)->timer_callout) +#define del_timer(timer) (void)callout_stop(&(timer)->timer_callout) +#define del_timer_sync(timer) (void)callout_drain(&(timer)->timer_callout) #define timer_pending(timer) callout_pending(&(timer)->timer_callout) #define round_jiffies(j) \ ((int)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) From owner-svn-src-all@freebsd.org Sat Nov 11 11:01:51 2017 Return-Path: Delivered-To: svn-src-all@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 DEB8FE67FD8; Sat, 11 Nov 2017 11:01:51 +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 B60247D521; Sat, 11 Nov 2017 11:01:51 +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 vABB1oKx057150; Sat, 11 Nov 2017 11:01:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABB1oXM057147; Sat, 11 Nov 2017 11:01:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711111101.vABB1oXM057147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 11 Nov 2017 11:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325708 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 325708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 11:01:52 -0000 Author: hselasky Date: Sat Nov 11 11:01:50 2017 New Revision: 325708 URL: https://svnweb.freebsd.org/changeset/base/325708 Log: Remove release and acquire semantics when accessing the "state" field of the LinuxKPI task struct. Change type of "state" variable from "int" to "atomic_t" to simplify code and avoid unneccessary casting. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/src/linux_current.c head/sys/compat/linuxkpi/common/src/linux_schedule.c Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Sat Nov 11 10:46:12 2017 (r325707) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Sat Nov 11 11:01:50 2017 (r325708) @@ -67,7 +67,7 @@ struct task_struct { void *task_data; int task_ret; atomic_t usage; - int state; + atomic_t state; atomic_t kthread_flags; pid_t pid; /* BSD thread ID */ const char *comm; @@ -92,9 +92,8 @@ struct task_struct { #define put_pid(x) do { } while (0) #define current_euid() (curthread->td_ucred->cr_uid) -#define set_task_state(task, x) \ - atomic_store_rel_int((volatile int *)&task->state, (x)) -#define __set_task_state(task, x) (task->state = (x)) +#define set_task_state(task, x) atomic_set(&(task)->state, (x)) +#define __set_task_state(task, x) ((task)->state.counter = (x)) #define set_current_state(x) set_task_state(current, x) #define __set_current_state(x) __set_task_state(current, x) Modified: head/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_current.c Sat Nov 11 10:46:12 2017 (r325707) +++ head/sys/compat/linuxkpi/common/src/linux_current.c Sat Nov 11 11:01:50 2017 (r325708) @@ -68,7 +68,7 @@ linux_alloc_current(struct thread *td, int flags) ts->comm = td->td_name; ts->pid = td->td_tid; atomic_set(&ts->usage, 1); - ts->state = TASK_RUNNING; + atomic_set(&ts->state, TASK_RUNNING); init_completion(&ts->parked); init_completion(&ts->exited); Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_schedule.c Sat Nov 11 10:46:12 2017 (r325707) +++ head/sys/compat/linuxkpi/common/src/linux_schedule.c Sat Nov 11 11:01:50 2017 (r325708) @@ -78,7 +78,7 @@ wake_up_task(struct task_struct *task, unsigned int st ret = wakeup_swapper = 0; sleepq_lock(task); - if ((atomic_load_acq_int(&task->state) & state) != 0) { + if ((atomic_read(&task->state) & state) != 0) { set_task_state(task, TASK_WAKING); wakeup_swapper = sleepq_signal(task, SLEEPQ_SLEEP, 0, 0); ret = 1; @@ -234,7 +234,7 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q */ PHOLD(task->task_thread->td_proc); sleepq_lock(task); - if (atomic_load_acq_int(&task->state) != TASK_WAKING) { + if (atomic_read(&task->state) != TASK_WAKING) { ret = linux_add_to_sleepqueue(task, "wevent", timeout, state); } else { sleepq_release(task); @@ -269,7 +269,7 @@ linux_schedule_timeout(int timeout) DROP_GIANT(); sleepq_lock(task); - state = atomic_load_acq_int(&task->state); + state = atomic_read(&task->state); if (state != TASK_WAKING) (void)linux_add_to_sleepqueue(task, "sched", timeout, state); else From owner-svn-src-all@freebsd.org Sat Nov 11 12:08:08 2017 Return-Path: Delivered-To: svn-src-all@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 B6EB3E699F0; Sat, 11 Nov 2017 12:08:08 +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 80E267F0F8; Sat, 11 Nov 2017 12:08:08 +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 vABC87S2085542; Sat, 11 Nov 2017 12:08:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABC87Ub085541; Sat, 11 Nov 2017 12:08:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711111208.vABC87Ub085541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 11 Nov 2017 12:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325709 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 325709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 12:08:08 -0000 Author: kib Date: Sat Nov 11 12:08:07 2017 New Revision: 325709 URL: https://svnweb.freebsd.org/changeset/base/325709 Log: MFC r325386: Convert explicit panic() call to assert. Modified: stable/11/sys/kern/kern_umtx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_umtx.c ============================================================================== --- stable/11/sys/kern/kern_umtx.c Sat Nov 11 11:01:50 2017 (r325708) +++ stable/11/sys/kern/kern_umtx.c Sat Nov 11 12:08:07 2017 (r325709) @@ -1577,8 +1577,7 @@ umtx_pi_setowner(struct umtx_pi *pi, struct thread *ow uq_owner = owner->td_umtxq; mtx_assert(&umtx_lock, MA_OWNED); - if (pi->pi_owner != NULL) - panic("pi_owner != NULL"); + MPASS(pi->pi_owner == NULL); pi->pi_owner = owner; TAILQ_INSERT_TAIL(&uq_owner->uq_pi_contested, pi, pi_link); } From owner-svn-src-all@freebsd.org Sat Nov 11 12:09:34 2017 Return-Path: Delivered-To: svn-src-all@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 6D7F4E69A71; Sat, 11 Nov 2017 12:09:34 +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 375A17F232; Sat, 11 Nov 2017 12:09:34 +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 vABC9XWU085666; Sat, 11 Nov 2017 12:09:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABC9X3n085665; Sat, 11 Nov 2017 12:09:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711111209.vABC9X3n085665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 11 Nov 2017 12:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325710 - stable/11/sys/i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/i386/i386 X-SVN-Commit-Revision: 325710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 12:09:34 -0000 Author: kib Date: Sat Nov 11 12:09:33 2017 New Revision: 325710 URL: https://svnweb.freebsd.org/changeset/base/325710 Log: MFC r325387: Eliminate unused load. Modified: stable/11/sys/i386/i386/swtch.s Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/i386/swtch.s ============================================================================== --- stable/11/sys/i386/i386/swtch.s Sat Nov 11 12:08:07 2017 (r325709) +++ stable/11/sys/i386/i386/swtch.s Sat Nov 11 12:09:33 2017 (r325710) @@ -262,7 +262,6 @@ sw1: popfl movl %edx, PCPU(CURPCB) - movl TD_TID(%ecx),%eax movl %ecx, PCPU(CURTHREAD) /* into next thread */ /* From owner-svn-src-all@freebsd.org Sat Nov 11 12:12:28 2017 Return-Path: Delivered-To: svn-src-all@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 36808E69C44; Sat, 11 Nov 2017 12:12:28 +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 001DB7F5E2; Sat, 11 Nov 2017 12:12:27 +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 vABCCRjP089919; Sat, 11 Nov 2017 12:12:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABCCQNH089917; Sat, 11 Nov 2017 12:12:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711111212.vABCCQNH089917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 11 Nov 2017 12:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325711 - in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 325711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 12:12:28 -0000 Author: kib Date: Sat Nov 11 12:12:26 2017 New Revision: 325711 URL: https://svnweb.freebsd.org/changeset/base/325711 Log: MFC r325388: x86: Do not emit unused TD_TID symbols. Modified: stable/11/sys/amd64/amd64/genassym.c stable/11/sys/i386/i386/genassym.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/genassym.c ============================================================================== --- stable/11/sys/amd64/amd64/genassym.c Sat Nov 11 12:09:33 2017 (r325710) +++ stable/11/sys/amd64/amd64/genassym.c Sat Nov 11 12:12:26 2017 (r325711) @@ -81,7 +81,6 @@ ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_PFLAGS, offsetof(struct thread, td_pflags)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); -ASSYM(TD_TID, offsetof(struct thread, td_tid)); ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); Modified: stable/11/sys/i386/i386/genassym.c ============================================================================== --- stable/11/sys/i386/i386/genassym.c Sat Nov 11 12:09:33 2017 (r325710) +++ stable/11/sys/i386/i386/genassym.c Sat Nov 11 12:12:26 2017 (r325711) @@ -88,7 +88,6 @@ ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_PFLAGS, offsetof(struct thread, td_pflags)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_MD, offsetof(struct thread, td_md)); -ASSYM(TD_TID, offsetof(struct thread, td_tid)); ASSYM(TDP_CALLCHAIN, TDP_CALLCHAIN); From owner-svn-src-all@freebsd.org Sat Nov 11 12:16:21 2017 Return-Path: Delivered-To: svn-src-all@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 17CB9E69D49; Sat, 11 Nov 2017 12:16:21 +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 D59BC7F74E; Sat, 11 Nov 2017 12:16:20 +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 vABCGJYs090160; Sat, 11 Nov 2017 12:16:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABCGJ3b090158; Sat, 11 Nov 2017 12:16:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711111216.vABCGJ3b090158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 11 Nov 2017 12:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r325712 - stable/11/lib/libc/stdlib X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/stdlib X-SVN-Commit-Revision: 325712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 12:16:21 -0000 Author: kib Date: Sat Nov 11 12:16:19 2017 New Revision: 325712 URL: https://svnweb.freebsd.org/changeset/base/325712 Log: MFC r325389: C++17 requires quick_exit(3) to be async-signal safe. Modified: stable/11/lib/libc/stdlib/quick_exit.3 stable/11/lib/libc/stdlib/quick_exit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdlib/quick_exit.3 ============================================================================== --- stable/11/lib/libc/stdlib/quick_exit.3 Sat Nov 11 12:12:26 2017 (r325711) +++ stable/11/lib/libc/stdlib/quick_exit.3 Sat Nov 11 12:16:19 2017 (r325712) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2014 +.Dd November 4, 2017 .Dt QUICK_EXIT 3 .Os .Sh NAME @@ -44,6 +44,17 @@ with .Xr at_quick_exit 3 but not any C++ destructors or cleanup code registered with .Xr atexit 3 . +The +.Xr stdio 3 +file buffers are not flushed. +.Pp +The function +.Fn quick_exit +is +.Em async-signal safe +when the functions registered with +.Xr at_quick_exit 3 +are. .Sh RETURN VALUES The .Fn quick_exit Modified: stable/11/lib/libc/stdlib/quick_exit.c ============================================================================== --- stable/11/lib/libc/stdlib/quick_exit.c Sat Nov 11 12:12:26 2017 (r325711) +++ stable/11/lib/libc/stdlib/quick_exit.c Sat Nov 11 12:16:19 2017 (r325712) @@ -26,6 +26,8 @@ * $FreeBSD$ */ +#include +#include #include #include @@ -60,6 +62,7 @@ at_quick_exit(void (*func)(void)) h->cleanup = func; pthread_mutex_lock(&atexit_mutex); h->next = handlers; + __compiler_membar(); handlers = h; pthread_mutex_unlock(&atexit_mutex); return (0); @@ -74,7 +77,9 @@ quick_exit(int status) * XXX: The C++ spec requires us to call std::terminate if there is an * exception here. */ - for (h = handlers; NULL != h; h = h->next) + for (h = handlers; NULL != h; h = h->next) { + __compiler_membar(); h->cleanup(); + } _Exit(status); } From owner-svn-src-all@freebsd.org Sat Nov 11 13:54:41 2017 Return-Path: Delivered-To: svn-src-all@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 EBD5BE6B752; Sat, 11 Nov 2017 13:54:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 753B21F84; Sat, 11 Nov 2017 13:54:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABDseBH032982; Sat, 11 Nov 2017 13:54:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABDsbOG032953; Sat, 11 Nov 2017 13:54:37 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201711111354.vABDsbOG032953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 11 Nov 2017 13:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325713 - in head/contrib/zstd: . contrib/gen_html contrib/pzstd contrib/pzstd/test contrib/pzstd/utils contrib/pzstd/utils/test contrib/seekable_format doc doc/educational_decoder lib ... X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/contrib/zstd: . contrib/gen_html contrib/pzstd contrib/pzstd/test contrib/pzstd/utils contrib/pzstd/utils/test contrib/seekable_format doc doc/educational_decoder lib lib/common lib/compress l... X-SVN-Commit-Revision: 325713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 13:54:42 -0000 Author: bapt Date: Sat Nov 11 13:54:37 2017 New Revision: 325713 URL: https://svnweb.freebsd.org/changeset/base/325713 Log: Update to zstd 1.3.2 Added: head/contrib/zstd/COPYING - copied unchanged from r325712, vendor/zstd/dist/COPYING head/contrib/zstd/contrib/seekable_format/ - copied from r325712, vendor/zstd/dist/contrib/seekable_format/ head/contrib/zstd/doc/educational_decoder/Makefile - copied unchanged from r325712, vendor/zstd/dist/doc/educational_decoder/Makefile head/contrib/zstd/lib/compress/zstd_compress.h - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_compress.h head/contrib/zstd/lib/compress/zstd_double_fast.c - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_double_fast.c head/contrib/zstd/lib/compress/zstd_double_fast.h - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_double_fast.h head/contrib/zstd/lib/compress/zstd_fast.c - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_fast.c head/contrib/zstd/lib/compress/zstd_fast.h - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_fast.h head/contrib/zstd/lib/compress/zstd_lazy.c - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_lazy.c head/contrib/zstd/lib/compress/zstd_lazy.h - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_lazy.h head/contrib/zstd/lib/compress/zstd_ldm.c - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_ldm.c head/contrib/zstd/lib/compress/zstd_ldm.h - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_ldm.h head/contrib/zstd/lib/compress/zstd_opt.c - copied unchanged from r325712, vendor/zstd/dist/lib/compress/zstd_opt.c head/contrib/zstd/tests/fuzz/block_decompress.c - copied unchanged from r325712, vendor/zstd/dist/tests/fuzz/block_decompress.c head/contrib/zstd/tests/fuzz/block_round_trip.c - copied unchanged from r325712, vendor/zstd/dist/tests/fuzz/block_round_trip.c head/contrib/zstd/tests/fuzz/default.options - copied unchanged from r325712, vendor/zstd/dist/tests/fuzz/default.options head/contrib/zstd/tests/fuzz/fuzz.py - copied unchanged from r325712, vendor/zstd/dist/tests/fuzz/fuzz.py head/contrib/zstd/tests/fuzz/zstd_helpers.c - copied unchanged from r325712, vendor/zstd/dist/tests/fuzz/zstd_helpers.c head/contrib/zstd/tests/fuzz/zstd_helpers.h - copied unchanged from r325712, vendor/zstd/dist/tests/fuzz/zstd_helpers.h Deleted: head/contrib/zstd/LICENSE-examples Modified: head/contrib/zstd/Makefile head/contrib/zstd/NEWS head/contrib/zstd/appveyor.yml head/contrib/zstd/circle.yml head/contrib/zstd/contrib/gen_html/Makefile head/contrib/zstd/contrib/gen_html/gen_html.cpp head/contrib/zstd/contrib/pzstd/ErrorHolder.h head/contrib/zstd/contrib/pzstd/Logging.h head/contrib/zstd/contrib/pzstd/Makefile head/contrib/zstd/contrib/pzstd/Options.cpp head/contrib/zstd/contrib/pzstd/Options.h head/contrib/zstd/contrib/pzstd/Pzstd.cpp head/contrib/zstd/contrib/pzstd/Pzstd.h head/contrib/zstd/contrib/pzstd/SkippableFrame.cpp head/contrib/zstd/contrib/pzstd/SkippableFrame.h head/contrib/zstd/contrib/pzstd/main.cpp head/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp head/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp head/contrib/zstd/contrib/pzstd/test/RoundTrip.h head/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp head/contrib/zstd/contrib/pzstd/utils/Buffer.h head/contrib/zstd/contrib/pzstd/utils/FileSystem.h head/contrib/zstd/contrib/pzstd/utils/Likely.h head/contrib/zstd/contrib/pzstd/utils/Range.h head/contrib/zstd/contrib/pzstd/utils/ResourcePool.h head/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h head/contrib/zstd/contrib/pzstd/utils/ThreadPool.h head/contrib/zstd/contrib/pzstd/utils/WorkQueue.h head/contrib/zstd/contrib/pzstd/utils/test/BufferTest.cpp head/contrib/zstd/contrib/pzstd/utils/test/RangeTest.cpp head/contrib/zstd/contrib/pzstd/utils/test/ResourcePoolTest.cpp head/contrib/zstd/contrib/pzstd/utils/test/ScopeGuardTest.cpp head/contrib/zstd/contrib/pzstd/utils/test/ThreadPoolTest.cpp head/contrib/zstd/contrib/pzstd/utils/test/WorkQueueTest.cpp head/contrib/zstd/doc/educational_decoder/harness.c head/contrib/zstd/doc/educational_decoder/zstd_decompress.c head/contrib/zstd/doc/educational_decoder/zstd_decompress.h head/contrib/zstd/doc/zstd_manual.html head/contrib/zstd/lib/.gitignore head/contrib/zstd/lib/Makefile head/contrib/zstd/lib/README.md head/contrib/zstd/lib/common/bitstream.h head/contrib/zstd/lib/common/compiler.h head/contrib/zstd/lib/common/error_private.c head/contrib/zstd/lib/common/error_private.h head/contrib/zstd/lib/common/fse.h head/contrib/zstd/lib/common/huf.h head/contrib/zstd/lib/common/mem.h head/contrib/zstd/lib/common/pool.c head/contrib/zstd/lib/common/pool.h head/contrib/zstd/lib/common/threading.c head/contrib/zstd/lib/common/threading.h head/contrib/zstd/lib/common/zstd_common.c head/contrib/zstd/lib/common/zstd_errors.h head/contrib/zstd/lib/common/zstd_internal.h head/contrib/zstd/lib/compress/fse_compress.c head/contrib/zstd/lib/compress/huf_compress.c head/contrib/zstd/lib/compress/zstd_compress.c head/contrib/zstd/lib/compress/zstd_opt.h head/contrib/zstd/lib/compress/zstdmt_compress.c head/contrib/zstd/lib/compress/zstdmt_compress.h head/contrib/zstd/lib/decompress/zstd_decompress.c head/contrib/zstd/lib/deprecated/zbuff.h head/contrib/zstd/lib/deprecated/zbuff_common.c head/contrib/zstd/lib/deprecated/zbuff_compress.c head/contrib/zstd/lib/deprecated/zbuff_decompress.c head/contrib/zstd/lib/dictBuilder/cover.c head/contrib/zstd/lib/dictBuilder/zdict.c head/contrib/zstd/lib/dictBuilder/zdict.h head/contrib/zstd/lib/legacy/zstd_legacy.h head/contrib/zstd/lib/legacy/zstd_v01.c head/contrib/zstd/lib/legacy/zstd_v01.h head/contrib/zstd/lib/legacy/zstd_v02.c head/contrib/zstd/lib/legacy/zstd_v02.h head/contrib/zstd/lib/legacy/zstd_v03.c head/contrib/zstd/lib/legacy/zstd_v03.h head/contrib/zstd/lib/legacy/zstd_v04.c head/contrib/zstd/lib/legacy/zstd_v04.h head/contrib/zstd/lib/legacy/zstd_v05.c head/contrib/zstd/lib/legacy/zstd_v05.h head/contrib/zstd/lib/legacy/zstd_v06.c head/contrib/zstd/lib/legacy/zstd_v06.h head/contrib/zstd/lib/legacy/zstd_v07.c head/contrib/zstd/lib/legacy/zstd_v07.h head/contrib/zstd/lib/zstd.h head/contrib/zstd/programs/Makefile head/contrib/zstd/programs/README.md head/contrib/zstd/programs/bench.c head/contrib/zstd/programs/bench.h head/contrib/zstd/programs/datagen.c head/contrib/zstd/programs/datagen.h head/contrib/zstd/programs/dibio.c head/contrib/zstd/programs/dibio.h head/contrib/zstd/programs/fileio.c head/contrib/zstd/programs/fileio.h head/contrib/zstd/programs/platform.h head/contrib/zstd/programs/util.h head/contrib/zstd/programs/zstd.1 head/contrib/zstd/programs/zstd.1.md head/contrib/zstd/programs/zstdcli.c head/contrib/zstd/tests/.gitignore head/contrib/zstd/tests/Makefile head/contrib/zstd/tests/datagencli.c head/contrib/zstd/tests/decodecorpus.c head/contrib/zstd/tests/fullbench.c head/contrib/zstd/tests/fuzz/Makefile head/contrib/zstd/tests/fuzz/README.md head/contrib/zstd/tests/fuzz/fuzz.h head/contrib/zstd/tests/fuzz/fuzz_helpers.h head/contrib/zstd/tests/fuzz/regression_driver.c head/contrib/zstd/tests/fuzz/simple_decompress.c head/contrib/zstd/tests/fuzz/simple_round_trip.c head/contrib/zstd/tests/fuzz/stream_decompress.c head/contrib/zstd/tests/fuzz/stream_round_trip.c head/contrib/zstd/tests/fuzzer.c head/contrib/zstd/tests/gzip/Makefile head/contrib/zstd/tests/invalidDictionaries.c head/contrib/zstd/tests/legacy.c head/contrib/zstd/tests/longmatch.c head/contrib/zstd/tests/namespaceTest.c head/contrib/zstd/tests/paramgrill.c head/contrib/zstd/tests/playTests.sh head/contrib/zstd/tests/poolTests.c head/contrib/zstd/tests/roundTripCrash.c head/contrib/zstd/tests/symbols.c head/contrib/zstd/tests/test-zstd-speed.py head/contrib/zstd/tests/test-zstd-versions.py head/contrib/zstd/tests/zbufftest.c head/contrib/zstd/tests/zstreamtest.c head/contrib/zstd/zlibWrapper/Makefile head/contrib/zstd/zlibWrapper/examples/zwrapbench.c head/contrib/zstd/zlibWrapper/gzcompatibility.h head/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c head/contrib/zstd/zlibWrapper/zstd_zlibwrapper.h Directory Properties: head/contrib/zstd/ (props changed) Copied: head/contrib/zstd/COPYING (from r325712, vendor/zstd/dist/COPYING) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/zstd/COPYING Sat Nov 11 13:54:37 2017 (r325713, copy of r325712, vendor/zstd/dist/COPYING) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file Modified: head/contrib/zstd/Makefile ============================================================================== --- head/contrib/zstd/Makefile Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/Makefile Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ # ################################################################ -# Copyright (c) 2016-present, Yann Collet, Facebook, Inc. +# Copyright (c) 2015-present, Yann Collet, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). # ################################################################ PRGDIR = programs @@ -12,6 +12,7 @@ ZSTDDIR = lib BUILDIR = build ZWRAPDIR = zlibWrapper TESTDIR = tests +FUZZDIR = $(TESTDIR)/fuzz # Define nul output VOID = /dev/null @@ -29,15 +30,12 @@ default: lib-release zstd-release all: | allmost examples manual .PHONY: allmost -allmost: - $(MAKE) -C $(ZSTDDIR) all - $(MAKE) -C $(PRGDIR) all - $(MAKE) -C $(TESTDIR) all +allmost: allzstd $(MAKE) -C $(ZWRAPDIR) all #skip zwrapper, can't build that on alternate architectures without the proper zlib installed -.PHONY: allarch -allarch: +.PHONY: allzstd +allzstd: $(MAKE) -C $(ZSTDDIR) all $(MAKE) -C $(PRGDIR) all $(MAKE) -C $(TESTDIR) all @@ -100,6 +98,7 @@ clean: @$(MAKE) -C examples/ $@ > $(VOID) @$(MAKE) -C contrib/gen_html $@ > $(VOID) @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* + @$(RM) -r lz4 @echo Cleaning completed #------------------------------------------------------------------------------ @@ -114,7 +113,7 @@ CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUI list: @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs -.PHONY: install clangtest gpptest armtest usan asan uasan +.PHONY: install clangtest armtest usan asan uasan install: @$(MAKE) -C $(ZSTDDIR) $@ @$(MAKE) -C $(PRGDIR) $@ @@ -158,16 +157,16 @@ m32build: clean $(MAKE) all32 armbuild: clean - CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allarch + CC=arm-linux-gnueabi-gcc CFLAGS="-Werror" $(MAKE) allzstd aarch64build: clean - CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allarch + CC=aarch64-linux-gnu-gcc CFLAGS="-Werror" $(MAKE) allzstd ppcbuild: clean - CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allarch + CC=powerpc-linux-gnu-gcc CLAGS="-m32 -Wno-attributes -Werror" $(MAKE) allzstd ppc64build: clean - CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allarch + CC=powerpc-linux-gnu-gcc CFLAGS="-m64 -Werror" $(MAKE) allzstd armfuzz: clean CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static MOREFLAGS="-static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest @@ -181,8 +180,10 @@ ppcfuzz: clean ppc64fuzz: clean CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static MOREFLAGS="-m64 -static" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) fuzztest -gpptest: clean - CC=$(CXX) $(MAKE) -C $(PRGDIR) all CFLAGS="-O3 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror" +.PHONY: cxxtest +cxxtest: CXXFLAGS += -Wall -Wextra -Wundef -Wshadow -Wcast-align -Werror +cxxtest: clean + $(MAKE) -C $(PRGDIR) all CC="$(CXX) -Wno-deprecated" CFLAGS="$(CXXFLAGS)" # adding -Wno-deprecated to avoid clang++ warning on dealing with C files directly gcc5test: clean gcc-5 -v @@ -218,6 +219,15 @@ arm-ppc-compilation: $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc-static ZSTDRTTEST= MOREFLAGS="-Werror -Wno-attributes -static" $(MAKE) -C $(PRGDIR) clean zstd CC=powerpc-linux-gnu-gcc QEMU_SYS=qemu-ppc64-static ZSTDRTTEST= MOREFLAGS="-m64 -static" +regressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest + +uasanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined" CXXFLAGS="-O3 -fsanitize=address,undefined" + +msanregressiontest: + $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory" + # run UBsan with -fsanitize-recover=signed-integer-overflow # due to a bug in UBsan when doing pointer subtraction # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303 @@ -277,6 +287,10 @@ gpp6install: apt-add-repo clang38install: APT_PACKAGES="clang-3.8" $(MAKE) apt-install +# Ubuntu 14.04 ships a too-old lz4 +lz4install: + [ -e lz4 ] || git clone https://github.com/lz4/lz4 && sudo $(MAKE) -C lz4 install + endif @@ -287,7 +301,7 @@ endif #------------------------------------------------------------------------ -#make tests validated only for MSYS, Linux, OSX, kFreeBSD and Hurd targets +# target specific tests #------------------------------------------------------------------------ ifneq (,$(filter $(HOST_OS),MSYS POSIX)) cmakebuild: @@ -297,38 +311,38 @@ cmakebuild: cd $(BUILDIR)/cmake/build ; cmake -DCMAKE_INSTALL_PREFIX:PATH=~/install_test_dir $(CMAKE_PARAMS) .. ; $(MAKE) install ; $(MAKE) uninstall c90build: clean - gcc -v + $(CC) -v CFLAGS="-std=c90" $(MAKE) allmost # will fail, due to missing support for `long long` gnu90build: clean - gcc -v + $(CC) -v CFLAGS="-std=gnu90" $(MAKE) allmost c99build: clean - gcc -v + $(CC) -v CFLAGS="-std=c99" $(MAKE) allmost gnu99build: clean - gcc -v + $(CC) -v CFLAGS="-std=gnu99" $(MAKE) allmost c11build: clean - gcc -v + $(CC) -v CFLAGS="-std=c11" $(MAKE) allmost bmix64build: clean - gcc -v + $(CC) -v CFLAGS="-O3 -mbmi -Werror" $(MAKE) -C $(TESTDIR) test bmix32build: clean - gcc -v + $(CC) -v CFLAGS="-O3 -mbmi -mx32 -Werror" $(MAKE) -C $(TESTDIR) test bmi32build: clean - gcc -v + $(CC) -v CFLAGS="-O3 -mbmi -m32 -Werror" $(MAKE) -C $(TESTDIR) test staticAnalyze: clean - gcc -v + $(CC) -v CPPFLAGS=-g scan-build --status-bugs -v $(MAKE) all endif Modified: head/contrib/zstd/NEWS ============================================================================== --- head/contrib/zstd/NEWS Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/NEWS Sat Nov 11 13:54:37 2017 (r325713) @@ -1,3 +1,26 @@ +v1.3.2 +new : long range mode, using --long command, by Stella Lau (@stellamplau) +new : ability to generate and decode magicless frames (#591) +changed : maximum nb of threads reduced to 200, to avoid address space exhaustion in 32-bits mode +fix : multi-threading compression works with custom allocators +fix : ZSTD_sizeof_CStream() was over-evaluating memory usage +fix : a rare compression bug when compression generates very large distances and bunch of other conditions (only possible at --ultra -22) +fix : 32-bits build can now decode large offsets (levels 21+) +cli : added LZ4 frame support by default, by Felix Handte (@felixhandte) +cli : improved --list output +cli : new : can split input file for dictionary training, using command -B# +cli : new : clean operation artefact on Ctrl-C interruption +cli : fix : do not change /dev/null permissions when using command -t with root access, reported by @mike155 (#851) +cli : fix : write file size in header in multiple-files mode +api : added macro ZSTD_COMPRESSBOUND() for static allocation +api : experimental : new advanced decompression API +api : fix : sizeof_CCtx() used to over-estimate +build: fix : no-multithread variant compiles without pool.c dependency, reported by Mitchell Blank Jr (@mitchblank) (#819) +build: better compatibility with reproducible builds, by Bernhard M. Wiedemann (@bmwiedemann) (#818) +example : added streaming_memory_usage +license : changed /examples license to BSD + GPLv2 +license : fix a few header files to reflect new license (#825) + v1.3.1 New license : BSD + GPLv2 perf: substantially decreased memory usage in Multi-threading mode, thanks to reports by Tino Reichardt (@mcmilk) Modified: head/contrib/zstd/appveyor.yml ============================================================================== --- head/contrib/zstd/appveyor.yml Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/appveyor.yml Sat Nov 11 13:54:37 2017 (r325713) @@ -9,19 +9,19 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allarch && make -C tests test-symbols fullbench-dll fullbench-lib" + SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests test-symbols fullbench-dll fullbench-lib" ARTIFACT: "true" BUILD: "true" - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x86" - SCRIPT: "make allarch" + SCRIPT: "make allzstd MOREFLAGS=-static" ARTIFACT: "true" BUILD: "true" - COMPILER: "clang" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allarch" + SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd" BUILD: "true" - COMPILER: "gcc" @@ -172,15 +172,15 @@ - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allarch" + SCRIPT: "make allzstd" - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x86" - SCRIPT: "make allarch" + SCRIPT: "make allzstd" - COMPILER: "clang" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allarch" + SCRIPT: "MOREFLAGS='--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion' make allzstd" - COMPILER: "visual" HOST: "visual" Modified: head/contrib/zstd/circle.yml ============================================================================== --- head/contrib/zstd/circle.yml Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/circle.yml Sat Nov 11 13:54:37 2017 (r325713) @@ -9,7 +9,7 @@ dependencies: test: override: - ? | - if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then cc -v; make all && make clean; fi && + if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then cc -v; make all && make clean && make -C lib libzstd-nomt && make clean; fi && if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gnu90build && make clean; fi : parallel: true @@ -45,12 +45,17 @@ test: parallel: true - ? | if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make ppc64build && make clean; fi && - if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc7build && make clean; fi #could add another test here + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make gcc7build && make clean; fi : parallel: true - ? | if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make shortest && make clean; fi && if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then make -C tests test-legacy test-longmatch test-symbols && make clean; fi + : + parallel: true + - ? | + if [[ "$CIRCLE_NODE_INDEX" == "0" ]] ; then make -j regressiontest && make clean; fi && + if [[ "$CIRCLE_NODE_TOTAL" < "2" ]] || [[ "$CIRCLE_NODE_INDEX" == "1" ]]; then true; fi # Could add another test here : parallel: true Modified: head/contrib/zstd/contrib/gen_html/Makefile ============================================================================== --- head/contrib/zstd/contrib/gen_html/Makefile Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/gen_html/Makefile Sat Nov 11 13:54:37 2017 (r325713) @@ -1,11 +1,11 @@ -# ########################################################################## +# ################################################################ # Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# ########################################################################## +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ CFLAGS ?= -O3 CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wno-comment Modified: head/contrib/zstd/contrib/gen_html/gen_html.cpp ============================================================================== --- head/contrib/zstd/contrib/gen_html/gen_html.cpp Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/gen_html/gen_html.cpp Sat Nov 11 13:54:37 2017 (r325713) @@ -2,9 +2,9 @@ * Copyright (c) 2016-present, Przemyslaw Skibinski, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include Modified: head/contrib/zstd/contrib/pzstd/ErrorHolder.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/ErrorHolder.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/ErrorHolder.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: head/contrib/zstd/contrib/pzstd/Logging.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/Logging.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/Logging.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: head/contrib/zstd/contrib/pzstd/Makefile ============================================================================== --- head/contrib/zstd/contrib/pzstd/Makefile Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/Makefile Sat Nov 11 13:54:37 2017 (r325713) @@ -1,11 +1,11 @@ -# ########################################################################## +# ################################################################ # Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. An additional grant -# of patent rights can be found in the PATENTS file in the same directory. -# ########################################################################## +# This source code is licensed under both the BSD-style license (found in the +# LICENSE file in the root directory of this source tree) and the GPLv2 (found +# in the COPYING file in the root directory of this source tree). +# ################################################################ # Standard variables for installation DESTDIR ?= Modified: head/contrib/zstd/contrib/pzstd/Options.cpp ============================================================================== --- head/contrib/zstd/contrib/pzstd/Options.cpp Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/Options.cpp Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Options.h" #include "util.h" Modified: head/contrib/zstd/contrib/pzstd/Options.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/Options.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/Options.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: head/contrib/zstd/contrib/pzstd/Pzstd.cpp ============================================================================== --- head/contrib/zstd/contrib/pzstd/Pzstd.cpp Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/Pzstd.cpp Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Pzstd.h" #include "SkippableFrame.h" Modified: head/contrib/zstd/contrib/pzstd/Pzstd.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/Pzstd.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/Pzstd.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: head/contrib/zstd/contrib/pzstd/SkippableFrame.cpp ============================================================================== --- head/contrib/zstd/contrib/pzstd/SkippableFrame.cpp Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/SkippableFrame.cpp Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "SkippableFrame.h" #include "mem.h" Modified: head/contrib/zstd/contrib/pzstd/SkippableFrame.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/SkippableFrame.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/SkippableFrame.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: head/contrib/zstd/contrib/pzstd/main.cpp ============================================================================== --- head/contrib/zstd/contrib/pzstd/main.cpp Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/main.cpp Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "ErrorHolder.h" #include "Options.h" Modified: head/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp ============================================================================== --- head/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/test/OptionsTest.cpp Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Options.h" Modified: head/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp ============================================================================== --- head/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/test/PzstdTest.cpp Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #include "Pzstd.h" extern "C" { Modified: head/contrib/zstd/contrib/pzstd/test/RoundTrip.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/test/RoundTrip.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/test/RoundTrip.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: head/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp ============================================================================== --- head/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/test/RoundTripTest.cpp Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ extern "C" { #include "datagen.h" Modified: head/contrib/zstd/contrib/pzstd/utils/Buffer.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/utils/Buffer.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/utils/Buffer.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: head/contrib/zstd/contrib/pzstd/utils/FileSystem.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/utils/FileSystem.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/utils/FileSystem.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: head/contrib/zstd/contrib/pzstd/utils/Likely.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/utils/Likely.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/utils/Likely.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** Modified: head/contrib/zstd/contrib/pzstd/utils/Range.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/utils/Range.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/utils/Range.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ /** Modified: head/contrib/zstd/contrib/pzstd/utils/ResourcePool.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/utils/ResourcePool.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/utils/ResourcePool.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once Modified: head/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h ============================================================================== --- head/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h Sat Nov 11 12:16:19 2017 (r325712) +++ head/contrib/zstd/contrib/pzstd/utils/ScopeGuard.h Sat Nov 11 13:54:37 2017 (r325713) @@ -1,10 +1,10 @@ -/** +/* * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). */ #pragma once *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Nov 11 13:57:31 2017 Return-Path: Delivered-To: svn-src-all@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 80C1AE6B804; Sat, 11 Nov 2017 13:57:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4A5B520F4; Sat, 11 Nov 2017 13:57:31 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABDvUDU033137; Sat, 11 Nov 2017 13:57:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABDvULC033136; Sat, 11 Nov 2017 13:57:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201711111357.vABDvULC033136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 11 Nov 2017 13:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325714 - head/lib/libzstd X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/lib/libzstd X-SVN-Commit-Revision: 325714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 13:57:31 -0000 Author: bapt Date: Sat Nov 11 13:57:30 2017 New Revision: 325714 URL: https://svnweb.freebsd.org/changeset/base/325714 Log: Follow up on zstd update Modified: head/lib/libzstd/Makefile Modified: head/lib/libzstd/Makefile ============================================================================== --- head/lib/libzstd/Makefile Sat Nov 11 13:54:37 2017 (r325713) +++ head/lib/libzstd/Makefile Sat Nov 11 13:57:30 2017 (r325714) @@ -19,7 +19,12 @@ SRCS= entropy_common.c \ zbuff_decompress.c \ cover.c \ divsufsort.c \ - zdict.c + zdict.c \ + zstd_fast.c \ + zstd_lazy.c \ + zstd_ldm.c \ + zstd_opt.c \ + zstd_double_fast.c WARNS= 2 INCS= zstd.h CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ \ From owner-svn-src-all@freebsd.org Sat Nov 11 14:02:23 2017 Return-Path: Delivered-To: svn-src-all@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 18565E6BA4A; Sat, 11 Nov 2017 14:02:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D3B48259C; Sat, 11 Nov 2017 14:02:22 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABE2Lnc036295; Sat, 11 Nov 2017 14:02:21 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABE2L2p036294; Sat, 11 Nov 2017 14:02:21 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201711111402.vABE2L2p036294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 11 Nov 2017 14:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325715 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 325715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 14:02:23 -0000 Author: allanjude Date: Sat Nov 11 14:02:21 2017 New Revision: 325715 URL: https://svnweb.freebsd.org/changeset/base/325715 Log: vmstat: fix duplicate key in libxo output In the libxo output from vmstat, the number of pages that have been paged out uses the same key name as the number of times pages have been paged. Appears to have been a typo or copy-pasto. PR: 222198 Submitted by: Yavuz Tanriverdi Reviewed by: phil, garga Differential Revision: https://reviews.freebsd.org/D12395 Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Sat Nov 11 13:57:30 2017 (r325714) +++ head/usr.bin/vmstat/vmstat.c Sat Nov 11 14:02:21 2017 (r325715) @@ -1059,7 +1059,7 @@ dosum(void) sum.v_vnodepgsin); xo_emit("{:vnode-page-outs/%9u} {N:vnode pager pageouts}\n", sum.v_vnodeout); - xo_emit("{:vnode-page-outs/%9u} {N:vnode pager pages paged out}\n", + xo_emit("{:vnode-page-out-pages/%9u} {N:vnode pager pages paged out}\n", sum.v_vnodepgsout); xo_emit("{:page-daemon-wakeups/%9u} {N:page daemon wakeups}\n", sum.v_pdwakeups); From owner-svn-src-all@freebsd.org Sat Nov 11 14:39:15 2017 Return-Path: Delivered-To: svn-src-all@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 22AF4E6C5CC; Sat, 11 Nov 2017 14:39:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DB416351D; Sat, 11 Nov 2017 14:39:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABEdEW6049682; Sat, 11 Nov 2017 14:39:14 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABEdEaT049681; Sat, 11 Nov 2017 14:39:14 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201711111439.vABEdEaT049681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 11 Nov 2017 14:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325716 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 325716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 14:39:15 -0000 Author: bapt Date: Sat Nov 11 14:39:13 2017 New Revision: 325716 URL: https://svnweb.freebsd.org/changeset/base/325716 Log: Fix some nroff style issue MFC after: 3 days Modified: head/lib/libutil/hexdump.3 Modified: head/lib/libutil/hexdump.3 ============================================================================== --- head/lib/libutil/hexdump.3 Sat Nov 11 14:02:21 2017 (r325715) +++ head/lib/libutil/hexdump.3 Sat Nov 11 14:39:13 2017 (r325716) @@ -42,14 +42,9 @@ The .Fn hexdump function prints an array of bytes to standard out in hexadecimal form, -along with the -.Tn ASCII -representation of the bytes, if possible. -By default, each line of -output will start with an offset count, followed by 16 hexadecimal values, -followed by 16 -.Tn ASCII -characters. +along with the ASCII representation of the bytes, if possible. +By default, each line of output will start with an offset count, followed by 16 +hexadecimal values, followed by 16 ASCII characters. .Bl -tag -width indent .It Fa ptr Pointer to the array of bytes to print. @@ -73,12 +68,10 @@ Flags for controlling the formatting of the output. Integer value of the number of bytes to display on each line. A value of 0 implies that the default value of 16 will be used. .It Bits 8-15 -Character -.Tn ASCII -value to use as the separator for the hexadecimal output. +Character ASCII value to use as the separator for the hexadecimal output. A value of 0 implies that the default value of 32 -.Tn ( ASCII -space) will be used. +.Pq ASCII space +will be used. .It Dv HD_OMIT_COUNT Do not print the offset column at the beginning of each line. .It Dv HD_OMIT_HEX From owner-svn-src-all@freebsd.org Sat Nov 11 14:47:26 2017 Return-Path: Delivered-To: svn-src-all@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 D98E2E6C92B for ; Sat, 11 Nov 2017 14:47:26 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (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 A1CD33B49 for ; Sat, 11 Nov 2017 14:47:26 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-pg0-x243.google.com with SMTP id j16so4008350pgn.9 for ; Sat, 11 Nov 2017 06:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ww9x8o/spMZyrpdFOnvqLoK2iNp0D4QPaQEU9kF31yM=; b=pOsSTly4oxiAUhy58cYQHD9jOSv2Kpre51EZ+ma+SFqSbps5tHyrd9d6V8CpJ0xQkY 0UAtcRpLQE8BWF0OMtmPSBcZYvSJuvaa4ukJ9JOVS0rEjwVHIBUglv1OnX9uLHPRJFSp 29u8WVPcTs6KwuW7WyStmt421BKd2J8/svXCNsLtjyCPQcCOPaetTtOuu+Xa9+oNShEB vpFLozdgeuZTUfDubBwET8iC47kBeosQUKdzwHXlmVOIAfdUCrbmRQBihbnmq3/UWoLc w3qM/2xEsywtjEi9ha3LS/sf8k/4Num3QjFeEGnNNwaHLY91lzfCzolZ3bFxrOtGwtCs kyBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ww9x8o/spMZyrpdFOnvqLoK2iNp0D4QPaQEU9kF31yM=; b=Lb1E8ePQf+8iEUB9sSbY4Z2FfvVO+QUgGc5+Zt3znSrSJaP9nYEHMVIkw67sHZUwmt kYY4MWhPIfh2wvYIkYiWoo7e6YnokuQbW+Lql6Zp0bDgjIUHqVAojej8dt7vVx7n7sqO t4w9Hm05b/MwRZ6Xgoz/Uoumz6AwskKRKKLeo/g4DV0CacHkMDg1bfbsIonUTT/Nr8wK plgsGpDw7/ycGqawgeFFf+awx+OXq+++a4vUw24Vev5WzwICy/Dk78gi/tpyRO7+5Mlk +GytwHcBeYFFMrLJV8455q8myVjhKA/dFQSgqR9k01DNzSQHFt1c6yLBjK1PP2FqCnX3 MStA== X-Gm-Message-State: AJaThX4lCLGJddf66noAHF/PlF+O+Pa8V5DAKcbhpDYk0tSI18BEI34s xVSU9ePgRpcE1q1lXThpuRBjLE+8YlY= X-Google-Smtp-Source: AGs4zMaE3dHyViOACjAPcc03mOKnxe2j/pefa4J2SsmLt7BzzQjjAVPlsajUxduLmm0KTtTa+7B67g== X-Received: by 10.159.205.132 with SMTP id v4mr3845685plo.426.1510411645989; Sat, 11 Nov 2017 06:47:25 -0800 (PST) Received: from mutt-hbsd ([5.188.11.165]) by smtp.gmail.com with ESMTPSA id d8sm24594866pfh.178.2017.11.11.06.47.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Nov 2017 06:47:25 -0800 (PST) Date: Sat, 11 Nov 2017 09:47:03 -0500 From: Shawn Webb To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325693 - in head: . share/mk sys/boot sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/gptzfsboot sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/i386/zfsboot sys/boot/i386/zfsloa... Message-ID: <20171111144703.dazfuukg46mkjj24@mutt-hbsd> References: <201711102354.vAANsmPJ075195@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3tb7we2x6xh5tndu" Content-Disposition: inline In-Reply-To: <201711102354.vAANsmPJ075195@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171013 X-Mailman-Approved-At: Sat, 11 Nov 2017 14:51:02 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 14:47:27 -0000 --3tb7we2x6xh5tndu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 10, 2017 at 11:54:48PM +0000, Warner Losh wrote: > Author: imp > Date: Fri Nov 10 23:54:48 2017 > New Revision: 325693 > URL: https://svnweb.freebsd.org/changeset/base/325693 >=20 > Log: > Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI > =20 > Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI > in the boot loaders. Add HAVE_GELI so components can flag they need > support (since it's too large to include everywhere). Add temporary > warnings for the old forms to ease transition. > =20 > Also, update test script to build without GELI on x86. > =20 > Sponsored by: Netflix >=20 > Added: > head/tools/build/options/WITHOUT_LOADER_GEIL (contents, props changed) Should this be tools/build/options/WITHOUT_LOADER_GELI instead? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --3tb7we2x6xh5tndu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAloHDWQACgkQaoRlj1JF bu45Lw/+JCniefs5el3w+Y8yNbhD2FYUAOuuF6mOsr2ZDKW1Z8W2AcNh7GZZXyR4 8oLYRbEGPXOSybfMyYnVw0Wl52gY9+OjMq3PKklPP+xlu+YAn2xBIQeiU4tLMVx0 0rjurI6E/854OE06lDr/C7eKpEY3dZFj2JIojCgmhz5A4zL5u3uNyGydN3oxuwA8 aWwv3RK7HznXYOBVm8j8WQWzU58Ec7TCBHHJsOt+Cnr/GTIz5Uhv3MLjhp7orO1g oWr5kHw3uJJ0xTlOH2wqttmgVotb0f12XGpczo/1XI20fe9PP0qz8SptLjp6TbXL Tgnwrz9OtmzZLkSMacwfHnhvXnrdz2mh6qiHmr0bwcaEZ+rEbimfiQIPaqmLe1y4 OKVLIe/90cAvbdi6LhgM6vcM20rfeOvWJ1vSwkJdV8HPjwoUCpuy/s9BhqSyOgEF WnKgDWYwIXGPDDL4P/KM03tRpUEKGOFyeqC1Zry0Hb/zRigkgEvGae9a7UHkAvp+ 9G850sDUrPlApicPDJx3aJtjnwDcFvU7FNmn6Ogeykrs3GmHtKoYOxWwgA5n+fQY DX6SOZXGPZ6FKqYKnm9T8zXtfi42Ge5unInhde+N2qa+dn7yUHHk3GwPqAXS7kmL yPjsgAGQHtU5dCT2ATjKuxmdkNARlvb/wRe6BGPCmTVV0mJfCQw= =ryOm -----END PGP SIGNATURE----- --3tb7we2x6xh5tndu-- From owner-svn-src-all@freebsd.org Sat Nov 11 15:18:27 2017 Return-Path: Delivered-To: svn-src-all@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 3E4DBE6D0F5; Sat, 11 Nov 2017 15:18:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EF89D6397D; Sat, 11 Nov 2017 15:18:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABFIQn7066824; Sat, 11 Nov 2017 15:18:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABFIQLS066823; Sat, 11 Nov 2017 15:18:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201711111518.vABFIQLS066823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 11 Nov 2017 15:18:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325717 - head/usr.bin/rctl X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/rctl X-SVN-Commit-Revision: 325717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 15:18:27 -0000 Author: bapt Date: Sat Nov 11 15:18:25 2017 New Revision: 325717 URL: https://svnweb.freebsd.org/changeset/base/325717 Log: Remove __unused attributed on arguments that are actually used MFC after: 3 days Modified: head/usr.bin/rctl/rctl.c Modified: head/usr.bin/rctl/rctl.c ============================================================================== --- head/usr.bin/rctl/rctl.c Sat Nov 11 14:39:13 2017 (r325716) +++ head/usr.bin/rctl/rctl.c Sat Nov 11 15:18:25 2017 (r325717) @@ -586,7 +586,7 @@ usage(void) } int -main(int argc __unused, char **argv __unused) +main(int argc, char **argv) { int ch, aflag = 0, hflag = 0, nflag = 0, lflag = 0, rflag = 0, uflag = 0; From owner-svn-src-all@freebsd.org Sat Nov 11 16:06:03 2017 Return-Path: Delivered-To: svn-src-all@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 77D91E6E1F3 for ; Sat, 11 Nov 2017 16:06:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (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 39CB46510A for ; Sat, 11 Nov 2017 16:06:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id h70so16493324ioi.4 for ; Sat, 11 Nov 2017 08:06:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=W5bBQwgUXWU7nYkGl1tKHxYmv7TKj435SoyneZq6rp8=; b=oWt0X8NoicL3L7CruvrIPstyYEuIXJK/6nmV/ShyW9Cda4Au1K2U3ov9ZN8L1ZfnET 5wCaXp+ITtk2LTk6bSQ05oQcIKLojEdvWNBvAdQJMwsm47MLXI6zIcZCiIBL5FW6nPE3 FRnxLdoWj6IMLu0NgT4+GnO61b+aam4BODDo2kUwp4ON2piKDRV213V67ULG0RG1xJCF QUqQXkEtAwwvBYnp8wqR8IrDUVIELmc+TnJcAjZRguB96r+EO4D8lEhQcPlwyZ3THtAJ b5J/5+Fv1mAeVqKIReMIj952IDfkrDfzq3JAD+e680nezJe+q7zNv0x1vx0jNkspOOPR dctQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=W5bBQwgUXWU7nYkGl1tKHxYmv7TKj435SoyneZq6rp8=; b=kyjKYvB0Ae7A4kNb30OAY8neX2UfIog6Sf3gHDfFXSN26DU+c8CkqmngCDhFZyk3L7 D2Hugq8DJaYjfEld8Wk2pzp+w7BNm9xP4Bj/7UAsrm8qQb5buUuPt4N0kgiz+9LKm+oE lJUxZXIg5Cp6W10y3Rl8aUi3kcaxxz6nftfEfcX37xQvLZZXzylkTVt3LG4ZmAxl5IHN EyiUngZSshDHmil+gl/hXP2PNmi2KLgpnmf3l5e2sGJKotF3+1PZfQwetNJTZ3JGVDED gAJdV68U3g2mT8NDqshz9YGu2jc/Rjvh6EY33ewkf6DgxgK6dDDeGl88IHq9U1vmVGRr rzLQ== X-Gm-Message-State: AJaThX4MSS4EVTYSjmSahU2jW1sUJ9T7s4GyYt6ZglUzCYBtvvJcJzyE ZlAdzAF5nFKgLBmaM/ZwATA/rBB5RZrBfO/K/Jv1qg== X-Google-Smtp-Source: AGs4zMbq4v9vjIbSV8XZD9I1lnOD4JqrjQL48KA2lBi78N4z3RQIRapCbkvcqzC52JzoKjZWXqLICfZD03KvRrq7+5k= X-Received: by 10.107.30.73 with SMTP id e70mr4257123ioe.130.1510416362457; Sat, 11 Nov 2017 08:06:02 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Sat, 11 Nov 2017 08:06:01 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:5122:5997:63f8:a0df] In-Reply-To: <20171111144703.dazfuukg46mkjj24@mutt-hbsd> References: <201711102354.vAANsmPJ075195@repo.freebsd.org> <20171111144703.dazfuukg46mkjj24@mutt-hbsd> From: Warner Losh Date: Sat, 11 Nov 2017 09:06:01 -0700 X-Google-Sender-Auth: EkYDwgqqBVXSeC5DC_NvQ1EEBpg Message-ID: Subject: Re: svn commit: r325693 - in head: . share/mk sys/boot sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/gptzfsboot sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/i386/zfsboot sys/boot/i386/zfsloa... To: Shawn Webb Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 16:06:03 -0000 On Sat, Nov 11, 2017 at 7:47 AM, Shawn Webb wrote: > On Fri, Nov 10, 2017 at 11:54:48PM +0000, Warner Losh wrote: > > Author: imp > > Date: Fri Nov 10 23:54:48 2017 > > New Revision: 325693 > > URL: https://svnweb.freebsd.org/changeset/base/325693 > > > > Log: > > Move LOADER_{NO,}_GELI_SUPPORT to MK_LOADER_GELI > > > > Transition to WITH/WITHOUT_LOADER_GELI to flag support or not of GELI > > in the boot loaders. Add HAVE_GELI so components can flag they need > > support (since it's too large to include everywhere). Add temporary > > warnings for the old forms to ease transition. > > > > Also, update test script to build without GELI on x86. > > > > Sponsored by: Netflix > > > > Added: > > head/tools/build/options/WITHOUT_LOADER_GEIL (contents, props > changed) > > Should this be tools/build/options/WITHOUT_LOADER_GELI instead? > Yes. Warner From owner-svn-src-all@freebsd.org Sat Nov 11 16:09:21 2017 Return-Path: Delivered-To: svn-src-all@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 9CC0CE6E2F8; Sat, 11 Nov 2017 16:09:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6763565363; Sat, 11 Nov 2017 16:09:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABG9KGH087606; Sat, 11 Nov 2017 16:09:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABG9KT2087605; Sat, 11 Nov 2017 16:09:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711111609.vABG9KT2087605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 11 Nov 2017 16:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325718 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 325718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 16:09:21 -0000 Author: imp Date: Sat Nov 11 16:09:20 2017 New Revision: 325718 URL: https://svnweb.freebsd.org/changeset/base/325718 Log: Fix typo in filename. Noticed by: Shawn Webb Added: head/tools/build/options/WITHOUT_LOADER_GELI (contents, props changed) - copied, changed from r325694, head/tools/build/options/WITHOUT_LOADER_GEIL Deleted: head/tools/build/options/WITHOUT_LOADER_GEIL Copied and modified: head/tools/build/options/WITHOUT_LOADER_GELI (from r325694, head/tools/build/options/WITHOUT_LOADER_GEIL) ============================================================================== From owner-svn-src-all@freebsd.org Sat Nov 11 17:21:23 2017 Return-Path: Delivered-To: svn-src-all@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 50407E6F971; Sat, 11 Nov 2017 17:21:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 241FC674B3; Sat, 11 Nov 2017 17:21:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 5AE41E092; Sat, 11 Nov 2017 17:21:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 9DA5C7D54; Sat, 11 Nov 2017 17:21:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id azOK6YK7SV_B; Sat, 11 Nov 2017 17:21:18 +0000 (UTC) Subject: Re: svn commit: r325705 - head/secure DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com A069F7D46 To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711110721.vAB7Lnun064724@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Sat, 11 Nov 2017 09:21:15 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201711110721.vAB7Lnun064724@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DFSauUNrC4BUuFvpb7OxJA1CqDf0rxtcx" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 17:21:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DFSauUNrC4BUuFvpb7OxJA1CqDf0rxtcx Content-Type: multipart/mixed; boundary="HnwtHgmN78TekShkOIsUbdLlMiNgpa7fR"; protected-headers="v1" From: Bryan Drewery To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r325705 - head/secure References: <201711110721.vAB7Lnun064724@repo.freebsd.org> In-Reply-To: <201711110721.vAB7Lnun064724@repo.freebsd.org> --HnwtHgmN78TekShkOIsUbdLlMiNgpa7fR Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 11/10/17 11:21 PM, Eitan Adler wrote: > Author: eadler > Date: Sat Nov 11 07:21:49 2017 > New Revision: 325705 > URL: https://svnweb.freebsd.org/changeset/base/325705 >=20 > Log: > secure: chase removal of pkg_install >=20 > Modified: > head/secure/Makefile >=20 > Modified: head/secure/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/secure/Makefile Sat Nov 11 07:20:14 2017 (r325704) > +++ head/secure/Makefile Sat Nov 11 07:21:49 2017 (r325705) > @@ -11,7 +11,7 @@ SUBDIR.${MK_TESTS}+=3D tests > # These are the programs which depend on crypto, but not Kerberos. > SPROGS=3D lib/libfetch lib/libpam lib/libradius lib/libtelnet \ > bin/ed libexec/telnetd usr.bin/fetch usr.bin/telnet \ > - usr.sbin/pkg_install usr.sbin/ppp usr.sbin/tcpdump/tcpdump > + usr.sbin/ppp usr.sbin/tcpdump/tcpdump > .if ${MK_SENDMAIL} !=3D "no" > SPROGS+=3Dusr.sbin/sendmail > .endif >=20 This whole list and target seems outdated. IMHO it should all be removed.= --=20 Regards, Bryan Drewery --HnwtHgmN78TekShkOIsUbdLlMiNgpa7fR-- --DFSauUNrC4BUuFvpb7OxJA1CqDf0rxtcx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEzBAEBCgAdFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAloHMY0ACgkQNddxu25G l8/c3Af+LGLRtKnxUf6F4escTTCxsR1AZNrvkwBEEx3wzeb4nZLTLseu+U3tcAXx dFo4+GWjE45UL//w5DolLYxr4lerx6GSKRJMHaySQtyDsUSmK3lxRpTvst53MfUL LHN1iZPb2eK/qD6mHISnQLRpkW3ZpDh0xHOYVxfsjfNuRgnkQ2yyzcrFiqGc19B3 nOycTR0GTSCsGnKEuQ9sT50g2WiKGMV0zLb3m0S+CW/nW/b623F0DYi4rhDgtQ61 CbLazmr6a+iuFqVIVy3JYfaNVCApP9MrSY8ttE6E7Ser1kIVJubh9qVpjoHr1lVB lp8+RubVR3Tody9GNLGfzE2lhVF6bg== =CW9+ -----END PGP SIGNATURE----- --DFSauUNrC4BUuFvpb7OxJA1CqDf0rxtcx-- From owner-svn-src-all@freebsd.org Sat Nov 11 18:02:25 2017 Return-Path: Delivered-To: svn-src-all@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 4E68EE7062A; Sat, 11 Nov 2017 18:02:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1978F687C0; Sat, 11 Nov 2017 18:02:25 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABI2OeN037759; Sat, 11 Nov 2017 18:02:24 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABI2OA1037758; Sat, 11 Nov 2017 18:02:24 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711111802.vABI2OA1037758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Nov 2017 18:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325719 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 18:02:25 -0000 Author: mjg Date: Sat Nov 11 18:02:23 2017 New Revision: 325719 URL: https://svnweb.freebsd.org/changeset/base/325719 Log: Remove useless proc lookup from sysctl_out_proc Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Nov 11 16:09:20 2017 (r325718) +++ head/sys/kern/kern_proc.c Sat Nov 11 18:02:23 2017 (r325719) @@ -1369,16 +1369,12 @@ kern_proc_out(struct proc *p, struct sbuf *sb, int fla } static int -sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags, - int doingzomb) +sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags) { struct sbuf sb; struct kinfo_proc ki; - struct proc *np; int error, error2; - pid_t pid; - pid = p->p_pid; sbuf_new_for_sysctl(&sb, (char *)&ki, sizeof(ki), req); sbuf_clear_flags(&sb, SBUF_INCLUDENUL); error = kern_proc_out(p, &sb, flags); @@ -1388,20 +1384,6 @@ sysctl_out_proc(struct proc *p, struct sysctl_req *req return (error); else if (error2 != 0) return (error2); - if (doingzomb) - np = zpfind(pid); - else { - if (pid == 0) - return (0); - np = pfind(pid); - } - if (np == NULL) - return (ESRCH); - if (np != p) { - PROC_UNLOCK(np); - return (ESRCH); - } - PROC_UNLOCK(np); return (0); } @@ -1435,7 +1417,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) sx_slock(&proctree_lock); error = pget((pid_t)name[0], PGET_CANSEE, &p); if (error == 0) - error = sysctl_out_proc(p, req, flags, 0); + error = sysctl_out_proc(p, req, flags); sx_sunlock(&proctree_lock); return (error); } @@ -1566,7 +1548,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } - error = sysctl_out_proc(p, req, flags, doingzomb); + error = sysctl_out_proc(p, req, flags); if (error) { sx_sunlock(&allproc_lock); sx_sunlock(&proctree_lock); From owner-svn-src-all@freebsd.org Sat Nov 11 18:03:28 2017 Return-Path: Delivered-To: svn-src-all@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 0D429E706D7; Sat, 11 Nov 2017 18:03:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBC1768A0C; Sat, 11 Nov 2017 18:03:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABI3QFM037983; Sat, 11 Nov 2017 18:03:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABI3QnC037982; Sat, 11 Nov 2017 18:03:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711111803.vABI3QnC037982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Nov 2017 18:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325720 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 18:03:28 -0000 Author: mjg Date: Sat Nov 11 18:03:26 2017 New Revision: 325720 URL: https://svnweb.freebsd.org/changeset/base/325720 Log: Avoid allproc lock in pfind if curproc->pid == pid Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Nov 11 18:02:23 2017 (r325719) +++ head/sys/kern/kern_proc.c Sat Nov 11 18:03:26 2017 (r325720) @@ -342,6 +342,11 @@ pfind(pid_t pid) { struct proc *p; + p = curproc; + if (p->p_pid == pid) { + PROC_LOCK(p); + return (p); + } sx_slock(&allproc_lock); p = pfind_locked(pid); sx_sunlock(&allproc_lock); From owner-svn-src-all@freebsd.org Sat Nov 11 18:04:41 2017 Return-Path: Delivered-To: svn-src-all@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 77DCEE70767; Sat, 11 Nov 2017 18:04:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F2B168B8A; Sat, 11 Nov 2017 18:04:41 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABI4e0C038064; Sat, 11 Nov 2017 18:04:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABI4e6H038060; Sat, 11 Nov 2017 18:04:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711111804.vABI4e6H038060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Nov 2017 18:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325721 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 325721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 18:04:41 -0000 Author: mjg Date: Sat Nov 11 18:04:39 2017 New Revision: 325721 URL: https://svnweb.freebsd.org/changeset/base/325721 Log: Add pfind_any It looks for both regular and zombie processes. This avoids allproc relocking previously seen with pfind -> zpfind calls. Modified: head/sys/kern/kern_event.c head/sys/kern/kern_proc.c head/sys/kern/kern_sig.c head/sys/sys/proc.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 11 18:03:26 2017 (r325720) +++ head/sys/kern/kern_event.c Sat Nov 11 18:04:39 2017 (r325721) @@ -406,16 +406,15 @@ filt_procattach(struct knote *kn) bool exiting, immediate; exiting = immediate = false; - p = pfind(kn->kn_id); - if (p == NULL && (kn->kn_sfflags & NOTE_EXIT)) { - p = zpfind(kn->kn_id); - exiting = true; - } else if (p != NULL && (p->p_flag & P_WEXIT)) { - exiting = true; - } - + if (kn->kn_sfflags & NOTE_EXIT) + p = pfind_any(kn->kn_id); + else + p = pfind(kn->kn_id); if (p == NULL) return (ESRCH); + if (p->p_flag & P_WEXIT) + exiting = true; + if ((error = p_cansee(curthread, p))) { PROC_UNLOCK(p); return (error); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Nov 11 18:03:26 2017 (r325720) +++ head/sys/kern/kern_proc.c Sat Nov 11 18:04:39 2017 (r325721) @@ -353,6 +353,23 @@ pfind(pid_t pid) return (p); } +/* + * Same as pfind but allow zombies. + */ +struct proc * +pfind_any(pid_t pid) +{ + struct proc *p; + + sx_slock(&allproc_lock); + p = pfind_locked(pid); + if (p == NULL) + p = zpfind_locked(pid); + sx_sunlock(&allproc_lock); + + return (p); +} + static struct proc * pfind_tid_locked(pid_t tid) { Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sat Nov 11 18:03:26 2017 (r325720) +++ head/sys/kern/kern_sig.c Sat Nov 11 18:04:39 2017 (r325721) @@ -1765,10 +1765,8 @@ sys_kill(struct thread *td, struct kill_args *uap) if (uap->pid > 0) { /* kill single process */ - if ((p = pfind(uap->pid)) == NULL) { - if ((p = zpfind(uap->pid)) == NULL) - return (ESRCH); - } + if ((p = pfind_any(uap->pid)) == NULL) + return (ESRCH); AUDIT_ARG_PROCESS(p); error = p_cansignal(td, p, uap->signum); if (error == 0 && uap->signum) Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Nov 11 18:03:26 2017 (r325720) +++ head/sys/sys/proc.h Sat Nov 11 18:04:39 2017 (r325721) @@ -954,6 +954,7 @@ extern struct proc *initproc, *pageproc; /* Process sl extern struct uma_zone *proc_zone; struct proc *pfind(pid_t); /* Find process by id. */ +struct proc *pfind_any(pid_t); /* Find (zombie) process by id. */ struct proc *pfind_locked(pid_t pid); struct pgrp *pgfind(pid_t); /* Find process group by id. */ struct proc *zpfind(pid_t); /* Find zombie process by id. */ From owner-svn-src-all@freebsd.org Sat Nov 11 18:07:25 2017 Return-Path: Delivered-To: svn-src-all@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 9A74CE7080C for ; Sat, 11 Nov 2017 18:07:25 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x22c.google.com (mail-yw0-x22c.google.com [IPv6:2607:f8b0:4002:c05::22c]) (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 4D65668D1D for ; Sat, 11 Nov 2017 18:07:25 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x22c.google.com with SMTP id t71so10579663ywc.3 for ; Sat, 11 Nov 2017 10:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CBXZ36eYtdlH6k14l4QiEdqoaz8DojqSPw0oeuFQnA8=; b=eCYfBuNFJFTSVAhLAy+OFQrYcP5EgY1Dc3vRbw7jNyIqLypIHG24C18mbwCbyxQpSo JVrIqv3wdQ4Qfk4w6E82APZCIVaEyIC8TGs1XXkYWZOo8nrD+VHXTuSbtw9LSbhcsZyj NwLxmpZ1i+n8NwuqU/ImC17PYO/MKi3acdxz8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CBXZ36eYtdlH6k14l4QiEdqoaz8DojqSPw0oeuFQnA8=; b=Iriq+3RsUe6vu9bmHpCSeMxmjprXtKA5RDYEsOOhjTlPhE65D5ypTlhlj+usDynMlE bRGmC748CnFIKLl7FlcdF+l2OPrEEAXxj4S7ONVjS9tF9TmipgDMEQhv3pKJaHmTJG0n P/Cm6VJKLPHlyOdALrcq/lzRGVYk87IazXK+m6i3k7fR91AOlA/njHDoDb5TeTFCKYAw 1gbThQhdPo6Q1v5Ti4ePgEFvySEwd/wamBtuQ2ow6WQx1TNH6zZnSAH1ZVFSFNQe+QHo uzcZ07Gqc2QOl+8r5HAUFdNKQtOoBnKOypKNpzDUwH3rT3Ahgp3FhIldgHdYDPMXaSKk me5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=CBXZ36eYtdlH6k14l4QiEdqoaz8DojqSPw0oeuFQnA8=; b=WvM02rsKDNEadc7FhWrwY63lRJn5O+6BvcB2Aw49UtIVnwJHrI4vJSBi801GzH+E0F tmxulsYlwBMoC2im6qEhdGdGJd5Vp05IUo8uPd3xlqHfdwt2iHyVqJpozeoojFBgihR4 IUYzZtUd09FbsDipNSk56gvoZMsrO2pWbIBOzr35NLJ700MqhdgeVJ1lvWId4EhzA1HF TKG/eHtw1qmcOiRJ7cr+5gXSFQVn1Q45J9FyL6C8PD6B7or1tgWRjkPyOHXt0VE4PAqK +ANunvHBY+eSQur6K4rRXM36wI7asTyPbvjQ8NXQgre0lPQXtH7Q6kSpSEVtOCD4nln9 kK/Q== X-Gm-Message-State: AJaThX75SljCGLUH87BgVvUYVQImYFdFfqYlJQ3AGDkxCxf1xsg1xcX1 Vt8rxNxzWqkOs/5fVUDS+q8pFTetD3ayvZ8GZr1Whg== X-Google-Smtp-Source: AGs4zMbEU/QKxnxX3PGIPVIep1w8EJNscnCHywQhm+5uqp/8KPhNH//6i5Nff0eQGZGJDsudJ/2+6ieK/83JlokPxzA= X-Received: by 10.129.196.12 with SMTP id j12mr2980612ywi.393.1510423644026; Sat, 11 Nov 2017 10:07:24 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.37.56.66 with HTTP; Sat, 11 Nov 2017 10:06:53 -0800 (PST) In-Reply-To: References: <201711110721.vAB7Lnun064724@repo.freebsd.org> From: Eitan Adler Date: Sat, 11 Nov 2017 10:06:53 -0800 X-Google-Sender-Auth: FGe8nfcIRoj2lgYDAWSU7jDBTJ4 Message-ID: Subject: Re: svn commit: r325705 - head/secure To: Bryan Drewery Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 18:07:25 -0000 On 11 November 2017 at 09:21, Bryan Drewery wrote: > On 11/10/17 11:21 PM, Eitan Adler wrote: >> Author: eadler >> Date: Sat Nov 11 07:21:49 2017 >> New Revision: 325705 >> URL: https://svnweb.freebsd.org/changeset/base/325705 >> >> Log: >> secure: chase removal of pkg_install >> >> Modified: >> head/secure/Makefile >> >> Modified: head/secure/Makefile >> ============================================================================== >> --- head/secure/Makefile Sat Nov 11 07:20:14 2017 (r325704) >> +++ head/secure/Makefile Sat Nov 11 07:21:49 2017 (r325705) >> @@ -11,7 +11,7 @@ SUBDIR.${MK_TESTS}+= tests >> # These are the programs which depend on crypto, but not Kerberos. >> SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ >> bin/ed libexec/telnetd usr.bin/fetch usr.bin/telnet \ >> - usr.sbin/pkg_install usr.sbin/ppp usr.sbin/tcpdump/tcpdump >> + usr.sbin/ppp usr.sbin/tcpdump/tcpdump >> .if ${MK_SENDMAIL} != "no" >> SPROGS+=usr.sbin/sendmail >> .endif >> > > This whole list and target seems outdated. IMHO it should all be removed. Not opposed but given chesterson's fence I wanted to be more minimal right now. Feel free to go further than I did :) -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Sat Nov 11 18:10:10 2017 Return-Path: Delivered-To: svn-src-all@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 76B78E70928; Sat, 11 Nov 2017 18:10:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FE7469067; Sat, 11 Nov 2017 18:10:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABIA9ak038651; Sat, 11 Nov 2017 18:10:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABIA9bC038649; Sat, 11 Nov 2017 18:10:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711111810.vABIA9bC038649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Nov 2017 18:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325722 - in head/sys: compat/linux kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: compat/linux kern X-SVN-Commit-Revision: 325722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 18:10:10 -0000 Author: mjg Date: Sat Nov 11 18:10:09 2017 New Revision: 325722 URL: https://svnweb.freebsd.org/changeset/base/325722 Log: Use pfind_any in linux_rt_sigqueueinfo and kern_sigqueue Modified: head/sys/compat/linux/linux_signal.c head/sys/kern/kern_sig.c Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Sat Nov 11 18:04:39 2017 (r325721) +++ head/sys/compat/linux/linux_signal.c Sat Nov 11 18:10:09 2017 (r325722) @@ -748,8 +748,7 @@ linux_rt_sigqueueinfo(struct thread *td, struct linux_ sig = linux_to_bsd_signal(args->sig); error = ESRCH; - if ((p = pfind(args->pid)) != NULL || - (p = zpfind(args->pid)) != NULL) { + if ((p = pfind_any(args->pid)) != NULL) { error = p_cansignal(td, p, sig); if (error != 0) { PROC_UNLOCK(p); Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sat Nov 11 18:04:39 2017 (r325721) +++ head/sys/kern/kern_sig.c Sat Nov 11 18:10:09 2017 (r325722) @@ -1870,10 +1870,8 @@ kern_sigqueue(struct thread *td, pid_t pid, int signum if (pid <= 0) return (EINVAL); - if ((p = pfind(pid)) == NULL) { - if ((p = zpfind(pid)) == NULL) - return (ESRCH); - } + if ((p = pfind_any(pid)) == NULL) + return (ESRCH); error = p_cansignal(td, p, signum); if (error == 0 && signum != 0) { ksiginfo_init(&ksi); From owner-svn-src-all@freebsd.org Sat Nov 11 19:18:48 2017 Return-Path: Delivered-To: svn-src-all@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 EF59EE71C63; Sat, 11 Nov 2017 19:18:48 +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 BA1DC6B837; Sat, 11 Nov 2017 19:18:48 +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 vABJIlah068675; Sat, 11 Nov 2017 19:18:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABJIlTj068674; Sat, 11 Nov 2017 19:18:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711111918.vABJIlTj068674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 11 Nov 2017 19:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325723 - head/usr.bin/find X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.bin/find X-SVN-Commit-Revision: 325723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 19:18:49 -0000 Author: delphij Date: Sat Nov 11 19:18:47 2017 New Revision: 325723 URL: https://svnweb.freebsd.org/changeset/base/325723 Log: find(1): Don't treat statfs() error as fatal in f_fstype, which can happen when a directory is removed in the middle of find. Instead of a full err(), allow find to continue, plus print a warning with exitstatus set when appropriate. Reported by: 100.chksetuid via gordon Reviewed by: jilles MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D13024 Modified: head/usr.bin/find/function.c Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Sat Nov 11 18:10:09 2017 (r325722) +++ head/usr.bin/find/function.c Sat Nov 11 19:18:47 2017 (r325723) @@ -902,8 +902,13 @@ f_fstype(PLAN *plan, FTSENT *entry) } else p = NULL; - if (statfs(entry->fts_accpath, &sb)) - err(1, "%s", entry->fts_accpath); + if (statfs(entry->fts_accpath, &sb)) { + if (!ignore_readdir_race || errno != ENOENT) { + warn("statfs: %s", entry->fts_accpath); + exitstatus = 1; + } + return 0; + } if (p) { p[0] = save[0]; From owner-svn-src-all@freebsd.org Sat Nov 11 19:21:28 2017 Return-Path: Delivered-To: svn-src-all@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 9969BE71E2C; Sat, 11 Nov 2017 19:21:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08C936BB2A; Sat, 11 Nov 2017 19:21:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vABJLP2t035443; Sat, 11 Nov 2017 11:21:25 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vABJLPtL035442; Sat, 11 Nov 2017 11:21:25 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201711111921.vABJLPtL035442@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r325702 - in head: . share/man/man5 share/man/man7 usr.bin/mail In-Reply-To: <201711110700.vAB70e9P052013@repo.freebsd.org> To: Eitan Adler Date: Sat, 11 Nov 2017 11:21:25 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 19:21:28 -0000 > Author: eadler > Date: Sat Nov 11 07:00:40 2017 > New Revision: 325702 > URL: https://svnweb.freebsd.org/changeset/base/325702 > > Log: > mailaddr(7): wave goodbye > > The information here is somewhere between ancient to obsolete. 20% of the information here is somewhat obsolete, 80% of it is valid, can you please tell me what part of the following main body of the page are either ancient or obsolete: Begin man page sectoin DESCRIPTION Mail addresses are based on the Internet protocol listed at the end of this manual page. These addresses are in the general format user@domain where a domain is a hierarchical dot separated list of subdomains. For example, a valid address is: eric@CS.Berkeley.EDU Unlike some other forms of addressing, domains do not imply any routing. Thus, although this address is specified as an Internet address, it might travel by an alternate route if that were more convenient or efficient. For example, at Berkeley, the associated message would probably go directly to CS over the Ethernet rather than going via the Berkeley Internet gateway. Abbreviation. Under certain circumstances it may not be necessary to type the entire domain name. In general, anything following the first dot may be omitted if it is the same as the domain from which you are sending the message. For example, a user on ``calder.berkeley.edu'' could send to ``eric@CS'' without adding the ``berkeley.edu'' since it is the same on both sending and receiving hosts. End man page secton. > It refers to a time in the internet's history when manual routing > was still useful, talks about UUCP as if its modern, and refers > to documents which I had trouble tracking down. A TINY part of it refered to UUCP and berknet, so rather than simply correct the 20% of the one file you removed the 80% valid information and touched 5 other files. Thus, imho, does not move the state of FreeBSD forward. > > It seems unlikely that a manual page in this form would be useful, so > just remove it. I think the information that was correct would be usefull to a new person to internet mail address formats. I think even bdrewey commented in the Differential that he learned a lot from reading this man page. > > Reviewed By: imp, tsoome, bdrewery(?) > Differential Revision: https://reviews.freebsd.org/D12924 You might of wanted to get a docs/manpage reviewer before commit. > > Deleted: > head/share/man/man7/mailaddr.7 > Modified: > head/ObsoleteFiles.inc > head/share/man/man5/forward.5 > head/share/man/man7/Makefile > head/share/man/man7/hostname.7 > head/usr.bin/mail/mail.1 > > Modified: head/ObsoleteFiles.inc -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Nov 11 20:12:50 2017 Return-Path: Delivered-To: svn-src-all@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 44CE2E72CD3; Sat, 11 Nov 2017 20:12:50 +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 0F2666D3EE; Sat, 11 Nov 2017 20:12:49 +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 vABKCnNt093985; Sat, 11 Nov 2017 20:12:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABKCn4d093984; Sat, 11 Nov 2017 20:12:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711112012.vABKCn4d093984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 11 Nov 2017 20:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325724 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 325724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 20:12:50 -0000 Author: hselasky Date: Sat Nov 11 20:12:48 2017 New Revision: 325724 URL: https://svnweb.freebsd.org/changeset/base/325724 Log: Implement missing KDGETMODE IOCTL in VT. Obtained from: Johannes Lundberg Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sat Nov 11 19:18:47 2017 (r325723) +++ head/sys/dev/vt/vt_core.c Sat Nov 11 20:12:48 2017 (r325724) @@ -2161,6 +2161,10 @@ skip_thunk: return (error); } + case KDGETMODE: + *(int *)data = (vw->vw_flags & VWF_GRAPHICS) ? + KD_GRAPHICS : KD_TEXT; + return (0); case KDGKBMODE: { error = 0; From owner-svn-src-all@freebsd.org Sat Nov 11 21:50:37 2017 Return-Path: Delivered-To: svn-src-all@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 61958E4D522; Sat, 11 Nov 2017 21:50:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EB8C6FDDB; Sat, 11 Nov 2017 21:50:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABLoaNX033504; Sat, 11 Nov 2017 21:50:36 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABLoaOl033503; Sat, 11 Nov 2017 21:50:36 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711112150.vABLoaOl033503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Nov 2017 21:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325725 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 21:50:37 -0000 Author: mjg Date: Sat Nov 11 21:50:36 2017 New Revision: 325725 URL: https://svnweb.freebsd.org/changeset/base/325725 Log: sysctl: try to avoid malloc in name2oid name2oid is called all the time and passed names are almost always very short (< 16 characters). Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sat Nov 11 20:12:48 2017 (r325724) +++ head/sys/kern/kern_sysctl.c Sat Nov 11 21:50:36 2017 (r325725) @@ -1209,17 +1209,21 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS) int error, oid[CTL_MAXNAME], len = 0; struct sysctl_oid *op = NULL; struct rm_priotracker tracker; + char buf[32]; if (!req->newlen) return (ENOENT); if (req->newlen >= MAXPATHLEN) /* XXX arbitrary, undocumented */ return (ENAMETOOLONG); - p = malloc(req->newlen+1, M_SYSCTL, M_WAITOK); + p = buf; + if (req->newlen >= sizeof(buf)) + p = malloc(req->newlen+1, M_SYSCTL, M_WAITOK); error = SYSCTL_IN(req, p, req->newlen); if (error) { - free(p, M_SYSCTL); + if (p != buf) + free(p, M_SYSCTL); return (error); } @@ -1229,7 +1233,8 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS) error = name2oid(p, oid, &len, &op); SYSCTL_RUNLOCK(&tracker); - free(p, M_SYSCTL); + if (p != buf) + free(p, M_SYSCTL); if (error) return (error); From owner-svn-src-all@freebsd.org Sat Nov 11 21:58:02 2017 Return-Path: Delivered-To: svn-src-all@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 D9F3CE4D841; Sat, 11 Nov 2017 21:58:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 A62667036A; Sat, 11 Nov 2017 21:58:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8395E2603B1; Sat, 11 Nov 2017 22:58:00 +0100 (CET) Subject: Re: svn commit: r325725 - head/sys/kern To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711112150.vABLoaOl033503@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Sat, 11 Nov 2017 22:55:19 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201711112150.vABLoaOl033503@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 21:58:03 -0000 On 11/11/17 22:50, Mateusz Guzik wrote: > Author: mjg > Date: Sat Nov 11 21:50:36 2017 > New Revision: 325725 > URL: https://svnweb.freebsd.org/changeset/base/325725 > > Log: > sysctl: try to avoid malloc in name2oid > > name2oid is called all the time and passed names are almost always very short > (< 16 characters). > Might be good to MFC. --HPS From owner-svn-src-all@freebsd.org Sat Nov 11 22:39:35 2017 Return-Path: Delivered-To: svn-src-all@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 28802E4E466; Sat, 11 Nov 2017 22:39:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9B537137D; Sat, 11 Nov 2017 22:39:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABMdXlu053881; Sat, 11 Nov 2017 22:39:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABMdXS2053880; Sat, 11 Nov 2017 22:39:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711112239.vABMdXS2053880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 11 Nov 2017 22:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325726 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 325726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 22:39:35 -0000 Author: mjg Date: Sat Nov 11 22:39:33 2017 New Revision: 325726 URL: https://svnweb.freebsd.org/changeset/base/325726 Log: Avoid locking and refing in sysctl_kern_proc_args if possible. Turns out the sysctl is called a lot e.g. by pkg-static. Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sat Nov 11 21:50:36 2017 (r325725) +++ head/sys/kern/kern_proc.c Sat Nov 11 22:39:33 2017 (r325726) @@ -1909,14 +1909,27 @@ sysctl_kern_proc_args(SYSCTL_HANDLER_ARGS) struct proc *p; struct sbuf sb; int flags, error = 0, error2; + pid_t pid; if (namelen != 1) return (EINVAL); + pid = (pid_t)name[0]; + /* + * If the query is for this process and it is single-threaded, there + * is nobody to modify pargs, thus we can just read. + */ + p = curproc; + if (pid == p->p_pid && p->p_numthreads == 1 && req->newptr == NULL) { + if ((pa = p->p_args) != NULL) + error = SYSCTL_OUT(req, pa->ar_args, pa->ar_length); + return (error); + } + flags = PGET_CANSEE; if (req->newptr != NULL) flags |= PGET_ISCURRENT; - error = pget((pid_t)name[0], flags, &p); + error = pget(pid, flags, &p); if (error) return (error); From owner-svn-src-all@freebsd.org Sat Nov 11 22:50:15 2017 Return-Path: Delivered-To: svn-src-all@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 89CE7E4E6B3; Sat, 11 Nov 2017 22:50:15 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 56AEA717CA; Sat, 11 Nov 2017 22:50:15 +0000 (UTC) (envelope-from robak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABMoEJx058041; Sat, 11 Nov 2017 22:50:14 GMT (envelope-from robak@FreeBSD.org) Received: (from robak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABMoEOo058040; Sat, 11 Nov 2017 22:50:14 GMT (envelope-from robak@FreeBSD.org) Message-Id: <201711112250.vABMoEOo058040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: robak set sender to robak@FreeBSD.org using -f From: Bartek Rutkowski Date: Sat, 11 Nov 2017 22:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325727 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: robak X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 325727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 22:50:15 -0000 Author: robak (ports committer) Date: Sat Nov 11 22:50:14 2017 New Revision: 325727 URL: https://svnweb.freebsd.org/changeset/base/325727 Log: bhyve: avoid applying capsicum capabilities to file that was not opened When using -l option targeting file that can't be opened (ie. nmdm module is not loaded and /dev/nmdm* is specified) bhyve tries to apply capsicum capabilities to a file that was not opened. Enclose that code in an if statement and only run it on correctly opened descriptor also providing meaningful message in case of an error. Submitted by: Pawel Biernacki Reviewed by: grehan, emaste Sponsoied by: Mysterious Code Ltd. Differential Revision: D12985 Modified: head/usr.sbin/bhyve/uart_emul.c Modified: head/usr.sbin/bhyve/uart_emul.c ============================================================================== --- head/usr.sbin/bhyve/uart_emul.c Sat Nov 11 22:39:33 2017 (r325726) +++ head/usr.sbin/bhyve/uart_emul.c Sat Nov 11 22:50:14 2017 (r325727) @@ -678,20 +678,24 @@ uart_set_backend(struct uart_softc *sc, const char *op if (retval == 0) retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); + if (retval == 0) { #ifndef WITHOUT_CAPSICUM - cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, CAP_WRITE); - if (cap_rights_limit(sc->tty.fd, &rights) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && errno != ENOSYS) - errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (!uart_stdio) { - if (caph_limit_stdin() == -1 && errno != ENOSYS) + cap_rights_init(&rights, CAP_EVENT, CAP_IOCTL, CAP_READ, + CAP_WRITE); + if (cap_rights_limit(sc->tty.fd, &rights) == -1 && + errno != ENOSYS) errx(EX_OSERR, "Unable to apply rights for sandbox"); - } + if (cap_ioctls_limit(sc->tty.fd, cmds, nitems(cmds)) == -1 && + errno != ENOSYS) + errx(EX_OSERR, "Unable to apply rights for sandbox"); + if (!uart_stdio) { + if (caph_limit_stdin() == -1 && errno != ENOSYS) + errx(EX_OSERR, + "Unable to apply rights for sandbox"); + } #endif - - if (retval == 0) uart_opentty(sc); + } return (retval); } From owner-svn-src-all@freebsd.org Sat Nov 11 23:31:00 2017 Return-Path: Delivered-To: svn-src-all@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 DEB82E4F559; Sat, 11 Nov 2017 23:31:00 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7CB4272A9A; Sat, 11 Nov 2017 23:31:00 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vABNUxjd077407; Sat, 11 Nov 2017 23:30:59 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vABNUwXC077395; Sat, 11 Nov 2017 23:30:58 GMT (envelope-from will@FreeBSD.org) Message-Id: <201711112330.vABNUwXC077395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Sat, 11 Nov 2017 23:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325728 - head/lib/libkvm X-SVN-Group: head X-SVN-Commit-Author: will X-SVN-Commit-Paths: head/lib/libkvm X-SVN-Commit-Revision: 325728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Nov 2017 23:31:01 -0000 Author: will Date: Sat Nov 11 23:30:58 2017 New Revision: 325728 URL: https://svnweb.freebsd.org/changeset/base/325728 Log: libkvm: add kvm_walk_pages API. This API allows callers to enumerate all known pages, including any direct map & kernel map virtual addresses, physical addresses, size, offset into the core, & protection configured. For architectures that support direct map addresses, also generate pages for any direct map only addresses that are not associated with kernel map addresses. Fix page size portability issue left behind from previous kvm page table lookup interface. Reviewed by: jhb Sponsored by: Backtrace I/O Differential Revision: https://reviews.freebsd.org/D12279 Modified: head/lib/libkvm/kvm.c head/lib/libkvm/kvm.h head/lib/libkvm/kvm_aarch64.h head/lib/libkvm/kvm_arm.h head/lib/libkvm/kvm_i386.h head/lib/libkvm/kvm_minidump_aarch64.c head/lib/libkvm/kvm_minidump_amd64.c head/lib/libkvm/kvm_minidump_arm.c head/lib/libkvm/kvm_minidump_i386.c head/lib/libkvm/kvm_minidump_mips.c head/lib/libkvm/kvm_mips.h head/lib/libkvm/kvm_private.c head/lib/libkvm/kvm_private.h Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm.c Sat Nov 11 23:30:58 2017 (r325728) @@ -49,6 +49,7 @@ static char sccsid[] = "@(#)kvm.c 8.2 (Berkeley) 2/13/ #include #include #include +#include #include @@ -299,6 +300,10 @@ kvm_close(kvm_t *kd) free((void *)kd->argv); if (kd->pt_map != NULL) free(kd->pt_map); + if (kd->page_map != NULL) + free(kd->page_map); + if (kd->sparse_map != MAP_FAILED) + munmap(kd->sparse_map, kd->pt_sparse_size); free((void *)kd); return (error); @@ -486,4 +491,14 @@ kvm_native(kvm_t *kd) if (ISALIVE(kd)) return (1); return (kd->arch->ka_native(kd)); +} + +int +kvm_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *closure) +{ + + if (kd->arch->ka_walk_pages == NULL) + return (0); + + return (kd->arch->ka_walk_pages(kd, cb, closure)); } Modified: head/lib/libkvm/kvm.h ============================================================================== --- head/lib/libkvm/kvm.h Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm.h Sat Nov 11 23:30:58 2017 (r325728) @@ -36,6 +36,7 @@ #include #include #include +#include /* Default version symbol. */ #define VRS_SYM "_version" @@ -73,7 +74,19 @@ struct kvm_swap { u_int ksw_reserved2; }; +struct kvm_page { + unsigned int version; + u_long paddr; + u_long kmap_vaddr; + u_long dmap_vaddr; + vm_prot_t prot; + u_long offset; + size_t len; + /* end of version 1 */ +}; + #define SWIF_DEV_PREFIX 0x0002 +#define LIBKVM_WALK_PAGES_VERSION 1 __BEGIN_DECLS int kvm_close(kvm_t *); @@ -104,6 +117,9 @@ ssize_t kvm_read(kvm_t *, unsigned long, void *, siz ssize_t kvm_read_zpcpu(kvm_t *, unsigned long, void *, size_t, int); ssize_t kvm_read2(kvm_t *, kvaddr_t, void *, size_t); ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t); + +typedef int kvm_walk_pages_cb_t(struct kvm_page *, void *); +int kvm_walk_pages(kvm_t *, kvm_walk_pages_cb_t *, void *); __END_DECLS #endif /* !_KVM_H_ */ Modified: head/lib/libkvm/kvm_aarch64.h ============================================================================== --- head/lib/libkvm/kvm_aarch64.h Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm_aarch64.h Sat Nov 11 23:30:58 2017 (r325728) @@ -40,7 +40,13 @@ typedef uint64_t aarch64_pte_t; #define AARCH64_PAGE_SIZE (1 << AARCH64_PAGE_SHIFT) #define AARCH64_PAGE_MASK (AARCH64_PAGE_SIZE - 1) +/* Source: arm64/include/pte.h */ #define AARCH64_ATTR_MASK 0xfff0000000000fff +#define AARCH64_ATTR_UXN (1UL << 54) +#define AARCH64_ATTR_PXN (1UL << 53) +#define AARCH64_ATTR_XN (AARCH64_ATTR_PXN | AARCH64_ATTR_UXN) +#define AARCH64_ATTR_AP(x) ((x) << 6) +#define AARCH64_ATTR_AP_RO (1 << 1) #define AARCH64_ATTR_DESCR_MASK 3 Modified: head/lib/libkvm/kvm_arm.h ============================================================================== --- head/lib/libkvm/kvm_arm.h Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm_arm.h Sat Nov 11 23:30:58 2017 (r325728) @@ -53,6 +53,19 @@ typedef uint32_t arm_pt_entry_t; #define ARM_L2_S_OFFSET (ARM_L2_S_SIZE - 1) #define ARM_L2_S_FRAME (~ARM_L2_S_OFFSET) #define ARM_L2_S_SHIFT 12 +#define ARM_L2_TEX1 0x00000080 +#define ARM_PTE2_RO ARM_L2_TEX1 +#define ARM_L2_NX 0x00000001 +#define ARM_PTE2_NX ARM_L2_NX + +/* + * Note: L2_S_PROT_W differs depending on whether the system is generic or + * xscale. This isn't easily accessible in this context, so use an + * approximation of 'xscale' which is a subset of 'generic'. + */ +#define ARM_L2_AP0(x) ((x) << 4) +#define ARM_AP_W 0x01 +#define ARM_L2_S_PROT_W (ARM_L2_AP0(ARM_AP_W)) #define ARM_L1_TYPE_INV 0x00 /* Invalid (fault) */ #define ARM_L1_TYPE_C 0x01 /* Coarse L2 */ Modified: head/lib/libkvm/kvm_i386.h ============================================================================== --- head/lib/libkvm/kvm_i386.h Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm_i386.h Sat Nov 11 23:30:58 2017 (r325728) @@ -53,8 +53,11 @@ typedef uint64_t i386_pde_pae_t; #define I386_NBPDR_PAE (1 << I386_PDRSHIFT_PAE) #define I386_PAGE_PS_MASK_PAE (I386_NBPDR_PAE - 1) +/* Source: i386/include/pmap.h */ #define I386_PG_V 0x001 +#define I386_PG_RW 0x002 #define I386_PG_PS 0x080 +#define I386_PG_NX (1ULL << 63) #define I386_PG_FRAME_PAE (0x000ffffffffff000ull) #define I386_PG_PS_FRAME_PAE (0x000fffffffe00000ull) #define I386_PG_FRAME (0xfffff000) Modified: head/lib/libkvm/kvm_minidump_aarch64.c ============================================================================== --- head/lib/libkvm/kvm_minidump_aarch64.c Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm_minidump_aarch64.c Sat Nov 11 23:30:58 2017 (r325728) @@ -50,9 +50,16 @@ __FBSDID("$FreeBSD$"); struct vmstate { struct minidumphdr hdr; - uint64_t *page_map; }; +static aarch64_pte_t +_aarch64_pte_get(kvm_t *kd, u_long pteindex) +{ + aarch64_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return le64toh(*pte); +} + static int _aarch64_minidump_probe(kvm_t *kd) { @@ -66,7 +73,6 @@ _aarch64_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->page_map); free(vm); kd->vmst = NULL; } @@ -116,30 +122,13 @@ _aarch64_minidump_initvtop(kvm_t *kd) aarch64_round_page(vmst->hdr.pmapsize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, AARCH64_PAGE_SIZE, sizeof(uint64_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += aarch64_round_page(vmst->hdr.bitmapsize); - vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize); - if (vmst->page_map == NULL) { - _kvm_err(kd, kd->program, - "cannot allocate %d bytes for page_map", - vmst->hdr.pmapsize); + if (_kvm_pmap_init(kd, vmst->hdr.pmapsize, off) == -1) { return (-1); } - /* This is the end of the dump, savecore may have truncated it. */ - /* - * XXX: This doesn't make sense. The pmap is not at the end, - * and if it is truncated we don't have any actual data (it's - * all stored after the bitmap and pmap. -- jhb - */ - if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) < - AARCH64_PAGE_SIZE) { - _kvm_err(kd, kd->program, "cannot read %d bytes for page_map", - vmst->hdr.pmapsize); - return (-1); - } off += aarch64_round_page(vmst->hdr.pmapsize); return (0); @@ -161,7 +150,7 @@ _aarch64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { a = (va - vm->hdr.dmapbase + vm->hdr.dmapphys) & ~AARCH64_PAGE_MASK; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AARCH64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_aarch64_minidump_vatop: " "direct map address 0x%jx not in minidump", @@ -172,16 +161,16 @@ _aarch64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t return (AARCH64_PAGE_SIZE - offset); } else if (va >= vm->hdr.kernbase) { l3_index = (va - vm->hdr.kernbase) >> AARCH64_L3_SHIFT; - if (l3_index >= vm->hdr.pmapsize / sizeof(*vm->page_map)) + if (l3_index >= vm->hdr.pmapsize / sizeof(l3)) goto invalid; - l3 = le64toh(vm->page_map[l3_index]); + l3 = _aarch64_pte_get(kd, l3_index); if ((l3 & AARCH64_ATTR_DESCR_MASK) != AARCH64_L3_PAGE) { _kvm_err(kd, kd->program, "_aarch64_minidump_vatop: pde not valid"); goto invalid; } a = l3 & ~AARCH64_ATTR_MASK; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AARCH64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_aarch64_minidump_vatop: " "physical address 0x%jx not in minidump", @@ -225,12 +214,73 @@ _aarch64_native(kvm_t *kd __unused) #endif } +static vm_prot_t +_aarch64_entry_to_prot(aarch64_pte_t pte) +{ + vm_prot_t prot = VM_PROT_READ; + + /* Source: arm64/arm64/pmap.c:pmap_protect() */ + if ((pte & AARCH64_ATTR_AP(AARCH64_ATTR_AP_RO)) == 0) + prot |= VM_PROT_WRITE; + if ((pte & AARCH64_ATTR_XN) == 0) + prot |= VM_PROT_EXECUTE; + return prot; +} + +static int +_aarch64_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct vmstate *vm = kd->vmst; + u_long nptes = vm->hdr.pmapsize / sizeof(aarch64_pte_t); + u_long bmindex, dva, pa, pteindex, va; + struct kvm_bitmap bm; + vm_prot_t prot; + int ret = 0; + + if (!_kvm_bitmap_init(&bm, vm->hdr.bitmapsize, &bmindex)) + return (0); + + for (pteindex = 0; pteindex < nptes; pteindex++) { + aarch64_pte_t pte = _aarch64_pte_get(kd, pteindex); + + if ((pte & AARCH64_ATTR_DESCR_MASK) != AARCH64_L3_PAGE) + continue; + + va = vm->hdr.kernbase + (pteindex << AARCH64_L3_SHIFT); + pa = pte & ~AARCH64_ATTR_MASK; + dva = vm->hdr.dmapbase + pa; + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + _aarch64_entry_to_prot(pte), AARCH64_PAGE_SIZE, 0)) { + goto out; + } + } + + while (_kvm_bitmap_next(&bm, &bmindex)) { + pa = bmindex * AARCH64_PAGE_SIZE; + dva = vm->hdr.dmapbase + pa; + if (vm->hdr.dmapend < (dva + AARCH64_PAGE_SIZE)) + break; + va = 0; + prot = VM_PROT_READ | VM_PROT_WRITE; + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + prot, AARCH64_PAGE_SIZE, 0)) { + goto out; + } + } + ret = 1; + +out: + _kvm_bitmap_deinit(&bm); + return (ret); +} + static struct kvm_arch kvm_aarch64_minidump = { .ka_probe = _aarch64_minidump_probe, .ka_initvtop = _aarch64_minidump_initvtop, .ka_freevtop = _aarch64_minidump_freevtop, .ka_kvatop = _aarch64_minidump_kvatop, .ka_native = _aarch64_native, + .ka_walk_pages = _aarch64_minidump_walk_pages, }; KVM_ARCH(kvm_aarch64_minidump); Modified: head/lib/libkvm/kvm_minidump_amd64.c ============================================================================== --- head/lib/libkvm/kvm_minidump_amd64.c Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm_minidump_amd64.c Sat Nov 11 23:30:58 2017 (r325728) @@ -46,12 +46,59 @@ __FBSDID("$FreeBSD$"); #include "kvm_amd64.h" #define amd64_round_page(x) roundup2((kvaddr_t)(x), AMD64_PAGE_SIZE) +#define VM_IS_V1(vm) (vm->hdr.version == 1) +#define VA_OFF(vm, va) \ + (VM_IS_V1(vm) ? ((va) & (AMD64_PAGE_SIZE - 1)) : ((va) & AMD64_PAGE_MASK)) struct vmstate { struct minidumphdr hdr; - amd64_pte_t *page_map; }; +static vm_prot_t +_amd64_entry_to_prot(uint64_t entry) +{ + vm_prot_t prot = VM_PROT_READ; + + if ((entry & PG_RW) != 0) + prot |= VM_PROT_WRITE; + if ((entry & PG_NX) == 0) + prot |= VM_PROT_EXECUTE; + return prot; +} + +/* + * Version 2 minidumps use page directory entries, while version 1 use page + * table entries. + */ + +static amd64_pde_t +_amd64_pde_get(kvm_t *kd, u_long pdeindex) +{ + amd64_pde_t *pde = _kvm_pmap_get(kd, pdeindex, sizeof(*pde)); + + return le64toh(*pde); +} + +static amd64_pte_t +_amd64_pte_get(kvm_t *kd, u_long pteindex) +{ + amd64_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return le64toh(*pte); +} + +/* Get the first page table entry for a given page directory index. */ +static amd64_pte_t * +_amd64_pde_first_pte(kvm_t *kd, u_long pdeindex) +{ + u_long *pa; + + pa = _kvm_pmap_get(kd, pdeindex, sizeof(amd64_pde_t)); + if (pa == NULL) + return NULL; + return _kvm_map_get(kd, *pa & AMD64_PG_FRAME, AMD64_PAGE_SIZE); +} + static int _amd64_minidump_probe(kvm_t *kd) { @@ -65,7 +112,6 @@ _amd64_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->page_map); free(vm); kd->vmst = NULL; } @@ -116,23 +162,13 @@ _amd64_minidump_initvtop(kvm_t *kd) amd64_round_page(vmst->hdr.pmapsize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, AMD64_PAGE_SIZE, sizeof(uint64_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += amd64_round_page(vmst->hdr.bitmapsize); - vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize); - if (vmst->page_map == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for page_map", - vmst->hdr.pmapsize); + if (_kvm_pmap_init(kd, vmst->hdr.pmapsize, off) == -1) { return (-1); } - if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) != - (ssize_t)vmst->hdr.pmapsize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for page_map", - vmst->hdr.pmapsize); - return (-1); - } off += amd64_round_page(vmst->hdr.pmapsize); return (0); @@ -153,16 +189,16 @@ _amd64_minidump_vatop_v1(kvm_t *kd, kvaddr_t va, off_t if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> AMD64_PAGE_SHIFT; - if (pteindex >= vm->hdr.pmapsize / sizeof(*vm->page_map)) + if (pteindex >= vm->hdr.pmapsize / sizeof(pte)) goto invalid; - pte = le64toh(vm->page_map[pteindex]); + pte = _amd64_pte_get(kd, pteindex); if ((pte & AMD64_PG_V) == 0) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop_v1: pte not valid"); goto invalid; } a = pte & AMD64_PG_FRAME; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop_v1: physical address 0x%jx not in minidump", @@ -173,7 +209,7 @@ _amd64_minidump_vatop_v1(kvm_t *kd, kvaddr_t va, off_t return (AMD64_PAGE_SIZE - offset); } else if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { a = (va - vm->hdr.dmapbase) & ~AMD64_PAGE_MASK; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop_v1: direct map address 0x%jx not in minidump", @@ -212,9 +248,9 @@ _amd64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *p if (va >= vm->hdr.kernbase) { pdeindex = (va - vm->hdr.kernbase) >> AMD64_PDRSHIFT; - if (pdeindex >= vm->hdr.pmapsize / sizeof(*vm->page_map)) + if (pdeindex >= vm->hdr.pmapsize / sizeof(pde)) goto invalid; - pde = le64toh(vm->page_map[pdeindex]); + pde = _amd64_pde_get(kd, pdeindex); if ((pde & AMD64_PG_V) == 0) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop: pde not valid"); @@ -223,7 +259,7 @@ _amd64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *p if ((pde & AMD64_PG_PS) == 0) { a = pde & AMD64_PG_FRAME; /* TODO: Just read the single PTE */ - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "cannot find page table entry for %ju", @@ -250,7 +286,7 @@ _amd64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *p a = pde & AMD64_PG_PS_FRAME; a += (va & AMD64_PDRMASK) ^ offset; } - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop: physical address 0x%jx not in minidump", @@ -261,7 +297,7 @@ _amd64_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *p return (AMD64_PAGE_SIZE - offset); } else if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { a = (va - vm->hdr.dmapbase) & ~AMD64_PAGE_MASK; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, AMD64_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_amd64_minidump_vatop: direct map address 0x%jx not in minidump", @@ -297,12 +333,99 @@ _amd64_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t * return (_amd64_minidump_vatop(kd, va, pa)); } +static int +_amd64_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct vmstate *vm = kd->vmst; + u_long npdes = vm->hdr.pmapsize / sizeof(amd64_pde_t); + u_long bmindex, dva, pa, pdeindex, va; + struct kvm_bitmap bm; + int ret = 0; + vm_prot_t prot; + unsigned int pgsz = AMD64_PAGE_SIZE; + + if (vm->hdr.version < 2) + return (0); + + if (!_kvm_bitmap_init(&bm, vm->hdr.bitmapsize, &bmindex)) + return (0); + + for (pdeindex = 0; pdeindex < npdes; pdeindex++) { + pd_entry_t pde = _amd64_pde_get(kd, pdeindex); + pt_entry_t *ptes; + u_long i; + + va = vm->hdr.kernbase + (pdeindex << AMD64_PDRSHIFT); + if ((pde & PG_V) == 0) + continue; + + if ((pde & AMD64_PG_PS) != 0) { + /* + * Large page. Iterate on each 4K page section + * within this page. This differs from 4K pages in + * that every page here uses the same PDE to + * generate permissions. + */ + pa = pde & AMD64_PG_PS_FRAME + + ((va & AMD64_PDRMASK) ^ VA_OFF(vm, va)); + dva = vm->hdr.dmapbase + pa; + _kvm_bitmap_set(&bm, pa, AMD64_PAGE_SIZE); + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + _amd64_entry_to_prot(pde), AMD64_NBPDR, pgsz)) { + goto out; + } + continue; + } + + /* 4K pages: pde references another page of entries. */ + ptes = _amd64_pde_first_pte(kd, pdeindex); + /* Ignore page directory pages that were not dumped. */ + if (ptes == NULL) + continue; + + for (i = 0; i < NPTEPG; i++) { + pt_entry_t pte = (u_long)ptes[i]; + + pa = pte & AMD64_PG_FRAME; + dva = vm->hdr.dmapbase + pa; + if ((pte & PG_V) != 0) { + _kvm_bitmap_set(&bm, pa, AMD64_PAGE_SIZE); + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + _amd64_entry_to_prot(pte), pgsz, 0)) { + goto out; + } + } + va += AMD64_PAGE_SIZE; + } + } + + while (_kvm_bitmap_next(&bm, &bmindex)) { + pa = bmindex * AMD64_PAGE_SIZE; + dva = vm->hdr.dmapbase + pa; + if (vm->hdr.dmapend < (dva + pgsz)) + break; + va = 0; + /* amd64/pmap.c: create_pagetables(): dmap always R|W. */ + prot = VM_PROT_READ | VM_PROT_WRITE; + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, prot, pgsz, 0)) { + goto out; + } + } + + ret = 1; + +out: + _kvm_bitmap_deinit(&bm); + return (ret); +} + static struct kvm_arch kvm_amd64_minidump = { .ka_probe = _amd64_minidump_probe, .ka_initvtop = _amd64_minidump_initvtop, .ka_freevtop = _amd64_minidump_freevtop, .ka_kvatop = _amd64_minidump_kvatop, .ka_native = _amd64_native, + .ka_walk_pages = _amd64_minidump_walk_pages, }; KVM_ARCH(kvm_amd64_minidump); Modified: head/lib/libkvm/kvm_minidump_arm.c ============================================================================== --- head/lib/libkvm/kvm_minidump_arm.c Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm_minidump_arm.c Sat Nov 11 23:30:58 2017 (r325728) @@ -51,10 +51,17 @@ __FBSDID("$FreeBSD$"); struct vmstate { struct minidumphdr hdr; - void *ptemap; unsigned char ei_data; }; +static arm_pt_entry_t +_arm_pte_get(kvm_t *kd, u_long pteindex) +{ + arm_pt_entry_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return _kvm32toh(kd, *pte); +} + static int _arm_minidump_probe(kvm_t *kd) { @@ -68,7 +75,6 @@ _arm_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->ptemap); free(vm); kd->vmst = NULL; } @@ -122,24 +128,13 @@ _arm_minidump_initvtop(kvm_t *kd) arm_round_page(vmst->hdr.ptesize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, ARM_PAGE_SIZE, sizeof(uint32_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += arm_round_page(vmst->hdr.bitmapsize); - vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); - if (vmst->ptemap == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for " - "ptemap", vmst->hdr.ptesize); + if (_kvm_pmap_init(kd, vmst->hdr.ptesize, off) == -1) { return (-1); } - - if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - (ssize_t)vmst->hdr.ptesize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", - vmst->hdr.ptesize); - return (-1); - } off += arm_round_page(vmst->hdr.ptesize); return (0); @@ -153,7 +148,6 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa arm_physaddr_t offset, a; kvaddr_t pteindex; off_t ofs; - arm_pt_entry_t *ptemap; if (ISALIVE(kd)) { _kvm_err(kd, 0, "_arm_minidump_kvatop called in live kernel!"); @@ -161,13 +155,12 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa } vm = kd->vmst; - ptemap = vm->ptemap; if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> ARM_PAGE_SHIFT; - if (pteindex >= vm->hdr.ptesize / sizeof(*ptemap)) + if (pteindex >= vm->hdr.ptesize / sizeof(pte)) goto invalid; - pte = _kvm32toh(kd, ptemap[pteindex]); + pte = _arm_pte_get(kd, pteindex); if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_INV) { _kvm_err(kd, kd->program, "_arm_minidump_kvatop: pte not valid"); @@ -190,7 +183,7 @@ _arm_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa a = pte & ARM_L2_S_FRAME; } - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, ARM_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_arm_minidump_kvatop: " "physical address 0x%jx not in minidump", @@ -209,12 +202,69 @@ invalid: return (0); } +static vm_prot_t +_arm_entry_to_prot(kvm_t *kd, arm_pt_entry_t pte) +{ + struct vmstate *vm = kd->vmst; + vm_prot_t prot = VM_PROT_READ; + + /* Source: arm/arm/pmap-v4.c:pmap_fault_fixup() */ + if (vm->hdr.mmuformat == MINIDUMP_MMU_FORMAT_V4) { + if (pte & ARM_L2_S_PROT_W) + prot |= VM_PROT_WRITE; + return prot; + } + + /* Source: arm/arm/pmap-v6.c:pmap_protect() */ + if ((pte & ARM_PTE2_RO) == 0) + prot |= VM_PROT_WRITE; + if ((pte & ARM_PTE2_NX) == 0) + prot |= VM_PROT_EXECUTE; + return prot; +} + +static int +_arm_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct vmstate *vm = kd->vmst; + u_long nptes = vm->hdr.ptesize / sizeof(arm_pt_entry_t); + u_long dva, pa, pteindex, va; + + for (pteindex = 0; pteindex < nptes; pteindex++) { + arm_pt_entry_t pte = _arm_pte_get(kd, pteindex); + + if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_INV) + continue; + + va = vm->hdr.kernbase + (pteindex << ARM_PAGE_SHIFT); + if ((pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_L) { + /* 64K page */ + pa = (pte & ARM_L2_L_FRAME) + + (va & ARM_L2_L_OFFSET & ARM_L2_S_FRAME); + } else { + if (vm->hdr.mmuformat == MINIDUMP_MMU_FORMAT_V4 && + (pte & ARM_L2_TYPE_MASK) == ARM_L2_TYPE_T) { + continue; + } + /* 4K page */ + pa = pte & ARM_L2_S_FRAME; + } + + dva = 0; /* no direct map on this platform */ + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + _arm_entry_to_prot(kd, pte), ARM_PAGE_SIZE, 0)) + return (0); + } + return (1); +} + static struct kvm_arch kvm_arm_minidump = { .ka_probe = _arm_minidump_probe, .ka_initvtop = _arm_minidump_initvtop, .ka_freevtop = _arm_minidump_freevtop, .ka_kvatop = _arm_minidump_kvatop, .ka_native = _arm_native, + .ka_walk_pages = _arm_minidump_walk_pages, }; KVM_ARCH(kvm_arm_minidump); Modified: head/lib/libkvm/kvm_minidump_i386.c ============================================================================== --- head/lib/libkvm/kvm_minidump_i386.c Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm_minidump_i386.c Sat Nov 11 23:30:58 2017 (r325728) @@ -49,9 +49,24 @@ __FBSDID("$FreeBSD$"); struct vmstate { struct minidumphdr hdr; - void *ptemap; }; +static i386_pte_pae_t +_i386_pte_pae_get(kvm_t *kd, u_long pteindex) +{ + i386_pte_pae_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return le64toh(*pte); +} + +static i386_pte_t +_i386_pte_get(kvm_t *kd, u_long pteindex) +{ + i386_pte_t *pte = _kvm_pmap_get(kd, pteindex, sizeof(*pte)); + + return le32toh(*pte); +} + static int _i386_minidump_probe(kvm_t *kd) { @@ -65,7 +80,6 @@ _i386_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->ptemap); free(vm); kd->vmst = NULL; } @@ -110,21 +124,13 @@ _i386_minidump_initvtop(kvm_t *kd) i386_round_page(vmst->hdr.ptesize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, I386_PAGE_SIZE, sizeof(uint32_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += i386_round_page(vmst->hdr.bitmapsize); - vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); - if (vmst->ptemap == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for ptemap", vmst->hdr.ptesize); + if (_kvm_pmap_init(kd, vmst->hdr.ptesize, off) == -1) { return (-1); } - if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - (ssize_t)vmst->hdr.ptesize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize); - return (-1); - } off += i386_round_page(vmst->hdr.ptesize); return (0); @@ -139,24 +145,22 @@ _i386_minidump_vatop_pae(kvm_t *kd, kvaddr_t va, off_t kvaddr_t pteindex; i386_physaddr_pae_t a; off_t ofs; - i386_pte_pae_t *ptemap; vm = kd->vmst; - ptemap = vm->ptemap; offset = va & I386_PAGE_MASK; if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> I386_PAGE_SHIFT; - if (pteindex >= vm->hdr.ptesize / sizeof(*ptemap)) + if (pteindex >= vm->hdr.ptesize / sizeof(pte)) goto invalid; - pte = le64toh(ptemap[pteindex]); + pte = _i386_pte_pae_get(kd, pteindex); if ((pte & I386_PG_V) == 0) { _kvm_err(kd, kd->program, "_i386_minidump_vatop_pae: pte not valid"); goto invalid; } a = pte & I386_PG_FRAME_PAE; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, I386_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_i386_minidump_vatop_pae: physical address 0x%jx not in minidump", @@ -186,24 +190,22 @@ _i386_minidump_vatop(kvm_t *kd, kvaddr_t va, off_t *pa kvaddr_t pteindex; i386_physaddr_t a; off_t ofs; - i386_pte_t *ptemap; vm = kd->vmst; - ptemap = vm->ptemap; offset = va & I386_PAGE_MASK; if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> I386_PAGE_SHIFT; - if (pteindex >= vm->hdr.ptesize / sizeof(*ptemap)) + if (pteindex >= vm->hdr.ptesize / sizeof(pte)) goto invalid; - pte = le32toh(ptemap[pteindex]); + pte = _i386_pte_get(kd, pteindex); if ((pte & I386_PG_V) == 0) { _kvm_err(kd, kd->program, "_i386_minidump_vatop: pte not valid"); goto invalid; } a = pte & I386_PG_FRAME; - ofs = _kvm_pt_find(kd, a); + ofs = _kvm_pt_find(kd, a, I386_PAGE_SIZE); if (ofs == -1) { _kvm_err(kd, kd->program, "_i386_minidump_vatop: physical address 0x%jx not in minidump", @@ -238,12 +240,95 @@ _i386_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *p return (_i386_minidump_vatop(kd, va, pa)); } +static vm_prot_t +_i386_entry_to_prot(uint64_t pte) +{ + vm_prot_t prot = VM_PROT_READ; + + /* Source: i386/pmap.c:pmap_protect() */ + if (pte & I386_PG_RW) + prot |= VM_PROT_WRITE; + if ((pte & I386_PG_NX) == 0) + prot |= VM_PROT_EXECUTE; + + return prot; +} + +struct i386_iter { + kvm_t *kd; + u_long nptes; + u_long pteindex; +}; + +static void +_i386_iterator_init(struct i386_iter *it, kvm_t *kd) +{ + struct vmstate *vm = kd->vmst; + + it->kd = kd; + it->pteindex = 0; + if (vm->hdr.paemode) { + it->nptes = vm->hdr.ptesize / sizeof(i386_pte_pae_t); + } else { + it->nptes = vm->hdr.ptesize / sizeof(i386_pte_t); + } + return; +} + +static int +_i386_iterator_next(struct i386_iter *it, u_long *pa, u_long *va, u_long *dva, + vm_prot_t *prot) +{ + struct vmstate *vm = it->kd->vmst; + i386_pte_t pte32; + i386_pte_pae_t pte64; + int found = 0; + + *dva = 0; + for (; it->pteindex < it->nptes && found == 0; it->pteindex++) { + if (vm->hdr.paemode) { + pte64 = _i386_pte_pae_get(it->kd, it->pteindex); + if ((pte64 & I386_PG_V) == 0) + continue; + *prot = _i386_entry_to_prot(pte64); + *pa = pte64 & I386_PG_FRAME_PAE; + } else { + pte32 = _i386_pte_get(it->kd, it->pteindex); + if ((pte32 & I386_PG_V) == 0) + continue; + *prot = _i386_entry_to_prot(pte32); + *pa = pte32 & I386_PG_FRAME; + } + *va = vm->hdr.kernbase + (it->pteindex << I386_PAGE_SHIFT); + found = 1; + } + return found; +} + +static int +_i386_minidump_walk_pages(kvm_t *kd, kvm_walk_pages_cb_t *cb, void *arg) +{ + struct i386_iter it; + u_long dva, pa, va; + vm_prot_t prot; + + _i386_iterator_init(&it, kd); + while (_i386_iterator_next(&it, &pa, &va, &dva, &prot)) { + if (!_kvm_visit_cb(kd, cb, arg, pa, va, dva, + prot, I386_PAGE_SIZE, 0)) { + return (0); + } + } + return (1); +} + static struct kvm_arch kvm_i386_minidump = { .ka_probe = _i386_minidump_probe, .ka_initvtop = _i386_minidump_initvtop, .ka_freevtop = _i386_minidump_freevtop, .ka_kvatop = _i386_minidump_kvatop, .ka_native = _i386_native, + .ka_walk_pages = _i386_minidump_walk_pages, }; KVM_ARCH(kvm_i386_minidump); Modified: head/lib/libkvm/kvm_minidump_mips.c ============================================================================== --- head/lib/libkvm/kvm_minidump_mips.c Sat Nov 11 22:50:14 2017 (r325727) +++ head/lib/libkvm/kvm_minidump_mips.c Sat Nov 11 23:30:58 2017 (r325728) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); struct vmstate { struct minidumphdr hdr; - void *ptemap; int pte_size; }; @@ -73,7 +72,6 @@ _mips_minidump_freevtop(kvm_t *kd) { struct vmstate *vm = kd->vmst; - free(vm->ptemap); free(vm); kd->vmst = NULL; } @@ -129,24 +127,13 @@ _mips_minidump_initvtop(kvm_t *kd) mips_round_page(vmst->hdr.ptesize); if (_kvm_pt_init(kd, vmst->hdr.bitmapsize, off, sparse_off, MIPS_PAGE_SIZE, sizeof(uint32_t)) == -1) { - _kvm_err(kd, kd->program, "cannot load core bitmap"); return (-1); } off += mips_round_page(vmst->hdr.bitmapsize); - vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); - if (vmst->ptemap == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for " - "ptemap", vmst->hdr.ptesize); + if (_kvm_pmap_init(kd, vmst->hdr.ptesize, off) == -1) { return (-1); } - - if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - (ssize_t)vmst->hdr.ptesize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", - vmst->hdr.ptesize); - return (-1); - } off += mips_round_page(vmst->hdr.ptesize); return (0); @@ -156,12 +143,12 @@ static int _mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *pa) { struct vmstate *vm; - uint64_t pte; mips_physaddr_t offset, a; kvaddr_t pteindex; + u_long valid; off_t ofs; - uint32_t *ptemap32; - uint64_t *ptemap64; + mips32_pte_t pte32; + mips64_pte_t pte64; if (ISALIVE(kd)) { _kvm_err(kd, 0, "_mips_minidump_kvatop called in live kernel!"); @@ -173,9 +160,6 @@ _mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *p va &= ~MIPS_PAGE_MASK; vm = kd->vmst; - ptemap32 = vm->ptemap; - ptemap64 = vm->ptemap; - if (kd->nlehdr.e_ident[EI_CLASS] == ELFCLASS64) { if (va >= MIPS_XKPHYS_START && va < MIPS_XKPHYS_END) { a = va & MIPS_XKPHYS_PHYS_MASK; @@ -202,17 +186,22 @@ _mips_minidump_kvatop(kvm_t *kd, kvaddr_t va, off_t *p if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> MIPS_PAGE_SHIFT; if (vm->pte_size == 64) { - if (pteindex >= vm->hdr.ptesize / sizeof(*ptemap64)) + valid = pteindex < vm->hdr.ptesize / sizeof(pte64); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***