From owner-svn-src-head@freebsd.org Sun Nov 5 00:11:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:11:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:11:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:11:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:12:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:12:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:12:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:12:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:12:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:13:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:13:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:26:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:44:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 00:51:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 01:27:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 01:36:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 01:44:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 02:47:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 03:02:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 04:51:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 05:03:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0752EE621E6 for ; Sun, 5 Nov 2017 05:03:57 +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 B1E586D87B for ; Sun, 5 Nov 2017 05:03:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id e89so12474149ioi.11 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=qO2gys8NV8+rq1BlVTdTJKEGGZHrevHJkVrlnIs9xg6JI0lndywPcwXyq3TRTmgpsY /Bu31WpFoJEHsnV3yRcCXHBhClu9w9mWkxaqrOQ86qHqmpbKdazW/DRqiPEmAbiQWyzR f1JL3CR+kOI915btbTBSfEOQE9uwHOvixBj1FCCanIVgRehIYrXGNC1urkbW+XKx0Dzj ECOE+UbnCedowMVr7hL/2BG1H4oXNYwRYK/kWTlWPD3js9JX8cK7nAOMtqwPdcdR6GaI OIKg1l2/z6qjykndrW/yYqUsyiNr4zd+f0BCwiqgnyndQCtfH2B8tKrIH29C5acypEq3 FucQ== X-Gm-Message-State: AMCzsaVzHFUnpUhMeJobFS8M8NZdYeu6LdbYrKQfzMrubo24mxlUsgNQ old1lgZftv3MEa4FgdaLeQ23qc+Jf5y9Ei1eC19V7Q== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 05:05:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 05:19:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 05:30:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 05:35:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5C84E62B6E for ; Sun, 5 Nov 2017 05:35:48 +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 A874B6E8E7 for ; Sun, 5 Nov 2017 05:35:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id l196so1738983itl.4 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=dMmu7xrPUCcOsBnyEqmf+tfQdsGe0Qa67/o0rn0ErE6TUbP2XUnJcRLRRhb6xRvMkn 6u2/xIscugM+LzaNnFF8A34Pk3G7aiiR4MueLvb6ieBdEoOlHxdW79Tpt+zpFrMEEUwt P/sl5s47jUWVM5N+yoSlaCn9ts+XYiCHNzdPqdpsvfbnEHK37YD3sQeBwbjPFpWKqXky SzftuJBKFd7co+IYn9JcGWssorlHRsQwk/O/aXgz9x5hBR9uC0dFNGR32hD5+dIRU5Tg 31cl+4uimuRShudS0/5kuHVs1ci+zHJQ7RdsIq0+iSjq9TJb//32kanT7ea0lYqW48Yf aL8Q== X-Gm-Message-State: AJaThX7BFdQQF1PH+WusdNowmftt7qsXkm/y6XGWVGwHOrTM2r8jX/IJ 9J08Icty8EkGpr1Q7l71YhbHsElEelC4k5BwODND/A== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 05:50:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5B30E62EBF for ; Sun, 5 Nov 2017 05:50:00 +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 A16806ED97 for ; Sun, 5 Nov 2017 05:50:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id p186so12509238ioe.12 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=EajmWMsVjh/ESQ2SAXrn7Tf4PBP9q/U6MgTODxdNbstgrl2/1e8qwNOtwLWQBXd9d+ iGjXtZCPgu6Ih6PJ4ZKrEsFK3+19unZpwb905+mgoo8cwPAQIGWKT+Iu5M4xSKiphPxz 2KLfXL5z0rNGdp52FsTtBAquL3h6WMRBh9LCcITWQvVVF0ohKVLuieoTU0IfDEuQf3jE cu8Amh12LdSVPPjfYyJLYz4IcFkJf8gSjZdtc0KHdVm1331m+5Q4s3nnl7O+thKcBhZD WEE4KhUQO2Et2p+liT6VLw5eDKnvPevsInG3kpY7J8mOZVufI72Nty+bpUSf2OBphWY3 ZenQ== X-Gm-Message-State: AJaThX4yWRahPT849sx/A1IKUDMWVcD/2bm++lJbq7f8h67ZnGA+Zeqg QdHwhoM5jQeW5rJkiD64N6jBy5q0VUa3J4IxgH80zg== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 08:31:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 10:17:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 11:59:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 13:03:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 13:06:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 13:28:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 13:56:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 14:41:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 15:17:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 15:30:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 16:01:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 16:26:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 16:28:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 16:29:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 16:30:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 16:52:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 16:55:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 17:14:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 17:22:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 17:30:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 18:24:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 18:26:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 18:32:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 18:42:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09FE4E4DC68 for ; Sun, 5 Nov 2017 18:42:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::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 C001164F17 for ; Sun, 5 Nov 2017 18:42:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x244.google.com with SMTP id 134so13544378ioo.0 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=A0KXxLeUogF7QdvXGDiG10sM2uhPsUhlFnqEWI7cI+R0mz3TgDdch86P4hNzLT6gz6 Fan9gDJYE+TFYpDtcTj/gfJEsLf5N4nP9au5yWpUnhHrTVg13P1P2cjIpsgn+JIQ5oj0 OqC8CMSH6dxP2mGEsGQlIEwUktdoYgrz0Exs3c22/5uXHcGRDMfPI0AMqPOXehYU7mc0 hixk5wxu8I2vY7doDHryXFO6k/g8jxyGo3LtocpsHanBGetgg9cCOV8ZdaxT3lkLjrGn fqYhNbnYu2I0FFbZ9zg+EuMdkjcZdrESIZPC+rkHkJvbAj+5Mp6Xido22d9hEQr9ONSU AH/w== X-Gm-Message-State: AJaThX4/3D9DlrOG0MOW2kzZnakRGb5g5JjcZwMuiWrD4SSLwWnp4tcY 0ND+5f1EL42WlH2vLd4XMlW9ioU0Br8uECPK9ywfsw== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 18:45:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 18:54:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A29D0E4E207 for ; Sun, 5 Nov 2017 18:54:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::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 2121B6564B for ; Sun, 5 Nov 2017 18:54:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22e.google.com with SMTP id r196so9896788wmf.2 for ; Sun, 05 Nov 2017 10:54:10 -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=cn2WojSPhHrQR2SAnVvpQmVKcazXQC8xIp+38KVPkhlVdnxVvfKvTLC+WwNaNs3a3r CwddZows/4FseWRi/Ky5Zb1U+S+LxbpM8pagebVCpsrYmLiBhDL31RMQM1yymXHx803b Dkc6IyQFx/9CN6i81npnmByJ2rjC9SC9F+upqOHcMPNPzxSeoQTCAgP2h+6N/eov1ZOG LhQHqb9m+4CKLSmTxu7EsNgh3pSoWzkJ1ykEWesIRZowr8ms6IQqtSyWa3+NpQ2OLFHN L+Ol1Tr6TgsAGj18lfgdqWoubvn4jnjLjyTX8cMtMHWlEjubrbNWVF5+l3S03ReLe8w3 Tmaw== X-Gm-Message-State: AMCzsaU2NCUKTWlWWcj1ZtSK6GrnAWPsjgYmKoXEo4oHU8NN220Pym8X NHkC6g2W6idpqxHXbbJsXN0QeKucdkwzCMOANV+okQ== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 18:56:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAE73E4E2CD 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 54AA3657DD 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:02:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:19:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:24:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:25:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:37:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 419E9E4F260 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 1562E66E58 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:38:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:45:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:45:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:49:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:52:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 998FAE4F9E2 for ; Sun, 5 Nov 2017 19:52:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (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 58E5F67E4C for ; Sun, 5 Nov 2017 19:52:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id 134so13643354ioo.0 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=l+SddD5BdjnPdBhNXNg4js4PS/smXAvOTPX3g38c2jTguhzXTJpoE7JrvFAb101C+t cchG7mIfMJMLnNw0ldyxvf5+TCniLgqC8gNbNbaUd+VKLYfIASJd4Z2YkHAMArl6T3Sj RBFziVQU1plht9TVYeP4N6+xCdTxOy0mUlws2lnAiTp3g3eaOmY/u0EzPgU/t22/Of6F VhVIKW6Syk5fyfTeb9DCJCOVA7zcKagslsYG812CXqFk9Sh8oBLW40ehDm89moSnNGZR I+QXzOBdslbp+zBearG1LA0qbqyATfN38kABlfYyCl2X8lrn67w9AESJKR83+nH0efuv xauA== X-Gm-Message-State: AMCzsaVMVr+jDz3cU5GFgifynyRd8uGrqo8p5wm2XuYac4N75FBbGRA6 s42eWCIrJbb9zow3s4udZ8dItHiYFng2pt0vqfFjyw== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 19:56:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4D58E4FC02 for ; Sun, 5 Nov 2017 19:56:39 +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 721E768222 for ; Sun, 5 Nov 2017 19:56:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id n195so2955617itg.0 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=BVYZonv/W8T79uOKBHKrniWO9qdUpRG4krY3aVf77Z6l/WxnKTC3kz5vhXKMRui41H 0Wu4TBUem5gX3W7dg+xB0M/FkcmMdt+yydDv3oPRoIWDR4y7BDzmBQzmbfvW0D08bV3X xWGNaijq9j/YZLk5kOd/IKm9PQauTX1nd+Tccbcpz5k2xcOJKLLJ+2vWvW2jtmrZEiDz vPmQCyEAbmuje+W4KQlQXP2QjTMYXBuNA25Rpf+zra8joF+ap2q0X8LvKCbuPJrZRwHp eODqC4TKevNQexFdQO1aKclA4TBZ/FhL9DqmRVhqb0XrCQFPYwu9tdycjqffyAuDEWAA VGnQ== X-Gm-Message-State: AJaThX7D4D3uwP2wmIZV7p6XMfCfyam+E3O99s0OOmrGVgTsR4JuPP/q a58H7t+kOR0PsEVuJAsHTgRqy3vr0Xu6tvjqqOKR3A== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 20:01:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 20:03:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 20:10:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CA7CE501AD for ; Sun, 5 Nov 2017 20:10:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::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 E3BD168B3F for ; Sun, 5 Nov 2017 20:10:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id k70so2325936itk.0 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=jVszkHV9q39RTcC1EmaUpubeauVvZ+T88cwZUGECre9BEqEE1FEGDbBk4Ttv/1+UF1 7cjqsRDqDd6pOCWQEthGisHzjCpb+EfGMVBdKwBNYm1gPled12qUhm94WpAQdLNXiHLr y9MuvhIy25tQCDn6ls6xLYQtl4sDANRnjg3qVfZl4J98F+PzAQrJ5c7evjoHKFGfhv4M DiiS6fxjiFhzKjo07jF7GWu2UDV24Yc+IGlEFRughbeRCKCtmPxfviWj8mCq0TxtrZUf 3HAMICqKihf7JXwu3EJzZrojFFTXM585dcAzTDJXqefS5imH4ssKQ8yK7wi18ipg0kcI Cp2g== X-Gm-Message-State: AJaThX4csdDbJZJe5qCxuxDs9yLZzxmi5A3VWywjfimqwzIIhlwCRE4u UEp6Mbuhx5v47BAh7Hn7P4Uy3E4028rQ02zNGdtkCg== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 20:15:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 20:26:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 20:38:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 21:43:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 21:59:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 22:00:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 22:10:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 22:28:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 22:29:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 22:29:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Nov 5 22:31:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 05:09:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 05:14:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 05:33:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 05:46:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 06:23:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 15:21:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 15:21:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 15:21:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 15:21:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 15:22:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 15:22:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 15:22:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 15:22:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 15:29:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 16:23:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 16:41:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 17:59:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 18:09:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 19:33:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 19:54:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Nov 6 23:40:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 04:56:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 04:58:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 05:03:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 06:28:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 09:30:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 09:46:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 09:47:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 09:48:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 09:58:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 13:20:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 13:26:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 15:02:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 15:14:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 15:21:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 16:59:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 17:15:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 17:39:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 17:44:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 17:46:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 18:21:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 19:21:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 21:17:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35386E650F9 for ; Tue, 7 Nov 2017 21:17:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::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 EF4106C1B1 for ; Tue, 7 Nov 2017 21:17:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id f187so4249625itb.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=jCiChok6SaTilz86Sa2NcQuz7wN2UKzGm6NfSYdn0p2mhu0FHVJybZZv/6wKleO0HH 9yH/YmtXl/3HQ9gmSBclVOCbRtIi+dKStqxGfOan/Ct1/SL+SPLRRrYgV8m+803ddd3D IfTcwhrNV+PhnAxvbBNKLZYQPstzatjujTuk2jcOUGYNm0x0ClC2goaFTuggNDjM56pU Iu2DjuJ/opdqEJcP7mL165vSwoXBgdIlLLlL388cMjIuRGDWUwTSU1Ryg1VPwk12PQh8 EH+gQo50ChQRYexFjo6KhEKVkSFDlfKNJ7gNFVCy/Yism4c6R5EYAOG+5N6C74FmXQiw zkCA== X-Gm-Message-State: AJaThX40ZgSrKOnQFIRi6aHJgIhWYysfFSN6wFpo8IHUPsU0JI9jXZzy i1mTcd4m/14WPYgjOU2y2hKhLTfQ5odU0VTo95WkTQ== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 22:10:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Nov 7 22:43:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 01:02:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 01:24:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 01:28:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 01:29:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 01:54:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 02:06:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 02:29:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 02:40:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 03:11:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 04:00:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 08:21:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 08:37:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 12:34:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 13:05:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 13:06:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 14:21:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 14:44:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 15:25:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 16:04:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 16:04:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 16:45:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 16:53:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 18:02:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 19:55:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 21:13:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 21:24:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 22:41:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 23:11:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 23:20:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 23:25:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 23:25:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 23:32:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Nov 8 23:41:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 01:41:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 02:37:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 07:36:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 10:15:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 11:46:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 11:48:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 11:50:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 11:52:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 11:54:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 11:57:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 11:59:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 12:01:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 12:03:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 12:07:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 12:32:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 12:37:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 12:39:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 13:09:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 13:30:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 13:33:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 13:35:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 13:36:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 13:38:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 13:38:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 14:31:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 15:08:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 15:10:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 15:10:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44661E52CA8 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 0741A6A14E 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 m16so10190439iod.1 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=bc6wRtVDvLBET7A5uuNwpMj273Hdz7vLJD7hhnSuymM/ePzcylB3FZBeNbF4qqlMKg xdyg4tgzQzdYwqAvRPQeOQ2iEyTRlYqGg27DMAQi8nbv8kfvLhyEITGH3wrZOYjjMq3T 45ZFWz60XnsChOIXqY0BgIUQ4T91yaBc6nPqF4j88t0yVZ2Syt+gO/lNXi6QRdtGRvzD vJwV6ZGBZbPENcfII3QMdeP/G+Y5V/GYiBiZRSvgTUhYU63MLjbNlESqQNnwy4JWBIhZ Irj/p3V8G+pMTHGZFKkm718Qx0YBgYSAPlyWliG18iwWXmjtzG5BcmRlxQQDCl1AzeIK +/kQ== X-Gm-Message-State: AJaThX5lVpLFMdfuN9WeUCfZG/Gr4OGzOhKae/w6u41fmE+5rPCRpPne 1DTNfhvKnMemFqWaVfeZnA/+oN9uvfK305Z7Ehu8hg== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 15:35:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 18:12:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 18:14:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 18:22:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 19:22:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 19:27:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 19:30:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 22:08:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 22:26:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 22:51:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Nov 9 23:36:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 01:13:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 01:17:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 02:00:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 02:09:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 02:09:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 04:14:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 04:23:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 04:47:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 07:44:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 07:52:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 07:53:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 07:53:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 08:00:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 08:31:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 08:58:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 09:49:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 11:19:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 12:07:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:25:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:28:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:30:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:38:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:40:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:44:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:50:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:53:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:56:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 13:58:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 14:02:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 14:10:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 14:14:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 14:19:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 14:39:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 14:53:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 17:01:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 18:43:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 18:46:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 19:10:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 19:52:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 19:53:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 19:53:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 19:53:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 19:53:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 20:09:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 20:09:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 20:09:16 -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-head@freebsd.org Fri Nov 10 20:10:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 20:30:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 21:26:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 21:42:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 21:43:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 21:49:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 21:52:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 22:17:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 22:37:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 22:58:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 23:30:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 23:54:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 23:54:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 23:54:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 23:54:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 23:54:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:28 -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-head@freebsd.org Fri Nov 10 23:54:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:38 -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-head@freebsd.org Fri Nov 10 23:54:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Nov 10 23:55:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:55:08 -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-head@freebsd.org Fri Nov 10 23:54:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 23:54:45 -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-head@freebsd.org Fri Nov 10 23:54:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 01:10:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 01:10:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 01:10:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 01:10:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 01:10:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 01:11:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 06:15:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 07:00:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 07:14:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 07:20:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 07:21:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 09:34:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 10:46:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 11:01:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 13:54:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 13:57:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 14:02:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 14:39:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 14:47:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D91DFE6C92A 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 A1BD23B48 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 4so641706pge.1 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=c0CF+vH7KTNzYz++Y6Q0KQadcqyrcU/WSYo7Frg8G6NOOSOF2DdrL0t9B7U2jvmck+ BkElj6J8mDI79hRqxcnGHLoMJ5PU8ZDlWcWBzn+t79OMhN14KFw32sB7hN5VyEA5gY3u nozlhX4HjJo+LGpQaUcBjSMnPrWLLXKKGiIAnMPg6Fw5XYqHjxT7VAvAHhQqV9Q7AsxK kAWfxmbr1SBtobUjsPZEGD7NMHTrxJ+OU3VJRtuN2f265quYlSCSQP0+PkIf2TniNa9c RZ9tgA4C6i068UU1YlTES53kygdFWB22lTeD1YJIGDQDTPuMqKZFP5ID6fHUURYGQjUX Y23g== X-Gm-Message-State: AJaThX5gH1kbPZeWMHeOXKXD/MYgRnUll06cOX//01BDJORyJ3tn9EB4 OG/1xfqrNy9UxeSdJOEUvlEKFA== 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 15:09:04 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 15:18:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 16:06:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70F33E6E1F2 for ; Sat, 11 Nov 2017 16:06:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::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 307AE65109 for ; Sat, 11 Nov 2017 16:06:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id x63so4322314ioe.6 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=STfsDmWbA2BvbF/GDnopBxXTi02X3R/Udks1FJ1+KzUg/yFSO+iBmj1cVNk0zSGoMJ HqMCoC/co8EtuB+IuvfNj9r8J5H91A0djCsMzsMAKv8lDSRtkjYOt7g8wYCvgFdC3x0x kgvw3JZhkNdAnEDtJv5bwWgOiiAryCo+4e6h23+HY4VXe1BuOsauMne4+lSc0Q/FqUMU dJrH86uIBjhutWAvqdVROa1noiCpK+r4W2O4cRRgZPy9drbxXQP+CLsIvqT8aHrWoGvU XRXuXe//I8E/J/6hN8QyQ1Ef6v2jdUHM21KAARAXb7UgoKCzfSMFcgswphT9B+SBmM89 EPHQ== X-Gm-Message-State: AJaThX6RMnuQvPJi8fzzWyJ0u6vk1fsmxHha4OeH2oeDt0e5nwIB3613 ZbMog0oCFs2NXAzvDR8LPpijTC2VeLIKo0Ax8URpVA== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 16:09:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 17:21:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 18:02:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 18:03:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 18:04:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 18:07:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 967A9E7080B 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 4D88068D1E 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 p74so171150ywe.2 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=dId4z8r4aKSSfcq+oHQyDi+HeyakIJ+6YIHkDDRGllkLdKuHEjFLlxu54EYICSZFTd jPfjZBr0r+0yDKDBoBSLuYbDg/vwfhMk+BaDUapqVIu/WgYTmTLUhDTH4QpAjo0dcS5f odXvBu7dFc6eKRFpLbxuxtBcgw+6aA+YQG1899uiKqv7oH0/fhtwAUoQKeInzAwOUN+y ty1WV3carPmQDgJgmnVaePwC66OZ21BlOBnfMj8hTTPtRlvQiF/wzcbXnTDsJGL14TXH MfsyQ8dxUtdO1LeTqurPhjqWuv+lMO5yFbg8SQZUbM4uqTZjofWUPECepXcEXkaSGdJz rK6g== X-Gm-Message-State: AJaThX5dWpLhQHA49+w0TyvPp36EVDdhqEACwOhytIR+HBQiOwJ0m3Ov dLJQ/Zaf0fSfWspCa5B8qp9hI3BagrsuH+3dulpjew== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 18:10:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 19:18:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 19:21:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 20:12:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 21:50:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 21:58:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 22:39:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 22:50:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Nov 11 23:31:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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 ***